<ahref="undocumented#Image_Info">Image Info</a><ahref="#SkBitmap_bounds">bounds</a> may be located anywhere fully inside <ahref="undocumented#Pixel_Ref">Pixel Ref</a><ahref="#SkBitmap_bounds">bounds</a>.
<ahref="#Bitmap">Bitmap</a> can be drawn using <ahref="SkCanvas_Reference#Canvas">Canvas</a>. <ahref="#Bitmap">Bitmap</a> can be a drawing destination for <ahref="SkCanvas_Reference#Canvas">Canvas</a>
draw methods. <ahref="#Bitmap">Bitmap</a> flexibility as a pixel container limits some optimizations
| <ahref="#SkBitmap_allocPixels">allocPixels</a> | Allocates pixels from <ahref="undocumented#Image_Info">Image Info</a>, or aborts. |
| <ahref="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> | Allocates pixels from <ahref="undocumented#Image_Info">Image Info</a> with options, or aborts. |
| <ahref="#SkBitmap_bytesPerPixel">bytesPerPixel</a> | Returns number of bytes in pixel based on <ahref="undocumented#Image_Color_Type">Color Type</a>. |
| <ahref="#SkBitmap_dimensions">dimensions</a> | Returns <ahref="#SkBitmap_width">width</a> and <ahref="#SkBitmap_height">height</a>. |
| <ahref="#SkBitmap_drawsNothing">drawsNothing</a> | Returns true if no <ahref="#SkBitmap_width">width</a>, no <ahref="#SkBitmap_height">height</a>, or no <ahref="undocumented#Pixel_Ref">Pixel Ref</a>. |
| <ahref="#SkBitmap_empty">empty</a> | Returns true if <ahref="undocumented#Image_Info">Image Info</a> has zero <ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_height">height</a>. |
| <ahref="#SkBitmap_setInfo">setInfo</a> | Sets <ahref="#SkBitmap_height">height</a>, <ahref="#SkBitmap_width">width</a>, <ahref="undocumented#Image_Color_Type">Color Type</a>, and so on, releasing pixels. |
| <ahref="#SkBitmap_tryAllocPixels">tryAllocPixels</a> | Allocates pixels from <ahref="undocumented#Image_Info">Image Info</a> if possible. |
| <ahref="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> | Allocates pixels from <ahref="undocumented#Image_Info">Image Info</a> with options if possible. |
Allocates the pixel memory for the <ahref="#SkBitmap_Allocator_allocPixelRef_bitmap">bitmap</a>, given its <ahref="#SkBitmap_dimensions">dimensions</a> and
<ahref="#Bitmap">Bitmap</a> containing <ahref="undocumented#Image_Info">Image Info</a> as input, and <ahref="undocumented#Pixel_Ref">Pixel Ref</a> as output</td>
Allocates the pixel memory for the <ahref="#SkBitmap_HeapAllocator_allocPixelRef_bitmap">bitmap</a>, given its <ahref="#SkBitmap_dimensions">dimensions</a> and
<ahref="#Bitmap">Bitmap</a> containing <ahref="undocumented#Image_Info">Image Info</a> as input, and <ahref="undocumented#Pixel_Ref">Pixel Ref</a> as output</td>
Creates an <ahref="#SkBitmap_empty">empty</a><ahref="#Bitmap">Bitmap</a> without pixels, with <ahref="undocumented#SkColorType">kUnknown SkColorType</a>,
<ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, and with a <ahref="#SkBitmap_width">width</a> and <ahref="#SkBitmap_height">height</a> of zero. <ahref="undocumented#Pixel_Ref">Pixel Ref</a> origin is
set to (0, 0). <ahref="#Bitmap">Bitmap</a> is not volatile.
Use <ahref="#SkBitmap_setInfo">setInfo</a> to associate <ahref="undocumented#SkColorType">SkColorType</a>, <ahref="undocumented#SkAlphaType">SkAlphaType</a>, <ahref="#SkBitmap_width">width</a>, and <ahref="#SkBitmap_height">height</a>
after <ahref="#Bitmap">Bitmap</a> has been created.
Copies settings from <ahref="#SkBitmap_copy_const_SkBitmap_src">src</a> to returned <ahref="#Bitmap">Bitmap</a>. Shares pixels if <ahref="#SkBitmap_copy_const_SkBitmap_src">src</a> has pixels
allocated, so both bitmaps reference the same pixels.
Copies settings from <ahref="#SkBitmap_move_SkBitmap_src">src</a> to returned <ahref="#Bitmap">Bitmap</a>. Moves ownership of <ahref="#SkBitmap_move_SkBitmap_src">src</a> pixels to
Copies settings from <ahref="#SkBitmap_copy_operator_src">src</a> to returned <ahref="#Bitmap">Bitmap</a>. Shares pixels if <ahref="#SkBitmap_copy_operator_src">src</a> has pixels
Copies settings from <ahref="#SkBitmap_move_operator_src">src</a> to returned <ahref="#Bitmap">Bitmap</a>. Moves ownership of <ahref="#SkBitmap_move_operator_src">src</a> pixels to
Returns <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> with <ahref="#Bitmap">Bitmap</a> pixel address, row bytes, and <ahref="undocumented#Image_Info">Image Info</a>, if address is available.
If pixel address is not available, returns default constructed <ahref="SkPixmap_Reference#Pixmap">Pixmap</a>: nullptr pixels,
<ahref="undocumented#SkColorType">kUnknown SkColorType</a>, <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, <ahref="#SkBitmap_width">width</a> and <ahref="#SkBitmap_height">height</a> of zero.
Returned <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> becomes invalid on any future change to <ahref="#Bitmap">Bitmap</a>
### Return Value
<ahref="SkPixmap_Reference#Pixmap">Pixmap</a> describing <ahref="#Bitmap">Bitmap</a>, if pixels are readable; otherwise containing zeroes
Maybe be less than <ahref="#SkBitmap_pixelRef">pixelRef</a>.<ahref="#SkBitmap_width">width</a>. Will not exceed <ahref="#SkBitmap_pixelRef">pixelRef</a>.<ahref="#SkBitmap_width">width</a> less
Maybe be less than <ahref="#SkBitmap_pixelRef">pixelRef</a>.<ahref="#SkBitmap_height">height</a>. Will not exceed <ahref="#SkBitmap_pixelRef">pixelRef</a>.<ahref="#SkBitmap_height">height</a> less
<div><fiddle-embedname="7ade8a1a21ea5197e565c86740b47b73"><div><ahref="#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <ahref="undocumented#Color_Space">Color Space</a> with linear gamma
and an <ahref="undocumented#sRGB">sRGB</a> gamut. This <ahref="undocumented#Color_Space">Color Space</a> gamma is not close to <ahref="undocumented#sRGB">sRGB</a> gamma.</div>
Returns true if either <ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_height">height</a> are zero.
Does not check if <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr; call <ahref="#SkBitmap_drawsNothing">drawsNothing</a> to check <ahref="#SkBitmap_width">width</a>,
<ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
### Return Value
true if <ahref="#SkBitmap_dimensions">dimensions</a> do not enclose area
Return true if <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr.
Does not check if <ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_height">height</a> are zero; call <ahref="#SkBitmap_drawsNothing">drawsNothing</a> to check
<ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
### Return Value
true if no <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is associated
Return true if <ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_height">height</a> are zero, or if <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr.
If true, <ahref="#Bitmap">Bitmap</a> has no effect when drawn or drawn into.
Sets <ahref="undocumented#Image_Alpha_Type">Alpha Type</a>, if <ahref="#SkBitmap_alphaType">alphaType</a> is compatible with <ahref="undocumented#Image_Color_Type">Color Type</a>.
Returns true unless <ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a> and current <ahref="undocumented#Image_Alpha_Type">Alpha Type</a>
Returns true if <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>. <ahref="#SkBitmap_alphaType">alphaType</a> is ignored, and
Returns true if <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kRGB 565 SkColorType</a> or <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>.
<ahref="#SkBitmap_alphaType">alphaType</a> is ignored, and <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> remains <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>.
If <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kARGB 4444 SkColorType</a>, <ahref="undocumented#SkColorType">kRGBA 8888 SkColorType</a>,
<ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a> and <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> is not <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>.
If <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> is <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, <ahref="#SkBitmap_alphaType">alphaType</a> is ignored.
If <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>, returns true unless
<ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a> and <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> is not <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>.
If <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> is <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, <ahref="#SkBitmap_alphaType">alphaType</a> is ignored. If <ahref="#SkBitmap_alphaType">alphaType</a> is
This changes <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> in <ahref="undocumented#Pixel_Ref">Pixel Ref</a>; all bitmaps sharing <ahref="undocumented#Pixel_Ref">Pixel Ref</a>
Returns minimum memory required for pixel storage.
Does not include unused memory on last row when <ahref="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <ahref="#SkBitmap_width">width</a>.
Returns zero if result does not fit in size_t.
Returns zero if <ahref="#SkBitmap_height">height</a> or <ahref="#SkBitmap_width">width</a> is 0.
Returns <ahref="#SkBitmap_height">height</a> times <ahref="#SkBitmap_rowBytes">rowBytes</a> if <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>.
Writing to immutable <ahref="#Bitmap">Bitmap</a> pixels triggers an assert on debug builds.
### Example
<div><fiddle-embedname="9210060d1f4ca46e1375496237902ef3"><div>Triggers assert if <ahref="undocumented#SK_DEBUG">SK DEBUG</a> is true, runs fine otherwise.</div></fiddle-embed></div>
<div><fiddle-embedname="5e76b68bb46d54315eb0c12d83bd6949"><div><ahref="#SkBitmap_isOpaque">isOpaque</a> ignores whether all pixels are opaque or not.</div>
Resets to its initial state; all fields are set to zero, as if <ahref="#Bitmap">Bitmap</a> had
been initialized by <ahref="#SkBitmap_empty_constructor">SkBitmap()</a>.
Sets <ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, row bytes to zero; pixel address to nullptr; <ahref="undocumented#SkColorType">SkColorType</a> to
<ahref="undocumented#SkColorType">kUnknown SkColorType</a>; and <ahref="undocumented#SkAlphaType">SkAlphaType</a> to <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>.
If <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is allocated, its reference count is decreased by one, releasing
its memory if <ahref="#Bitmap">Bitmap</a> is the sole owner.
For <ahref="undocumented#Image_Color_Type">Color Types</a><ahref="undocumented#SkColorType">kRGB 565 SkColorType</a> or <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>: always
returns true. For <ahref="undocumented#Image_Color_Type">Color Types</a><ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>, <ahref="undocumented#SkColorType">kBGRA 8888 SkColorType</a>,
For <ahref="undocumented#Image_Color_Type">Color Type</a><ahref="undocumented#SkColorType">kARGB 4444 SkColorType</a>: returns true if all pixel <ahref="#Alpha">Alpha</a> values are 15.
<ahref="#SkBitmap_rowBytes">rowBytes</a>. Frees pixels, and returns true if successful.
<ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> may be altered to a value permitted by <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a>.
If <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>, <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> is
set to <ahref="undocumented#SkAlphaType">kUnknown SkAlphaType</a>.
If <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a> and <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> is
<ahref="undocumented#SkAlphaType">kUnpremul SkAlphaType</a>, <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> is replaced by <ahref="undocumented#SkAlphaType">kPremul SkAlphaType</a>.
If <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kRGB 565 SkColorType</a> or <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>,
<ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> is set to <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>.
If <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kARGB 4444 SkColorType</a>, <ahref="undocumented#SkColorType">kRGBA 8888 SkColorType</a>,
<ahref="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, or <ahref="undocumented#SkColorType">kRGBA F16 SkColorType</a>: <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> remains
unchanged.
<ahref="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a>. If <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a> is
<ahref="undocumented#SkColorType">kUnknown SkColorType</a>, <ahref="#SkBitmap_rowBytes">rowBytes</a> is ignored and treated as zero; for all other
<ahref="undocumented#Color_Space">Color Space</a> values, <ahref="#SkBitmap_rowBytes">rowBytes</a> of zero is treated as <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a>.
Calls <ahref="#SkBitmap_reset">reset</a> and returns false if:
<td><ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_width">width</a> is negative</td></tr><tr>
<td><ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_height">height</a> is negative</td></tr><tr>
<td><ahref="#SkBitmap_rowBytes">rowBytes</a> is positive and less than <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_width">width</a> times <ahref="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<ahref="#SkBitmap_bytesPerPixel">bytesPerPixel</a></td></tr>
<ahref="#SkBitmap_AllocFlags">AllocFlags</a> provides the option to zero pixel memory when allocated.
### Constants
<table>
<tr>
<td><aname="SkBitmap_kZeroPixels_AllocFlag"><code><strong>SkBitmap::kZeroPixels_AllocFlag </strong></code></a></td><td>1</td><td>Instructs <ahref="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> and <ahref="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> to zero pixel memory.</td>
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
memory. If <ahref="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is <ahref="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, memory is zeroed.
On most platforms, allocating pixel memory may succeed even though there is
not sufficient memory to hold pixels; allocation does not take place
until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if <ahref="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is zero, and calloc(), if <ahref="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
memory. If <ahref="#SkBitmap_allocPixelsFlags_flags">flags</a> is <ahref="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, memory is zeroed.
be zeroed. Abort steps may be provided by the user at compile time by defining
<ahref="undocumented#SK_ABORT">SK ABORT</a>.
On most platforms, allocating pixel memory may succeed even though there is
not sufficient memory to hold pixels; allocation does not take place
until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if <ahref="#SkBitmap_allocPixelsFlags_flags">flags</a> is zero, and calloc(), if <ahref="#SkBitmap_allocPixelsFlags_flags">flags</a> is
<ahref="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, or zero</td>
</tr>
</table>
### Example
<div><fiddle-embedname="f21b8965a88c94a32393a8890c4672af"><div><ahref="undocumented#Text">Text</a> is drawn on a transparent background; drawing the bitmap a second time
lets the first draw show through.</div></fiddle-embed></div>
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
memory. <ahref="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_width">width</a> times <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_bytesPerPixel">bytesPerPixel</a>,
or equal zero. Pass in zero for <ahref="#SkBitmap_rowBytes">rowBytes</a> to compute the minimum valid value.
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
memory. <ahref="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_width">width</a> times <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_bytesPerPixel">bytesPerPixel</a>,
or equal zero. Pass in zero for <ahref="#SkBitmap_rowBytes">rowBytes</a> to compute the minimum valid value.
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a> and allocates pixel
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Native_Color_Type">Native Color Type</a>; and allocates
pixel memory. If <ahref="#SkBitmap_isOpaque">isOpaque</a> is true, sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>;
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and the <ahref="undocumented#Native_Color_Type">Native Color Type</a>; and allocates
pixel memory. If <ahref="#SkBitmap_isOpaque">isOpaque</a> is true, sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="undocumented#SkAlphaType">kPremul SkAlphaType</a>;
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a>, and creates <ahref="undocumented#Pixel_Ref">Pixel Ref</a>
containing <ahref="#SkBitmap_installPixels_pixels">pixels</a> and <ahref="#SkBitmap_rowBytes">rowBytes</a>. <ahref="#SkBitmap_installPixels_releaseProc">releaseProc</a>, if not nullptr, is called
immediately on failure or when <ahref="#SkBitmap_installPixels_pixels">pixels</a> are no longer referenced. <ahref="#SkBitmap_installPixels_context">context</a> may be
If <ahref="undocumented#Image_Info">Image Info</a> could not be set, or <ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkBitmap_info">info</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a>:
If <ahref="undocumented#Image_Info">Image Info</a> is set, <ahref="#SkBitmap_installPixels_pixels">pixels</a> is not nullptr, and <ahref="#SkBitmap_installPixels_releaseProc">releaseProc</a> is not nullptr:
when <ahref="#SkBitmap_installPixels_pixels">pixels</a> are no longer referenced, calls <ahref="#SkBitmap_installPixels_releaseProc">releaseProc</a> with <ahref="#SkBitmap_installPixels_pixels">pixels</a> and <ahref="#SkBitmap_installPixels_context">context</a>
<div><fiddle-embedname="ff5b5c349efb5d929ff5dff07b7727e6"><div><ahref="#SkBitmap_installPixels_releaseProc">releaseProc</a> is called immediately because <ahref="#SkBitmap_rowBytes">rowBytes</a> is too small for <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.</div>
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a>, and creates <ahref="undocumented#Pixel_Ref">Pixel Ref</a>
If <ahref="undocumented#Image_Info">Image Info</a> could not be set, or <ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkBitmap_info">info</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a>:
Caller must ensure that <ahref="#SkBitmap_installPixels_2_pixels">pixels</a> are valid for the lifetime of <ahref="#Bitmap">Bitmap</a> and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
<div><fiddle-embedname="a7e04447b2081010c50d7920e80a6bb2"><div><ahref="undocumented#GPU">GPU</a> does not support <ahref="undocumented#SkAlphaType">kUnpremul SkAlphaType</a>, does not assert that it does not.</div></fiddle-embed></div>
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_pixmap">pixmap</a>.<ahref="#SkBitmap_info">info</a> following the rules in <ahref="#SkBitmap_setInfo">setInfo</a>, and creates
<ahref="undocumented#Pixel_Ref">Pixel Ref</a> containing <ahref="#SkBitmap_pixmap">pixmap</a>.addr() and <ahref="#SkBitmap_pixmap">pixmap</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a>.
If <ahref="undocumented#Image_Info">Image Info</a> could not be set, or <ahref="#SkBitmap_pixmap">pixmap</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than
Caller must ensure that <ahref="#SkBitmap_pixmap">pixmap</a> is valid for the lifetime of <ahref="#Bitmap">Bitmap</a> and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
<div><fiddle-embedname="6e2a8c9358b34aebd2ec586815fe9d3a"><div>Draw a five by five bitmap, and draw it again with a center white pixel.</div></fiddle-embed></div>
Sets <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_height">height</a>, <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>, and
<ahref="undocumented#SkAlphaType">kPremul SkAlphaType</a>. Sets <ahref="undocumented#Pixel_Ref">Pixel Ref</a> to <ahref="#SkBitmap_installMaskPixels_mask">mask</a> image and <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_rowBytes">rowBytes</a>.
Returns false and calls <ahref="#SkBitmap_reset">reset</a> if <ahref="#SkBitmap_installMaskPixels_mask">mask</a> format is not <ahref="#SkMask_kA8_Format">SkMask::kA8 Format</a>,
or if <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_height">height</a> is negative, or if <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_rowBytes">rowBytes</a> is less
than <ahref="#SkBitmap_installMaskPixels_mask">mask</a><ahref="#SkBitmap_width">width</a>.
Caller must ensure that <ahref="#SkBitmap_installMaskPixels_mask">mask</a> is valid for the lifetime of <ahref="#Bitmap">Bitmap</a> and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
true if <ahref="undocumented#Image_Info">Image Info</a> and <ahref="undocumented#Pixel_Ref">Pixel Ref</a> refer to <ahref="#SkBitmap_installMaskPixels_mask">mask</a>
<div><fiddle-embedname="b0456fc063ca467ccecf2105160a3d1d"><div>Draw a five by five bitmap, and draw it again with a center white pixel.</div></fiddle-embed></div>
Replaces <ahref="undocumented#Pixel_Ref">Pixel Ref</a> with <ahref="#SkBitmap_setPixels_pixels">pixels</a>, preserving <ahref="undocumented#Image_Info">Image Info</a> and <ahref="#SkBitmap_rowBytes">rowBytes</a>.
Sets <ahref="undocumented#Pixel_Ref">Pixel Ref</a> origin to (0, 0).
If <ahref="#SkBitmap_setPixels_pixels">pixels</a> is nullptr, or if <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_colorType">colorType</a> equals <ahref="undocumented#SkColorType">kUnknown SkColorType</a>;
release reference to <ahref="undocumented#Pixel_Ref">Pixel Ref</a>, and set <ahref="undocumented#Pixel_Ref">Pixel Ref</a> to nullptr.
Caller is responsible for handling ownership pixel memory for the lifetime
of <ahref="#Bitmap">Bitmap</a> and <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
The allocation size is determined by <ahref="undocumented#Image_Info">Image Info</a><ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Image_Color_Type">Color Type</a>.
Returns false if <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>, or allocation fails.
<div><fiddle-embedname="720e4c053fae9e929ab6518b47e49370"><div><ahref="#Bitmap">Bitmap</a> hosts and draws gray values in set1. <ahref="#SkBitmap_tryAllocPixels">tryAllocPixels</a> replaces <ahref="undocumented#Pixel_Ref">Pixel Ref</a>
and erases it to black, but does not alter set1. <ahref="#SkBitmap_setPixels">setPixels</a> replaces black
<ahref="undocumented#Pixel_Ref">Pixel Ref</a> with set1.</div></fiddle-embed></div>
The allocation size is determined by <ahref="undocumented#Image_Info">Image Info</a><ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Image_Color_Type">Color Type</a>.
Aborts if <ahref="#SkBitmap_info">info</a>.<ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>, or allocation fails.
Abort steps may be provided by the user at compile
time by defining <ahref="undocumented#SK_ABORT">SK ABORT</a>.
### Example
<div><fiddle-embedname="1219b38c788bf270fb20f8cd2d78cff8"><div><ahref="#Bitmap">Bitmap</a> hosts and draws gray values in set1. <ahref="#SkBitmap_allocPixels">allocPixels</a> replaces <ahref="undocumented#Pixel_Ref">Pixel Ref</a>
and erases it to black, but does not alter set1. <ahref="#SkBitmap_setPixels">setPixels</a> replaces black
<ahref="undocumented#Pixel_Ref">Pixel Ref</a> with set2.</div></fiddle-embed></div>
Allocates pixel memory with <ahref="#SkBitmap_tryAllocPixels_4_allocator">allocator</a>, and replaces existing <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
The allocation size is determined by <ahref="undocumented#Image_Info">Image Info</a><ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Image_Color_Type">Color Type</a>.
instance of <ahref="#SkBitmap_Allocator">SkBitmap::Allocator</a> instantiation</td>
</tr>
</table>
### Return Value
true if custom <ahref="#SkBitmap_tryAllocPixels_4_allocator">allocator</a> reports success
### Example
<div><fiddle-embedname="eb6f861ca1839146d26e40d56c2a001c"><div><ahref="#SkBitmap_HeapAllocator">HeapAllocator</a> limits the maximum size of <ahref="#Bitmap">Bitmap</a> to two gigabytes. Using
a custom <ahref="#SkBitmap_tryAllocPixels_4_allocator">allocator</a>, this limitation may be relaxed. This example can be
modified to allocate an eight gigabyte <ahref="#Bitmap">Bitmap</a> on a 64 bit platform with
Allocates pixel memory with <ahref="#SkBitmap_allocPixels_4_allocator">allocator</a>, and replaces existing <ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
The allocation size is determined by <ahref="undocumented#Image_Info">Image Info</a><ahref="#SkBitmap_width">width</a>, <ahref="#SkBitmap_height">height</a>, and <ahref="undocumented#Image_Color_Type">Color Type</a>.
If <ahref="#SkBitmap_allocPixels_4_allocator">allocator</a> is nullptr, use <ahref="#SkBitmap_HeapAllocator">HeapAllocator</a> instead.
Aborts if <ahref="#SkBitmap_allocPixels_4_allocator">allocator</a><ahref="#SkBitmap_HeapAllocator_allocPixelRef">allocPixelRef</a> return false. Abort steps may be provided by
the user at compile time by defining <ahref="undocumented#SK_ABORT">SK ABORT</a>.
Returns origin of pixels within <ahref="undocumented#Pixel_Ref">Pixel Ref</a>. <ahref="#Bitmap">Bitmap</a><ahref="#SkBitmap_bounds">bounds</a> is always contained
by <ahref="undocumented#Pixel_Ref">Pixel Ref</a><ahref="#SkBitmap_bounds">bounds</a>, which may be the same size or larger. Multiple <ahref="#Bitmap">Bitmaps</a>
can share the same <ahref="undocumented#Pixel_Ref">Pixel Ref</a>, where each <ahref="#Bitmap">Bitmap</a> has different <ahref="#SkBitmap_bounds">bounds</a>.
The returned origin added to <ahref="#Bitmap">Bitmap</a><ahref="#SkBitmap_dimensions">dimensions</a> equals or is smaller than the
void setPixelRef(sk_sp<SkPixelRef> pixelRef, int dx, int dy)
</pre>
Replaces <ahref="#SkBitmap_pixelRef">pixelRef</a> and origin in <ahref="#Bitmap">Bitmap</a>. <ahref="#SkBitmap_setPixelRef_dx">dx</a> and <ahref="#SkBitmap_setPixelRef_dy">dy</a> specify the offset
within the <ahref="undocumented#Pixel_Ref">Pixel Ref</a> pixels for the top-left corner of the bitmap.
Asserts in debug builds if <ahref="#SkBitmap_setPixelRef_dx">dx</a> or <ahref="#SkBitmap_setPixelRef_dy">dy</a> are out of range. Pins <ahref="#SkBitmap_setPixelRef_dx">dx</a> and <ahref="#SkBitmap_setPixelRef_dy">dy</a>
to legal range in release builds.
The caller is responsible for ensuring that the pixels match the
<ahref="undocumented#Image_Color_Type">Color Type</a> and <ahref="undocumented#Image_Alpha_Type">Alpha Type</a> in <ahref="undocumented#Image_Info">Image Info</a>.
row offset in <ahref="undocumented#Pixel_Ref">Pixel Ref</a> for bitmap origin</td>
</tr>
</table>
### Example
<div><fiddle-embedname="13df9e5b1adcec33d11e4b0f8a91ecb8"><div>Treating 32 bit data as 8 bit data is unlikely to produce useful results.</div></fiddle-embed></div>
Replaces pixel values with <ahref="#SkBitmap_eraseColor_c">c</a>. All pixels contained by <ahref="#SkBitmap_bounds">bounds</a> are affected.
If the <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a> or k565_SkColorType, then <ahref="#Alpha">Color Alpha</a>
is ignored; <ahref="#RGB">Color RGB</a> is treated as opaque. If <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>,
void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const
</pre>
Replaces pixel values with <ahref="#Unpremultiply">Unpremultiplied</a><ahref="undocumented#Color">Color</a> built from <ahref="#SkBitmap_eraseARGB_a">a</a>, <ahref="#SkBitmap_eraseARGB_r">r</a>, <ahref="#SkBitmap_eraseARGB_g">g</a>, and <ahref="#SkBitmap_eraseARGB_b">b</a>.
All pixels contained by <ahref="#SkBitmap_bounds">bounds</a> are affected.
If the <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a> or k565_SkColorType, then <ahref="#SkBitmap_eraseARGB_a">a</a>
is ignored; <ahref="#SkBitmap_eraseARGB_r">r</a>, <ahref="#SkBitmap_eraseARGB_g">g</a>, and <ahref="#SkBitmap_eraseARGB_b">b</a> are treated as opaque. If <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>,
then <ahref="#SkBitmap_eraseARGB_r">r</a>, <ahref="#SkBitmap_eraseARGB_g">g</a>, and <ahref="#SkBitmap_eraseARGB_b">b</a> are ignored.
Replaces pixel values inside <ahref="#SkBitmap_erase_area">area</a> with <ahref="#SkBitmap_erase_c">c</a>. If <ahref="#SkBitmap_erase_area">area</a> does not intersect <ahref="#SkBitmap_bounds">bounds</a>,
call has no effect.
If the <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a> or k565_SkColorType, then <ahref="#Alpha">Color Alpha</a>
is ignored; <ahref="#RGB">Color RGB</a> is treated as opaque. If <ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>,
Returns pixel at (<ahref="#SkBitmap_getColor_x">x</a>, <ahref="#SkBitmap_getColor_y">y</a>) as <ahref="#Unpremultiply">Unpremultiplied</a><ahref="undocumented#Color">Color</a>.
Returns black with <ahref="#Alpha">Alpha</a> if <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>.
Input is not validated: out of <ahref="#SkBitmap_bounds">bounds</a> values of <ahref="#SkBitmap_getColor_x">x</a> or <ahref="#SkBitmap_getColor_y">y</a> trigger an assert() if
built with <ahref="undocumented#SK_DEBUG">SK DEBUG</a> defined; and returns undefined values or may crash if
<ahref="undocumented#SK_RELEASE">SK RELEASE</a> is defined. Fails if <ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a> or
<ahref="undocumented#Color_Space">Color Space</a> in <ahref="undocumented#Image_Info">Image Info</a> is ignored. Some <ahref="undocumented#Color">Color</a> precision may be lost in the
Returns pixel address at (<ahref="#SkBitmap_getAddr_x">x</a>, <ahref="#SkBitmap_getAddr_y">y</a>).
Input is not validated: out of <ahref="#SkBitmap_bounds">bounds</a> values of <ahref="#SkBitmap_getAddr_x">x</a> or <ahref="#SkBitmap_getAddr_y">y</a>, or <ahref="undocumented#SkColorType">kUnknown SkColorType</a>,
trigger an assert() if built with <ahref="undocumented#SK_DEBUG">SK DEBUG</a> defined. Returns nullptr if
<ahref="undocumented#Image_Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kUnknown SkColorType</a>, or <ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr.
Shares <ahref="undocumented#Pixel_Ref">Pixel Ref</a> with <ahref="#SkBitmap_extractSubset_dst">dst</a>. Pixels are not copied; <ahref="#Bitmap">Bitmap</a> and <ahref="#SkBitmap_extractSubset_dst">dst</a> point
to the same pixels; <ahref="#SkBitmap_extractSubset_dst">dst</a><ahref="#SkBitmap_bounds">bounds</a> are set to the intersection of <ahref="#SkBitmap_extractSubset_subset">subset</a>
and the original <ahref="#SkBitmap_bounds">bounds</a>.
<ahref="#SkBitmap_extractSubset_subset">subset</a> may be larger than <ahref="#SkBitmap_bounds">bounds</a>. Any area outside of <ahref="#SkBitmap_bounds">bounds</a> is ignored.
Any contents of <ahref="#SkBitmap_extractSubset_dst">dst</a> are discarded. <ahref="#SkBitmap_isVolatile">isVolatile</a> setting is copied to <ahref="#SkBitmap_extractSubset_dst">dst</a>.
<ahref="#SkBitmap_extractSubset_dst">dst</a> is set to <ahref="#SkBitmap_colorType">colorType</a>, <ahref="#SkBitmap_alphaType">alphaType</a>, and <ahref="#SkBitmap_colorSpace">colorSpace</a>.
Return false if:
<table><tr>
<td><ahref="#SkBitmap_extractSubset_dst">dst</a> is nullptr</td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr><tr>
<td><ahref="#SkBitmap_extractSubset_subset">subset</a> does not intersect <ahref="#SkBitmap_bounds">bounds</a></td></tr>
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels to <ahref="#SkBitmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<ahref="#SkBitmap_readPixels_srcX">srcX</a>, <ahref="#SkBitmap_readPixels_srcY">srcY</a>), and does not exceed
<ahref="undocumented#Color_Space">Color Space</a> of destination. <ahref="#SkBitmap_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination
row to the next. Returns true if pixels are copied. Returns false if:
<td><ahref="#SkBitmap_readPixels_dstRowBytes">dstRowBytes</a> is less than <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
<ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, or <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> must match.
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkBitmap_readPixels_srcX">srcX</a> and <ahref="#SkBitmap_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns
or ifabs(srcY) >= this-><ahref="#SkBitmap_height">height</a>.
If <ahref="#SkBitmap_readPixels_behavior">behavior</a> is <ahref="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts source
pixels to a linear space before converting to <ahref="#SkBitmap_readPixels_dstInfo">dstInfo</a>.
If <ahref="#SkBitmap_readPixels_behavior">behavior</a> is <ahref="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: source
pixels are treated as if they are linear, regardless of how they are encoded.
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels to <ahref="#SkBitmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (<ahref="#SkBitmap_readPixels_2_srcX">srcX</a>, <ahref="#SkBitmap_readPixels_2_srcY">srcY</a>), and does not exceed
<ahref="undocumented#Color_Space">Color Space</a> of destination. <ahref="#SkBitmap_readPixels_2_dstRowBytes">dstRowBytes</a> specifics the gap from one destination
row to the next. Returns true if pixels are copied. Returns false if:
<td><ahref="#SkBitmap_readPixels_2_dstRowBytes">dstRowBytes</a> is less than <ahref="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<ahref="undocumented#SkImageInfo">minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
<ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, or <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <ahref="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorType">colorType</a> must match.
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<ahref="#SkBitmap_alphaType">alphaType</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<ahref="#SkBitmap_colorSpace">colorSpace</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkBitmap_readPixels_2_srcX">srcX</a> and <ahref="#SkBitmap_readPixels_2_srcY">srcY</a> may be negative to copy only top or left of source. Returns
bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
</pre>
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels to <ahref="#SkBitmap_readPixels_3_dst">dst</a>. Copy starts at (<ahref="#SkBitmap_readPixels_3_srcX">srcX</a>, <ahref="#SkBitmap_readPixels_3_srcY">srcY</a>), and does not exceed
and row bytes of destination. <ahref="#SkBitmap_readPixels_3_dst">dst</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one destination
row to the next. Returns true if pixels are copied. Returns false if:
<td><ahref="#SkBitmap_readPixels_3_dst">dst</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_readPixels_3_dst">dst</a><ahref="undocumented#Color_Space">Color Space</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_readPixels_3_dst">dst</a><ahref="undocumented#Image_Alpha_Type">Alpha Type</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_readPixels_3_dst">dst</a><ahref="undocumented#Color_Space">Color Space</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkBitmap_readPixels_3_srcX">srcX</a> and <ahref="#SkBitmap_readPixels_3_srcY">srcY</a> may be negative to copy only top or left of source. Returns
and row bytes of destination. <ahref="#SkBitmap_readPixels_4_dst">dst</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one destination
row to the next. Returns true if pixels are copied. Returns false if:
<td><ahref="#SkBitmap_readPixels_4_dst">dst</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_readPixels_4_dst">dst</a><ahref="undocumented#Color_Space">Color Space</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_readPixels_4_dst">dst</a><ahref="undocumented#Image_Alpha_Type">Alpha Type</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_readPixels_4_dst">dst</a><ahref="undocumented#Color_Space">Color Space</a> must match. Returns
bool writePixels(const SkPixmap& src, int dstX, int dstY)
</pre>
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels from <ahref="#SkBitmap_writePixels_src">src</a>. Copy starts at (<ahref="#SkBitmap_writePixels_dstX">dstX</a>, <ahref="#SkBitmap_writePixels_dstY">dstY</a>), and does not exceed
<td><ahref="#SkBitmap_writePixels_src">src</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_writePixels_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_writePixels_src">src</a><ahref="undocumented#Image_Alpha_Type">Alpha Type</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_writePixels_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkBitmap_writePixels_dstX">dstX</a> and <ahref="#SkBitmap_writePixels_dstY">dstY</a> may be negative to copy only top or left of source. Returns
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels from <ahref="#SkBitmap_writePixels_2_src">src</a>. Copy starts at (0, 0), and does not exceed
<td><ahref="#SkBitmap_writePixels_2_src">src</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_writePixels_2_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_writePixels_2_src">src</a><ahref="undocumented#Image_Alpha_Type">Alpha Type</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_writePixels_2_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match. Returns
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels from <ahref="#SkBitmap_writePixels_3_src">src</a>. Copy starts at (0, 0), and does not exceed
<td><ahref="#SkBitmap_writePixels_3_src">src</a>.<ahref="#SkBitmap_rowBytes">rowBytes</a> is less than <ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td></tr><tr>
<td><ahref="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td></tr>
</table>
Pixels are copied only if pixel conversion is possible. If this-><ahref="#SkBitmap_colorType">colorType</a> is
If this-><ahref="#SkBitmap_colorType">colorType</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkBitmap_writePixels_3_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match.
If this-><ahref="#SkBitmap_alphaType">alphaType</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkBitmap_writePixels_3_src">src</a><ahref="undocumented#Image_Alpha_Type">Alpha Type</a> must
match. If this-><ahref="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <ahref="#SkBitmap_writePixels_3_src">src</a><ahref="undocumented#Color_Space">Color Space</a> must match. Returns
false if pixel conversion is not possible. Returns false if <ahref="#SkBitmap_width">width</a> or <ahref="#SkBitmap_height">height</a>
is zero or negative.
If <ahref="#SkBitmap_writePixels_3_behavior">behavior</a> is <ahref="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts <ahref="#SkBitmap_writePixels_3_src">src</a>
If <ahref="#SkBitmap_writePixels_3_behavior">behavior</a> is <ahref="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: <ahref="#SkBitmap_writePixels_3_src">src</a>
pixels are treated as if they are linear, regardless of how they are encoded.
Sets <ahref="#SkBitmap_extractAlpha_dst">dst</a> to <ahref="#Alpha">Alpha</a> described by pixels. Returns false if <ahref="#SkBitmap_extractAlpha_dst">dst</a> cannot be written to
or <ahref="#SkBitmap_extractAlpha_dst">dst</a> pixels cannot be allocated.
Uses <ahref="#SkBitmap_HeapAllocator">HeapAllocator</a> to reserve memory for <ahref="#SkBitmap_extractAlpha_dst">dst</a><ahref="undocumented#Pixel_Ref">Pixel Ref</a>.
Sets <ahref="#SkBitmap_extractAlpha_2_dst">dst</a> to <ahref="#Alpha">Alpha</a> described by pixels. Returns false if <ahref="#SkBitmap_extractAlpha_2_dst">dst</a> cannot be written to
or <ahref="#SkBitmap_extractAlpha_2_dst">dst</a> pixels cannot be allocated.
If <ahref="#SkBitmap_extractAlpha_2_paint">paint</a> is not nullptr and contains <ahref="undocumented#Mask_Filter">Mask Filter</a>, <ahref="#SkMaskFilter_filterMask">SkMaskFilter::filterMask</a>
generates <ahref="undocumented#Mask_Alpha">Mask Alpha</a> from <ahref="#Bitmap">Bitmap</a>. Uses <ahref="#SkBitmap_HeapAllocator">HeapAllocator</a> to reserve memory for <ahref="#SkBitmap_extractAlpha_2_dst">dst</a>
<ahref="undocumented#Pixel_Ref">Pixel Ref</a>. Sets <ahref="#SkBitmap_extractAlpha_2_offset">offset</a> to top-left position for <ahref="#SkBitmap_extractAlpha_2_dst">dst</a> for alignment with <ahref="#Bitmap">Bitmap</a>;
Sets <ahref="#SkBitmap_extractAlpha_3_dst">dst</a> to <ahref="#Alpha">Alpha</a> described by pixels. Returns false if <ahref="#SkBitmap_extractAlpha_3_dst">dst</a> cannot be written to
or <ahref="#SkBitmap_extractAlpha_3_dst">dst</a> pixels cannot be allocated.
If <ahref="#SkBitmap_extractAlpha_3_paint">paint</a> is not nullptr and contains <ahref="undocumented#Mask_Filter">Mask Filter</a>, <ahref="#SkMaskFilter_filterMask">SkMaskFilter::filterMask</a>
generates <ahref="undocumented#Mask_Alpha">Mask Alpha</a> from <ahref="#Bitmap">Bitmap</a>. <ahref="#SkBitmap_extractAlpha_3_allocator">allocator</a> may reference a custom allocation
class or be set to nullptr to use <ahref="#SkBitmap_HeapAllocator">HeapAllocator</a>. Sets <ahref="#SkBitmap_extractAlpha_3_offset">offset</a> to top-left
position for <ahref="#SkBitmap_extractAlpha_3_dst">dst</a> for alignment with <ahref="#Bitmap">Bitmap</a>; (0, 0) unless <ahref="undocumented#SkMaskFilter">SkMaskFilter</a> generates
Copies <ahref="#Bitmap">Bitmap</a> pixel address, row bytes, and <ahref="undocumented#Image_Info">Image Info</a> to <ahref="#SkBitmap_pixmap">pixmap</a>, if address