reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkImageInfo_DEFINED |
| 9 | #define SkImageInfo_DEFINED |
| 10 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 11 | #include "SkMath.h" |
halcanary | f622a6c | 2014-10-24 12:54:53 -0700 | [diff] [blame] | 12 | #include "SkRect.h" |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 13 | #include "SkSize.h" |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 14 | |
commit-bot@chromium.org | 8b0e8ac | 2014-01-30 18:58:24 +0000 | [diff] [blame] | 15 | class SkReadBuffer; |
halcanary | f622a6c | 2014-10-24 12:54:53 -0700 | [diff] [blame] | 16 | class SkWriteBuffer; |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 17 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 18 | /** |
| 19 | * Describes how to interpret the alpha compoent of a pixel. |
| 20 | */ |
| 21 | enum SkAlphaType { |
| 22 | /** |
| 23 | * All pixels should be treated as opaque, regardless of the value stored |
| 24 | * in their alpha field. Used for legacy images that wrote 0 or garbarge |
| 25 | * in their alpha field, but intended the RGB to be treated as opaque. |
| 26 | */ |
| 27 | kIgnore_SkAlphaType, |
skia.committer@gmail.com | 73a5d53 | 2013-11-14 07:02:31 +0000 | [diff] [blame] | 28 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 29 | /** |
| 30 | * All pixels are stored as opaque. This differs slightly from kIgnore in |
| 31 | * that kOpaque has correct "opaque" values stored in the pixels, while |
| 32 | * kIgnore may not, but in both cases the caller should treat the pixels |
| 33 | * as opaque. |
| 34 | */ |
| 35 | kOpaque_SkAlphaType, |
skia.committer@gmail.com | 73a5d53 | 2013-11-14 07:02:31 +0000 | [diff] [blame] | 36 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 37 | /** |
| 38 | * All pixels have their alpha premultiplied in their color components. |
| 39 | * This is the natural format for the rendering target pixels. |
| 40 | */ |
| 41 | kPremul_SkAlphaType, |
skia.committer@gmail.com | 73a5d53 | 2013-11-14 07:02:31 +0000 | [diff] [blame] | 42 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 43 | /** |
| 44 | * All pixels have their color components stored without any regard to the |
| 45 | * alpha. e.g. this is the default configuration for PNG images. |
| 46 | * |
| 47 | * This alpha-type is ONLY supported for input images. Rendering cannot |
| 48 | * generate this on output. |
| 49 | */ |
| 50 | kUnpremul_SkAlphaType, |
skia.committer@gmail.com | 73a5d53 | 2013-11-14 07:02:31 +0000 | [diff] [blame] | 51 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 52 | kLastEnum_SkAlphaType = kUnpremul_SkAlphaType |
| 53 | }; |
| 54 | |
| 55 | static inline bool SkAlphaTypeIsOpaque(SkAlphaType at) { |
| 56 | SK_COMPILE_ASSERT(kIgnore_SkAlphaType < kOpaque_SkAlphaType, bad_alphatype_order); |
| 57 | SK_COMPILE_ASSERT(kPremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order); |
| 58 | SK_COMPILE_ASSERT(kUnpremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order); |
| 59 | |
| 60 | return (unsigned)at <= kOpaque_SkAlphaType; |
| 61 | } |
| 62 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 63 | static inline bool SkAlphaTypeIsValid(unsigned value) { |
| 64 | return value <= kLastEnum_SkAlphaType; |
| 65 | } |
| 66 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 67 | /////////////////////////////////////////////////////////////////////////////// |
| 68 | |
| 69 | /** |
| 70 | * Describes how to interpret the components of a pixel. |
reed | 6c6ddb8 | 2014-06-30 12:44:03 -0700 | [diff] [blame] | 71 | * |
| 72 | * kN32_SkColorType is an alias for whichever 32bit ARGB format is the "native" |
| 73 | * form for skia's blitters. Use this if you don't have a swizzle preference |
| 74 | * for 32bit pixels. |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 75 | */ |
| 76 | enum SkColorType { |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 77 | kUnknown_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 78 | kAlpha_8_SkColorType, |
| 79 | kRGB_565_SkColorType, |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 80 | kARGB_4444_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 81 | kRGBA_8888_SkColorType, |
| 82 | kBGRA_8888_SkColorType, |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 83 | kIndex_8_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 84 | |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 85 | kLastEnum_SkColorType = kIndex_8_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 86 | |
| 87 | #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) |
commit-bot@chromium.org | 28fcae2 | 2014-04-11 17:15:40 +0000 | [diff] [blame] | 88 | kN32_SkColorType = kBGRA_8888_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 89 | #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) |
commit-bot@chromium.org | 28fcae2 | 2014-04-11 17:15:40 +0000 | [diff] [blame] | 90 | kN32_SkColorType = kRGBA_8888_SkColorType, |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 91 | #else |
| 92 | #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" |
| 93 | #endif |
commit-bot@chromium.org | 28fcae2 | 2014-04-11 17:15:40 +0000 | [diff] [blame] | 94 | |
| 95 | #ifdef SK_SUPPORT_LEGACY_N32_NAME |
| 96 | kPMColor_SkColorType = kN32_SkColorType |
| 97 | #endif |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | static int SkColorTypeBytesPerPixel(SkColorType ct) { |
| 101 | static const uint8_t gSize[] = { |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 102 | 0, // Unknown |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 103 | 1, // Alpha_8 |
| 104 | 2, // RGB_565 |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 105 | 2, // ARGB_4444 |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 106 | 4, // RGBA_8888 |
| 107 | 4, // BGRA_8888 |
| 108 | 1, // kIndex_8 |
| 109 | }; |
| 110 | SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1), |
| 111 | size_mismatch_with_SkColorType_enum); |
| 112 | |
| 113 | SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize)); |
| 114 | return gSize[ct]; |
| 115 | } |
| 116 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 117 | static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) { |
| 118 | return width * SkColorTypeBytesPerPixel(ct); |
| 119 | } |
| 120 | |
| 121 | static inline bool SkColorTypeIsValid(unsigned value) { |
| 122 | return value <= kLastEnum_SkColorType; |
| 123 | } |
| 124 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 125 | /////////////////////////////////////////////////////////////////////////////// |
| 126 | |
| 127 | /** |
scroggo | 2fd0d14 | 2014-07-01 07:08:19 -0700 | [diff] [blame] | 128 | * Return true if alphaType is supported by colorType. If there is a canonical |
| 129 | * alphaType for this colorType, return it in canonical. |
| 130 | */ |
| 131 | bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, |
| 132 | SkAlphaType* canonical = NULL); |
| 133 | |
| 134 | /////////////////////////////////////////////////////////////////////////////// |
| 135 | |
| 136 | /** |
rileya | abaef86 | 2014-09-12 17:45:58 -0700 | [diff] [blame] | 137 | * Describes the color space a YUV pixel. |
| 138 | */ |
| 139 | enum SkYUVColorSpace { |
| 140 | /** Standard JPEG color space. */ |
| 141 | kJPEG_SkYUVColorSpace, |
| 142 | /** SDTV standard Rec. 601 color space. Uses "studio swing" [16, 235] color |
| 143 | range. See http://en.wikipedia.org/wiki/Rec._601 for details. */ |
| 144 | kRec601_SkYUVColorSpace, |
| 145 | |
| 146 | kLastEnum_SkYUVColorSpace = kRec601_SkYUVColorSpace |
| 147 | }; |
| 148 | |
| 149 | /////////////////////////////////////////////////////////////////////////////// |
| 150 | |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 151 | enum SkColorProfileType { |
| 152 | kLinear_SkColorProfileType, |
| 153 | kSRGB_SkColorProfileType, |
| 154 | |
| 155 | kLastEnum_SkColorProfileType = kSRGB_SkColorProfileType |
| 156 | }; |
| 157 | |
rileya | abaef86 | 2014-09-12 17:45:58 -0700 | [diff] [blame] | 158 | /** |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 159 | * Describe an image's dimensions and pixel type. |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 160 | * Used for both src images and render-targets (surfaces). |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 161 | */ |
reed | 2bdf1f5 | 2014-09-03 05:48:56 -0700 | [diff] [blame] | 162 | struct SkImageInfo { |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 163 | public: |
| 164 | SkImageInfo() |
| 165 | : fWidth(0) |
| 166 | , fHeight(0) |
| 167 | , fColorType(kUnknown_SkColorType) |
| 168 | , fAlphaType(kIgnore_SkAlphaType) |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 169 | , fProfileType(kLinear_SkColorProfileType) |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 170 | {} |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 171 | |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 172 | static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at, |
| 173 | SkColorProfileType pt = kLinear_SkColorProfileType) { |
| 174 | return SkImageInfo(width, height, ct, at, pt); |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Sets colortype to the native ARGB32 type. |
| 179 | */ |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 180 | static SkImageInfo MakeN32(int width, int height, SkAlphaType at, |
| 181 | SkColorProfileType pt = kLinear_SkColorProfileType) { |
| 182 | return SkImageInfo(width, height, kN32_SkColorType, at, pt); |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Sets colortype to the native ARGB32 type, and the alphatype to premul. |
| 187 | */ |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 188 | static SkImageInfo MakeN32Premul(int width, int height, |
| 189 | SkColorProfileType pt = kLinear_SkColorProfileType) { |
| 190 | return SkImageInfo(width, height, kN32_SkColorType, kPremul_SkAlphaType, pt); |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 191 | } |
skia.committer@gmail.com | d77b3ec | 2014-01-15 07:01:43 +0000 | [diff] [blame] | 192 | |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 193 | /** |
| 194 | * Sets colortype to the native ARGB32 type, and the alphatype to premul. |
| 195 | */ |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 196 | static SkImageInfo MakeN32Premul(const SkISize& size, |
| 197 | SkColorProfileType pt = kLinear_SkColorProfileType) { |
| 198 | return MakeN32Premul(size.width(), size.height(), pt); |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 199 | } |
skia.committer@gmail.com | d77b3ec | 2014-01-15 07:01:43 +0000 | [diff] [blame] | 200 | |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 201 | static SkImageInfo MakeA8(int width, int height) { |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 202 | return SkImageInfo(width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType, |
| 203 | kLinear_SkColorProfileType); |
commit-bot@chromium.org | 32678d9 | 2014-01-15 02:38:22 +0000 | [diff] [blame] | 204 | } |
skia.committer@gmail.com | d77b3ec | 2014-01-15 07:01:43 +0000 | [diff] [blame] | 205 | |
reed@google.com | 900ecf2 | 2014-02-20 20:55:37 +0000 | [diff] [blame] | 206 | static SkImageInfo MakeUnknown(int width, int height) { |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 207 | return SkImageInfo(width, height, kUnknown_SkColorType, kIgnore_SkAlphaType, |
| 208 | kLinear_SkColorProfileType); |
reed@google.com | 900ecf2 | 2014-02-20 20:55:37 +0000 | [diff] [blame] | 209 | } |
| 210 | |
reed | f252f64 | 2014-06-14 04:24:56 -0700 | [diff] [blame] | 211 | static SkImageInfo MakeUnknown() { |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 212 | return SkImageInfo(); |
reed | f252f64 | 2014-06-14 04:24:56 -0700 | [diff] [blame] | 213 | } |
| 214 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 215 | int width() const { return fWidth; } |
| 216 | int height() const { return fHeight; } |
| 217 | SkColorType colorType() const { return fColorType; } |
| 218 | SkAlphaType alphaType() const { return fAlphaType; } |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 219 | SkColorProfileType profileType() const { return fProfileType; } |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 220 | |
| 221 | bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; } |
| 222 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 223 | bool isOpaque() const { |
| 224 | return SkAlphaTypeIsOpaque(fAlphaType); |
| 225 | } |
| 226 | |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 227 | bool isLinear() const { return kLinear_SkColorProfileType == fProfileType; } |
| 228 | bool isSRGB() const { return kSRGB_SkColorProfileType == fProfileType; } |
| 229 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 230 | SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); } |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 231 | SkIRect bounds() const { return SkIRect::MakeWH(fWidth, fHeight); } |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 232 | |
reed | c77392e | 2014-06-02 13:07:26 -0700 | [diff] [blame] | 233 | /** |
| 234 | * Return a new ImageInfo with the same colortype and alphatype as this info, |
| 235 | * but with the specified width and height. |
| 236 | */ |
| 237 | SkImageInfo makeWH(int newWidth, int newHeight) const { |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 238 | return SkImageInfo::Make(newWidth, newHeight, fColorType, fAlphaType, fProfileType); |
reed | c77392e | 2014-06-02 13:07:26 -0700 | [diff] [blame] | 239 | } |
| 240 | |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 241 | SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const { |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 242 | return SkImageInfo::Make(fWidth, fHeight, fColorType, newAlphaType, fProfileType); |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | SkImageInfo makeColorType(SkColorType newColorType) const { |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 246 | return SkImageInfo::Make(fWidth, fHeight, newColorType, fAlphaType, fProfileType); |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 247 | } |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 248 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 249 | int bytesPerPixel() const { |
| 250 | return SkColorTypeBytesPerPixel(fColorType); |
| 251 | } |
| 252 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 253 | uint64_t minRowBytes64() const { |
| 254 | return sk_64_mul(fWidth, this->bytesPerPixel()); |
| 255 | } |
| 256 | |
mike@reedtribe.org | 169a0ed | 2014-02-11 02:20:17 +0000 | [diff] [blame] | 257 | size_t minRowBytes() const { |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 258 | return (size_t)this->minRowBytes64(); |
mike@reedtribe.org | 169a0ed | 2014-02-11 02:20:17 +0000 | [diff] [blame] | 259 | } |
skia.committer@gmail.com | 8ed6443 | 2014-02-11 03:02:13 +0000 | [diff] [blame] | 260 | |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 261 | bool operator==(const SkImageInfo& other) const { |
| 262 | return 0 == memcmp(this, &other, sizeof(other)); |
| 263 | } |
| 264 | bool operator!=(const SkImageInfo& other) const { |
| 265 | return 0 != memcmp(this, &other, sizeof(other)); |
| 266 | } |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 267 | |
commit-bot@chromium.org | 8b0e8ac | 2014-01-30 18:58:24 +0000 | [diff] [blame] | 268 | void unflatten(SkReadBuffer&); |
| 269 | void flatten(SkWriteBuffer&) const; |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 270 | |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 271 | int64_t getSafeSize64(size_t rowBytes) const { |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 272 | if (0 == fHeight) { |
| 273 | return 0; |
| 274 | } |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 275 | return sk_64_mul(fHeight - 1, rowBytes) + fWidth * this->bytesPerPixel(); |
reed@google.com | 9230ea2 | 2013-12-09 22:01:03 +0000 | [diff] [blame] | 276 | } |
commit-bot@chromium.org | 61e96cd | 2014-02-11 18:21:45 +0000 | [diff] [blame] | 277 | |
| 278 | size_t getSafeSize(size_t rowBytes) const { |
| 279 | return (size_t)this->getSafeSize64(rowBytes); |
| 280 | } |
| 281 | |
| 282 | bool validRowBytes(size_t rowBytes) const { |
| 283 | uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); |
| 284 | return rowBytes >= rb; |
| 285 | } |
| 286 | |
| 287 | SkDEBUGCODE(void validate() const;) |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 288 | |
| 289 | #ifdef SK_SUPPORT_LEGACY_PUBLIC_IMAGEINFO_FIELDS |
| 290 | public: |
| 291 | #else |
| 292 | private: |
| 293 | #endif |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 294 | int fWidth; |
| 295 | int fHeight; |
| 296 | SkColorType fColorType; |
| 297 | SkAlphaType fAlphaType; |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 298 | |
| 299 | private: |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 300 | SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorProfileType pt) |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 301 | : fWidth(width) |
| 302 | , fHeight(height) |
| 303 | , fColorType(ct) |
| 304 | , fAlphaType(at) |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 305 | , fProfileType(pt) |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 306 | {} |
reed | 7c74885 | 2014-11-10 08:57:21 -0800 | [diff] [blame^] | 307 | |
| 308 | SkColorProfileType fProfileType; |
reed@google.com | 3443fd8 | 2013-11-13 19:09:13 +0000 | [diff] [blame] | 309 | }; |
| 310 | |
| 311 | #endif |