10 #ifndef SkColorTable_DEFINED
11 #define SkColorTable_DEFINED
13 #include "../private/SkOnce.h"
15 #include "SkFlattenable.h"
16 #include "SkImageInfo.h"
36 int count()
const {
return fCount; }
42 SkASSERT(fColors != NULL && (
unsigned)index < (
unsigned)fCount);
43 return fColors[index];
52 const uint16_t* read16BitCache()
const;
60 enum AllocatedWithMalloc {
67 mutable uint16_t* f16BitCache =
nullptr;
68 mutable SkOnce f16BitCacheOnce;
71 void init(
const SkPMColor* colors,
int count);
74 friend class SkBitmapRegionCodec;
76 void dangerous_overwriteColors(
const SkPMColor newColors[],
int count) {
77 if (count < 0 || count > fCount) {
81 memcpy(fColors, newColors, count *
sizeof(
SkPMColor));
SkColorTable holds an array SkPMColors (premultiplied 32-bit colors) used by 8-bit bitmaps...
Definition: SkColorTable.h:25
Definition: SkImageGenerator.h:27
Definition: SkRefCnt.h:125
int count() const
Returns the number of colors in the table.
Definition: SkColorTable.h:36
const SkPMColor * readColors() const
Return the array of colors for reading.
Definition: SkColorTable.h:48
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:161
Definition: SkWriteBuffer.h:27
SkPMColor operator[](int index) const
Returns the specified color from the table.
Definition: SkColorTable.h:41
Types and macros for colors.