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