msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | #include "SkBmpStandardCodec.h" |
| 9 | #include "SkCodecPriv.h" |
| 10 | #include "SkColorPriv.h" |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 11 | #include "SkStream.h" |
| 12 | |
| 13 | /* |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 14 | * Creates an instance of the decoder |
| 15 | * Called only by NewFromStream |
| 16 | */ |
| 17 | SkBmpStandardCodec::SkBmpStandardCodec(const SkImageInfo& info, SkStream* stream, |
| 18 | uint16_t bitsPerPixel, uint32_t numColors, |
| 19 | uint32_t bytesPerColor, uint32_t offset, |
scroggo | 46c5747 | 2015-09-30 08:57:13 -0700 | [diff] [blame] | 20 | SkCodec::SkScanlineOrder rowOrder, bool inIco) |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 21 | : INHERITED(info, stream, bitsPerPixel, rowOrder) |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 22 | , fColorTable(nullptr) |
benjaminwagner | 886e5e4 | 2015-12-04 08:48:26 -0800 | [diff] [blame] | 23 | , fNumColors(numColors) |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 24 | , fBytesPerColor(bytesPerColor) |
| 25 | , fOffset(offset) |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 26 | , fSwizzler(nullptr) |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 27 | , fSrcRowBytes(SkAlign4(compute_row_bytes(this->getInfo().width(), this->bitsPerPixel()))) |
| 28 | , fSrcBuffer(new uint8_t [fSrcRowBytes]) |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 29 | , fInIco(inIco) |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 30 | , fAndMaskRowBytes(fInIco ? SkAlign4(compute_row_bytes(this->getInfo().width(), 1)) : 0) |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 31 | {} |
| 32 | |
| 33 | /* |
| 34 | * Initiates the bitmap decode |
| 35 | */ |
| 36 | SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo, |
| 37 | void* dst, size_t dstRowBytes, |
| 38 | const Options& opts, |
| 39 | SkPMColor* inputColorPtr, |
msarett | e6dd004 | 2015-10-09 11:07:34 -0700 | [diff] [blame] | 40 | int* inputColorCount, |
| 41 | int* rowsDecoded) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 42 | if (opts.fSubset) { |
| 43 | // Subsets are not supported. |
| 44 | return kUnimplemented; |
| 45 | } |
| 46 | if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
| 47 | SkCodecPrintf("Error: scaling not supported.\n"); |
| 48 | return kInvalidScale; |
| 49 | } |
| 50 | if (!conversion_possible(dstInfo, this->getInfo())) { |
| 51 | SkCodecPrintf("Error: cannot convert input type to output type.\n"); |
| 52 | return kInvalidConversion; |
| 53 | } |
| 54 | |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 55 | Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputColorCount); |
| 56 | if (kSuccess != result) { |
| 57 | return result; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 58 | } |
msarett | f724b99 | 2015-10-15 06:41:06 -0700 | [diff] [blame] | 59 | int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); |
msarett | e6dd004 | 2015-10-09 11:07:34 -0700 | [diff] [blame] | 60 | if (rows != dstInfo.height()) { |
| 61 | *rowsDecoded = rows; |
| 62 | return kIncompleteInput; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 63 | } |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 64 | return kSuccess; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | /* |
| 68 | * Process the color table for the bmp input |
| 69 | */ |
| 70 | bool SkBmpStandardCodec::createColorTable(SkAlphaType alphaType, int* numColors) { |
| 71 | // Allocate memory for color table |
| 72 | uint32_t colorBytes = 0; |
| 73 | SkPMColor colorTable[256]; |
| 74 | if (this->bitsPerPixel() <= 8) { |
| 75 | // Inform the caller of the number of colors |
| 76 | uint32_t maxColors = 1 << this->bitsPerPixel(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 77 | if (nullptr != numColors) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 78 | // We set the number of colors to maxColors in order to ensure |
| 79 | // safe memory accesses. Otherwise, an invalid pixel could |
| 80 | // access memory outside of our color table array. |
| 81 | *numColors = maxColors; |
| 82 | } |
benjaminwagner | 886e5e4 | 2015-12-04 08:48:26 -0800 | [diff] [blame] | 83 | // Don't bother reading more than maxColors. |
| 84 | const uint32_t numColorsToRead = |
| 85 | fNumColors == 0 ? maxColors : SkTMin(fNumColors, maxColors); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 86 | |
| 87 | // Read the color table from the stream |
benjaminwagner | 886e5e4 | 2015-12-04 08:48:26 -0800 | [diff] [blame] | 88 | colorBytes = numColorsToRead * fBytesPerColor; |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 89 | SkAutoTDeleteArray<uint8_t> cBuffer(new uint8_t[colorBytes]); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 90 | if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) { |
| 91 | SkCodecPrintf("Error: unable to read color table.\n"); |
| 92 | return false; |
| 93 | } |
| 94 | |
| 95 | // Choose the proper packing function |
| 96 | SkPMColor (*packARGB) (uint32_t, uint32_t, uint32_t, uint32_t); |
| 97 | switch (alphaType) { |
| 98 | case kOpaque_SkAlphaType: |
| 99 | case kUnpremul_SkAlphaType: |
| 100 | packARGB = &SkPackARGB32NoCheck; |
| 101 | break; |
| 102 | case kPremul_SkAlphaType: |
| 103 | packARGB = &SkPreMultiplyARGB; |
| 104 | break; |
| 105 | default: |
| 106 | // This should not be reached because conversion possible |
| 107 | // should fail if the alpha type is not one of the above |
| 108 | // values. |
| 109 | SkASSERT(false); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 110 | packARGB = nullptr; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 111 | break; |
| 112 | } |
| 113 | |
| 114 | // Fill in the color table |
| 115 | uint32_t i = 0; |
benjaminwagner | 886e5e4 | 2015-12-04 08:48:26 -0800 | [diff] [blame] | 116 | for (; i < numColorsToRead; i++) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 117 | uint8_t blue = get_byte(cBuffer.get(), i*fBytesPerColor); |
| 118 | uint8_t green = get_byte(cBuffer.get(), i*fBytesPerColor + 1); |
| 119 | uint8_t red = get_byte(cBuffer.get(), i*fBytesPerColor + 2); |
| 120 | uint8_t alpha; |
| 121 | if (kOpaque_SkAlphaType == alphaType) { |
| 122 | alpha = 0xFF; |
| 123 | } else { |
| 124 | alpha = get_byte(cBuffer.get(), i*fBytesPerColor + 3); |
| 125 | } |
| 126 | colorTable[i] = packARGB(alpha, red, green, blue); |
| 127 | } |
| 128 | |
| 129 | // To avoid segmentation faults on bad pixel data, fill the end of the |
| 130 | // color table with black. This is the same the behavior as the |
| 131 | // chromium decoder. |
| 132 | for (; i < maxColors; i++) { |
| 133 | colorTable[i] = SkPackARGB32NoCheck(0xFF, 0, 0, 0); |
| 134 | } |
| 135 | |
| 136 | // Set the color table |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 137 | fColorTable.reset(new SkColorTable(colorTable, maxColors)); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | // Bmp-in-Ico files do not use an offset to indicate where the pixel data |
| 141 | // begins. Pixel data always begins immediately after the color table. |
| 142 | if (!fInIco) { |
| 143 | // Check that we have not read past the pixel array offset |
| 144 | if(fOffset < colorBytes) { |
| 145 | // This may occur on OS 2.1 and other old versions where the color |
| 146 | // table defaults to max size, and the bmp tries to use a smaller |
| 147 | // color table. This is invalid, and our decision is to indicate |
| 148 | // an error, rather than try to guess the intended size of the |
| 149 | // color table. |
| 150 | SkCodecPrintf("Error: pixel data offset less than color table size.\n"); |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | // After reading the color table, skip to the start of the pixel array |
| 155 | if (stream()->skip(fOffset - colorBytes) != fOffset - colorBytes) { |
| 156 | SkCodecPrintf("Error: unable to skip to image data.\n"); |
| 157 | return false; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // Return true on success |
| 162 | return true; |
| 163 | } |
| 164 | |
msarett | fdb4757 | 2015-10-13 12:50:14 -0700 | [diff] [blame] | 165 | bool SkBmpStandardCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 166 | // Get swizzler configuration |
| 167 | SkSwizzler::SrcConfig config; |
| 168 | switch (this->bitsPerPixel()) { |
| 169 | case 1: |
| 170 | config = SkSwizzler::kIndex1; |
| 171 | break; |
| 172 | case 2: |
| 173 | config = SkSwizzler::kIndex2; |
| 174 | break; |
| 175 | case 4: |
| 176 | config = SkSwizzler::kIndex4; |
| 177 | break; |
| 178 | case 8: |
| 179 | config = SkSwizzler::kIndex; |
| 180 | break; |
| 181 | case 24: |
| 182 | config = SkSwizzler::kBGR; |
| 183 | break; |
| 184 | case 32: |
| 185 | if (kOpaque_SkAlphaType == dstInfo.alphaType()) { |
| 186 | config = SkSwizzler::kBGRX; |
| 187 | } else { |
| 188 | config = SkSwizzler::kBGRA; |
| 189 | } |
| 190 | break; |
| 191 | default: |
| 192 | SkASSERT(false); |
| 193 | return false; |
| 194 | } |
| 195 | |
| 196 | // Get a pointer to the color table if it exists |
| 197 | const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
| 198 | |
| 199 | // Create swizzler |
msarett | fdb4757 | 2015-10-13 12:50:14 -0700 | [diff] [blame] | 200 | fSwizzler.reset(SkSwizzler::CreateSwizzler(config, colorPtr, dstInfo, opts)); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 201 | |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 202 | if (nullptr == fSwizzler.get()) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 203 | return false; |
| 204 | } |
| 205 | return true; |
| 206 | } |
| 207 | |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 208 | SkCodec::Result SkBmpStandardCodec::prepareToDecode(const SkImageInfo& dstInfo, |
| 209 | const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputColorCount) { |
| 210 | // Create the color table if necessary and prepare the stream for decode |
| 211 | // Note that if it is non-NULL, inputColorCount will be modified |
| 212 | if (!this->createColorTable(dstInfo.alphaType(), inputColorCount)) { |
| 213 | SkCodecPrintf("Error: could not create color table.\n"); |
| 214 | return SkCodec::kInvalidInput; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 215 | } |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 216 | |
| 217 | // Copy the color table to the client if necessary |
| 218 | copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount); |
| 219 | |
| 220 | // Initialize a swizzler if necessary |
| 221 | if (!this->initializeSwizzler(dstInfo, options)) { |
| 222 | SkCodecPrintf("Error: cannot initialize swizzler.\n"); |
| 223 | return SkCodec::kInvalidConversion; |
| 224 | } |
| 225 | return SkCodec::kSuccess; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | /* |
| 229 | * Performs the bitmap decoding for standard input format |
| 230 | */ |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 231 | int SkBmpStandardCodec::decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, |
| 232 | const Options& opts) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 233 | // Iterate over rows of the image |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 234 | const int height = dstInfo.height(); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 235 | for (int y = 0; y < height; y++) { |
| 236 | // Read a row of the input |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 237 | if (this->stream()->read(fSrcBuffer.get(), fSrcRowBytes) != fSrcRowBytes) { |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 238 | SkCodecPrintf("Warning: incomplete input stream.\n"); |
msarett | e6dd004 | 2015-10-09 11:07:34 -0700 | [diff] [blame] | 239 | return y; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | // Decode the row in destination format |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 243 | uint32_t row = this->getDstRow(y, dstInfo.height()); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 244 | |
| 245 | void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
| 246 | fSwizzler->swizzle(dstRow, fSrcBuffer.get()); |
| 247 | } |
| 248 | |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 249 | if (fInIco) { |
| 250 | const int startScanline = this->currScanline(); |
| 251 | if (startScanline < 0) { |
| 252 | // We are not performing a scanline decode. |
| 253 | // Just decode the entire ICO mask and return. |
| 254 | decodeIcoMask(this->stream(), dstInfo, dst, dstRowBytes); |
| 255 | return height; |
| 256 | } |
| 257 | |
| 258 | // In order to perform a scanline ICO decode, we must be able |
| 259 | // to skip ahead in the stream in order to apply the AND mask |
| 260 | // to the requested scanlines. |
| 261 | // We will do this by taking advantage of the fact that |
| 262 | // SkIcoCodec always uses a SkMemoryStream as its underlying |
| 263 | // representation of the stream. |
| 264 | const void* memoryBase = this->stream()->getMemoryBase(); |
| 265 | SkASSERT(nullptr != memoryBase); |
| 266 | SkASSERT(this->stream()->hasLength()); |
| 267 | SkASSERT(this->stream()->hasPosition()); |
| 268 | |
| 269 | const size_t length = this->stream()->getLength(); |
| 270 | const size_t currPosition = this->stream()->getPosition(); |
| 271 | |
| 272 | // Calculate how many bytes we must skip to reach the AND mask. |
| 273 | const int remainingScanlines = this->getInfo().height() - startScanline - height; |
| 274 | const size_t bytesToSkip = remainingScanlines * fSrcRowBytes + |
| 275 | startScanline * fAndMaskRowBytes; |
| 276 | const size_t subStreamStartPosition = currPosition + bytesToSkip; |
| 277 | if (subStreamStartPosition >= length) { |
| 278 | // FIXME: How can we indicate that this decode was actually incomplete? |
| 279 | return height; |
| 280 | } |
| 281 | |
| 282 | // Create a subStream to pass to decodeIcoMask(). It is useful to encapsulate |
| 283 | // the memory base into a stream in order to safely handle incomplete images |
| 284 | // without reading out of bounds memory. |
| 285 | const void* subStreamMemoryBase = SkTAddOffset<const void>(memoryBase, |
| 286 | subStreamStartPosition); |
| 287 | const size_t subStreamLength = length - subStreamStartPosition; |
| 288 | // This call does not transfer ownership of the subStreamMemoryBase. |
| 289 | SkMemoryStream subStream(subStreamMemoryBase, subStreamLength, false); |
| 290 | |
| 291 | // FIXME: If decodeIcoMask does not succeed, is there a way that we can |
| 292 | // indicate the decode was incomplete? |
| 293 | decodeIcoMask(&subStream, dstInfo, dst, dstRowBytes); |
| 294 | } |
| 295 | |
msarett | e6dd004 | 2015-10-09 11:07:34 -0700 | [diff] [blame] | 296 | return height; |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 297 | } |
scroggo | cc2feb1 | 2015-08-14 08:32:46 -0700 | [diff] [blame] | 298 | |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 299 | void SkBmpStandardCodec::decodeIcoMask(SkStream* stream, const SkImageInfo& dstInfo, |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 300 | void* dst, size_t dstRowBytes) { |
| 301 | // BMP in ICO have transparency, so this cannot be 565, and this mask |
| 302 | // prevents us from using kIndex8. The below code depends on the output |
| 303 | // being an SkPMColor. |
| 304 | SkASSERT(dstInfo.colorType() == kN32_SkColorType); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 305 | |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 306 | // If we are sampling, make sure that we only mask the sampled pixels. |
| 307 | // We do not need to worry about sampling in the y-dimension because that |
| 308 | // should be handled by SkSampledCodec. |
| 309 | const int sampleX = fSwizzler->sampleX(); |
| 310 | const int sampledWidth = get_scaled_dimension(this->getInfo().width(), sampleX); |
| 311 | const int srcStartX = get_start_coord(sampleX); |
| 312 | |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 313 | |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 314 | SkPMColor* dstPtr = (SkPMColor*) dst; |
| 315 | for (int y = 0; y < dstInfo.height(); y++) { |
| 316 | // The srcBuffer will at least be large enough |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 317 | if (stream->read(fSrcBuffer.get(), fAndMaskRowBytes) != fAndMaskRowBytes) { |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 318 | SkCodecPrintf("Warning: incomplete AND mask for bmp-in-ico.\n"); |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 319 | return; |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 320 | } |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 321 | |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 322 | int row = this->getDstRow(y, dstInfo.height()); |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 323 | |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 324 | SkPMColor* dstRow = |
| 325 | SkTAddOffset<SkPMColor>(dstPtr, row * dstRowBytes); |
| 326 | |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 327 | int srcX = srcStartX; |
| 328 | for (int dstX = 0; dstX < sampledWidth; dstX++) { |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 329 | int quotient; |
| 330 | int modulus; |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 331 | SkTDivMod(srcX, 8, "ient, &modulus); |
msarett | 5406d6f | 2015-08-31 06:55:13 -0700 | [diff] [blame] | 332 | uint32_t shift = 7 - modulus; |
msarett | be8216a | 2015-12-04 08:00:50 -0800 | [diff] [blame] | 333 | uint32_t alphaBit = (fSrcBuffer.get()[quotient] >> shift) & 0x1; |
| 334 | dstRow[dstX] &= alphaBit - 1; |
| 335 | srcX += sampleX; |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 336 | } |
| 337 | } |
msarett | 4ab9d5f | 2015-08-06 15:34:42 -0700 | [diff] [blame] | 338 | } |
msarett | e6dd004 | 2015-10-09 11:07:34 -0700 | [diff] [blame] | 339 | |
| 340 | uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const { |
| 341 | const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
| 342 | if (colorPtr) { |
| 343 | return get_color_table_fill_value(colorType, colorPtr, 0); |
| 344 | } |
| 345 | return INHERITED::onGetFillValue(colorType, alphaType); |
| 346 | } |