diff options
author | 2017-09-14 11:25:39 -0400 | |
---|---|---|
committer | 2017-09-14 16:05:21 +0000 | |
commit | d0530ba8f406ef287ce89a995ce7be4b32ab6e85 (patch) | |
tree | 4a4f575d252e68364d041a4a67ee38739e7b5e1b /site | |
parent | d29f0e7ccb84993562f34f2d8e3933a19a3ed676 (diff) |
wip pixmap docs
wip pixmap docs
Docs-Preview: https://skia.org/?cl=42522
Bug: skia: 6898
Change-Id: I85947bc36ea057ed008b87d7bef2efa82d7c89ad
Reviewed-on: https://skia-review.googlesource.com/42522
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site')
-rw-r--r-- | site/user/api/SkCanvas_Reference.md | 34 | ||||
-rw-r--r-- | site/user/api/SkPaint_Reference.md | 32 | ||||
-rw-r--r-- | site/user/api/SkPixmap_Reference.md | 2066 | ||||
-rw-r--r-- | site/user/api/index.md | 3 | ||||
-rw-r--r-- | site/user/api/undocumented.md | 203 | ||||
-rw-r--r-- | site/user/api/usingBookmaker.md | 35 |
6 files changed, 2325 insertions, 48 deletions
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 1848816aff..98875b8888 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -80,7 +80,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers | <a href="#SkCanvas_drawArc">drawArc</a> | Draws <a href="undocumented#Arc">Arc</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | | <a href="#SkCanvas_drawAtlas">drawAtlas</a> | Draws sprites using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | | <a href="#SkCanvas_drawBitmap">drawBitmap</a> | Draws <a href="undocumented#Bitmap">Bitmap</a> at (x, y) position. | -| <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> | Draws differentially stretched <a href="undocumented#Bitmap">Bitmap</a>. | +| <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> | Draws proportionally stretched <a href="undocumented#Bitmap">Bitmap</a>. | | <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> | Draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="undocumented#Bitmap">Bitmap</a>. | | <a href="#SkCanvas_drawBitmapRect">drawBitmapRect</a> | Draws <a href="undocumented#Bitmap">Bitmap</a>, source <a href="undocumented#Rect">Rect</a> to destination <a href="undocumented#Rect">Rect</a>. | | <a href="#SkCanvas_drawCircle">drawCircle</a> | Draws <a href="undocumented#Circle">Circle</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | @@ -89,7 +89,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers | <a href="#SkCanvas_drawDrawable">drawDrawable</a> | Draws <a href="undocumented#Drawable">Drawable</a>, encapsulated drawing commands. | | <a href="#SkCanvas_drawIRect">drawIRect</a> | Draws <a href="undocumented#IRect">IRect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | | <a href="#SkCanvas_drawImage">drawImage</a> | Draws <a href="undocumented#Image">Image</a> at (x, y) position. | -| <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> | Draws differentially stretched <a href="undocumented#Image">Image</a>. | +| <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> | Draws proportionally stretched <a href="undocumented#Image">Image</a>. | | <a href="#SkCanvas_drawImageNine">drawImageNine</a> | Draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="undocumented#Image">Image</a>. | | <a href="#SkCanvas_drawImageRect">drawImageRect</a> | Draws <a href="undocumented#Image">Image</a>, source <a href="undocumented#Rect">Rect</a> to destination <a href="undocumented#Rect">Rect</a>. | | <a href="#SkCanvas_drawLine">drawLine</a> | Draws line segment between two points. | @@ -277,12 +277,12 @@ in the center.</div> SkCanvas() </pre> -Creates an empty canvas with no backing device or pixels, with +Creates an empty <a href="#Canvas">Canvas</a> with no backing device or pixels, with a width and height of zero. ### Return Value -empty canvas +empty <a href="#Canvas">Canvas</a> ### Example @@ -310,11 +310,11 @@ SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr) Creates <a href="#Canvas">Canvas</a> of the specified dimensions without a <a href="undocumented#Surface">Surface</a>. Used by <a href="undocumented#Subclasses">Subclasses</a> with custom implementations for draw methods. -If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="#Properties">Surface Properties</a> are created with <a href="#Properties_Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings, -which choose the pixel striping direction and order. Since a platform may dynamically -change its direction when the device is rotated, and since a platform may have -multiple monitors with different characteristics, it's best not to rely on this -legacy behavior. +If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="#Properties">Surface Properties</a> are created with +<a href="#Properties_Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings, which choose the pixel striping +direction and order. Since a platform may dynamically change its direction when +the device is rotated, and since a platform may have multiple monitors with +different characteristics, it is best not to rely on this legacy behavior. ### Parameters @@ -981,7 +981,7 @@ Does not copy, and returns false if: <td>Source and destination rectangles do not intersect.</td> </tr> <tr> <td><a href="#Canvas">Canvas</a> pixels could not be converted to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() or <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.alphaType().</td> </tr> <tr> <td><a href="#Canvas">Canvas</a> pixels are not readable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> - <td><a href="undocumented#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr> + <td><a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr> <td><a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.rowBytes() is too small to contain one row of pixels.</td> </tr> </table> @@ -1130,7 +1130,7 @@ width, height, <a href="#Color_Type">Image Color Type</a>, and <a href="#Alpha_T </tr> <tr> <td><a name="SkCanvas_writePixels_pixels"> <code><strong>pixels </strong></code> </a></td> <td> <a href="#SkCanvas_writePixels_pixels">pixels</a> to copy, of size <a href="#SkCanvas_writePixels_info">info</a>.height() times <a href="#SkCanvas_writePixels_rowBytes">rowBytes</a>, or larger</td> </tr> <tr> <td><a name="SkCanvas_writePixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of one <a href="#SkCanvas_writePixels_pixels">pixels</a> row; <a href="#SkCanvas_writePixels_info">info</a>.width() times pixel size, or larger</td> +size of one row of <a href="#SkCanvas_writePixels_pixels">pixels</a>; <a href="#SkCanvas_writePixels_info">info</a>.width() times pixel size, or larger</td> </tr> <tr> <td><a name="SkCanvas_writePixels_x"> <code><strong>x </strong></code> </a></td> <td> offset into <a href="#Canvas">Canvas</a> writable <a href="#SkCanvas_writePixels_pixels">pixels</a> in <a href="#SkCanvas_writePixels_x">x</a>; may be negative</td> </tr> <tr> <td><a name="SkCanvas_writePixels_y"> <code><strong>y </strong></code> </a></td> <td> @@ -2730,7 +2730,7 @@ graphics state used to fill <a href="#Canvas">Canvas</a></td> enum <a href="#SkCanvas_PointMode">PointMode</a> { <a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>, <a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>, -<a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a> +<a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>, };</pre> Selects if an array of points are drawn as discrete points, as lines, or as @@ -3692,7 +3692,7 @@ void drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) </pre> -Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>. +Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_center">center</a> divides the <a href="#SkCanvas_drawImageNine_image">image</a> into nine sections: four sides, four corners, and the <a href="#SkCanvas_drawImageNine_center">center</a>. Corners are unmodified or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawImageNine_dst">dst</a>; <a href="#SkCanvas_drawImageNine_center">center</a> and four sides are scaled to fit remaining space, if any. @@ -3735,7 +3735,7 @@ void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) </pre> -Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>. +Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_2_center">center</a> divides the <a href="#SkCanvas_drawImageNine_2_image">image</a> into nine sections: four sides, four corners, and the <a href="#SkCanvas_drawImageNine_2_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawImageNine_2_dst">dst</a>; <a href="#SkCanvas_drawImageNine_2_center">center</a> and four sides are scaled to fit remaining space, if any. @@ -3958,7 +3958,7 @@ void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) </pre> -Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>. +Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawBitmapNine_center">center</a> divides the <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> into nine sections: four sides, four corners, and the <a href="#SkCanvas_drawBitmapNine_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawBitmapNine_dst">dst</a>; <a href="#SkCanvas_drawBitmapNine_center">center</a> and four sides are scaled to fit remaining @@ -4085,7 +4085,7 @@ void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst, const SkPaint* paint = nullptr) </pre> -Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapLattice_dst">dst</a>. +Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapLattice_dst">dst</a>. <a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawBitmapLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners @@ -4137,7 +4137,7 @@ void drawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst, const SkPaint* paint = nullptr) </pre> -Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageLattice_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageLattice_dst">dst</a>. +Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageLattice_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageLattice_dst">dst</a>. <a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawImageLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawImageLattice_image">image</a> into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index cbb77e720d..a9fa76e3d3 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -332,7 +332,7 @@ SK_ColorBLUE == paint2.getColor() SkPaint(SkPaint&& paint) </pre> -Implements a move constructor to avoid incrementing the reference counts +Implements a move constructor to avoid increasing the reference counts of objects referenced by the <a href="#SkPaint_move_SkPaint_paint">paint</a>. After the call, <a href="#SkPaint_move_SkPaint_paint">paint</a> is undefined, and can be safely destructed. @@ -450,7 +450,7 @@ SK_ColorRED == paint2.getColor() SkPaint& operator=(SkPaint&& paint) </pre> -Moves the <a href="#SkPaint_move_assignment_operator_paint">paint</a> to avoid incrementing the reference counts +Moves the <a href="#SkPaint_move_assignment_operator_paint">paint</a> to avoid increasing the reference counts of objects referenced by the <a href="#SkPaint_move_assignment_operator_paint">paint</a> parameter. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> in the prior destination are decreased by one; those objects are deleted if the resulting count is zero. @@ -1143,7 +1143,7 @@ When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is enabled, the <a href="SkPaint_Reference#Linear_Text">Linear Text</a> selects whether text is rendered as a <a href="undocumented#Glyph">Glyph</a> or as a <a href="SkPath_Reference#Path">Path</a>. If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is set, it has the same effect as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>. -If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear, it's the same as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>. +If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear, it is the same as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>. <a name="SkPaint_isLinearText"></a> ## isLinearText @@ -2825,7 +2825,7 @@ void setShader(sk_sp<SkShader> shader) Optional colors used when filling a path, such as a gradient. -Sets <a href="undocumented#Shader">Shader</a> to <a href="#SkPaint_setShader_shader">shader</a>, decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Shader">Shader</a>. +Sets <a href="undocumented#Shader">Shader</a> to <a href="#SkPaint_setShader_shader">shader</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Shader">Shader</a>. Does not alter <a href="#SkPaint_setShader_shader">shader</a> <a href="undocumented#Reference_Count">Reference Count</a>. ### Parameters @@ -2917,7 +2917,7 @@ color filter unique: false void setColorFilter(sk_sp<SkColorFilter> colorFilter) </pre> -Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Color_Filter">Color Filter</a>. +Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Color_Filter">Color Filter</a>. Pass nullptr to clear <a href="undocumented#Color_Filter">Color Filter</a>. Does not alter filter <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3115,7 +3115,7 @@ void setPathEffect(sk_sp<SkPathEffect> pathEffect) </pre> Sets <a href="undocumented#Path_Effect">Path Effect</a> to <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Path_Effect">Path Effect</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Path_Effect">Path Effect</a>. Pass nullptr to leave the path geometry unaltered. Does not alter <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a> <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3209,7 +3209,7 @@ void setMaskFilter(sk_sp<SkMaskFilter> maskFilter) </pre> Sets <a href="undocumented#Mask_Filter">Mask Filter</a> to <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Mask_Filter">Mask Filter</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Mask_Filter">Mask Filter</a>. Pass nullptr to clear <a href="undocumented#Mask_Filter">Mask Filter</a> and leave <a href="undocumented#Mask_Filter">Mask Filter</a> effect on <a href="undocumented#Mask_Alpha">Mask Alpha</a> unaltered. Does not affect <a href="undocumented#Rasterizer">Rasterizer</a>. Does not alter <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a> <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3302,7 +3302,7 @@ void setTypeface(sk_sp<SkTypeface> typeface) </pre> Sets <a href="undocumented#Typeface">Typeface</a> to <a href="#SkPaint_setTypeface_typeface">typeface</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>. Pass nullptr to clear <a href="undocumented#Typeface">Typeface</a> and use the default <a href="#SkPaint_setTypeface_typeface">typeface</a>. Does not alter <a href="#SkPaint_setTypeface_typeface">typeface</a> <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3399,7 +3399,7 @@ void setRasterizer(sk_sp<SkRasterizer> rasterizer) </pre> Sets <a href="undocumented#Rasterizer">Rasterizer</a> to <a href="#SkPaint_setRasterizer_rasterizer">rasterizer</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Rasterizer">Rasterizer</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Rasterizer">Rasterizer</a>. Pass nullptr to clear <a href="undocumented#Rasterizer">Rasterizer</a> and leave <a href="undocumented#Rasterizer">Rasterizer</a> effect on <a href="undocumented#Mask_Alpha">Mask Alpha</a> unaltered. Does not affect <a href="undocumented#Mask_Filter">Mask Filter</a>. Does not alter <a href="#SkPaint_setRasterizer_rasterizer">rasterizer</a> <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3496,7 +3496,7 @@ void setImageFilter(sk_sp<SkImageFilter> imageFilter) </pre> Sets <a href="undocumented#Image_Filter">Image Filter</a> to <a href="#SkPaint_setImageFilter_imageFilter">imageFilter</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Image_Filter">Image Filter</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Image_Filter">Image Filter</a>. Pass nullptr to clear <a href="undocumented#Image_Filter">Image Filter</a>, and remove <a href="undocumented#Image_Filter">Image Filter</a> effect on drawing. Does not affect <a href="undocumented#Rasterizer">Rasterizer</a> or <a href="undocumented#Mask_Filter">Mask Filter</a>. @@ -3609,7 +3609,7 @@ void setDrawLooper(sk_sp<SkDrawLooper> drawLooper) </pre> Sets <a href="undocumented#Draw_Looper">Draw Looper</a> to <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>, -decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>. +decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>. Pass nullptr to clear <a href="undocumented#Draw_Looper">Draw Looper</a> and leave <a href="undocumented#Draw_Looper">Draw Looper</a> effect on drawing unaltered. Does not alter <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a> <a href="undocumented#Reference_Count">Reference Count</a>. @@ -3947,11 +3947,11 @@ All character encoding are able to represent all of <a href="undocumented#Unicod in the total storage required. <a href="undocumented#UTF_8">UTF-8</a> (<a href="undocumented#RFC">RFC</a> 3629)is made up of 8-bit bytes, -and is a superset of <a href="undocumented#ASCII">ASCII</a>. -<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)is made up of 16-bit words, -and is a superset of <a href="undocumented#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF. -<a href="undocumented#UTF_32">UTF-32</a>is -made up of 32-bit words, and is a superset of <a href="undocumented#Unicode">Unicode</a>. +and encodes <a href="undocumented#ASCII">ASCII</a> in one byte, and all valid code points in <a href="undocumented#Unicode">Unicode</a> in multiple bytes. +<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)uses one or two 16-bit words, +and encodes <a href="undocumented#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF in one word. +<a href="undocumented#UTF_32">UTF-32</a>describes +a 32-bit word, which encodes all code points in <a href="undocumented#Unicode">Unicode</a>. <a href="undocumented#Font_Manager">Font Manager</a> uses font data to convert character code points into glyph indices. A glyph index is a 16-bit word. diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md new file mode 100644 index 0000000000..8fc14c4d86 --- /dev/null +++ b/site/user/api/SkPixmap_Reference.md @@ -0,0 +1,2066 @@ +SkPixmap Reference +=== + +# <a name="Pixmap"></a> Pixmap + +# <a name="SkPixmap"></a> Class SkPixmap +<a href="#Pixmap">Pixmap</a> provides a utility to pair <a href="undocumented#SkImageInfo">SkImageInfo</a> with pixels and row bytes. +<a href="#Pixmap">Pixmap</a> is a low level class which provides convenience functions to access +raster destinations. <a href="SkCanvas_Reference#Canvas">Canvas</a> can not draw <a href="#Pixmap">Pixmap</a>, nor does <a href="#Pixmap">Pixmap</a> provide +a direct drawing destination. + +Use <a href="undocumented#Bitmap">Bitmap</a> to draw pixels referenced by <a href="#Pixmap">Pixmap</a>; use <a href="undocumented#Surface">Surface</a> to draw into +pixels referenced by <a href="#Pixmap">Pixmap</a>. + +<a href="#Pixmap">Pixmap</a> does not try to manage the lifetime of the pixel memory. Use <a href="undocumented#PixelRef">PixelRef</a> +to manage pixel memory; <a href="undocumented#PixelRef">PixelRef</a> is safe across threads. + +# <a name="Overview"></a> Overview + +## <a name="Subtopics"></a> Subtopics + +| topics | description | +| --- | --- | +| <a href="#Image_Info_Access">Image Info Access</a> | Returns all or part of <a href="#Info">Image Info</a>. | +| <a href="#Initialization">Initialization</a> | Sets fields for use. | +| <a href="#Reader">Reader</a> | Examine pixel value. | +| <a href="#Writer">Writer</a> | Copy to pixel values. | +| <a href="#Readable_Address">Readable Address</a> | Returns read only pixels. | +| <a href="#Writable_Address">Writable Address</a> | Returns writable pixels. | + +## <a name="Constructors"></a> Constructors + +| | description | +| --- | --- | +| <a href="#SkPixmap_empty_constructor">SkPixmap()</a> | Constructs with default values. | +| <a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> | Constructs from <a href="#Info">Image Info</a>, pixels. | + +## <a name="Member_Functions"></a> Member Functions + +| function | description | +| --- | --- | +| <a href="#SkPixmap_addr">addr</a> | Returns readable pixel address as void pointer. | +| <a href="#SkPixmap_addr16">addr16</a> | Returns readable pixel address as 16-bit pointer. | +| <a href="#SkPixmap_addr32">addr32</a> | Returns readable pixel address as 32-bit pointer. | +| <a href="#SkPixmap_addr64">addr64</a> | Returns readable pixel address as 64-bit pointer. | +| <a href="#SkPixmap_addr8">addr8</a> | Returns readable pixel address as 8-bit pointer. | +| <a href="#SkPixmap_addrF16">addrF16</a> | Returns readable pixel component address as 16-bit pointer. | +| <a href="#SkPixmap_alphaType">alphaType</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Alpha_Type">Alpha Type</a>. | +| <a href="#SkPixmap_bounds">bounds</a> | Returns <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> as Rectangle. | +| <a href="#SkPixmap_colorSpace">colorSpace</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a>. | +| <a href="#SkPixmap_colorType">colorType</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Color_Type">Color Type</a>. | +| <a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> | Returns true if all pixels are opaque. | +| <a href="#SkPixmap_erase">erase</a> | Writes <a href="undocumented#Color">Color</a> to pixels. | +| <a href="#SkPixmap_extractSubset">extractSubset</a> | Sets pointer to portion of original. | +| <a href="#SkPixmap_getColor">getColor</a> | Returns one pixel as <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>. | +| <a href="#SkPixmap_getSafeSize">getSafeSize</a> | Returns minimum size required for pixels in 32 bits. | +| <a href="#SkPixmap_getSafeSize64">getSafeSize64</a> | Returns minimum size required for pixels in 64 bits. | +| <a href="#SkPixmap_getSize64">getSize64</a> | Returns conservative size required for pixels. | +| <a href="#SkPixmap_height">height</a> | Returns pixel row count. | +| <a href="#SkPixmap_info">info</a> | Returns <a href="#Info">Image Info</a>. | +| <a href="#SkPixmap_isOpaque">isOpaque</a> | Returns true if <a href="#Info">Image Info</a> describes opaque pixels. | +| <a href="#SkPixmap_readPixels">readPixels</a> | Copies and converts pixels. | +| <a href="#SkPixmap_reset">reset</a> | Reuses existing <a href="#Pixmap">Pixmap</a> with replacement values. | +| <a href="#SkPixmap_rowBytes">rowBytes</a> | Returns interval between rows in bytes. | +| <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> | Returns interval between rows in pixels. | +| <a href="#SkPixmap_scalePixels">scalePixels</a> | Scales and converts pixels. | +| <a href="#SkPixmap_setColorSpace">setColorSpace</a> | Sets <a href="#Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a>. | +| <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> | Returns bit shift from pixels to bytes. | +| <a href="#SkPixmap_width">width</a> | Returns pixel column count. | +| <a href="#SkPixmap_writable_addr">writable addr</a> | Returns writable pixel address as void pointer. | +| <a href="#SkPixmap_writable_addr16">writable addr16</a> | Returns writable pixel address as 16-bit pointer. | +| <a href="#SkPixmap_writable_addr32">writable addr32</a> | Returns writable pixel address as 32-bit pointer. | +| <a href="#SkPixmap_writable_addr64">writable addr64</a> | Returns writable pixel address as 64-bit pointer. | +| <a href="#SkPixmap_writable_addr8">writable addr8</a> | Returns writable pixel address as 8-bit pointer. | +| <a href="#SkPixmap_writable_addrF16">writable addrF16</a> | Returns writable pixel component address as 16-bit pointer. | + +## <a name="Initialization"></a> Initialization + +<a name="SkPixmap_empty_constructor"></a> +## SkPixmap + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkPixmap() +</pre> + +Creates an empty <a href="#Pixmap">Pixmap</a> without pixels, with <a href="undocumented#SkColorType">kUnknown SkColorType</a>, with +<a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, and with a <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> of zero. Use +<a href="#SkPixmap_reset">reset</a> to associate pixels, <a href="undocumented#SkColorType">SkColorType</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="#SkPixmap_width">width</a>, and <a href="#SkPixmap_height">height</a> +after <a href="#Pixmap">Pixmap</a> has been created. + +### Return Value + +empty <a href="#Pixmap">Pixmap</a> + +### Example + +<div><fiddle-embed name="7befb4876e17f4bfc89ae8c54aef8660"> + +#### Example Output + +~~~~ +width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType +width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a> + +--- + +<a name="SkPixmap_const_SkImageInfo_const_star"></a> +## SkPixmap + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes) +</pre> + +Creates <a href="#Pixmap">Pixmap</a> from <a href="#SkPixmap_info">info</a> <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a>. +<a href="#SkPixmap_addr">addr</a> points to pixels, or nullptr. <a href="#SkPixmap_rowBytes">rowBytes</a> should be<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel()or larger. + +No parameter checking is performed; it is up to the caller to ensure that +<a href="#SkPixmap_addr">addr</a> and <a href="#SkPixmap_rowBytes">rowBytes</a> agree with <a href="#SkPixmap_info">info</a>. + +The memory lifetime pixels are managed by the caller. When <a href="#Pixmap">Pixmap</a> goes +out of scope, <a href="#SkPixmap_addr">addr</a> is unaffected. + +<a href="#Pixmap">Pixmap</a> may be later modified by <a href="#SkPixmap_reset">reset</a> to change its size, pixel type, or +storage. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_info"> <code><strong>info </strong></code> </a></td> <td> +<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="undocumented#SkColorType">SkColorType</a> of <a href="#Info">Image Info</a></td> + </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_addr"> <code><strong>addr </strong></code> </a></td> <td> +pointer to pixels allocated by caller; may be nullptr</td> + </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> +size of one row of <a href="#SkPixmap_addr">addr</a>; <a href="#SkPixmap_width">width</a> times pixel size, or larger</td> + </tr> +</table> + +### Return Value + +initialized <a href="#Pixmap">Pixmap</a> + +### Example + +<div><fiddle-embed name="9a00774be57d7308313b3a9073e6e696"><div><a href="#SkImage_MakeRasterCopy">SkImage::MakeRasterCopy</a> takes const <a href="#SkPixmap">SkPixmap</a>& as an argument. The example +constructs a <a href="#SkPixmap">SkPixmap</a> from the brace-delimited parameters.</div> + +#### Example Output + +~~~~ +image alpha only = false +copy alpha only = true +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a> + +--- + +<a name="SkPixmap_reset"></a> +## reset + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void reset() +</pre> + +Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, row bytes to zero; pixel address to nullptr; <a href="undocumented#SkColorType">SkColorType</a> to +<a href="undocumented#SkColorType">kUnknown SkColorType</a>; and <a href="undocumented#SkAlphaType">SkAlphaType</a> to <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>. + +The prior pixels are unaffected; it is up to the caller to release pixels +memory if desired. + +### Example + +<div><fiddle-embed name="759feda9c22260f96567b9e2ccc1a118"> + +#### Example Output + +~~~~ +width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType +width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void reset(const SkImageInfo& info, const void* addr, size_t rowBytes) +</pre> + +Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a> from <a href="#SkPixmap_info">info</a>. +Sets pixel address from <a href="#SkPixmap_addr">addr</a>, which may be nullptr. +Sets row bytes from <a href="#SkPixmap_rowBytes">rowBytes</a>, which should be<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel()or larger. + +Does not check <a href="#SkPixmap_addr">addr</a>. Asserts if built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined and if <a href="#SkPixmap_rowBytes">rowBytes</a> is +too small to hold one row of pixels. + +The memory lifetime pixels are managed by the caller. When <a href="#Pixmap">Pixmap</a> goes +out of scope, <a href="#SkPixmap_addr">addr</a> is unaffected. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_reset_2_info"> <code><strong>info </strong></code> </a></td> <td> +<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="undocumented#SkColorType">SkColorType</a> of <a href="#Info">Image Info</a></td> + </tr> <tr> <td><a name="SkPixmap_reset_2_addr"> <code><strong>addr </strong></code> </a></td> <td> +pointer to pixels allocated by caller; may be nullptr</td> + </tr> <tr> <td><a name="SkPixmap_reset_2_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> +size of one row of <a href="#SkPixmap_addr">addr</a>; <a href="#SkPixmap_width">width</a> times pixel size, or larger</td> + </tr> +</table> + +### Example + +<div><fiddle-embed name="c8e31733704bfebdb038b003aa8a62d7"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a> + +--- + +<a name="SkPixmap_setColorSpace"></a> +## setColorSpace + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void setColorSpace(sk_sp<SkColorSpace> colorSpace) +</pre> + +Changes <a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a>; preserves <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and +<a href="undocumented#SkColorType">SkColorType</a> in <a href="undocumented#Image">Image</a>, and leaves pixel address and row bytes unchanged. +<a href="#SkPixmap_colorSpace">colorSpace</a> reference count is incremented. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_setColorSpace_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> +<a href="undocumented#Color_Space">Color Space</a> moved to <a href="#Info">Image Info</a></td> + </tr> +</table> + +### Example + +<div><fiddle-embed name="bc42aea1e30b7234544bc25b4fc09dd0"> + +#### Example Output + +~~~~ +is unique +is not unique +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_makeColorSpace">SkImageInfo::makeColorSpace</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask) +</pre> + +Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address, and row bytes to <a href="undocumented#Mask">Mask</a> properties, if <a href="undocumented#Mask">Mask</a> +format is <a href="#SkMask_kA8_Format">SkMask::kA8 Format</a>; and returns true. Otherwise sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, +row bytes to zero; pixel address to nullptr; <a href="undocumented#SkColorType">SkColorType</a> to <a href="undocumented#SkColorType">kUnknown SkColorType</a>; +and <a href="undocumented#SkAlphaType">SkAlphaType</a> to <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>; and returns false. + +Failing to read the return value generates a compile time warning. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_reset_3_mask"> <code><strong>mask </strong></code> </a></td> <td> +<a href="undocumented#Mask">Mask</a> containing pixels and dimensions</td> + </tr> +</table> + +### Return Value + +true if set to <a href="undocumented#Mask">Mask</a> properties + +### Example + +<div><fiddle-embed name="379761a97bd7a116638a34eb3e80bf0d"> + +#### Example Output + +~~~~ +success: true width: 2 height: 2 +success: false width: 0 height: 0 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="undocumented#Mask">Mask</a> <a href="#SkPixmap_reset">reset</a> + +--- + +<a name="SkPixmap_extractSubset"></a> +## extractSubset + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const +</pre> + +Sets <a href="#SkPixmap_extractSubset_subset">subset</a> <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address to intersection of <a href="#Pixmap">Pixmap</a> with <a href="#SkPixmap_extractSubset_area">area</a>, +if intersection is not empty; and return true. Otherwise, leave <a href="#SkPixmap_extractSubset_subset">subset</a> unchanged +and return false. + +Failing to read the return value generates a compile time warning. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_extractSubset_subset"> <code><strong>subset </strong></code> </a></td> <td> +storage for <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address of intersection</td> + </tr> <tr> <td><a name="SkPixmap_extractSubset_area"> <code><strong>area </strong></code> </a></td> <td> +<a href="#SkPixmap_bounds">bounds</a> to intersect with <a href="#Pixmap">Pixmap</a></td> + </tr> +</table> + +### Return Value + +true if intersection of <a href="#Pixmap">Pixmap</a> and <a href="#SkPixmap_extractSubset_area">area</a> is not empty + +### Example + +<div><fiddle-embed name="febdbfac6cf4cde69837643be2e1f6dd"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_reset">reset</a> <a href="#SkIRect_intersect">SkIRect::intersect</a> + +--- + +## <a name="Image_Info_Access"></a> Image Info Access + +<a name="SkPixmap_info"></a> +## info + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const SkImageInfo& info() const +</pre> + +Returns <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a>. + +### Return Value + +reference to ImageInfo + +### Example + +<div><fiddle-embed name="7294fbffeb15bf062b6ce989719b783f"> + +#### Example Output + +~~~~ +width: 384 height: 384 color: BGRA_8888 alpha: Opaque +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#Info">Image Info</a> + +--- + +<a name="SkPixmap_rowBytes"></a> +## rowBytes + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +size_t rowBytes() const +</pre> + +Returns row bytes, the interval from one pixel row to the next. Row bytes +is at least as large as<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel(). + +It is up to the <a href="#Pixmap">Pixmap</a> creator to ensure that row bytes is a useful value. + +### Return Value + +byte length of pixel row + +### Example + +<div><fiddle-embed name="da5e1f7f49891d3805a5a6103a000eff"> + +#### Example Output + +~~~~ +rowBytes: 2 minRowBytes: 4 +rowBytes: 8 minRowBytes: 4 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_info">info</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a> + +--- + +<a name="SkPixmap_addr"></a> +## addr + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const void* addr() const +</pre> + +Returns pixel address, the base corresponding the pixel origin. + +It is up to the <a href="#Pixmap">Pixmap</a> creator to ensure that pixel address is a useful value. + +### Return Value + +pixel address + +### Example + +<div><fiddle-embed name="17bcabaaee2dbb7beba562e9ca50b55e"> + +#### Example Output + +~~~~ +#Volatile +pixels address: 0x7f2a440bb010 +inset address: 0x7f2a440fb210 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr_2">addr(int x, int y)</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_info">info</a> <a href="#SkPixmap_rowBytes">rowBytes</a> + +--- + +<a name="SkPixmap_width"></a> +## width + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int width() const +</pre> + +Returns pixel count in each pixel row. Should be equal or less than: +<a href="#SkPixmap_rowBytes">rowBytes</a> / <a href="#SkPixmap_info">info</a>.bytesPerPixel(). + +### Return Value + +pixel <a href="#SkPixmap_width">width</a> in <a href="#Info">Image Info</a> + +### Example + +<div><fiddle-embed name="f68617b7153a20b2ed3d7f9ed5c6e5e4"> + +#### Example Output + +~~~~ +pixmap width: 16 info width: 16 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_height">height</a> + +--- + +<a name="SkPixmap_height"></a> +## height + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int height() const +</pre> + +Returns pixel row count. + +### Return Value + +pixel <a href="#SkPixmap_height">height</a> in <a href="#Info">Image Info</a> + +### Example + +<div><fiddle-embed name="cf80286d58a00cb0328c4205b6517755"> + +#### Example Output + +~~~~ +pixmap height: 32 info height: 32 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_width">width</a> + +--- + +<a name="SkPixmap_colorType"></a> +## colorType + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkColorType colorType() const +</pre> + +Returns <a href="undocumented#Color_Type">Color Type</a>, one of: <a href="undocumented#SkColorType">kUnknown SkColorType</a>, <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>, +<a href="undocumented#SkColorType">kRGB 565 SkColorType</a>, <a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a>, +<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a>. + +### Return Value + +<a href="undocumented#Color_Type">Color Type</a> in <a href="#Info">Image Info</a> + +### Example + +<div><fiddle-embed name="57cebd9fc88c4dfe04b20d0ff34f77fd"> + +#### Example Output + +~~~~ +color type: kAlpha_SkColorType +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_alphaType">alphaType</a> + +--- + +<a name="SkPixmap_alphaType"></a> +## alphaType + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkAlphaType alphaType() const +</pre> + +Returns <a href="undocumented#Alpha_Type">Alpha Type</a>, one of: <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, +<a href="undocumented#SkAlphaType">kPremul SkAlphaType</a>, <a href="undocumented#SkAlphaType">kUnpremul SkAlphaType</a>. + +### Return Value + +<a href="undocumented#Alpha_Type">Alpha Type</a> in <a href="#Info">Image Info</a> + +### Example + +<div><fiddle-embed name="070b1a60232be499eb10c6ea62371804"> + +#### Example Output + +~~~~ +alpha type: kPremul_SkAlphaType +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_colorType">colorType</a> + +--- + +<a name="SkPixmap_colorSpace"></a> +## colorSpace + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkColorSpace* colorSpace() const +</pre> + +Returns <a href="undocumented#Color_Space">Color Space</a> associated with <a href="#Info">Image Info</a>. + +### Return Value + +<a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a> + +### Example + +<div><fiddle-embed name="34c71f803b8edb48eaf1cd0c55bb212e"><div><a href="#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <a href="undocumented#Color_Space">Color Space</a> with linear gamma +and an sRGB gamut. This <a href="undocumented#Color_Space">Color Space</a> gamma is not close to sRGB gamma.</div> + +#### Example Output + +~~~~ +gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="undocumented#Color_Space">Color Space</a> + +--- + +<a name="SkPixmap_isOpaque"></a> +## isOpaque + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool isOpaque() const +</pre> + +Returns true if <a href="undocumented#Alpha_Type">Alpha Type</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>. +Does not check if <a href="undocumented#Color_Type">Color Type</a> allows <a href="#Alpha">Alpha</a>, or <a href="#Alpha">Alpha</a> in pixel values. + +### Return Value + +true if <a href="#Info">Image Info</a> has opaque <a href="undocumented#Alpha_Type">Alpha Type</a> + +### Example + +<div><fiddle-embed name="efd083f121e888a523455ea8a49e50d1"><div><a href="#SkPixmap_isOpaque">isOpaque</a> ignores whether all pixels are opaque or not.</div> + +#### Example Output + +~~~~ +isOpaque: false +isOpaque: false +isOpaque: true +isOpaque: true +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> <a href="#SkImageInfo_isOpaque">SkImageInfo::isOpaque</a> + +--- + +<a name="SkPixmap_bounds"></a> +## bounds + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkIRect bounds() const +</pre> + +Returns <a href="undocumented#IRect">IRect</a>{ 0, 0, <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a> }. + +### Return Value + +integral rectangle from origin to <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> + +### Example + +<div><fiddle-embed name="79750fb1d898a4e5c8c828b7bc9acec5"> + +#### Example Output + +~~~~ +width: 0 height: 0 empty: true +width: 0 height: 2 empty: true +width: 2 height: 0 empty: true +width: 2 height: 2 empty: false +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_height">height</a> <a href="#SkPixmap_width">width</a> <a href="undocumented#IRect">IRect</a> + +--- + +<a name="SkPixmap_rowBytesAsPixels"></a> +## rowBytesAsPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int rowBytesAsPixels() const +</pre> + +Returns number of pixels that fit on row. Should be greater than or equal to +<a href="#SkPixmap_width">width</a>. + +### Return Value + +maximum pixels per row + +### Example + +<div><fiddle-embed name="6231bb212d0c231b5bc44eac626fbcb5"> + +#### Example Output + +~~~~ +rowBytes: 4 rowBytesAsPixels: 1 +rowBytes: 5 rowBytesAsPixels: 1 +rowBytes: 6 rowBytesAsPixels: 1 +rowBytes: 7 rowBytesAsPixels: 1 +rowBytes: 8 rowBytesAsPixels: 2 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> + +--- + +<a name="SkPixmap_shiftPerPixel"></a> +## shiftPerPixel + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int shiftPerPixel() const +</pre> + +Returns bit shift converting row bytes to row pixels. +Returns zero for <a href="undocumented#SkColorType">kUnknown SkColorType</a>. + +### Return Value + +one of: 0, 1, 2, 3; left shift to convert pixels to bytes + +### Example + +<div><fiddle-embed name="d91065811bb118dd686a2b94abe3360a"> + +#### Example Output + +~~~~ +color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0 +color: kAlpha_SkColorType bytesPerPixel: 1 shiftPerPixel: 0 +color: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1 +color: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1 +color: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2 +color: kBGRA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2 +color: kGray_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0 +color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> + +--- + +<a name="SkPixmap_getSize64"></a> +## getSize64 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint64_t getSize64() const +</pre> + +Returns conservative memory required for pixel storage. +Includes unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>. + +### Return Value + +conservative pixel storage size + +### Example + +<div><fiddle-embed name="2ab8c15170ff23edb386258299221051"> + +#### Example Output + +~~~~ +width: 1 height: 1 getSize64: 5 +width: 1 height: 1000 getSize64: 5000 +width: 1 height: 1000000 getSize64: 5000000 +width: 1000 height: 1 getSize64: 5000 +width: 1000 height: 1000 getSize64: 5000000 +width: 1000 height: 1000000 getSize64: 5000000000 +width: 1000000 height: 1 getSize64: 5000000 +width: 1000000 height: 1000 getSize64: 5000000000 +width: 1000000 height: 1000000 getSize64: 5000000000000 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_getSafeSize64">getSafeSize64</a> <a href="#SkPixmap_getSafeSize">getSafeSize</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> + +--- + +<a name="SkPixmap_getSafeSize64"></a> +## getSafeSize64 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint64_t getSafeSize64() const +</pre> + +Returns minimum memory required for pixel storage. +Does not include unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>. + +### Return Value + +exact pixel storage size + +### Example + +<div><fiddle-embed name="aee6a517fce327bba42844b26bd4655f"> + +#### Example Output + +~~~~ +width: 1 height: 1 getSafeSize64: 4 +width: 1 height: 1000 getSafeSize64: 4999 +width: 1 height: 1000000 getSafeSize64: 4999999 +width: 1000 height: 1 getSafeSize64: 4000 +width: 1000 height: 1000 getSafeSize64: 4999000 +width: 1000 height: 1000000 getSafeSize64: 4999999000 +width: 1000000 height: 1 getSafeSize64: 4000000 +width: 1000000 height: 1000 getSafeSize64: 4999000000 +width: 1000000 height: 1000000 getSafeSize64: 4999999000000 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_getSize64">getSize64</a> <a href="#SkPixmap_getSafeSize">getSafeSize</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> + +--- + +<a name="SkPixmap_getSafeSize"></a> +## getSafeSize + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +size_t getSafeSize() const +</pre> + +Returns minimum memory required for pixel storage. +Does not include unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>. +Returns zero if value is does not fit in a signed 32-bit integer. +The largest value than can be returned is 2,147,483,647. + +### Return Value + +exact pixel storage size if size fits in signed 32 bits + +### Example + +<div><fiddle-embed name="1e2830708e4da1db886d8d7541af618b"> + +#### Example Output + +~~~~ +width: 1 height: 1 getSafeSize: 4 +width: 1 height: 1000 getSafeSize: 4999 +width: 1 height: 1000000 getSafeSize: 4999999 +width: 1000 height: 1 getSafeSize: 4000 +width: 1000 height: 1000 getSafeSize: 4999000 +width: 1000 height: 1000000 getSafeSize: 0 +width: 1000000 height: 1 getSafeSize: 4000000 +width: 1000000 height: 1000 getSafeSize: 0 +width: 1000000 height: 1000000 getSafeSize: 0 +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_getSize64">getSize64</a> <a href="#SkPixmap_getSafeSize64">getSafeSize64</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> <a href="undocumented#sk_64_isS32">sk 64 isS32</a> + +--- + +## <a name="Reader"></a> Reader + +<a name="SkPixmap_computeIsOpaque"></a> +## computeIsOpaque + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool computeIsOpaque() const +</pre> + +Returns true if all pixels are opaque. <a href="undocumented#Color_Type">Color Type</a> determines how pixels +are encoded, and whether pixel describes <a href="#Alpha">Alpha</a>. Returns true for <a href="undocumented#Color_Type">Color Types</a> +without alpha for each pixel; for other <a href="undocumented#Color_Type">Color Types</a>, returns true if all +pixels have alpha values equivalent to 1.0 or greater. + +For <a href="undocumented#Color_Type">Color Types</a> <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or <a href="undocumented#SkColorType">kGray 8 SkColorType</a>: always +returns true. For <a href="undocumented#Color_Type">Color Types</a> <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>, <a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, +<a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 255. +For <a href="undocumented#Color_Type">Color Type</a> <a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 15. +For <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 1.0 or +greater. + +Returns false for any other <a href="undocumented#Color_Type">Color Type</a>. + +### Return Value + +true all pixels have opaque values or <a href="undocumented#Color_Type">Color Type</a> is opaque + +### Example + +<div><fiddle-embed name="6ef37d5be03d0bfaec992dbb5a94c66f"> + +#### Example Output + +~~~~ +computeIsOpaque: false +computeIsOpaque: true +computeIsOpaque: false +computeIsOpaque: true +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_isOpaque">isOpaque</a> <a href="undocumented#Color_Type">Color Type</a> <a href="#Alpha">Alpha</a> + +--- + +<a name="SkPixmap_getColor"></a> +## getColor + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkColor getColor(int x, int y) const +</pre> + +Returns pixel at (<a href="#SkPixmap_getColor_x">x</a>, <a href="#SkPixmap_getColor_y">y</a>) as <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>. +Returns black with <a href="#Alpha">Alpha</a> if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>. + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_getColor_x">x</a> or <a href="#SkPixmap_getColor_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined; and returns undefined values or may crash if +<a href="undocumented#SK_RELEASE">SK RELEASE</a> is defined. Fails if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a> or +pixel address is nullptr. + +<a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a> is ignored. Some <a href="undocumented#Color">Color</a> precision may be lost in the +conversion to <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>; original pixel data may have additional +precision. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_getColor_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_getColor_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +pixel converted to <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> + +### Example + +<div><fiddle-embed name="94ad244056dc80ecd87daae004266334"> + +#### Example Output + +~~~~ +Premultiplied: +(0, 0) 0x00000000 0x2a0e002a 0x55380055 0x7f7f007f +(0, 1) 0x2a000e2a 0x551c1c55 0x7f542a7f 0xaaaa38aa +(0, 2) 0x55003855 0x7f2a547f 0xaa7171aa 0xd4d48dd4 +(0, 3) 0x7f007f7f 0xaa38aaaa 0xd48dd4d4 0xffffffff +Unpremultiplied: +(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff +(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff +(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff +(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_readPixels">readPixels</a> + +--- + +## <a name="Readable_Address"></a> Readable Address + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const void* addr(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addr_2_x">x</a>, <a href="#SkPixmap_addr_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr_2_x">x</a> or <a href="#SkPixmap_addr_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. Returns zero if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addr_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addr_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable generic pointer to pixel + +### Example + +<div><fiddle-embed name="6e6e29e860eafed77308c973400cc84d"> + +#### Example Output + +~~~~ +pixmap.addr(1, 2) == &storage[1 + 2 * w] +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> + +--- + +<a name="SkPixmap_addr8"></a> +## addr8 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint8_t* addr8() const +</pre> + +Returns readable base pixel address. Result is addressable as unsigned 8-bit bytes. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One byte corresponds to one pixel. + +### Return Value + +readable unsigned 8-bit pointer to pixels + +### Example + +<div><fiddle-embed name="9adda80b2dd1b08ec5ccf66da7c8bd91"> + +#### Example Output + +~~~~ +pixmap.addr8() == storage +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> + +--- + +<a name="SkPixmap_addr16"></a> +## addr16 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint16_t* addr16() const +</pre> + +Returns readable base pixel address. Result is addressable as unsigned 16-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or +<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Return Value + +readable unsigned 16-bit pointer to pixels + +### Example + +<div><fiddle-embed name="9b16012d265c954c6de13f3fc960da52"> + +#### Example Output + +~~~~ +pixmap.addr16() == storage +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> + +--- + +<a name="SkPixmap_addr32"></a> +## addr32 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint32_t* addr32() const +</pre> + +Returns readable base pixel address. Result is addressable as unsigned 32-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or +<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Return Value + +readable unsigned 32-bit pointer to pixels + +### Example + +<div><fiddle-embed name="6b90c7ae9f254fe4ea9ef638f893a3e6"> + +#### Example Output + +~~~~ +pixmap.addr32() == storage +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> + +--- + +<a name="SkPixmap_addr64"></a> +## addr64 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint64_t* addr64() const +</pre> + +Returns readable base pixel address. Result is addressable as unsigned 64-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Return Value + +readable unsigned 64-bit pointer to pixels + +### Example + +<div><fiddle-embed name="0d17085a4698a8a2e2235fad9041b4b4"> + +#### Example Output + +~~~~ +pixmap.addr64() == storage +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> + +--- + +<a name="SkPixmap_addrF16"></a> +## addrF16 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint16_t* addrF16() const +</pre> + +Returns readable base pixel address. Result is addressable as unsigned 16-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Each word represents one color component encoded as a half float. +Four words correspond to one pixel. + +### Return Value + +readable unsigned 16-bit pointer to first component of pixels + +### Example + +<div><fiddle-embed name="54e8525a592f05623c33b375aebc90c1"> + +#### Example Output + +~~~~ +pixmap.addrF16() == storage +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint8_t* addr8(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr8_2_x">x</a> or <a href="#SkPixmap_addr8_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addr8_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addr8_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable unsigned 8-bit pointer to pixel at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>) + +### Example + +<div><fiddle-embed name="5b986272268ef2c52045c1856f8b6107"> + +#### Example Output + +~~~~ +pixmap.addr8(1, 2) == &storage[1 + 2 * w] +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint16_t* addr16(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr16_2_x">x</a> or <a href="#SkPixmap_addr16_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or +<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addr16_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addr16_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable unsigned 16-bit pointer to pixel at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>) + +### Example + +<div><fiddle-embed name="2c0c88a546d4ef093ab63ff72dac00b9"> + +#### Example Output + +~~~~ +pixmap.addr16(1, 2) == &storage[1 + 2 * w] +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint32_t* addr32(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr32_2_x">x</a> or <a href="#SkPixmap_addr32_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or +<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addr32_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addr32_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable unsigned 32-bit pointer to pixel at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>) + +### Example + +<div><fiddle-embed name="12f8b5ce9fb25604f33df336677f5d62"> + +#### Example Output + +~~~~ +pixmap.addr32(1, 2) == &storage[1 + 2 * w] +~~~~ + +</fiddle-embed></div> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint64_t* addr64(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr64_2_x">x</a> or <a href="#SkPixmap_addr64_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addr64_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addr64_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable unsigned 64-bit pointer to pixel at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>) + +### Example + +<div><fiddle-embed name="5449f65fd7673273b0b57807fd3117ff"> + +#### Example Output + +~~~~ +pixmap.addr64(1, 2) == &storage[1 + 2 * w] +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +const uint16_t* addrF16(int x, int y) const +</pre> + +Returns readable pixel address at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addrF16_2_x">x</a> or <a href="#SkPixmap_addrF16_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Each unsigned 16-bit word represents one color component encoded as a half float. +Four words correspond to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_addrF16_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_addrF16_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +readable unsigned 16-bit pointer to pixel component at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>) + +### Example + +<div><fiddle-embed name="f6076cad455bc80af5d06eb121d3b6f2"> + +#### Example Output + +~~~~ +pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords] +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> + +--- + +## <a name="Writable_Address"></a> Writable Address + +<a name="SkPixmap_writable_addr"></a> +## writable_addr + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void* writable_addr() const +</pre> + +Returns writable base pixel address. + +### Return Value + +writable generic base pointer to pixels + +### Example + +<div><fiddle-embed name="74ef460f89ed5904334d0f8883e781c4"> + +#### Example Output + +~~~~ +pixmap.writable_addr() == (void *)storage +pixmap.getColor(0, 1) == 0x00000000 +pixmap.getColor(0, 0) == 0xFFFFFFFF +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void* writable_addr(int x, int y) const +</pre> + +Returns writable pixel address at (<a href="#SkPixmap_writable_addr_2_x">x</a>, <a href="#SkPixmap_writable_addr_2_y">y</a>). + +Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_writable_addr_2_x">x</a> or <a href="#SkPixmap_writable_addr_2_y">y</a> trigger an assert() if +built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. Returns zero if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addr_2_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addr_2_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable generic pointer to pixel + +### Example + +<div><fiddle-embed name="559eaca89c765bc8466ea1ba3331d4db"> + +#### Example Output + +~~~~ +pixmap.writable_addr() == (void *)storage +pixmap.getColor(0, 0) == 0x00000000 +pixmap.getColor(1, 2) == 0xFFFFFFFF +~~~~ + +</fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> + +--- + +<a name="SkPixmap_writable_addr8"></a> +## writable_addr8 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint8_t* writable_addr8(int x, int y) const +</pre> + +Returns writable base pixel address. Result is addressable as unsigned 8-bit bytes. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One byte corresponds to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addr8_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addr8_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable unsigned 8-bit pointer to pixels + +### Example + +<div><fiddle-embed name="809284db136748208b3efc31cd89de29"><div>Altering pixels after drawing <a href="undocumented#Bitmap">Bitmap</a> is not guaranteed to affect subsequent +drawing on all platforms. Adding a second <a href="#SkBitmap_installPixels">SkBitmap::installPixels</a> after editing +pixel memory is safer.</div></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> + +--- + +<a name="SkPixmap_writable_addr16"></a> +## writable_addr16 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint16_t* writable_addr16(int x, int y) const +</pre> + +Returns <a href="#SkPixmap_writable_addr">writable addr</a> base pixel address. Result is addressable as unsigned 16-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or +<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addr16_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addr16_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable unsigned 16-bit pointer to pixel + +### Example + +<div><fiddle-embed name="6da54774f6432b46b47ea9013c15f280"><div>Draw a five by five bitmap, and draw it again with a center black pixel. +The low nibble of the 16-bit word is <a href="#Alpha">Alpha</a>.</div></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr16">addr16</a> + +--- + +<a name="SkPixmap_writable_addr32"></a> +## writable_addr32 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint32_t* writable_addr32(int x, int y) const +</pre> + +Returns writable base pixel address. Result is addressable as unsigned 32-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or +<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addr32_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addr32_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable unsigned 32-bit pointer to pixel + +### Example + +<div><fiddle-embed name="f4fdce206b8c0a4e79f0a9f52b7f47a6"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr32">addr32</a> + +--- + +<a name="SkPixmap_writable_addr64"></a> +## writable_addr64 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint64_t* writable_addr64(int x, int y) const +</pre> + +Returns writable base pixel address. Result is addressable as unsigned 64-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +One word corresponds to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addr64_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addr64_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable unsigned 64-bit pointer to pixel + +### Example + +<div><fiddle-embed name="33a04ac51c74a1e8d461b1d6f31ed82a"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr64">addr64</a> + +--- + +<a name="SkPixmap_writable_addrF16"></a> +## writable_addrF16 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +uint16_t* writable_addrF16(int x, int y) const +</pre> + +Returns writable base pixel address. Result is addressable as unsigned 16-bit words. +Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built +with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. + +Each word represents one color component encoded as a half float. +Four words correspond to one pixel. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_writable_addrF16_x"> <code><strong>x </strong></code> </a></td> <td> +positive column index less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_writable_addrF16_y"> <code><strong>y </strong></code> </a></td> <td> +positive row index less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +writable unsigned 16-bit pointer to first component of pixel + +### Example + +<div><fiddle-embed name="7822d78f5cacf5c04267cbbc6c6d0b80"><div>Left bitmap is drawn with two pixels defined in half float format. Right bitmap +is drawn after overwriting bottom half float color with top half float color.</div></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addrF16">addrF16</a> + +--- + +## <a name="Writer"></a> Writer + +<a name="SkPixmap_readPixels"></a> +## readPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, + int srcX, int srcY, SkTransferFunctionBehavior behavior) const +</pre> + +Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_srcX">srcX</a>, <a href="#SkPixmap_readPixels_srcY">srcY</a>), and does not +exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>). +<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and +<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +row to the next. Returns true if pixels are copied. Returns false if +<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +false if pixel conversion is not possible. +<a href="#SkPixmap_readPixels_srcX">srcX</a> and <a href="#SkPixmap_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns +false if <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= this-><a href="#SkPixmap_height">height</a>. + +If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts source +pixels to a linear space before converting to <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>. +If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: source +pixels are treated as if they are linear, regardless of their encoding. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> +destination <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> +destination pixel storage</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> +destination row length</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> +column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> +row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_behavior"> <code><strong>behavior </strong></code> </a></td> <td> +one of: <a href="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>, +<a href="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a> + +### Example + +<div><fiddle-embed name="2b7f6cc59ea2d5ebceddccbc2f232bcf"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const +</pre> + +Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (0, 0), and does not +exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>). +<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and +<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +row to the next. Returns true if pixels are copied. Returns false if +<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +false if pixel conversion is not possible. + +Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_readPixels_2_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> +destination <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> +destination pixel storage</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> +destination row length</td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a> + +### Example + +<div><fiddle-embed name="df4e355c4845350daede833b4fd21ec1"><div>Transferring the gradient from 8 bits per component to 4 bits per component +creates visible banding.</div></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, + int srcX, int srcY) const +</pre> + +Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_3_srcX">srcX</a>, <a href="#SkPixmap_readPixels_3_srcY">srcY</a>), and does not +exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>). +<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and +<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +row to the next. Returns true if pixels are copied. Returns false if +<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +false if pixel conversion is not possible. +<a href="#SkPixmap_readPixels_3_srcX">srcX</a> and <a href="#SkPixmap_readPixels_3_srcY">srcY</a> may be negative to copy only top or left of source. Returns +false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= this-><a href="#SkPixmap_height">height</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_readPixels_3_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> +destination <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> +destination pixel storage</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> +destination row length</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td> +column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td> +row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a> + +### Example + +<div><fiddle-embed name="094ca0bd37588cc7be241bb387a3e17b"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkPixmap& dst, int srcX, int srcY) const +</pre> + +Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_4_dst">dst</a>. Copy starts at (<a href="#SkPixmap_readPixels_4_srcX">srcX</a>, <a href="#SkPixmap_readPixels_4_srcY">srcY</a>), and does not +exceed (this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>). <a href="#SkPixmap_readPixels_4_dst">dst</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, +<a href="undocumented#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of destination. Returns true if pixels are copied. +Returns false if <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than +<a href="#SkPixmap_readPixels_4_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorType">colorType</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_alphaType">alphaType</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +false if pixel conversion is not possible. +<a href="#SkPixmap_readPixels_4_srcX">srcX</a> and <a href="#SkPixmap_readPixels_4_srcY">srcY</a> may be negative to copy only top or left of source. Returns +false this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= this-><a href="#SkPixmap_height">height</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_readPixels_4_dst"> <code><strong>dst </strong></code> </a></td> <td> +<a href="#Info">Image Info</a> and pixel address to write to</td> + </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcX"> <code><strong>srcX </strong></code> </a></td> <td> +column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> + </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcY"> <code><strong>srcY </strong></code> </a></td> <td> +row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_readPixels_4_dst">dst</a> + +### Example + +<div><fiddle-embed name="6ec7f7b2cc163cd29f627eef6d4b061c"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkPixmap& dst) const +</pre> + +Copies pixels inside <a href="#SkPixmap_bounds">bounds</a> to <a href="#SkPixmap_readPixels_5_dst">dst</a>. <a href="#SkPixmap_readPixels_5_dst">dst</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, +<a href="undocumented#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of destination. Returns true if pixels are copied. +Returns false if <a href="#SkPixmap_readPixels_5_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_5_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than +<a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Type">Color Type</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Alpha_Type">Alpha Type</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +false if pixel conversion is not possible. +Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_readPixels_5_dst"> <code><strong>dst </strong></code> </a></td> <td> +<a href="#Info">Image Info</a> and pixel address to write to</td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_readPixels_5_dst">dst</a> + +### Example + +<div><fiddle-embed name="e18549b5ee1039cb61b0bb38c2104fc9"></fiddle-embed></div> + +### See Also + +<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a> + +--- + +<a name="SkPixmap_scalePixels"></a> +## scalePixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const +</pre> + +Copies this to <a href="#SkPixmap_scalePixels_dst">dst</a>, scaling pixels to fit <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>, and +converting pixels to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_colorType">colorType</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_alphaType">alphaType</a>. Returns true if +pixels are copied. Returns false if <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> is nullptr, or <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is +less than <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. + +Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is +<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Type">Color Type</a> must match. +If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. +If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Alpha_Type">Alpha Type</a> must +match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +false if pixel conversion is not possible. + +Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. + +Scales the image, with <a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a>, to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>. +<a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a> <a href="undocumented#SkFilterQuality">kNone SkFilterQuality</a> is fastest, typically implemented with +<a href="undocumented#Filter_Quality_Nearest_Neighbor">Filter Quality Nearest Neighbor</a>. <a href="undocumented#SkFilterQuality">kLow SkFilterQuality</a> is typically implemented with +<a href="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>. <a href="undocumented#SkFilterQuality">kMedium SkFilterQuality</a> is typically implemented with +<a href="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>, and <a href="undocumented#Filter_Quality_MipMap">Filter Quality MipMap</a> when size is reduced. +<a href="undocumented#SkFilterQuality">kHigh SkFilterQuality</a> is slowest, typically implemented with <a href="undocumented#Filter_Quality_BiCubic">Filter Quality BiCubic</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_scalePixels_dst"> <code><strong>dst </strong></code> </a></td> <td> +<a href="#Info">Image Info</a> and pixel address to write to</td> + </tr> <tr> <td><a name="SkPixmap_scalePixels_filterQuality"> <code><strong>filterQuality </strong></code> </a></td> <td> +one of: <a href="undocumented#SkFilterQuality">kNone SkFilterQuality</a>, <a href="undocumented#SkFilterQuality">kLow SkFilterQuality</a>, +<a href="undocumented#SkFilterQuality">kMedium SkFilterQuality</a>, <a href="undocumented#SkFilterQuality">kHigh SkFilterQuality</a></td> + </tr> +</table> + +### Return Value + +true if pixels are copied to <a href="#SkPixmap_scalePixels_dst">dst</a> + +### Example + +<div><fiddle-embed name="8e3c8a9c1d0d2e9b8bf66e24d274f792"></fiddle-embed></div> + +### See Also + +<a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkImage_scalePixels">SkImage::scalePixels</a> + +--- + +<a name="SkPixmap_erase"></a> +## erase + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool erase(SkColor color, const SkIRect& subset) const +</pre> + +Writes <a href="#SkPixmap_erase_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_subset">subset</a>; returns true on success. +Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, or if <a href="#SkPixmap_erase_subset">subset</a> does +not intersect <a href="#SkPixmap_bounds">bounds</a>. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_erase_color"> <code><strong>color </strong></code> </a></td> <td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td> + </tr> <tr> <td><a name="SkPixmap_erase_subset"> <code><strong>subset </strong></code> </a></td> <td> +bounding integer <a href="undocumented#Rect">Rect</a> of written pixels</td> + </tr> +</table> + +### Return Value + +true if pixels are changed + +### Example + +<div><fiddle-embed name="f0a8f4e07fd8b6c48eb52f2238d8f88b"></fiddle-embed></div> + +### See Also + +<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool erase(SkColor color) const +</pre> + +Writes <a href="#SkPixmap_erase_2_color">color</a> to pixels inside <a href="#SkPixmap_bounds">bounds</a>; returns true on success. +Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, or if <a href="#SkPixmap_bounds">bounds</a> +is empty. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_erase_2_color"> <code><strong>color </strong></code> </a></td> <td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td> + </tr> +</table> + +### Return Value + +true if pixels are changed + +### Example + +<div><fiddle-embed name="ee0bb3f3aae12dbc1c2759349527e9da"></fiddle-embed></div> + +### See Also + +<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a> + +--- + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const +</pre> + +Writes <a href="#SkPixmap_erase_3_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_3_subset">subset</a>; returns true on success. +if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr, writes colors pixels inside <a href="#SkPixmap_bounds">bounds</a>. Returns false if +<a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, if <a href="#SkPixmap_erase_3_subset">subset</a> is not nullptr and does +not intersect <a href="#SkPixmap_bounds">bounds</a>, or if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr and <a href="#SkPixmap_bounds">bounds</a> is empty. + +### Parameters + +<table> <tr> <td><a name="SkPixmap_erase_3_color"> <code><strong>color </strong></code> </a></td> <td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td> + </tr> <tr> <td><a name="SkPixmap_erase_3_subset"> <code><strong>subset </strong></code> </a></td> <td> +bounding integer <a href="undocumented#Rect">Rect</a> of pixels to write; may be nullptr</td> + </tr> +</table> + +### Return Value + +true if pixels are changed + +### Example + +<div><fiddle-embed name="da215a59c574d26bc5caf7de630d5966"></fiddle-embed></div> + +### See Also + +<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a> + +--- + diff --git a/site/user/api/index.md b/site/user/api/index.md index afab43c834..b2a9c4297e 100644 --- a/site/user/api/index.md +++ b/site/user/api/index.md @@ -32,9 +32,10 @@ Using the SkCanvas API: Reference: -1. **[SkCanvas Reference](/user/api/SkCanvas_Reference)** - the drawing context. +1. **[SkCanvas Reference](/user/api/SkCanvas_Reference)** - drawing context 2. **[SkPaint Reference](/user/api/SkPaint_Reference)** - color, stroke, font, effects 3. **[SkPath Reference](/user/api/SkPath_Reference)** - paths +4. **[SkPixmap Reference](/user/api/SkPixmap_Reference)** - pixel map: image info and pixel address Autogenerated Doxygen Documentaion ---------------------------------- diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index cc23a48ef0..6d3dbd70f0 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -93,6 +93,10 @@ bool equalsWithinTolerance(const SkPoint& p) const # <a name="SkDumpCanvas"></a> Class SkDumpCanvas +# <a name="HTML_Canvas"></a> HTML Canvas + +## <a name="ArcTo"></a> ArcTo + # <a name="Alias"></a> Alias # <a name="Anti-alias"></a> Anti-alias @@ -107,6 +111,34 @@ bool equalsWithinTolerance(const SkPoint& p) const ## <a name="Row_Bytes"></a> Row Bytes +<a name="SkBitmap_erase"></a> +## erase + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void erase(SkColor c, const SkIRect& area) const +</pre> + +--- + +<a name="SkBitmap_installPixels"></a> +## installPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) +</pre> + +--- + +<a name="SkBitmap_readPixels"></a> +## readPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, + int srcX, int srcY, SkTransferFunctionBehavior behavior) const +</pre> + +--- + # <a name="Blend_Mode"></a> Blend Mode ## <a name="SkBlendMode"></a> Enum SkBlendMode @@ -233,6 +265,31 @@ int SkColorSetARGB(a, r, g, b) # <a name="Color_Space"></a> Color Space +# <a name="SkColorSpace"></a> Class SkColorSpace + +<a name="SkColorSpace_MakeSRGBLinear"></a> +## MakeSRGBLinear + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +static sk_sp<SkColorSpace> MakeSRGBLinear() +</pre> + +--- + +## <a name="SkTransferFunctionBehavior"></a> Enum SkTransferFunctionBehavior + +### Constants + +<table> + <tr> + <td><a name="SkTransferFunctionBehavior_kRespect"> <code><strong>SkTransferFunctionBehavior::kRespect </strong></code> </a></td><td>0</td><td></td> + </tr> + <tr> + <td><a name="SkTransferFunctionBehavior_kIgnore"> <code><strong>SkTransferFunctionBehavior::kIgnore </strong></code> </a></td><td>1</td><td></td> + </tr> + +</table> + # <a name="Core_Graphics"></a> Core Graphics # <a name="Core_Text"></a> Core Text @@ -302,6 +359,16 @@ static std::unique_ptr<SkCanvas> </table> +## <a name="Nearest_Neighbor"></a> Nearest Neighbor + +## <a name="Bilerp"></a> Bilerp + +## <a name="MipMap"></a> MipMap + +## <a name="BiCubic"></a> BiCubic + +# <a name="Left_Side_Bearing"></a> Left Side Bearing + # <a name="Font"></a> Font ## <a name="Advance"></a> Advance @@ -316,10 +383,6 @@ static std::unique_ptr<SkCanvas> # <a name="GPU_Surface"></a> GPU Surface -# <a name="HTML_Canvas"></a> HTML Canvas - -## <a name="ArcTo"></a> ArcTo - # <a name="Image"></a> Image ## <a name="Alpha_Type"></a> Alpha Type @@ -330,8 +393,17 @@ static std::unique_ptr<SkCanvas> <table> <tr> + <td><a name="kUnknown_SkAlphaType"> <code><strong>kUnknown_SkAlphaType </strong></code> </a></td><td>0</td><td></td> + </tr> + <tr> + <td><a name="kOpaque_SkAlphaType"> <code><strong>kOpaque_SkAlphaType </strong></code> </a></td><td>1</td><td></td> + </tr> + <tr> <td><a name="kPremul_SkAlphaType"> <code><strong>kPremul_SkAlphaType </strong></code> </a></td><td>2</td><td></td> </tr> + <tr> + <td><a name="kUnpremul_SkAlphaType"> <code><strong>kUnpremul_SkAlphaType </strong></code> </a></td><td>3</td><td></td> + </tr> </table> @@ -393,6 +465,42 @@ SkImageInfo() --- +<a name="SkImageInfo_makeColorSpace"></a> +## makeColorSpace + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const +</pre> + +--- + +<a name="SkImageInfo_minRowBytes"></a> +## minRowBytes + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +size_t minRowBytes() const +</pre> + +--- + +<a name="SkImageInfo_isOpaque"></a> +## isOpaque + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool isOpaque() const +</pre> + +--- + +<a name="SkImageInfo_bytesPerPixel"></a> +## bytesPerPixel + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int bytesPerPixel() const +</pre> + +--- + # <a name="SkImage"></a> Class SkImage <a name="SkImage_makeShader"></a> @@ -405,6 +513,35 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode, --- +<a name="SkImage_MakeRasterCopy"></a> +## MakeRasterCopy + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +static sk_sp<SkImage> MakeRasterCopy(const SkPixmap&) +</pre> + +--- + +<a name="SkImage_readPixels"></a> +## readPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkPixmap& dst, int srcX, int srcY, + CachingHint = kAllow_CachingHint) const +</pre> + +--- + +<a name="SkImage_scalePixels"></a> +## scalePixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool scalePixels(const SkPixmap& dst, SkFilterQuality, + CachingHint = kAllow_CachingHint) const +</pre> + +--- + # <a name="Image_Filter"></a> Image Filter ## <a name="Scaling"></a> Scaling @@ -417,16 +554,59 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode, # <a name="SkIRect"></a> Struct SkIRect -# <a name="Left_Side_Bearing"></a> Left Side Bearing +<a name="SkIRect_intersect"></a> +## intersect + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool intersect(const SkIRect& r) +</pre> + +--- # <a name="Mask"></a> Mask +# <a name="SkMask"></a> Class SkMask + +## <a name="SkMask_Format"></a> Enum SkMask::Format + +### Constants + +<table> + <tr> + <td><a name="SkMask_kBW_Format"> <code><strong>SkMask::kBW_Format </strong></code> </a></td><td>0</td><td></td> + </tr> + <tr> + <td><a name="SkMask_kA8_Format"> <code><strong>SkMask::kA8_Format </strong></code> </a></td><td>1</td><td></td> + </tr> + <tr> + <td><a name="SkMask_k3D_Format"> <code><strong>SkMask::k3D_Format </strong></code> </a></td><td>2</td><td></td> + </tr> + <tr> + <td><a name="SkMask_kARGB32_Format"> <code><strong>SkMask::kARGB32_Format </strong></code> </a></td><td>3</td><td></td> + </tr> +k <tr> + <td><a name="SkMask_LCD16_Format"> <code><strong>SkMask::LCD16_Format </strong></code> </a></td><td>4</td><td></td> + </tr> + +</table> + # <a name="Mask_Alpha"></a> Mask Alpha # <a name="Mask_Filter"></a> Mask Filter # <a name="SkMaskFilter"></a> Class SkMaskFilter +# <a name="Math"></a> Math + +<a name="sk_64_isS32"></a> +## sk_64_isS32 + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +static inline bool sk_64_isS32(int64_t value) +</pre> + +--- + # <a name="Matrix"></a> Matrix # <a name="SkMatrix"></a> Struct SkMatrix @@ -521,9 +701,9 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, ## <a name="Storage"></a> Storage -# <a name="Pixmap"></a> Pixmap +# <a name="PixelRef"></a> PixelRef -# <a name="SkPixmap"></a> Class SkPixmap +# <a name="SkPixelRef"></a> Class SkPixelRef # <a name="PostScript"></a> PostScript @@ -628,6 +808,15 @@ static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels, --- +<a name="SkSurface_readPixels"></a> +## readPixels + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +bool readPixels(const SkPixmap& dst, int srcX, int srcY) ; +</pre> + +--- + ## <a name="Properties"></a> Properties # <a name="SkSurfaceProps"></a> Class SkSurfaceProps diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md index d29b86fd99..7a93f7a304 100644 --- a/site/user/api/usingBookmaker.md +++ b/site/user/api/usingBookmaker.md @@ -17,14 +17,34 @@ Build <a href="#Bookmaker">Bookmaker</a>. $ ninja -<a href="undocumented#C">C</a> out/dir bookmaker</pre> Generate an starter <a href="#Bookmaker">Bookmaker</a> file from an existing include. -This writes <a href="usingBookmaker#SkXXX">SkXXX</a>.bmh in the current directory, which is -out/dir/obj/ from an IDE. <pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> -$ ./out/dir/bookmaker -t -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre> +$ ./out/dir/bookmaker -i include/core/<a href="undocumented#SkXXX.h">SkXXX.h</a> -t docs</pre> -Copy <a href="usingBookmaker#SkXXX">SkXXX</a>.bmh to docs. -Use your favorite editor to fill out docs/<a href="usingBookmaker#SkXXX">SkXXX</a>.bmh. +If a method or function has an unnamed parameter, bookmaker generates an error: + +<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> +<a href="undocumented#C">C</a>:/puregit/include/core/<a href="SkPixmap_Reference#SkPixmap">SkPixmap</a>.h(208): error: # missing param name +bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const +^ +</pre> + +All parameters require names to allow markdown and doxygen documents to refer to +them. After naming all parameters, check in the include before continuing. + +A successful run generates + +<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> +docs/<a href="undocumented#SkXXX_Reference">SkXXX Reference</a>.bmh</pre> + +. + +Next, use your favorite editor to fill out + +<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> +docs/<a href="undocumented#SkXXX_Reference">SkXXX Reference</a>.bmh</pre> + +. ## <a name="Style"></a> Style @@ -86,12 +106,13 @@ This reports if a method no longer exists or its parameters have changed. <pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> $ ./out/dir/bookmaker -x -b docs/<a href="usingBookmaker#SkXXX">SkXXX</a>.bmh -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre> -Generate an updated include header. -This writes the updated <a href="undocumented#SkXXX.h">SkXXX.h</a> to the current directory. +Generate an updated include header. Run: <pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> $ ./out/dir/bookmaker -p -b docs -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre> +to write the updated <a href="undocumented#SkXXX.h">SkXXX.h</a> to the current directory. + ## <a name="Bugs"></a> Bugs <a href="#Bookmaker">Bookmaker</a> bugs are trackedhere. |