10 #ifndef SkMask_DEFINED
11 #define SkMask_DEFINED
20 SkMask() : fImage(
nullptr) {}
62 SkASSERT(fImage != NULL);
63 return fImage + ((x - fBounds.fLeft) >> 3) + (y - fBounds.fTop) * fRowBytes;
73 SkASSERT(fImage != NULL);
74 return fImage + x - fBounds.fLeft + (y - fBounds.fTop) * fRowBytes;
85 SkASSERT(fImage != NULL);
86 uint16_t* row = (uint16_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
87 return row + (x - fBounds.fLeft);
98 SkASSERT(fImage != NULL);
99 uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
100 return row + (x - fBounds.fLeft);
115 void*
getAddr(
int x,
int y)
const;
117 static uint8_t* AllocImage(
size_t bytes);
118 static void FreeImage(
void* image);
142 SkMask::FreeImage(fImage);
148 #define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage)
uint8_t * getAddr1(int x, int y) const
Returns the address of the byte that holds the specified bit.
Definition: SkMask.h:59
3 8bit per pixl planes: alpha, mul, add
Definition: SkMask.h:25
size_t computeImageSize() const
Return the byte size of the mask, assuming only 1 plane.
compute bounds, alloc image and render into it
Definition: SkMask.h:123
bool isEmpty() const
Returns true if the mask is empty: i.e.
Definition: SkMask.h:41
SkPMColor.
Definition: SkMask.h:26
CreateMode
Definition: SkMask.h:120
uint16_t * getAddrLCD16(int x, int y) const
Return the address of the specified 16bit mask.
Definition: SkMask.h:82
SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or the 3-channel 3D format.
Definition: SkMask.h:19
8bits per pixel mask (e.g. antialiasing)
Definition: SkMask.h:24
bool contains(int32_t x, int32_t y) const
Returns true if (x,y) is inside the rectangle and the rectangle is not empty.
Definition: SkRect.h:234
uint32_t * getAddr32(int x, int y) const
Return the address of the specified 32bit mask.
Definition: SkMask.h:95
bool isEmpty() const
Return true if the rectangle's width or height are <= 0.
Definition: SkRect.h:103
uint8_t * getAddr8(int x, int y) const
Returns the address of the specified byte.
Definition: SkMask.h:70
size_t computeTotalImageSize() const
Return the byte size of the mask, taking into account any extra planes (e.g.
render into preallocate mask
Definition: SkMask.h:122
void * getAddr(int x, int y) const
Returns the address of the specified pixel, computing the pixel-size at runtime based on the mask for...
Format
Definition: SkMask.h:22
565 alpha for r/g/b
Definition: SkMask.h:27
1bit per pixel mask (e.g. monochrome)
Definition: SkMask.h:23
compute bounds and return
Definition: SkMask.h:121
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20