Flutter Engine
The Flutter Engine
|
#include <SkMask.h>
Classes | |
struct | AlphaIter |
struct | AlphaIter< SkMask::kA8_Format > |
struct | AlphaIter< SkMask::kARGB32_Format > |
struct | AlphaIter< SkMask::kBW_Format > |
struct | AlphaIter< SkMask::kLCD16_Format > |
Public Types | |
enum | Format : uint8_t { kBW_Format , kA8_Format , k3D_Format , kARGB32_Format , kLCD16_Format , kSDF_Format } |
enum | { kCountMaskFormats = kSDF_Format + 1 } |
Public Member Functions | |
SkMask (const uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format) | |
bool | isEmpty () const |
size_t | computeImageSize () const |
size_t | computeTotalImageSize () const |
const uint8_t * | getAddr1 (int x, int y) const |
const uint8_t * | getAddr8 (int x, int y) const |
const uint16_t * | getAddrLCD16 (int x, int y) const |
const uint32_t * | getAddr32 (int x, int y) const |
const void * | getAddr (int x, int y) const |
Static Public Member Functions | |
static bool | IsValidFormat (uint8_t format) |
Public Attributes | |
uint8_t const *const | fImage |
const SkIRect | fBounds |
const uint32_t | fRowBytes |
const Format | fFormat |
SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or the 3-channel 3D format. These are passed to SkMaskFilter objects.
enum SkMask::Format : uint8_t |
Definition at line 26 of file SkMask.h.
|
inline |
size_t SkMask::computeImageSize | ( | ) | const |
Return the byte size of the mask, assuming only 1 plane. Does not account for k3D_Format. For that, use computeTotalImageSize(). If there is an overflow of 32bits, then returns 0.
Definition at line 30 of file SkMask.cpp.
size_t SkMask::computeTotalImageSize | ( | ) | const |
Return the byte size of the mask, taking into account any extra planes (e.g. k3D_Format). If there is an overflow of 32bits, then returns 0.
Definition at line 34 of file SkMask.cpp.
Returns the address of the specified pixel, computing the pixel-size at runtime based on the mask format. This will be slightly slower than using one of the routines where the format is implied by the name e.g. getAddr8 or getAddr32.
x,y must be contained by the mask's bounds (this is asserted in the debug build, but not checked in the release build.)
This should not be called with kBW_Format, as it will give unspecified results (and assert in the debug build).
Definition at line 112 of file SkMask.cpp.
Returns the address of the byte that holds the specified bit. Asserts that the mask is kBW_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.
Return the address of the specified 32bit mask. In the debug build, this asserts that the mask's format is 32bits, and that (x,y) are contained in the mask's fBounds.
Returns the address of the specified byte. Asserts that the mask is kA8_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.
Return the address of the specified 16bit mask. In the debug build, this asserts that the mask's format is kLCD16_Format, and that (x,y) are contained in the mask's fBounds.
|
inline |
|
inlinestatic |