Skia
2D Graphics Library
|
SkPixmap provides a utility to pair SkImageInfo with pixels and row bytes. More...
#include <SkPixmap.h>
Public Member Functions | |
SkPixmap () | |
Creates an empty SkPixmap without pixels, with kUnknown_SkColorType, with kUnknown_SkAlphaType, and with a width and height of zero. More... | |
SkPixmap (const SkImageInfo &info, const void *addr, size_t rowBytes) | |
Creates SkPixmap from info width, height, SkAlphaType, and SkColorType. More... | |
void | reset () |
Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to kUnknown_SkColorType; and SkAlphaType to kUnknown_SkAlphaType. More... | |
void | reset (const SkImageInfo &info, const void *addr, size_t rowBytes) |
Sets width, height, SkAlphaType, and SkColorType from info. More... | |
void | setColorSpace (sk_sp< SkColorSpace > colorSpace) |
Changes SkColorSpace in SkImageInfo; preserves width, height, SkAlphaType, and SkColorType in SkImage, and leaves pixel address and row bytes unchanged. More... | |
bool | reset (const SkMask &mask) |
Deprecated. More... | |
bool | extractSubset (SkPixmap *subset, const SkIRect &area) const |
Sets subset width, height, pixel address to intersection of SkPixmap with area, if intersection is not empty; and return true. More... | |
const SkImageInfo & | info () const |
Returns width, height, SkAlphaType, SkColorType, and SkColorSpace. More... | |
size_t | rowBytes () const |
Returns row bytes, the interval from one pixel row to the next. More... | |
const void * | addr () const |
Returns pixel address, the base address corresponding to the pixel origin. More... | |
int | width () const |
Returns pixel count in each pixel row. More... | |
int | height () const |
Returns pixel row count. More... | |
SkISize | dimensions () const |
Return the dimensions of the pixmap (from its ImageInfo) More... | |
SkColorType | colorType () const |
SkAlphaType | alphaType () const |
SkColorSpace * | colorSpace () const |
Returns SkColorSpace, the range of colors, associated with SkImageInfo. More... | |
sk_sp< SkColorSpace > | refColorSpace () const |
Returns smart pointer to SkColorSpace, the range of colors, associated with SkImageInfo. More... | |
bool | isOpaque () const |
Returns true if SkAlphaType is kOpaque_SkAlphaType. More... | |
SkIRect | bounds () const |
Returns SkIRect { 0, 0, width(), height() }. More... | |
int | rowBytesAsPixels () const |
Returns number of pixels that fit on row. More... | |
int | shiftPerPixel () const |
Returns bit shift converting row bytes to row pixels. More... | |
size_t | computeByteSize () const |
Returns minimum memory required for pixel storage. More... | |
bool | computeIsOpaque () const |
Returns true if all pixels are opaque. More... | |
SkColor | getColor (int x, int y) const |
Returns pixel at (x, y) as unpremultiplied color. More... | |
SkColor4f | getColor4f (int x, int y) const |
Returns pixel at (x, y) as unpremultiplied color as an SkColor4f. More... | |
float | getAlphaf (int x, int y) const |
Look up the pixel at (x,y) and return its alpha component, normalized to [0..1]. More... | |
const void * | addr (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
const uint8_t * | addr8 () const |
Returns readable base pixel address. More... | |
const uint16_t * | addr16 () const |
Returns readable base pixel address. More... | |
const uint32_t * | addr32 () const |
Returns readable base pixel address. More... | |
const uint64_t * | addr64 () const |
Returns readable base pixel address. More... | |
const uint16_t * | addrF16 () const |
Returns readable base pixel address. More... | |
const uint8_t * | addr8 (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
const uint16_t * | addr16 (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
const uint32_t * | addr32 (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
const uint64_t * | addr64 (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
const uint16_t * | addrF16 (int x, int y) const |
Returns readable pixel address at (x, y). More... | |
void * | writable_addr () const |
Returns writable base pixel address. More... | |
void * | writable_addr (int x, int y) const |
Returns writable pixel address at (x, y). More... | |
uint8_t * | writable_addr8 (int x, int y) const |
Returns writable pixel address at (x, y). More... | |
uint16_t * | writable_addr16 (int x, int y) const |
Returns writable_addr pixel address at (x, y). More... | |
uint32_t * | writable_addr32 (int x, int y) const |
Returns writable pixel address at (x, y). More... | |
uint64_t * | writable_addr64 (int x, int y) const |
Returns writable pixel address at (x, y). More... | |
uint16_t * | writable_addrF16 (int x, int y) const |
Returns writable pixel address at (x, y). More... | |
bool | readPixels (const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes) const |
Copies a SkRect of pixels to dstPixels. More... | |
bool | readPixels (const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const |
Copies a SkRect of pixels to dstPixels. More... | |
bool | readPixels (const SkPixmap &dst, int srcX, int srcY) const |
Copies a SkRect of pixels to dst. More... | |
bool | readPixels (const SkPixmap &dst) const |
Copies pixels inside bounds() to dst. More... | |
bool | scalePixels (const SkPixmap &dst, const SkSamplingOptions &) const |
Copies SkBitmap to dst, scaling pixels to fit dst.width() and dst.height(), and converting pixels to match dst.colorType() and dst.alphaType(). More... | |
bool | erase (SkColor color, const SkIRect &subset) const |
Writes color to pixels bounded by subset; returns true on success. More... | |
bool | erase (SkColor color) const |
Writes color to pixels inside bounds(); returns true on success. More... | |
bool | erase (const SkColor4f &color, const SkIRect *subset=nullptr) const |
Writes color to pixels bounded by subset; returns true on success. More... | |
SkPixmap provides a utility to pair SkImageInfo with pixels and row bytes.
SkPixmap is a low level class which provides convenience functions to access raster destinations. SkCanvas can not draw SkPixmap, nor does SkPixmap provide a direct drawing destination.
Use SkBitmap to draw pixels referenced by SkPixmap; use SkSurface to draw into pixels referenced by SkPixmap.
SkPixmap does not try to manage the lifetime of the pixel memory. Use SkPixelRef to manage pixel memory; SkPixelRef is safe across threads.
|
inline |
|
inline |
Creates SkPixmap from info width, height, SkAlphaType, and SkColorType.
addr points to pixels, or nullptr. rowBytes should be info.width() times info.bytesPerPixel(), or larger.
No parameter checking is performed; it is up to the caller to ensure that addr and rowBytes agree with info.
The memory lifetime of pixels is managed by the caller. When SkPixmap goes out of scope, addr is unaffected.
SkPixmap may be later modified by reset() to change its size, pixel type, or storage.
info | width, height, SkAlphaType, SkColorType of SkImageInfo |
addr | pointer to pixels allocated by caller; may be nullptr |
rowBytes | size of one row of addr; width times pixel size, or larger |
|
inline |
Returns pixel address, the base address corresponding to the pixel origin.
It is up to the SkPixmap creator to ensure that pixel address is a useful value.
|
inline |
Returns readable pixel address at (x, y).
Returns nullptr if SkPixelRef is nullptr.
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined. Returns nullptr if SkColorType is kUnknown_SkColorType.
Performs a lookup of pixel size; for better performance, call one of: addr8, addr16, addr32, addr64, or addrF16().
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns readable base pixel address.
Result is addressable as unsigned 16-bit words. Will trigger an assert() if SkColorType is not kRGB_565_SkColorType or kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
One word corresponds to one pixel.
|
inline |
Returns readable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined.
Will trigger an assert() if SkColorType is not kRGB_565_SkColorType or kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns readable base pixel address.
Result is addressable as unsigned 32-bit words. Will trigger an assert() if SkColorType is not kRGBA_8888_SkColorType or kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
One word corresponds to one pixel.
|
inline |
Returns readable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined.
Will trigger an assert() if SkColorType is not kRGBA_8888_SkColorType or kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns readable base pixel address.
Result is addressable as unsigned 64-bit words. Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
One word corresponds to one pixel.
|
inline |
Returns readable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined.
Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns readable base pixel address.
Result is addressable as unsigned 8-bit bytes. Will trigger an assert() if SkColorType is not kAlpha_8_SkColorType or kGray_8_SkColorType, and is built with SK_DEBUG defined.
One byte corresponds to one pixel.
|
inline |
Returns readable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined.
Will trigger an assert() if SkColorType is not kAlpha_8_SkColorType or kGray_8_SkColorType, and is built with SK_DEBUG defined.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns readable base pixel address.
Result is addressable as unsigned 16-bit words. Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
Each word represents one color component encoded as a half float. Four words correspond to one pixel.
|
inline |
Returns readable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined.
Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
Each unsigned 16-bit word represents one color component encoded as a half float. Four words correspond to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
|
inline |
SkColorSpace* SkPixmap::colorSpace | ( | ) | const |
Returns SkColorSpace, the range of colors, associated with SkImageInfo.
The reference count of SkColorSpace is unchanged. The returned SkColorSpace is immutable.
|
inline |
|
inline |
Returns minimum memory required for pixel storage.
Does not include unused memory on last row when rowBytesAsPixels() exceeds width(). Returns SIZE_MAX if result does not fit in size_t. Returns zero if height() or width() is 0. Returns height() times rowBytes() if colorType() is kUnknown_SkColorType.
bool SkPixmap::computeIsOpaque | ( | ) | const |
Returns true if all pixels are opaque.
SkColorType determines how pixels are encoded, and whether pixel describes alpha. Returns true for SkColorType without alpha in each pixel; for other SkColorType, returns true if all pixels have alpha values equivalent to 1.0 or greater.
For SkColorType kRGB_565_SkColorType or kGray_8_SkColorType: always returns true. For SkColorType kAlpha_8_SkColorType, kBGRA_8888_SkColorType, kRGBA_8888_SkColorType: returns true if all pixel alpha values are 255. For SkColorType kARGB_4444_SkColorType: returns true if all pixel alpha values are 15. For kRGBA_F16_SkColorType: returns true if all pixel alpha values are 1.0 or greater.
Returns false for kUnknown_SkColorType.
|
inline |
Return the dimensions of the pixmap (from its ImageInfo)
Writes color to pixels bounded by subset; returns true on success.
if subset is nullptr, writes colors pixels inside bounds(). Returns false if colorType() is kUnknown_SkColorType, if subset is not nullptr and does not intersect bounds(), or if subset is nullptr and bounds() is empty.
color | unpremultiplied color to write |
subset | bounding integer SkRect of pixels to write; may be nullptr |
|
inline |
Writes color to pixels inside bounds(); returns true on success.
Returns false if colorType() is kUnknown_SkColorType, or if bounds() is empty.
color | sRGB unpremultiplied color to write |
Writes color to pixels bounded by subset; returns true on success.
Returns false if colorType() is kUnknown_SkColorType, or if subset does not intersect bounds().
color | sRGB unpremultiplied color to write |
subset | bounding integer SkRect of written pixels |
Sets subset width, height, pixel address to intersection of SkPixmap with area, if intersection is not empty; and return true.
Otherwise, leave subset unchanged and return false.
Failing to read the return value generates a compile time warning.
subset | storage for width, height, pixel address of intersection |
area | bounds to intersect with SkPixmap |
float SkPixmap::getAlphaf | ( | int | x, |
int | y | ||
) | const |
Look up the pixel at (x,y) and return its alpha component, normalized to [0..1].
This is roughly equivalent to SkGetColorA(getColor()), but can be more efficent (and more precise if the pixels store more than 8 bits per component).
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
SkColor SkPixmap::getColor | ( | int | x, |
int | y | ||
) | const |
Returns pixel at (x, y) as unpremultiplied color.
Returns black with alpha if SkColorType is kAlpha_8_SkColorType.
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if SK_RELEASE is defined. Fails if SkColorType is kUnknown_SkColorType or pixel address is nullptr.
SkColorSpace in SkImageInfo is ignored. Some color precision may be lost in the conversion to unpremultiplied color; original pixel data may have additional precision.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
SkColor4f SkPixmap::getColor4f | ( | int | x, |
int | y | ||
) | const |
Returns pixel at (x, y) as unpremultiplied color as an SkColor4f.
Returns black with alpha if SkColorType is kAlpha_8_SkColorType.
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if SK_RELEASE is defined. Fails if SkColorType is kUnknown_SkColorType or pixel address is nullptr.
SkColorSpace in SkImageInfo is ignored. Some color precision may be lost in the conversion to unpremultiplied color; original pixel data may have additional precision, though this is less likely than for getColor(). Rounding errors may occur if the underlying type has lower precision.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns pixel row count.
|
inline |
Returns width, height, SkAlphaType, SkColorType, and SkColorSpace.
|
inline |
Returns true if SkAlphaType is kOpaque_SkAlphaType.
Does not check if SkColorType allows alpha, or if any pixel value has transparency.
|
inline |
Copies a SkRect of pixels to dstPixels.
Copy starts at (0, 0), and does not exceed SkPixmap (width(), height()).
dstInfo specifies width, height, SkColorType, SkAlphaType, and SkColorSpace of destination. dstRowBytes specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if dstInfo address equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes().
Pixels are copied only if pixel conversion is possible. If SkPixmap colorType() is kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType() must match. If SkPixmap colorType() is kGray_8_SkColorType, dstInfo.colorSpace() must match. If SkPixmap alphaType() is kOpaque_SkAlphaType, dstInfo.alphaType() must match. If SkPixmap colorSpace() is nullptr, dstInfo.colorSpace() must match. Returns false if pixel conversion is not possible.
Returns false if SkPixmap width() or height() is zero or negative.
dstInfo | destination width, height, SkColorType, SkAlphaType, SkColorSpace |
dstPixels | destination pixel storage |
dstRowBytes | destination row length |
bool SkPixmap::readPixels | ( | const SkImageInfo & | dstInfo, |
void * | dstPixels, | ||
size_t | dstRowBytes, | ||
int | srcX, | ||
int | srcY | ||
) | const |
Copies a SkRect of pixels to dstPixels.
Copy starts at (srcX, srcY), and does not exceed SkPixmap (width(), height()).
dstInfo specifies width, height, SkColorType, SkAlphaType, and SkColorSpace of destination. dstRowBytes specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if dstInfo address equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes().
Pixels are copied only if pixel conversion is possible. If SkPixmap colorType() is kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType() must match. If SkPixmap colorType() is kGray_8_SkColorType, dstInfo.colorSpace() must match. If SkPixmap alphaType() is kOpaque_SkAlphaType, dstInfo.alphaType() must match. If SkPixmap colorSpace() is nullptr, dstInfo.colorSpace() must match. Returns false if pixel conversion is not possible.
srcX and srcY may be negative to copy only top or left of source. Returns false if SkPixmap width() or height() is zero or negative. Returns false if: abs(srcX) >= Pixmap width(), or if abs(srcY) >= Pixmap height().
dstInfo | destination width, height, SkColorType, SkAlphaType, SkColorSpace |
dstPixels | destination pixel storage |
dstRowBytes | destination row length |
srcX | column index whose absolute value is less than width() |
srcY | row index whose absolute value is less than height() |
|
inline |
Copies pixels inside bounds() to dst.
dst specifies width, height, SkColorType, SkAlphaType, and SkColorSpace of destination. Returns true if pixels are copied. Returns false if dst address equals nullptr, or dst.rowBytes() is less than dst SkImageInfo::minRowBytes.
Pixels are copied only if pixel conversion is possible. If SkPixmap colorType() is kGray_8_SkColorType, or kAlpha_8_SkColorType; dst SkColorType must match. If SkPixmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match. If SkPixmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must match. If SkPixmap colorSpace() is nullptr, dst SkColorSpace must match. Returns false if pixel conversion is not possible.
Returns false if SkPixmap width() or height() is zero or negative.
dst | SkImageInfo and pixel address to write to |
|
inline |
Copies a SkRect of pixels to dst.
Copy starts at (srcX, srcY), and does not exceed SkPixmap (width(), height()). dst specifies width, height, SkColorType, SkAlphaType, and SkColorSpace of destination. Returns true if pixels are copied. Returns false if dst address equals nullptr, or dst.rowBytes() is less than dst SkImageInfo::minRowBytes.
Pixels are copied only if pixel conversion is possible. If SkPixmap colorType() is kGray_8_SkColorType, or kAlpha_8_SkColorType; dst.info().colorType must match. If SkPixmap colorType() is kGray_8_SkColorType, dst.info().colorSpace must match. If SkPixmap alphaType() is kOpaque_SkAlphaType, dst.info().alphaType must match. If SkPixmap colorSpace() is nullptr, dst.info().colorSpace must match. Returns false if pixel conversion is not possible.
srcX and srcY may be negative to copy only top or left of source. Returns false SkPixmap width() or height() is zero or negative. Returns false if: abs(srcX) >= Pixmap width(), or if abs(srcY) >= Pixmap height().
dst | SkImageInfo and pixel address to write to |
srcX | column index whose absolute value is less than width() |
srcY | row index whose absolute value is less than height() |
sk_sp<SkColorSpace> SkPixmap::refColorSpace | ( | ) | const |
Returns smart pointer to SkColorSpace, the range of colors, associated with SkImageInfo.
The smart pointer tracks the number of objects sharing this SkColorSpace reference so the memory is released when the owners destruct.
The returned SkColorSpace is immutable.
void SkPixmap::reset | ( | ) |
Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to kUnknown_SkColorType; and SkAlphaType to kUnknown_SkAlphaType.
The prior pixels are unaffected; it is up to the caller to release pixels memory if desired.
void SkPixmap::reset | ( | const SkImageInfo & | info, |
const void * | addr, | ||
size_t | rowBytes | ||
) |
Sets width, height, SkAlphaType, and SkColorType from info.
Sets pixel address from addr, which may be nullptr. Sets row bytes from rowBytes, which should be info.width() times info.bytesPerPixel(), or larger.
Does not check addr. Asserts if built with SK_DEBUG defined and if rowBytes is too small to hold one row of pixels.
The memory lifetime pixels are managed by the caller. When SkPixmap goes out of scope, addr is unaffected.
info | width, height, SkAlphaType, SkColorType of SkImageInfo |
addr | pointer to pixels allocated by caller; may be nullptr |
rowBytes | size of one row of addr; width times pixel size, or larger |
bool SkPixmap::reset | ( | const SkMask & | mask | ) |
Deprecated.
|
inline |
Returns row bytes, the interval from one pixel row to the next.
Row bytes is at least as large as: width() * info().bytesPerPixel().
Returns zero if colorType() is kUnknown_SkColorType. It is up to the SkBitmap creator to ensure that row bytes is a useful value.
|
inline |
Returns number of pixels that fit on row.
Should be greater than or equal to width().
bool SkPixmap::scalePixels | ( | const SkPixmap & | dst, |
const SkSamplingOptions & | |||
) | const |
Copies SkBitmap to dst, scaling pixels to fit dst.width() and dst.height(), and converting pixels to match dst.colorType() and dst.alphaType().
Returns true if pixels are copied. Returns false if dst address is nullptr, or dst.rowBytes() is less than dst SkImageInfo::minRowBytes.
Pixels are copied only if pixel conversion is possible. If SkPixmap colorType() is kGray_8_SkColorType, or kAlpha_8_SkColorType; dst SkColorType must match. If SkPixmap colorType() is kGray_8_SkColorType, dst SkColorSpace must match. If SkPixmap alphaType() is kOpaque_SkAlphaType, dst SkAlphaType must match. If SkPixmap colorSpace() is nullptr, dst SkColorSpace must match. Returns false if pixel conversion is not possible.
Returns false if SkBitmap width() or height() is zero or negative.
dst | SkImageInfo and pixel address to write to |
void SkPixmap::setColorSpace | ( | sk_sp< SkColorSpace > | colorSpace | ) |
Changes SkColorSpace in SkImageInfo; preserves width, height, SkAlphaType, and SkColorType in SkImage, and leaves pixel address and row bytes unchanged.
SkColorSpace reference count is incremented.
colorSpace | SkColorSpace moved to SkImageInfo |
|
inline |
Returns bit shift converting row bytes to row pixels.
Returns zero for kUnknown_SkColorType.
|
inline |
Returns pixel count in each pixel row.
Should be equal or less than: rowBytes() / info().bytesPerPixel().
|
inline |
Returns writable base pixel address.
|
inline |
Returns writable pixel address at (x, y).
Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined. Returns zero if SkColorType is kUnknown_SkColorType.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns writable_addr pixel address at (x, y).
Result is addressable as unsigned 16-bit words. Will trigger an assert() if SkColorType is not kRGB_565_SkColorType or kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
One word corresponds to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns writable pixel address at (x, y).
Result is addressable as unsigned 32-bit words. Will trigger an assert() if SkColorType is not kRGBA_8888_SkColorType or kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
One word corresponds to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns writable pixel address at (x, y).
Result is addressable as unsigned 64-bit words. Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
One word corresponds to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns writable pixel address at (x, y).
Result is addressable as unsigned 8-bit bytes. Will trigger an assert() if SkColorType is not kAlpha_8_SkColorType or kGray_8_SkColorType, and is built with SK_DEBUG defined.
One byte corresponds to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |
|
inline |
Returns writable pixel address at (x, y).
Result is addressable as unsigned 16-bit words. Will trigger an assert() if SkColorType is not kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
Each word represents one color component encoded as a half float. Four words correspond to one pixel.
x | column index, zero or greater, and less than width() |
y | row index, zero or greater, and less than height() |