#include <SkBitmap.h>
Inherits SkRefCnt.
Public Types | |
enum | Flags { kColorsAreOpaque_Flag = 0x01 } |
Public Member Functions | |
SkColorTable (const SkColorTable &src) | |
SkColorTable (int count) | |
SkColorTable (SkFlattenableReadBuffer &) | |
SkColorTable (const SkPMColor colors[], int count) | |
virtual | ~SkColorTable () |
unsigned | getFlags () const |
void | setFlags (unsigned flags) |
bool | isOpaque () const |
void | setIsOpaque (bool isOpaque) |
int | count () const |
SkPMColor | operator[] (int index) const |
SkPMColor * | lockColors () |
void | unlockColors (bool changed) |
const uint16_t * | lock16BitCache () |
void | unlock16BitCache () |
void | flatten (SkFlattenableWriteBuffer &) const |
SkColorTable holds an array SkPMColors (premultiplied 32-bit colors) used by 8-bit bitmaps, where the bitmap bytes are interpreted as indices into the colortable.
Definition at line 488 of file SkBitmap.h.
enum SkColorTable::Flags |
Definition at line 501 of file SkBitmap.h.
SkColorTable::SkColorTable | ( | const SkColorTable & | src | ) |
Makes a deep copy of colors.
SkColorTable::SkColorTable | ( | int | count | ) | [explicit] |
Preallocates the colortable to have 'count' colors, which are initially set to 0.
SkColorTable::SkColorTable | ( | SkFlattenableReadBuffer & | ) | [explicit] |
SkColorTable::SkColorTable | ( | const SkPMColor | colors[], | |
int | count | |||
) |
virtual SkColorTable::~SkColorTable | ( | ) | [virtual] |
int SkColorTable::count | ( | ) | const [inline] |
Returns the number of colors in the table.
Definition at line 516 of file SkBitmap.h.
void SkColorTable::flatten | ( | SkFlattenableWriteBuffer & | ) | const |
unsigned SkColorTable::getFlags | ( | ) | const [inline] |
Returns the flag bits for the color table. These can be changed with setFlags().
Definition at line 506 of file SkBitmap.h.
bool SkColorTable::isOpaque | ( | ) | const [inline] |
Definition at line 511 of file SkBitmap.h.
const uint16_t* SkColorTable::lock16BitCache | ( | ) |
Similar to lockColors(), lock16BitCache() returns the array of RGB16 colors that mirror the 32bit colors. However, this function will return null if kColorsAreOpaque_Flag is not set. Also, unlike lockColors(), the returned array here cannot be modified.
SkPMColor* SkColorTable::lockColors | ( | ) | [inline] |
Specify the number of colors in the color table. This does not initialize the colors to any value, just allocates memory for them. To initialize the values, either call setColors(array, count), or follow setCount(count) with a call to lockColors()/{set the values}/unlockColors(true). Return the array of colors for reading and/or writing. This must be balanced by a call to unlockColors(changed?), telling the colortable if the colors were changed during the lock.
Definition at line 538 of file SkBitmap.h.
SkPMColor SkColorTable::operator[] | ( | int | index | ) | const [inline] |
Returns the specified color from the table. In the debug build, this asserts that the index is in range (0 <= index < count).
Definition at line 521 of file SkBitmap.h.
void SkColorTable::setFlags | ( | unsigned | flags | ) |
Set the flags for the color table. See the Flags enum for possible values.
void SkColorTable::setIsOpaque | ( | bool | isOpaque | ) |
void SkColorTable::unlock16BitCache | ( | ) | [inline] |
Balancing call to lock16BitCache().
Definition at line 554 of file SkBitmap.h.
void SkColorTable::unlockColors | ( | bool | changed | ) |
Balancing call to lockColors(). If the colors have been changed, pass true.