<ahref="#Image">Image</a> describes a two dimensional array of pixels to draw. The pixels may be
unencoded in a <ahref="undocumented#Raster_Bitmap">Raster Bitmap</a>, encoded in a <ahref="undocumented#Picture">Picture</a> or compressed data stream,
<ahref="#Image">Image</a> cannot be modified after it is created. <ahref="#Image">Image</a> may allocate additional
storage as needed; for instance, an encoded <ahref="#Image">Image</a> may decode when drawn.
<ahref="#Image">Image</a><ahref="#SkImage_width">width</a> and <ahref="#SkImage_height">height</a> are greater than zero. Creating an <ahref="#Image">Image</a> with zero <ahref="#SkImage_width">width</a>
or <ahref="#SkImage_height">height</a> returns <ahref="#Image">Image</a> equal to nullptr.
<ahref="#Image">Image</a> may be created from <ahref="SkBitmap_Reference#Bitmap">Bitmap</a>, <ahref="SkPixmap_Reference#Pixmap">Pixmap</a>, <ahref="SkSurface_Reference#Surface">Surface</a>, <ahref="undocumented#Picture">Picture</a>, encoded streams,
<ahref="SkImage_Reference#Raster_Image">Raster Image</a> pixels are unencoded in a <ahref="undocumented#Raster_Bitmap">Raster Bitmap</a>. These pixels may be read
directly and in most cases written to, although edited pixels may not be drawn
if <ahref="#Image">Image</a> has been copied internally.
| <ahref="#SkImage_MakeCrossContextFromEncoded">MakeCrossContextFromEncoded</a> | Creates <ahref="#Image">Image</a> from encoded data, and uploads to GPU. |
| <ahref="#SkImage_MakeFromAHardwareBuffer">MakeFromAHardwareBuffer</a> | Creates <ahref="#Image">Image</a> from Android hardware buffer. |
| <ahref="#SkImage_MakeFromEncoded">MakeFromEncoded</a> | Creates <ahref="#Image">Image</a> from encoded data. |
| <ahref="#SkImage_MakeFromGenerator">MakeFromGenerator</a> | Creates <ahref="#Image">Image</a> from a stream of data. |
| <ahref="#SkImage_MakeFromNV12TexturesCopy">MakeFromNV12TexturesCopy</a> | Creates <ahref="#Image">Image</a> from <ahref="undocumented#YUV_ColorSpace">YUV ColorSpace</a> data in two planes. |
| <ahref="#SkImage_MakeFromPicture">MakeFromPicture</a> | Creates <ahref="#Image">Image</a> from <ahref="undocumented#Picture">Picture</a>. |
| <ahref="#SkImage_MakeFromRaster">MakeFromRaster</a> | Creates <ahref="#Image">Image</a> from <ahref="SkPixmap_Reference#Pixmap">Pixmap</a>, with release. |
| <ahref="#SkImage_MakeFromYUVTexturesCopy">MakeFromYUVTexturesCopy</a> | Creates <ahref="#Image">Image</a> from <ahref="undocumented#YUV_ColorSpace">YUV ColorSpace</a> data in three planes. |
| <ahref="#SkImage_MakeRasterCopy">MakeRasterCopy</a> | Creates <ahref="#Image">Image</a> from <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> and copied pixels. |
| <ahref="#SkImage_MakeRasterData">MakeRasterData</a> | Creates <ahref="#Image">Image</a> from <ahref="#Info">Image Info</a> and shared pixels. |
| <ahref="#SkImage_isTextureBacked">isTextureBacked</a> | Returns if <ahref="#Image">Image</a> was created from <ahref="undocumented#GPU_Texture">GPU Texture</a>. |
| <ahref="#SkImage_isValid">isValid</a> | Returns if <ahref="#Image">Image</a> can draw to <ahref="undocumented#Raster_Surface">Raster Surface</a> or <ahref="undocumented#GPU_Context">GPU Context</a>. |
| <ahref="#SkImage_makeShader">makeShader</a> | Creates <ahref="undocumented#Shader">Shader</a>, <ahref="SkPaint_Reference#Paint">Paint</a> element that can tile <ahref="#Image">Image</a>. |
| <ahref="#SkImage_makeSubset">makeSubset</a> | Creates <ahref="#Image">Image</a> containing part of original. |
Creates <ahref="#Image">Image</a> from <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> and copy of pixels. Since pixels are copied, <ahref="SkPixmap_Reference#Pixmap">Pixmap</a>
pixels may be modified or deleted without affecting <ahref="#Image">Image</a>.
<ahref="#Image">Image</a> is returned if <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> is valid. Valid <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> parameters include:
<ahref="#SkImage_dimensions">dimensions</a> are greater than zero;
each dimension fits in 29 bits;
<ahref="#Color_Type">Color Type</a> and <ahref="#Alpha_Type">Alpha Type</a> are valid, and <ahref="#Color_Type">Color Type</a> is not <ahref="undocumented#SkColorType">kUnknown SkColorType</a>;
row bytes are large enough to hold one row of pixels;
<div><fiddle-embedname="513afec5795a9504ebf6af5373d16b6b"><div>Draw a five by five bitmap, and draw a copy in an <ahref="#Image">Image</a>. Editing the <ahref="#SkImage_MakeRasterCopy_pixmap">pixmap</a>
alters the bitmap draw, but does not alter the <ahref="#Image">Image</a> draw since the <ahref="#Image">Image</a>
contains a copy of the pixels.</div></fiddle-embed></div>
Creates <ahref="#Image">Image</a> from <ahref="#Info">Image Info</a>, sharing <ahref="#SkImage_MakeRasterData_pixels">pixels</a>.
<ahref="#Image">Image</a> is returned if <ahref="#Info">Image Info</a> is valid. Valid <ahref="#Info">Image Info</a> parameters include:
<ahref="#SkImage_dimensions">dimensions</a> are greater than zero;
each dimension fits in 29 bits;
<ahref="#Color_Type">Color Type</a> and <ahref="#Alpha_Type">Alpha Type</a> are valid, and <ahref="#Color_Type">Color Type</a> is not <ahref="undocumented#SkColorType">kUnknown SkColorType</a>;
<ahref="#SkImage_MakeRasterData_rowBytes">rowBytes</a> are large enough to hold one row of <ahref="#SkImage_MakeRasterData_pixels">pixels</a>;
<ahref="#SkImage_MakeRasterData_pixels">pixels</a> is not nullptr, and contains enough data for <ahref="#Image">Image</a>.
Creates <ahref="#Image">Image</a> from <ahref="#SkImage_MakeFromRaster_pixmap">pixmap</a>, sharing <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> pixels. Pixels must remain valid and
unchanged until <ahref="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> is called. <ahref="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> is passed
<ahref="#SkImage_MakeFromRaster_releaseContext">releaseContext</a> when <ahref="#Image">Image</a> is deleted or no longer refers to <ahref="#SkImage_MakeFromRaster_pixmap">pixmap</a> pixels.
Pass nullptr for <ahref="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> to share <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> without requiring a callback
when <ahref="#Image">Image</a> is released. Pass nullptr for <ahref="#SkImage_MakeFromRaster_releaseContext">releaseContext</a> if <ahref="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a>
<ahref="#Image">Image</a> is returned if <ahref="#SkImage_MakeFromRaster_pixmap">pixmap</a> is valid. Valid <ahref="SkPixmap_Reference#Pixmap">Pixmap</a> parameters include:
<ahref="#SkImage_dimensions">dimensions</a> are greater than zero;
each dimension fits in 29 bits;
<ahref="#Color_Type">Color Type</a> and <ahref="#Alpha_Type">Alpha Type</a> are valid, and <ahref="#Color_Type">Color Type</a> is not <ahref="undocumented#SkColorType">kUnknown SkColorType</a>;
row bytes are large enough to hold one row of pixels;
Creates <ahref="#Image">Image</a> from <ahref="#SkImage_MakeFromBitmap_bitmap">bitmap</a>, sharing or copying <ahref="#SkImage_MakeFromBitmap_bitmap">bitmap</a> pixels. If the <ahref="#SkImage_MakeFromBitmap_bitmap">bitmap</a>
is marked immutable, and its pixel memory is shareable, it may be shared
instead of copied.
<ahref="#Image">Image</a> is returned if <ahref="#SkImage_MakeFromBitmap_bitmap">bitmap</a> is valid. Valid <ahref="SkBitmap_Reference#Bitmap">Bitmap</a> parameters include:
<ahref="#SkImage_dimensions">dimensions</a> are greater than zero;
each dimension fits in 29 bits;
<ahref="#Color_Type">Color Type</a> and <ahref="#Alpha_Type">Alpha Type</a> are valid, and <ahref="#Color_Type">Color Type</a> is not <ahref="undocumented#SkColorType">kUnknown SkColorType</a>;
row bytes are large enough to hold one row of pixels;
<div><fiddle-embedname="cf2cf53321e4e6a77c2841bfbc0ef707"><div>The first <ahref="SkBitmap_Reference#Bitmap">Bitmap</a> is shared; writing to the pixel memory changes the first
<ahref="#Image">Image</a>.
The second <ahref="SkBitmap_Reference#Bitmap">Bitmap</a> is marked immutable, and is copied; writing to the pixel
memory does not alter the second <ahref="#Image">Image</a>.</div></fiddle-embed></div>
Creates <ahref="#Image">Image</a> from data returned by <ahref="#SkImage_MakeFromGenerator_imageGenerator">imageGenerator</a>. Generated data is owned by <ahref="#Image">Image</a> and may not
<ahref="#SkImage_MakeFromGenerator_imageGenerator">imageGenerator</a> may wrap <ahref="undocumented#Picture">Picture</a> data, codec data, or custom data.
Creates <ahref="#Image">Image</a> from <ahref="undocumented#GPU_Texture">GPU Texture</a> associated with <ahref="#SkImage_MakeFromTexture_3_context">context</a>. Caller is responsible for
managing the lifetime of <ahref="undocumented#GPU_Texture">GPU Texture</a>.
<ahref="#Image">Image</a> is returned if format of <ahref="#SkImage_MakeFromTexture_3_backendTexture">backendTexture</a> is recognized and supported.
<div><fiddle-embedname="d5e43961a54548f445eece91d517381c"gpu="true"><div>A back-end texture has been created and uploaded to the GPU outside of this example.</div></fiddle-embed></div>
Creates <ahref="#Image">Image</a> from <ahref="undocumented#GPU_Texture">GPU Texture</a> associated with <ahref="#SkImage_MakeFromTexture_4_context">context</a>. <ahref="undocumented#GPU_Texture">GPU Texture</a> must stay
valid and unchanged until <ahref="#SkImage_MakeFromTexture_4_textureReleaseProc">textureReleaseProc</a> is called. <ahref="#SkImage_MakeFromTexture_4_textureReleaseProc">textureReleaseProc</a> is
passed <ahref="#SkImage_MakeFromTexture_4_releaseContext">releaseContext</a> when <ahref="#Image">Image</a> is deleted or no longer refers to texture.
<ahref="#Image">Image</a> is returned if format of <ahref="#SkImage_MakeFromTexture_4_backendTexture">backendTexture</a> is recognized and supported.
Creates <ahref="#Image">Image</a> from encoded <ahref="#SkImage_MakeCrossContextFromEncoded_data">data</a>. <ahref="#Image">Image</a> is uploaded to GPU back-end using <ahref="#SkImage_MakeCrossContextFromEncoded_context">context</a>.
<ahref="undocumented#Texture">Texture</a> decoded from <ahref="#SkImage_MakeCrossContextFromEncoded_data">data</a> is uploaded to match <ahref="SkSurface_Reference#Surface">Surface</a> created with
<ahref="#SkImage_MakeCrossContextFromEncoded_dstColorSpace">dstColorSpace</a>. <ahref="undocumented#Color_Space">Color Space</a> of <ahref="#Image">Image</a> is determined by encoded <ahref="#SkImage_MakeCrossContextFromEncoded_data">data</a>.
<ahref="#Image">Image</a> is returned if format of <ahref="#SkImage_MakeCrossContextFromEncoded_data">data</a> is recognized and supported, and if <ahref="#SkImage_MakeCrossContextFromEncoded_context">context</a>
<ahref="#Image">Image</a> is returned using <ahref="#SkImage_MakeFromEncoded">MakeFromEncoded</a> if <ahref="#SkImage_MakeCrossContextFromEncoded_context">context</a> is nullptr or does not support
Creates <ahref="#Image">Image</a> from <ahref="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a>. <ahref="#Image">Image</a> is uploaded to GPU back-end using <ahref="#SkImage_MakeCrossContextFromPixmap_context">context</a>.
When <ahref="#Image">Image</a> is no longer referenced, <ahref="#SkImage_MakeCrossContextFromPixmap_context">context</a> releases texture memory
asynchronously.
<ahref="undocumented#Texture">Texture</a> created from <ahref="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a> is uploaded to match <ahref="SkSurface_Reference#Surface">Surface</a> created with
<ahref="#SkImage_MakeCrossContextFromPixmap_dstColorSpace">dstColorSpace</a>. <ahref="undocumented#Color_Space">Color Space</a> of <ahref="#Image">Image</a> is determined by <ahref="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a>.<ahref="#SkImage_colorSpace">colorSpace</a>.
format of data is recognized and supported, and if <ahref="#SkImage_MakeCrossContextFromPixmap_context">context</a> supports moving
resources between contexts. Otherwise, <ahref="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a> pixel data is copied and <ahref="#Image">Image</a>
as returned in raster format if possible; nullptr may be returned.
Creates <ahref="#Image">Image</a> from <ahref="#SkImage_MakeFromAdoptedTexture_2_backendTexture">backendTexture</a> associated with <ahref="#SkImage_MakeFromAdoptedTexture_2_context">context</a>. <ahref="#SkImage_MakeFromAdoptedTexture_2_backendTexture">backendTexture</a> and
returned <ahref="#Image">Image</a> are managed internally, and are released when no longer needed.
<ahref="#Image">Image</a> is returned if format of <ahref="#SkImage_MakeFromAdoptedTexture_2_backendTexture">backendTexture</a> is recognized and supported.
Creates <ahref="#Image">Image</a> from copy of <ahref="#SkImage_MakeFromYUVTexturesCopy_yuvTextureHandles">yuvTextureHandles</a>, an array of textures on GPU.
<ahref="#SkImage_MakeFromYUVTexturesCopy_yuvTextureHandles">yuvTextureHandles</a> contain pixels for YUV planes of <ahref="#Image">Image</a>.
<ahref="#SkImage_MakeFromYUVTexturesCopy_yuvSizes">yuvSizes</a> conain <ahref="#SkImage_dimensions">dimensions</a> for each pixel plane. Dimensions must be greater than
zero but may differ from plane to plane. Returned <ahref="#Image">Image</a> has the <ahref="#SkImage_dimensions">dimensions</a>
<ahref="#SkImage_MakeFromYUVTexturesCopy_yuvSizes">yuvSizes</a>[0]. <ahref="#SkImage_MakeFromYUVTexturesCopy_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors.
Creates <ahref="#Image">Image</a> from copy of <ahref="#SkImage_MakeFromYUVTexturesCopy_2_yuvTextureHandles">yuvTextureHandles</a>, an array of textures on GPU.
<ahref="#SkImage_MakeFromYUVTexturesCopy_2_yuvTextureHandles">yuvTextureHandles</a> contain pixels for YUV planes of <ahref="#Image">Image</a>.
<ahref="#SkImage_MakeFromYUVTexturesCopy_2_yuvSizes">yuvSizes</a> conain <ahref="#SkImage_dimensions">dimensions</a> for each pixel plane. Dimensions must be greater than
zero but may differ from plane to plane. Returned <ahref="#Image">Image</a> has the <ahref="#SkImage_dimensions">dimensions</a>
<ahref="#SkImage_MakeFromYUVTexturesCopy_2_yuvSizes">yuvSizes</a>[0]. <ahref="#SkImage_MakeFromYUVTexturesCopy_2_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors.
Creates <ahref="#Image">Image</a> from copy of <ahref="#SkImage_MakeFromNV12TexturesCopy_nv12TextureHandles">nv12TextureHandles</a>, an array of textures on GPU.
<ahref="#SkImage_MakeFromNV12TexturesCopy_nv12TextureHandles">nv12TextureHandles</a>[0] contains pixels for YUV_Component_Y plane.
<ahref="#SkImage_MakeFromNV12TexturesCopy_nv12TextureHandles">nv12TextureHandles</a>[1] contains pixels for YUV_Component_U plane,
<ahref="#SkImage_MakeFromNV12TexturesCopy_nv12Sizes">nv12Sizes</a> conain <ahref="#SkImage_dimensions">dimensions</a> for each pixel plane. Dimensions must be greater than
zero but may differ from plane to plane. Returned <ahref="#Image">Image</a> has the <ahref="#SkImage_dimensions">dimensions</a>
<ahref="#SkImage_MakeFromNV12TexturesCopy_nv12Sizes">nv12Sizes</a>[0]. <ahref="#SkImage_MakeFromNV12TexturesCopy_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors.
Creates <ahref="#Image">Image</a> from copy of <ahref="#SkImage_MakeFromNV12TexturesCopy_2_nv12TextureHandles">nv12TextureHandles</a>, an array of textures on GPU.
<ahref="#SkImage_MakeFromNV12TexturesCopy_2_nv12TextureHandles">nv12TextureHandles</a>[0] contains pixels for YUV_Component_Y plane.
<ahref="#SkImage_MakeFromNV12TexturesCopy_2_nv12TextureHandles">nv12TextureHandles</a>[1] contains pixels for YUV_Component_U plane,
<ahref="#SkImage_MakeFromNV12TexturesCopy_2_nv12Sizes">nv12Sizes</a> conain <ahref="#SkImage_dimensions">dimensions</a> for each pixel plane. Dimensions must be greater than
zero but may differ from plane to plane. Returned <ahref="#Image">Image</a> has the <ahref="#SkImage_dimensions">dimensions</a>
<ahref="#SkImage_MakeFromNV12TexturesCopy_2_nv12Sizes">nv12Sizes</a>[0]. <ahref="#SkImage_MakeFromNV12TexturesCopy_2_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors.
<td><aname="SkImage_kF16"><code><strong>SkImage::kF16 </strong></code></a></td><td>1</td><td>Use 16 bits per <ahref="#ARGB">Color ARGB</a> component using half-precision floating point format.</td>
Creates <ahref="#Image">Image</a> from <ahref="#SkImage_MakeFromPicture_picture">picture</a>. Returned <ahref="#Image">Image</a><ahref="#SkImage_width">width</a> and <ahref="#SkImage_height">height</a> are set by <ahref="#SkImage_dimensions">dimensions</a>.
<ahref="#Image">Image</a> draws <ahref="#SkImage_MakeFromPicture_picture">picture</a> with <ahref="#SkImage_MakeFromPicture_matrix">matrix</a> and <ahref="#SkImage_MakeFromPicture_paint">paint</a>, set to <ahref="#SkImage_MakeFromPicture_bitDepth">bitDepth</a> and <ahref="#SkImage_colorSpace">colorSpace</a>.
If <ahref="#SkImage_MakeFromPicture_matrix">matrix</a> is nullptr, draws with identity <ahref="SkMatrix_Reference#Matrix">Matrix</a>. If <ahref="#SkImage_MakeFromPicture_paint">paint</a> is nullptr, draws
Creates <ahref="undocumented#Shader">Shader</a> from <ahref="#Image">Image</a>. <ahref="undocumented#Shader">Shader</a><ahref="#SkImage_dimensions">dimensions</a> are taken from <ahref="#Image">Image</a>. <ahref="undocumented#Shader">Shader</a> uses
<ahref="#SkShader_TileMode">SkShader::TileMode</a> rules to fill drawn area outside <ahref="#Image">Image</a>. <ahref="#SkImage_makeShader_localMatrix">localMatrix</a> permits
transforming <ahref="#Image">Image</a> before <ahref="#Matrix">Canvas Matrix</a> is applied.
tiling in x, one of: <ahref="#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a>, <ahref="#SkShader_kRepeat_TileMode">SkShader::kRepeat TileMode</a>,
tiling in y, one of: <ahref="#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a>, <ahref="#SkShader_kRepeat_TileMode">SkShader::kRepeat TileMode</a>,
Creates <ahref="undocumented#Shader">Shader</a> from <ahref="#Image">Image</a>. <ahref="undocumented#Shader">Shader</a><ahref="#SkImage_dimensions">dimensions</a> are taken from <ahref="#Image">Image</a>. <ahref="undocumented#Shader">Shader</a> uses
<ahref="#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> to fill drawn area outside <ahref="#Image">Image</a>. <ahref="#SkImage_makeShader_2_localMatrix">localMatrix</a> permits
transforming <ahref="#Image">Image</a> before <ahref="#Matrix">Canvas Matrix</a> is applied.
Copies <ahref="#Image">Image</a> pixel address, row bytes, and <ahref="#Info">Image Info</a> to <ahref="#SkImage_peekPixels_pixmap">pixmap</a>, if address
is available, and returns true. If pixel address is not available, return
false and leave <ahref="#SkImage_peekPixels_pixmap">pixmap</a> unchanged.
Returns true if <ahref="#Image">Image</a> can be drawn on either <ahref="undocumented#Raster_Surface">Raster Surface</a> or <ahref="undocumented#GPU_Surface">GPU Surface</a>.
If <ahref="#SkImage_isValid_context">context</a> is nullptr, tests if <ahref="#Image">Image</a> draws on <ahref="undocumented#Raster_Surface">Raster Surface</a>;
otherwise, tests if <ahref="#Image">Image</a> draws on <ahref="undocumented#GPU_Surface">GPU Surface</a> associated with <ahref="#SkImage_isValid_context">context</a>.
<ahref="#Image">Image</a> backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> may become invalid if associated <ahref="undocumented#GrContext">GrContext</a> is
invalid. <ahref="#Lazy_Image">Lazy Image</a> may be invalid and may not draw to <ahref="undocumented#Raster_Surface">Raster Surface</a> or
<ahref="undocumented#GPU_Surface">GPU Surface</a> or both.
<td><aname="SkImage_kAllow_CachingHint"><code><strong>SkImage::kAllow_CachingHint </strong></code></a></td><td>0</td><td>Allows Skia to internally cache decoded and copied pixels.</td>
<td><aname="SkImage_kDisallow_CachingHint"><code><strong>SkImage::kDisallow_CachingHint </strong></code></a></td><td>1</td><td>Disallows Skia from internally caching decoded and copied pixels.</td>
Copies <ahref="SkRect_Reference#Rect">Rect</a> of pixels from <ahref="#Image">Image</a> to <ahref="#SkImage_readPixels_dstPixels">dstPixels</a>. Copy starts at offset (<ahref="#SkImage_readPixels_srcX">srcX</a>, <ahref="#SkImage_readPixels_srcY">srcY</a>),
and does not exceed <ahref="#Image">Image</a> (<ahref="#SkImage_width">width</a>, <ahref="#SkImage_height">height</a>).
<td><ahref="#SkImage_readPixels_dstRowBytes">dstRowBytes</a> is less than <ahref="#SkImage_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 <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is
<ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, or <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <ahref="#SkImage_readPixels_dstInfo">dstInfo</a>.<ahref="undocumented#SkImageInfo">colorType</a> must match.
If <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkImage_readPixels_dstInfo">dstInfo</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match.
If <ahref="#Image">Image</a><ahref="#Alpha_Type">Alpha Type</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkImage_readPixels_dstInfo">dstInfo</a>.<ahref="#SkImage_alphaType">alphaType</a> must
match. If <ahref="#Image">Image</a><ahref="undocumented#Color_Space">Color Space</a> is nullptr, <ahref="#SkImage_readPixels_dstInfo">dstInfo</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkImage_readPixels_srcX">srcX</a> and <ahref="#SkImage_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns
false if <ahref="#SkImage_width">width</a> or <ahref="#SkImage_height">height</a> is zero or negative.
If <ahref="#SkImage_readPixels_cachingHint">cachingHint</a> is <ahref="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally.
If <ahref="#SkImage_readPixels_cachingHint">cachingHint</a> is <ahref="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache.
Copies a <ahref="SkRect_Reference#Rect">Rect</a> of pixels from <ahref="#Image">Image</a> to <ahref="#SkImage_readPixels_2_dst">dst</a>. Copy starts at (<ahref="#SkImage_readPixels_2_srcX">srcX</a>, <ahref="#SkImage_readPixels_2_srcY">srcY</a>), and
does not exceed <ahref="#Image">Image</a> (<ahref="#SkImage_width">width</a>, <ahref="#SkImage_height">height</a>).
and row bytes of destination. <ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">rowBytes</a> specifics the gap from one destination
row to the next. Returns true if pixels are copied. Returns false if:
<td><ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">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 <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is
<ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, or <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">colorType</a> must match.
If <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match.
If <ahref="#Image">Image</a><ahref="#Alpha_Type">Alpha Type</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="#SkImage_alphaType">alphaType</a> must
match. If <ahref="#Image">Image</a><ahref="undocumented#Color_Space">Color Space</a> is nullptr, <ahref="#SkImage_readPixels_2_dst">dst</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match. Returns
false if pixel conversion is not possible.
<ahref="#SkImage_readPixels_2_srcX">srcX</a> and <ahref="#SkImage_readPixels_2_srcY">srcY</a> may be negative to copy only top or left of source. Returns
false if <ahref="#SkImage_width">width</a> or <ahref="#SkImage_height">height</a> is zero or negative.
or ifabs(srcY) >= <ahref="#Image">Image</a><ahref="#SkImage_height">height</a>.
If <ahref="#SkImage_readPixels_2_cachingHint">cachingHint</a> is <ahref="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally.
If <ahref="#SkImage_readPixels_2_cachingHint">cachingHint</a> is <ahref="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache.
Copies <ahref="#Image">Image</a> to <ahref="#SkImage_scalePixels_dst">dst</a>, scaling pixels to fit <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_width">width</a> and <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_height">height</a>, and
converting pixels to match <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">colorType</a> and <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_alphaType">alphaType</a>. Returns true if
pixels are copied. Returns false if <ahref="#SkImage_scalePixels_dst">dst</a>.addr() is nullptr, or <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">rowBytes</a> is
less than <ahref="#SkImage_scalePixels_dst">dst</a><ahref="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>.
Pixels are copied only if pixel conversion is possible. If <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is
<ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, or <ahref="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="SkPixmap_Reference#SkPixmap">colorType</a> must match.
If <ahref="#Image">Image</a><ahref="#Color_Type">Color Type</a> is <ahref="undocumented#SkColorType">kGray 8 SkColorType</a>, <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match.
If <ahref="#Image">Image</a><ahref="#Alpha_Type">Alpha Type</a> is <ahref="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_alphaType">alphaType</a> must
match. If <ahref="#Image">Image</a><ahref="undocumented#Color_Space">Color Space</a> is nullptr, <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_colorSpace">colorSpace</a> must match. Returns
false if pixel conversion is not possible.
Scales the image, with <ahref="#SkImage_scalePixels_filterQuality">filterQuality</a>, to match <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_width">width</a> and <ahref="#SkImage_scalePixels_dst">dst</a>.<ahref="#SkImage_height">height</a>.
<ahref="#SkImage_scalePixels_filterQuality">filterQuality</a><ahref="undocumented#SkFilterQuality">kNone SkFilterQuality</a> is fastest, typically implemented with
<ahref="undocumented#Filter_Quality_Nearest_Neighbor">Filter Quality Nearest Neighbor</a>. <ahref="undocumented#SkFilterQuality">kLow SkFilterQuality</a> is typically implemented with
<ahref="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>. <ahref="undocumented#SkFilterQuality">kMedium SkFilterQuality</a> is typically implemented with
<ahref="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>, and <ahref="undocumented#Filter_Quality_MipMap">Filter Quality MipMap</a> when size is reduced.
<ahref="undocumented#SkFilterQuality">kHigh SkFilterQuality</a> is slowest, typically implemented with <ahref="undocumented#Filter_Quality_BiCubic">Filter Quality BiCubic</a>.
If <ahref="#SkImage_scalePixels_cachingHint">cachingHint</a> is <ahref="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally.
If <ahref="#SkImage_scalePixels_cachingHint">cachingHint</a> is <ahref="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache.
Returns nullptr if encoding fails, or if <ahref="#SkImage_encodeToData_encodedImageFormat">encodedImageFormat</a> is not supported.
<ahref="#Image">Image</a> encoding in a format requires both building with one or more of:
SK_HAS_JPEG_LIBRARY, SK_HAS_PNG_LIBRARY, SK_HAS_WEBP_LIBRARY; and platform support
for the encoded format.
If SK_BUILD_FOR_MAC or SK_BUILD_FOR_IOS is defined, <ahref="#SkImage_encodeToData_encodedImageFormat">encodedImageFormat</a> can
additionally be one of: <ahref="#SkEncodedImageFormat_kICO">SkEncodedImageFormat::kICO</a>, <ahref="#SkEncodedImageFormat_kBMP">SkEncodedImageFormat::kBMP</a>,
<ahref="#SkImage_encodeToData_quality">quality</a> is a platform and format specific metric trading off size and encoding
error. When used, <ahref="#SkImage_encodeToData_quality">quality</a> equaling 100 encodes with the least error. <ahref="#SkImage_encodeToData_quality">quality</a> may
Appends <ahref="#Image">Image</a> description to <ahref="#SkImage_toString_string">string</a>, including unique ID, <ahref="#SkImage_width">width</a>, <ahref="#SkImage_height">height</a>, and
Returns <ahref="#SkImage_makeSubset_subset">subset</a> of <ahref="#Image">Image</a>. <ahref="#SkImage_makeSubset_subset">subset</a> must be fully contained by <ahref="#Image">Image</a><ahref="#SkImage_dimensions">dimensions</a>.
The implementation may share pixels, or may copy them.
Returns nullptr if <ahref="#SkImage_makeSubset_subset">subset</a> is empty, or <ahref="#SkImage_makeSubset_subset">subset</a> is not contained by <ahref="#SkImage_bounds">bounds</a>, or
pixels in <ahref="#Image">Image</a> could not be read or copied.
Returns <ahref="#Image">Image</a> backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> associated with <ahref="#SkImage_makeTextureImage_context">context</a>. Returned <ahref="#Image">Image</a> is
compatible with <ahref="SkSurface_Reference#Surface">Surface</a> created with <ahref="#SkImage_makeTextureImage_dstColorSpace">dstColorSpace</a>. Returns original
<ahref="#Image">Image</a> if <ahref="#SkImage_makeTextureImage_context">context</a> and <ahref="#SkImage_makeTextureImage_dstColorSpace">dstColorSpace</a> match.
Returns nullptr if <ahref="#SkImage_makeTextureImage_context">context</a> is nullptr, or if <ahref="#Image">Image</a> was created with another
Returns <ahref="SkImage_Reference#Raster_Image">Raster Image</a> or <ahref="#Lazy_Image">Lazy Image</a>. Copies <ahref="#Image">Image</a> backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> into
CPU memory if needed. Returns original <ahref="#Image">Image</a> if unencoded in <ahref="undocumented#Raster_Bitmap">Raster Bitmap</a>,
or if encoded in a stream.
Returns nullptr if backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> and copy fails.
Returns <ahref="SkImage_Reference#Raster_Image">Raster Image</a>. Copies <ahref="#Image">Image</a> backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> into CPU memory,
or decodes <ahref="#Image">Image</a> from <ahref="#Lazy_Image">Lazy Image</a>. Returns original <ahref="#Image">Image</a> if unencoded in
Creates filtered <ahref="#Image">Image</a>. <ahref="#SkImage_makeWithFilter_filter">filter</a> processes original <ahref="#Image">Image</a>, potentially changing
color, position, and size. <ahref="#SkImage_makeWithFilter_subset">subset</a> is the <ahref="#SkImage_bounds">bounds</a> of original <ahref="#Image">Image</a> processed
by <ahref="#SkImage_makeWithFilter_filter">filter</a>. <ahref="#SkImage_makeWithFilter_clipBounds">clipBounds</a> is the expected <ahref="#SkImage_bounds">bounds</a> of the filtered <ahref="#Image">Image</a>. <ahref="#SkImage_makeWithFilter_outSubset">outSubset</a>
is required storage for the actual <ahref="#SkImage_bounds">bounds</a> of the filtered <ahref="#Image">Image</a>. <ahref="#SkImage_makeWithFilter_offset">offset</a> is
required storage for translation of returned <ahref="#Image">Image</a>.
Returns nullptr if <ahref="#Image">Image</a> could not be created. If nullptr is returned, <ahref="#SkImage_makeWithFilter_outSubset">outSubset</a>
and <ahref="#SkImage_makeWithFilter_offset">offset</a> are undefined.
<ahref="#SkImage_makeWithFilter">makeWithFilter</a> is optimized to support <ahref="#Image">Image</a> backed by <ahref="undocumented#GPU_Texture">GPU Texture</a> drawn in an
animation with <ahref="undocumented#SkImageFilter">SkImageFilter</a> that vary in size from one frame to the next. The
created <ahref="#Image">Image</a> is drawn at an increased size so that <ahref="undocumented#GPU_Texture">GPU Texture</a> can be reused
with different sized effects. <ahref="#SkImage_makeWithFilter_outSubset">outSubset</a> describes the valid <ahref="#SkImage_bounds">bounds</a> of <ahref="undocumented#GPU_Texture">GPU Texture</a>
returned. The returned <ahref="#Image">Image</a> may be much larger than required for the <ahref="#SkImage_makeWithFilter_filter">filter</a>.
<ahref="#SkImage_makeWithFilter_offset">offset</a> translates the returned <ahref="#Image">Image</a> to keep subsequent animation frames
<div><fiddle-embedname="eabb12543886ace5e1212af220a19c6d"gpu="true"><div>In each frame of the animation, filtered <ahref="#Image">Image</a> is drawn in a different location.
By translating canvas by returned <ahref="#SkImage_makeWithFilter_offset">offset</a>, <ahref="#Image">Image</a> appears stationary.</div></fiddle-embed></div>
This method allows clients to capture the data necessary to turn a <ahref="#SkImage">SkImage</a> into a texture-
backed image. If the original image is codec-backed this will decode into a format optimized
for the context represented by the proxy. This method is thread safe with respect to the
<ahref="undocumented#GrContext">GrContext</a> whence the proxy came. Clients allocate and manage the storage of the deferred
texture data and control its lifetime. No cleanup is required, thus it is safe to simply free
the memory out from under the data.
The same method is used both for getting the size necessary for pre-uploaded texture data
and for retrieving the data. The params array represents the set of draws over which to
optimize the pre-upload data.
When called with a null <ahref="#SkImage_getDeferredTextureImageData_buffer">buffer</a> this returns the size that the client must allocate in order
to create deferred texture data for this image (or zero if this is an inappropriate
candidate). The <ahref="#SkImage_getDeferredTextureImageData_buffer">buffer</a> allocated by the client should be 8 byte aligned.
When <ahref="#SkImage_getDeferredTextureImageData_buffer">buffer</a> is not null this fills in the deferred texture data for this image in the
provided <ahref="#SkImage_getDeferredTextureImageData_buffer">buffer</a> (assuming this is an appropriate candidate image and the <ahref="#SkImage_getDeferredTextureImageData_buffer">buffer</a> is
appropriately aligned). Upon success the size written is returned, otherwise 0.
<ahref="#SkImage_getDeferredTextureImageData_dstColorSpace">dstColorSpace</a> is the <ahref="undocumented#Color_Space">Color Space</a> of the surface where this texture will ultimately be used.
If the method determines that mip-maps are needed, this helps determine the correct strategy
for building them (gamma-correct or not).
<ahref="#SkImage_getDeferredTextureImageData_dstColorType">dstColorType</a> is the color type of the surface where this texture will ultimately be used.
This determines the format with which the image will be uploaded to the GPU. If <ahref="#SkImage_getDeferredTextureImageData_dstColorType">dstColorType</a>
does not support <ahref="undocumented#Color_Space">Color Space</a> (low bit depth types such as <ahref="undocumented#SkColorType">kARGB 4444 SkColorType</a>),
Returns a texture-backed image from <ahref="#SkImage_MakeFromDeferredTextureImageData_data">data</a> produced in <ahref="#SkImage_getDeferredTextureImageData">SkImage::getDeferredTextureImageData</a>.
The <ahref="#SkImage_MakeFromDeferredTextureImageData_context">context</a> must be the <ahref="#SkImage_MakeFromDeferredTextureImageData_context">context</a> that provided the proxy passed to
<ahref="undocumented#GrBackendTexture">GrBackendTexture</a> and <ahref="#SkImage_BackendTextureReleaseProc">BackendTextureReleaseProc</a> are populated on success. It is the callers
responsibility to call the <ahref="#SkImage_BackendTextureReleaseProc">BackendTextureReleaseProc</a> once they have deleted the texture.
to the <ahref="undocumented#GrBackendTexture">GrBackendTexture</a>, and is not a substitute for the client deleting the <ahref="undocumented#GrBackendTexture">GrBackendTexture</a>
themselves.
If <ahref="#SkImage_MakeBackendTextureFromSkImage_image">image</a> is both texture backed and singly referenced; that is, its only
reference was transferred using std::move(): <ahref="#SkImage_MakeBackendTextureFromSkImage_image">image</a> is returned in <ahref="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a>
If the <ahref="#SkImage">SkImage</a> is not texture backed, this function will generate a texture with the <ahref="#SkImage_MakeBackendTextureFromSkImage_image">image</a>'s
Creates raster <ahref="SkBitmap_Reference#Bitmap">Bitmap</a> with same pixels as <ahref="#Image">Image</a>. If <ahref="#SkImage_asLegacyBitmap_legacyBitmapMode">legacyBitmapMode</a> is
<ahref="#SkImage_kRO_LegacyBitmapMode">kRO LegacyBitmapMode</a>, returned <ahref="#SkImage_asLegacyBitmap_bitmap">bitmap</a> is read-only and immutable.
Returns true if <ahref="SkBitmap_Reference#Bitmap">Bitmap</a> is stored in <ahref="#SkImage_asLegacyBitmap_bitmap">bitmap</a>. Returns false and resets <ahref="#SkImage_asLegacyBitmap_bitmap">bitmap</a> if
<ahref="SkBitmap_Reference#Bitmap">Bitmap</a> write did not succeed.
Creates <ahref="#Image">Image</a> in <ahref="#SkImage_makeColorSpace_target">target</a><ahref="undocumented#Color_Space">Color Space</a>.
Returns nullptr if <ahref="#Image">Image</a> could not be created.
Returns original <ahref="#Image">Image</a> if it is in <ahref="#SkImage_makeColorSpace_target">target</a><ahref="undocumented#Color_Space">Color Space</a>.
Otherwise, converts pixels from <ahref="#Image">Image</a><ahref="undocumented#Color_Space">Color Space</a> to <ahref="#SkImage_makeColorSpace_target">target</a><ahref="undocumented#Color_Space">Color Space</a>.
If <ahref="#Image">Image</a><ahref="#SkImage_colorSpace">colorSpace</a> returns nullptr, <ahref="#Image">Image</a><ahref="undocumented#Color_Space">Color Space</a> is assumed to be sRGB.
<ahref="undocumented#SkTransferFunctionBehavior">SkTransferFunctionBehavior</a> is to be deprecated.
Set <ahref="#SkImage_makeColorSpace_premulBehavior">premulBehavior</a> to <ahref="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a> to convert <ahref="#Image">Image</a>
pixels to a linear space, before converting to destination <ahref="#Color_Type">Color Type</a>
Set <ahref="#SkImage_makeColorSpace_premulBehavior">premulBehavior</a> to <ahref="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a> to treat <ahref="#Image">Image</a>
pixels as linear, when converting to destination <ahref="#Color_Type">Color Type</a>
and <ahref="undocumented#Color_Space">Color Space</a>, ignoring pixel encoding.