158 fPtr = SkTAddOffset<const uint8_t>(fPtr, rb);
161 uint8_t
operator*()
const {
return ((*fPtr) >> fOffset) & 1 ? 0xFF : 0; }
163 return fPtr < that.fPtr || (fPtr == that.fPtr && fOffset > that.fOffset);
175 fPtr = SkTAddOffset<const uint8_t>(fPtr, rb);
189 fPtr = SkTAddOffset<const uint32_t>(fPtr, rb);
203 fPtr = SkTAddOffset<const uint16_t>(fPtr, rb);
207 unsigned packed = *fPtr;
211 return (r + g +
b) / 3;
225 this->
image() = that.image();
226 this->
bounds() = that.bounds();
228 this->
format() = that.format();
229 that.image() =
nullptr;
#define SkPacked16ToG32(c)
#define SkPacked16ToR32(c)
#define SkPacked16ToB32(c)
#define SkGetPackedA32(packed)
std::unique_ptr< uint8_t, SkFunctionObject< SkMaskBuilder::FreeImage > > SkAutoMaskFreeImage
uint32_t uint32_t * format
Optional< SkRect > bounds
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
bool contains(int32_t x, int32_t y) const
static void FreeImage(void *image)
uint8_t * getAddr8(int x, int y)
@ kComputeBoundsAndRenderImage_CreateMode
compute bounds, alloc image and render into it
@ kJustRenderImage_CreateMode
render into preallocate mask
@ kJustComputeBounds_CreateMode
compute bounds and return
SkMaskBuilder(uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format)
uint8_t * getAddr1(int x, int y)
void * getAddr(int x, int y)
static SkMaskBuilder PrepareDestination(int radiusX, int radiusY, const SkMask &src)
uint16_t * getAddrLCD16(int x, int y)
static uint8_t * AllocImage(size_t bytes, AllocType=kUninit_Alloc)
SkMaskBuilder & operator=(const SkMaskBuilder &)=delete
SkMaskBuilder & operator=(SkMaskBuilder &&that)
uint32_t * getAddr32(int x, int y)
SkMaskBuilder(SkMaskBuilder &&)=default
SkMaskBuilder(const SkMaskBuilder &)=delete
@ k3D_Format
3 8bit per pixl planes: alpha, mul, add
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
@ kLCD16_Format
565 alpha for r/g/b
@ kARGB32_Format
SkPMColor.
@ kSDF_Format
8bits representing signed distance field
@ kBW_Format
1bit per pixel mask (e.g. monochrome)
const uint8_t * getAddr8(int x, int y) const
const void * getAddr(int x, int y) const
const uint16_t * getAddrLCD16(int x, int y) const
const uint8_t * getAddr1(int x, int y) const
uint8_t const *const fImage
static bool IsValidFormat(uint8_t format)
const uint32_t * getAddr32(int x, int y) const
size_t computeTotalImageSize() const
SkMask(const uint8_t *img, const SkIRect &bounds, uint32_t rowBytes, Format format)
size_t computeImageSize() const