10 #ifndef SkColorTable_DEFINED
11 #define SkColorTable_DEFINED
13 #include "../private/SkOnce.h"
15 #include "SkFlattenable.h"
16 #include "SkImageInfo.h"
34 int count()
const {
return fCount; }
40 SkASSERT(fColors != NULL && (
unsigned)index < (
unsigned)fCount);
41 return fColors[index];
50 const uint16_t* read16BitCache()
const;
58 enum AllocatedWithMalloc {
65 mutable uint16_t* f16BitCache =
nullptr;
66 mutable SkOnce f16BitCacheOnce;
69 void init(
const SkPMColor* colors,
int count);
72 friend class SkBitmapRegionCodec;
74 void dangerous_overwriteColors(
const SkPMColor newColors[],
int count) {
75 if (count < 0 || count > fCount) {
79 memcpy(fColors, newColors, count *
sizeof(
SkPMColor));
SkColorTable holds an array SkPMColors (premultiplied 32-bit colors) used by 8-bit bitmaps...
Definition: SkColorTable.h:25
An interface that allows a purgeable PixelRef (such as a SkDiscardablePixelRef) to decode and re-deco...
Definition: SkImageGenerator.h:62
Definition: SkRefCnt.h:135
int count() const
Returns the number of colors in the table.
Definition: SkColorTable.h:34
const SkPMColor * readColors() const
Return the array of colors for reading.
Definition: SkColorTable.h:46
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:147
Definition: SkWriteBuffer.h:26
SkPMColor operator[](int index) const
Returns the specified color from the table.
Definition: SkColorTable.h:39
Types and macros for colors.