From e80cd44cb2c549b709022a62a1fa9f8d6a7822ec Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 17 Jul 2018 13:19:56 -0400 Subject: fix bookmaker build bot Sync up with deletion of SkTransferFunctionBehavior. TBR=brianosman@google.com NOTRY=true Docs-Preview: https://skia.org/?cl=141828 Bug: skia:6818 Change-Id: Ibcfad17b8e886a4c980e4eb2bbae5a007f4bb36e Reviewed-on: https://skia-review.googlesource.com/141828 Commit-Queue: Cary Clark Commit-Queue: Brian Osman Auto-Submit: Cary Clark Reviewed-by: Brian Osman Reviewed-by: Cary Clark --- site/user/api/SkBitmap_Reference.md | 241 +++++++----------------------------- site/user/api/SkCanvas_Reference.md | 12 +- site/user/api/SkImage_Reference.md | 23 +--- site/user/api/SkPixmap_Reference.md | 170 +++++++------------------ site/user/api/catalog.htm | 48 ++----- site/user/api/undocumented.md | 22 ---- 6 files changed, 114 insertions(+), 402 deletions(-) (limited to 'site') diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 8273397001..b08db748e8 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -997,7 +997,7 @@ reference to Pixmap describing this peekPixels installPixels[2][3] readPixels[2][3][4] writePixels[2][3] +peekPixels installPixels[2][3] readPixels[2][3] writePixels[2] --- @@ -2716,39 +2716,31 @@ soon - readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior) const + readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY) const - readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY) const + readPixels(const SkPixmap& dst, int srcX, int srcY) const - readPixels(const SkPixmap& dst, int srcX, int srcY) const + readPixels(const SkPixmap& dst) const - - readPixels(const SkPixmap& dst) const - - setPixels sets Pixel Ref without an offset - + writePixels copies and converts pixels - - - writePixels(const SkPixmap& src, int dstX, int dstY) - - writePixels(const SkPixmap& src) + writePixels(const SkPixmap& src, int dstX, int dstY) - writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior) + writePixels(const SkPixmap& src) @@ -3324,7 +3316,7 @@ Unpremultiplied: ### See Also -getAddr readPixels[2][3][4] +getAddr readPixels[2][3] --- @@ -3372,7 +3364,7 @@ addr interval == rowBytes ### See Also -getAddr8 getAddr16 getAddr32 readPixels[2][3][4] SkPixmap::addr[2] +getAddr8 getAddr16 getAddr32 readPixels[2][3] SkPixmap::addr[2] --- @@ -3426,7 +3418,7 @@ addr interval == rowBytes ### See Also -getAddr8 getAddr16 getAddr readPixels[2][3][4] SkPixmap::addr32[2] +getAddr8 getAddr16 getAddr readPixels[2][3] SkPixmap::addr32[2] --- @@ -3480,7 +3472,7 @@ addr interval == rowBytes ### See Also -getAddr8 getAddr getAddr32 readPixels[2][3][4] SkPixmap::addr16[2] +getAddr8 getAddr getAddr32 readPixels[2][3] SkPixmap::addr16[2] --- @@ -3534,7 +3526,7 @@ unsigned 8-bit pointer to pixel at (x, getAddr getAddr16 getAddr32 readPixels[2][3][4] SkPixmap::addr8[2] +getAddr getAddr16 getAddr32 readPixels[2][3] SkPixmap::addr8[2] --- @@ -3605,7 +3597,7 @@ subset: 1000, 100, 1000, 200 success; false ### See Also -readPixels[2][3][4] writePixels[2][3] SkCanvas::drawBitmap +readPixels[2][3] writePixels[2] SkCanvas::drawBitmap --- @@ -3613,16 +3605,15 @@ subset: 1000, 100, 1000, 200 success; false ## readPixels
-bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY,
-                SkTransferFunctionBehavior behavior) const
+bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const
 
-Copies Rect of pixels from Bitmap pixels to dstPixels. Copy starts at (srcX, srcY), +Copies a Rect of pixels from Bitmap to dstPixels. Copy starts at (srcX, srcY), and does not exceed Bitmap (width, height). -dstInfo specifies width, height, Color Type, Alpha Type, and -Color Space of destination. dstRowBytes specifics the gap from one destination -row to the next. Returns true if pixels are copied. Returns false if: +dstInfo specifies width, height, Color Type, Alpha Type, and Color Space of +destination. dstRowBytes specifics the gap from one destination row to the next. +Returns true if pixels are copied. Returns false if: @@ -3645,11 +3636,6 @@ false if width or heigh Returns false ifabs(srcX) >= Bitmapwidth, or ifabs(srcY) >= Bitmapheight. -If behavior is SkTransferFunctionBehavior::kRespect: converts source -pixels to a linear space before converting to dstInfo. -If behavior is SkTransferFunctionBehavior::kIgnore: source -pixels are treated as if they are linear, regardless of how they are encoded. - ### Parameters
dstInfo.addr() equals nullptr
@@ -3667,10 +3653,6 @@ pixels are treated as if they are linear, regardless of how they are encoded. - - -
dstInfo
srcY row index whose absolute value is less than height
behaviorone of: SkTransferFunctionBehavior::kRespect, -SkTransferFunctionBehavior::kIgnore
### Return Value @@ -3679,41 +3661,43 @@ true if pixels are copied to dstPixels< ### Example -
+
Transferring the gradient from 8 bits per component to 4 bits per component +creates visible banding. +
### See Also -
writePixels[2][3] SkPixmap::readPixels[2][3][4][5] SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +writePixels[2] SkPixmap::readPixels[2][3][4] SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] ---
-bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const
+bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
 
-Copies a Rect of pixels from Bitmap to dstPixels. Copy starts at (srcX, srcY), -and does not exceed Bitmap (width, height). +Copies a Rect of pixels from Bitmap to dst. Copy starts at (srcX, srcY), and +does not exceed Bitmap (width, height). -dstInfo specifies width, height, Color Type, Alpha Type, and Color Space of -destination. dstRowBytes specifics the gap from one destination row to the next. -Returns true if pixels are copied. Returns false if: +dst specifies width, height, Color Type, Alpha Type, Color Space, pixel storage, +and row bytes of destination. dst.rowBytes specifics the gap from one destination +row to the next. Returns true if pixels are copied. Returns false if: - + - +
dstInfo.addr() equals nullptrdst pixel storage equals nullptr
dstRowBytes is less than dstInfo.minRowBytesdst.rowBytes is less than SkImageInfo::minRowBytes
Pixel Ref is nullptr
Pixels are copied only if pixel conversion is possible. If Bitmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match. -If Bitmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match. -If Bitmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must -match. If Bitmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns +kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color Type must match. +If Bitmap colorType is kGray_8_SkColorType, dst Color Space must match. +If Bitmap alphaType is kOpaque_SkAlphaType, dst Alpha Type must +match. If Bitmap colorSpace is nullptr, dst Color Space must match. Returns false if pixel conversion is not possible. srcX and srcY may be negative to copy only top or left of source. Returns @@ -3723,14 +3707,8 @@ or ifabs(srcY) >= Bitmap height ### Parameters - - - - - - - - +
dstInfodestination width, height, Color Type, Alpha Type, Color Space
dstPixelsdestination pixel storage
dstRowBytesdestination row length
+ @@ -3742,27 +3720,25 @@ or ifabs(srcY) >= Bitmapheight ### Return Value -true if pixels are copied to dstPixels +true if pixels are copied to dst ### Example -
Transferring the gradient from 8 bits per component to 4 bits per component -creates visible banding. -
+
### See Also -writePixels[2][3]SkPixmap::readPixels[2][3][4][5]SkCanvas::readPixels[2][3]SkImage::readPixels[2]SkSurface::readPixels[2][3] +writePixels[2]SkPixmap::readPixels[2][3][4]SkCanvas::readPixels[2][3]SkImage::readPixels[2]SkSurface::readPixels[2][3] ---
-bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
+bool readPixels(const SkPixmap& dst) const
 
-Copies a Rect of pixels from Bitmap to dst. Copy starts at (srcX, srcY), and +Copies a Rect of pixels from Bitmap to dst. Copy starts at (0, 0), and does not exceed Bitmap (width, height). dst specifies width, height, Color Type, Alpha Type, Color Space, pixel storage, @@ -3785,22 +3761,11 @@ If BitmapalphaType is < match. If BitmapcolorSpace is nullptr, dstColor Space must match. Returns false if pixel conversion is not possible. -srcX and srcY may be negative to copy only top or left of source. Returns -false if width or height is zero or negative. -Returns false ifabs(srcX) >= Bitmapwidth, -or ifabs(srcY) >= Bitmapheight. - ### Parameters
dstdestination Pixmap: Image Info, pixels, row bytes
srcX column index whose absolute value is less than width
- - - - - -
dst destination Pixmap: Image Info, pixels, row bytes
srcXcolumn index whose absolute value is less than width
srcYrow index whose absolute value is less than height
### Return Value @@ -3809,61 +3774,11 @@ true if pixels are copied to dst ### Example -
- -### See Also - -writePixels[2][3] SkPixmap::readPixels[2][3][4][5] SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] - ---- - - - -
-bool readPixels(const SkPixmap& dst) const
-
- -Copies a Rect of pixels from Bitmap to dst. Copy starts at (0, 0), and -does not exceed Bitmap (width, height). - -dst specifies width, height, Color Type, Alpha Type, Color Space, pixel storage, -and row bytes of destination. dst.rowBytes specifics the gap from one destination -row to the next. Returns true if pixels are copied. Returns false if: - - - - - - - - -
dst pixel storage equals nullptr
dst.rowBytes is less than SkImageInfo::minRowBytes
Pixel Ref is nullptr
- -Pixels are copied only if pixel conversion is possible. If Bitmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color Type must match. -If Bitmap colorType is kGray_8_SkColorType, dst Color Space must match. -If Bitmap alphaType is kOpaque_SkAlphaType, dst Alpha Type must -match. If Bitmap colorSpace is nullptr, dst Color Space must match. Returns -false if pixel conversion is not possible. - -### Parameters - - - - -
dstdestination Pixmap: Image Info, pixels, row bytes
- -### Return Value - -true if pixels are copied to dst - -### Example -
### See Also -writePixels[2][3] SkPixmap::readPixels[2][3][4][5] SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +writePixels[2] SkPixmap::readPixels[2][3][4] SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- @@ -3925,7 +3840,7 @@ true if src pixels are copied to readPixels[2][3][4] +readPixels[2][3] --- @@ -3975,73 +3890,7 @@ true if src pixels are copied to readPixels[2][3][4] - ---- - - - -
-bool writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior)
-
- -Copies a Rect of pixels from src. Copy starts at (0, 0), and does not exceed -(src.width, src.height). - -src specifies width, height, Color Type, Alpha Type, Color Space, pixel storage, -and row bytes of source. src.rowBytes specifics the gap from one source -row to the next. Returns true if pixels are copied. Returns false if: - - - - - - - - -
src pixel storage equals nullptr
src.rowBytes is less than SkImageInfo::minRowBytes
Pixel Ref is nullptr
- -Pixels are copied only if pixel conversion is possible. If Bitmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; src Color Type must match. -If Bitmap colorType is kGray_8_SkColorType, src Color Space must match. -If Bitmap alphaType is kOpaque_SkAlphaType, src Alpha Type must -match. If Bitmap colorSpace is nullptr, src Color Space must match. Returns -false if pixel conversion is not possible. Returns false if width or height -is zero or negative. - -If behavior is SkTransferFunctionBehavior::kRespect: converts src -pixels to a linear space before converting to Image Info. -If behavior is SkTransferFunctionBehavior::kIgnore: src -pixels are treated as if they are linear, regardless of how they are encoded. - -### Parameters - - - - - - - - - - - - - -
srcsource Pixmap: Image Info, pixels, row bytes
xcolumn index whose absolute value is less than width
yrow index whose absolute value is less than height
behaviorone of: SkTransferFunctionBehavior::kRespect, -SkTransferFunctionBehavior::kIgnore
- -### Return Value - -true if src pixels are copied to Bitmap - -### Example - -
- -### See Also - -readPixels[2][3][4] +readPixels[2][3] --- @@ -4253,7 +4102,7 @@ x---x- ### See Also -pixmap installPixels[2][3] readPixels[2][3][4] writePixels[2][3] +pixmap installPixels[2][3] readPixels[2][3] writePixels[2] --- diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 75bf7645f8..b44a55bd85 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -1547,7 +1547,7 @@ pixel = 8056a9ff ### See Also -peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3][4] SkPixmap::readPixels[2][3][4][5] SkImage::readPixels[2] SkSurface::readPixels[2][3] +peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3] SkPixmap::readPixels[2][3][4] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- @@ -1627,7 +1627,7 @@ pixel = 802b5580 ### See Also -peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3][4] SkPixmap::readPixels[2][3][4][5] SkImage::readPixels[2] SkSurface::readPixels[2][3] +peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3] SkPixmap::readPixels[2][3][4] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- @@ -1707,7 +1707,7 @@ pixel = 802b5580 ### See Also -peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3][4] SkPixmap::readPixels[2][3][4][5] SkImage::readPixels[2] SkSurface::readPixels[2][3] +peekPixels writePixels[2] drawBitmap drawImage[2] SkBitmap::readPixels[2][3] SkPixmap::readPixels[2][3][4] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- @@ -1781,7 +1781,7 @@ true if pixels were written to readPixels[2][3] drawBitmap drawImage[2] SkBitmap::writePixels[2][3] +readPixels[2][3] drawBitmap drawImage[2] SkBitmap::writePixels[2] --- @@ -1851,7 +1851,7 @@ true if pixels were written to Canvas ### See Also -readPixels[2][3] drawBitmap drawImage[2] SkBitmap::writePixels[2][3] +readPixels[2][3] drawBitmap drawImage[2] SkBitmap::writePixels[2] --- @@ -5230,7 +5230,7 @@ and so on; or nullptr ### See Also -drawImage[2] drawBitmapLattice drawBitmapNine drawBitmapRect[2][3] SkBitmap::readPixels[2][3][4] SkBitmap::writePixels[2][3] +drawImage[2] drawBitmapLattice drawBitmapNine drawBitmapRect[2][3] SkBitmap::readPixels[2][3] SkBitmap::writePixels[2] --- diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index ad21311548..3e145d3a35 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -2019,7 +2019,7 @@ true if pixels are copied to dstPixelsscalePixels SkBitmap::readPixels[2][3][4] SkPixmap::readPixels[2][3][4][5] SkCanvas::readPixels[2][3] SkSurface::readPixels[2][3] +scalePixels SkBitmap::readPixels[2][3] SkPixmap::readPixels[2][3][4] SkCanvas::readPixels[2][3] SkSurface::readPixels[2][3] --- @@ -2086,7 +2086,7 @@ true if pixels are copied to dst ### See Also -scalePixels SkBitmap::readPixels[2][3][4] SkPixmap::readPixels[2][3][4][5] SkCanvas::readPixels[2][3] SkSurface::readPixels[2][3] +scalePixels SkBitmap::readPixels[2][3] SkPixmap::readPixels[2][3][4] SkCanvas::readPixels[2][3] SkSurface::readPixels[2][3] --- @@ -2622,9 +2622,7 @@ true if Image is created as needed ## makeColorSpace
-sk sp<SkImage> makeColorSpace(
-              sk sp<SkColorSpace> target,
-                    SkTransferFunctionBehavior premulBehavior = SkTransferFunctionBehavior::kIgnore) const
+sk sp<SkImage> makeColorSpace(sk sp<SkColorSpace> target) const
 
Creates Image in target Color Space. @@ -2634,26 +2632,11 @@ Returns original Image if it is in Image Color Space to target Color Space. If Image colorSpace returns nullptr, Image Color Space is assumed to be sRGB. -SkTransferFunctionBehavior is to be deprecated. - -Set premulBehavior to SkTransferFunctionBehavior::kRespect to convert Image -pixels to a linear space, before converting to destination Color Type -and Color Space. - -Set premulBehavior to SkTransferFunctionBehavior::kIgnore to treat Image -pixels as linear, when converting to destination Color Type -and Color Space, ignoring pixel encoding. premulBehavior is -SkTransferFunctionBehavior::kIgnore by default. - ### Parameters - - -
target Color Space describing color range of returned Image
premulBehaviorone of: SkTransferFunctionBehavior::kRespect, -SkTransferFunctionBehavior::kIgnore
### Return Value diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md index 4a5ba1f941..bd2a187d6e 100644 --- a/site/user/api/SkPixmap_Reference.md +++ b/site/user/api/SkPixmap_Reference.md @@ -1038,7 +1038,7 @@ Unpremultiplied: ### See Also -addr[2] readPixels[2][3][4][5] +addr[2] readPixels[2][3][4] --- @@ -1801,25 +1801,21 @@ is drawn after overwriting bottom half float color with top half float color. - readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior) const + readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes) const - readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes) const + readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY) const - readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY) const + readPixels(const SkPixmap& dst, int srcX, int srcY) const - readPixels(const SkPixmap& dst, int srcX, int srcY) const + readPixels(const SkPixmap& dst) const - - readPixels(const SkPixmap& dst) const - - scalePixels scales and converts pixels @@ -1829,11 +1825,10 @@ is drawn after overwriting bottom half float color with top half float color. ## readPixels
-bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY,
-                SkTransferFunctionBehavior behavior) const
+bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
 
-Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not +Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not exceed Pixmap (width, height). dstInfo specifies width, height, Color Type, Alpha Type, and @@ -1848,16 +1843,7 @@ If Pixmap alphaType is < match. If Pixmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns false if pixel conversion is not possible. -srcX and srcY may be negative to copy only top or left of source. Returns -false if width or height is zero or negative. Returns false if: - -abs(srcX) >= Pixmap width, -or ifabs(srcY) >= Pixmap height. - -If behavior is SkTransferFunctionBehavior::kRespect: converts source -pixels to a linear space before converting to dstInfo. -If behavior is SkTransferFunctionBehavior::kIgnore: source -pixels are treated as if they are linear, regardless of how they are encoded. +Returns false if Pixmap width or height is zero or negative. ### Parameters @@ -1870,16 +1856,6 @@ pixels are treated as if they are linear, regardless of how they are encoded. dstRowBytes destination row length - srcX - column index whose absolute value is less than width - - srcY - row index whose absolute value is less than height - - behavior - one of: SkTransferFunctionBehavior::kRespect, -SkTransferFunctionBehavior::kIgnore - ### Return Value @@ -1888,21 +1864,23 @@ true if pixels are copied to dstPixels< ### Example -
+
Transferring the gradient from 8 bits per component to 4 bits per component +creates visible banding. +
### See Also -
erase[2][3] SkBitmap::readPixels[2][3][4] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +erase[2][3] SkBitmap::readPixels[2][3] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] ---
-bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
+bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const
 
-Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not +Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not exceed Pixmap (width, height). dstInfo specifies width, height, Color Type, Alpha Type, and @@ -1917,59 +1895,7 @@ If Pixmap alphaType is < match. If Pixmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns false if pixel conversion is not possible. -Returns false if Pixmap width or height is zero or negative. - -### Parameters - - - - - - - - - - -
dstInfodestination width, height, Color Type, Alpha Type, Color Space
dstPixelsdestination pixel storage
dstRowBytesdestination row length
- -### Return Value - -true if pixels are copied to dstPixels - -### Example - -
Transferring the gradient from 8 bits per component to 4 bits per component -creates visible banding. -
- -### See Also - -erase[2][3] SkBitmap::readPixels[2][3][4] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] - ---- - - - -
-bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const
-
- -Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not -exceed Pixmap (width, height). - -dstInfo specifies width, height, Color Type, Alpha Type, and -Color Space of destination. dstRowBytes specifics the gap from one destination -row to the next. Returns true if pixels are copied. Returns false if -dstInfo.addr equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes. - -Pixels are copied only if pixel conversion is possible. If Pixmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match. -If Pixmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match. -If Pixmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must -match. If Pixmap colorSpace is nullptr, dstInfo.colorSpace must match. Returns -false if pixel conversion is not possible. - -srcX and srcY may be negative to copy only top or left of source. Returns +srcX and srcY may be negative to copy only top or left of source. Returns false if Pixmap width or height is zero or negative. Returns false if: abs(srcX) >= Pixmap width, @@ -1977,26 +1903,26 @@ or ifabs(srcY) >= Pixmap height ### Parameters - +
dstInfo
- + - + - + - +
dstInfo destination width, height, Color Type, Alpha Type, Color Space
dstPixels
dstPixels destination pixel storage
dstRowBytes
dstRowBytes destination row length
srcX
srcX column index whose absolute value is less than width
srcY
srcY row index whose absolute value is less than height
### Return Value -true if pixels are copied to
dstPixels +true if pixels are copied to dstPixels ### Example @@ -2004,30 +1930,30 @@ true if pixels are copied to dstPixel ### See Also -erase[2][3] SkBitmap::readPixels[2][3][4] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +erase[2][3] SkBitmap::readPixels[2][3] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- - +
 bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
 
-Copies a Rect of pixels to dst. Copy starts at (srcX, srcY), and does not -exceed Pixmap (width, height). dst specifies width, height, Color Type, +Copies a Rect of pixels to dst. Copy starts at (srcX, srcY), and does not +exceed Pixmap (width, height). dst specifies width, height, Color Type, Alpha Type, and Color Space of destination. Returns true if pixels are copied. -Returns false if dst.addr equals nullptr, or dst.rowBytes is less than -dst SkImageInfo::minRowBytes. +Returns false if dst.addr equals nullptr, or dst.rowBytes is less than +dst SkImageInfo::minRowBytes. Pixels are copied only if pixel conversion is possible. If Pixmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dst.info.colorType must match. -If Pixmap colorType is kGray_8_SkColorType, dst.info.colorSpace must match. -If Pixmap alphaType is kOpaque_SkAlphaType, dst.info.alphaType must -match. If Pixmap colorSpace is nullptr, dst.info.colorSpace must match. Returns +kGray_8_SkColorType, or kAlpha_8_SkColorType; dst.info.colorType must match. +If Pixmap colorType is kGray_8_SkColorType, dst.info.colorSpace must match. +If Pixmap alphaType is kOpaque_SkAlphaType, dst.info.alphaType must +match. If Pixmap colorSpace is nullptr, dst.info.colorSpace must match. Returns false if pixel conversion is not possible. -srcX and srcY may be negative to copy only top or left of source. Returns +srcX and srcY may be negative to copy only top or left of source. Returns false Pixmap width or height is zero or negative. Returns false if: abs(srcX) >= Pixmap width, @@ -2035,20 +1961,20 @@ or ifabs(srcY) >= Pixmap height ### Parameters - +
dst
- + - +
dst Image Info and pixel address to write to
srcX
srcX column index whose absolute value is less than width
srcY
srcY row index whose absolute value is less than height
### Return Value -true if pixels are copied to
dst +true if pixels are copied to dst ### Example @@ -2056,40 +1982,40 @@ true if pixels are copied to dst ### See Also -erase[2][3] SkBitmap::readPixels[2][3][4] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +erase[2][3] SkBitmap::readPixels[2][3] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- - +
 bool readPixels(const SkPixmap& dst) const
 
-Copies pixels inside bounds to dst. dst specifies width, height, Color Type, +Copies pixels inside bounds to dst. dst specifies width, height, Color Type, Alpha Type, and Color Space of destination. Returns true if pixels are copied. -Returns false if dst.addr equals nullptr, or dst.rowBytes is less than -dst SkImageInfo::minRowBytes. +Returns false if dst.addr equals nullptr, or dst.rowBytes is less than +dst SkImageInfo::minRowBytes. Pixels are copied only if pixel conversion is possible. If Pixmap colorType is -kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color Type must match. -If Pixmap colorType is kGray_8_SkColorType, dst Color Space must match. -If Pixmap alphaType is kOpaque_SkAlphaType, dst Alpha Type must -match. If Pixmap colorSpace is nullptr, dst Color Space must match. Returns +kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color Type must match. +If Pixmap colorType is kGray_8_SkColorType, dst Color Space must match. +If Pixmap alphaType is kOpaque_SkAlphaType, dst Alpha Type must +match. If Pixmap colorSpace is nullptr, dst Color Space must match. Returns false if pixel conversion is not possible. Returns false if Pixmap width or height is zero or negative. ### Parameters - +
dst
dst Image Info and pixel address to write to
### Return Value -true if pixels are copied to dst +true if pixels are copied to dst ### Example @@ -2097,7 +2023,7 @@ true if pixels are copied to dst ### See Also -erase[2][3] SkBitmap::readPixels[2][3][4] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] +erase[2][3] SkBitmap::readPixels[2][3] SkCanvas::drawBitmap SkCanvas::readPixels[2][3] SkImage::readPixels[2] SkSurface::readPixels[2][3] --- diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index aede7441de..50cb9cf8ee 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -4305,36 +4305,28 @@ "name": "SkBitmap::notifyPixelsChanged" }, "SkBitmap_readPixels": { - "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 32;\n std::vector dstPixels;\n dstPixels.resize(height * width * 4);\n SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);\n SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };\n SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };\n SkPaint gradPaint;\n gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n for (auto behavior : { SkTransferFunctionBehavior::kRespect,\n SkTransferFunctionBehavior::kIgnore} ) {\n SkBitmap bitmap;\n bitmap.allocPixels(info);\n SkCanvas srcCanvas(bitmap);\n srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint);\n if (bitmap.readPixels(info, &dstPixels.front(), width * 4, 0, 0, behavior)) {\n SkPixmap dstPixmap(info, &dstPixels.front(), width * 4);\n bitmap.installPixels(dstPixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n canvas->translate(0, height);\n }\n}\n", - "width": 256, - "height": 64, - "hash": "86fb9979516d256d71aa3f3f2182fe0c", - "file": "SkBitmap_Reference", - "name": "SkBitmap::readPixels" -}, - "SkBitmap_readPixels_2": { "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 64;\n SkImageInfo srcInfo = SkImageInfo::MakeN32Premul(width, height);\n SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };\n SkPoint gradPoints[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n SkBitmap bitmap;\n bitmap.allocPixels(srcInfo);\n SkCanvas srcCanvas(bitmap);\n srcCanvas.drawRect(SkRect::MakeWH(width, height), paint);\n canvas->drawBitmap(bitmap, 0, 0);\n SkImageInfo dstInfo = srcInfo.makeColorType(kARGB_4444_SkColorType);\n std::vector dstPixels;\n dstPixels.resize(height * width);\n bitmap.readPixels(dstInfo, &dstPixels.front(), width * 2, 0, 0);\n SkPixmap dstPixmap(dstInfo, &dstPixels.front(), width * 2);\n bitmap.installPixels(dstPixmap);\n canvas->drawBitmap(bitmap, 0, 64);\n}", "width": 256, "height": 128, "hash": "b2cbbbbcffb618865d8aae3bc04b2a62", "file": "SkBitmap_Reference", - "name": "SkBitmap::readPixels_2" + "name": "SkBitmap::readPixels" }, - "SkBitmap_readPixels_3": { + "SkBitmap_readPixels_2": { "code": "void draw(SkCanvas* canvas) {\n std::vector srcPixels;\n srcPixels.resize(source.height() * source.rowBytes());\n for (int y = 0; y < 4; ++y) {\n for (int x = 0; x < 4; ++x) {\n SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width() / 4, source.height() / 4),\n &srcPixels.front() + x * source.height() * source.width() / 4 +\n y * source.width() / 4, source.rowBytes());\n source.readPixels(pixmap, x * source.width() / 4, y * source.height() / 4);\n }\n }\n canvas->scale(.5f, .5f);\n SkBitmap bitmap;\n bitmap.installPixels(SkImageInfo::MakeN32Premul(source.width(), source.height()),\n &srcPixels.front(), source.rowBytes());\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 256, "hash": "e9f70cbc9827097449a386ec7a8a8188", "file": "SkBitmap_Reference", - "name": "SkBitmap::readPixels_3" + "name": "SkBitmap::readPixels_2" }, - "SkBitmap_readPixels_4": { + "SkBitmap_readPixels_3": { "code": "void draw(SkCanvas* canvas) {\n std::vector srcPixels;\n srcPixels.resize(source.height() * source.width() * 8);\n for (int i = 0; i < 2; ++i) {\n SkPixmap pixmap(SkImageInfo::Make(source.width() * 2, source.height(),\n i ? kRGBA_8888_SkColorType : kBGRA_8888_SkColorType, kPremul_SkAlphaType),\n &srcPixels.front() + i * source.width(), source.rowBytes() * 2);\n source.readPixels(pixmap);\n }\n canvas->scale(.25f, .25f);\n SkBitmap bitmap;\n bitmap.installPixels(SkImageInfo::MakeN32Premul(source.width() * 2, source.height()),\n &srcPixels.front(), source.rowBytes() * 2);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 128, "hash": "4590fbf052659d6e629fbfd827081ae5", "file": "SkBitmap_Reference", - "name": "SkBitmap::readPixels_4" + "name": "SkBitmap::readPixels_3" }, "SkBitmap_readyToDraw": { "code": "void draw(SkCanvas* canvas) {\n if (source.readyToDraw()) {\n canvas->drawBitmap(source, 10, 10);\n }\n}", @@ -4431,14 +4423,6 @@ "hash": "faa5dfa466f6e16c07c124d971f32679", "file": "SkBitmap_Reference", "name": "SkBitmap::writePixels_2" -}, - "SkBitmap_writePixels_3": { - "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 32;\n std::vector dstPixels;\n dstPixels.resize(height * width * 4);\n SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);\n SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };\n SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };\n SkPaint gradPaint;\n gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n for (auto behavior : { SkTransferFunctionBehavior::kRespect,\n SkTransferFunctionBehavior::kIgnore} ) {\n SkPixmap dstPixmap(info, &dstPixels.front(), width * 4);\n SkBitmap bitmap;\n bitmap.installPixels(dstPixmap);\n SkCanvas srcCanvas(bitmap);\n srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint);\n if (bitmap.writePixels(dstPixmap, 0, 0, behavior)) {\n canvas->drawBitmap(bitmap, 0, 0);\n }\n canvas->translate(0, height);\n }\n}", - "width": 256, - "height": 64, - "hash": "9f046f407b01b759cb737d702a994620", - "file": "SkBitmap_Reference", - "name": "SkBitmap::writePixels_3" }, "SkCanvas_PointMode": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(10);\n SkPoint points[] = {{64, 32}, {96, 96}, {32, 96}};\n canvas->drawPoints(SkCanvas::kPoints_PointMode, 3, points, paint);\n canvas->translate(128, 0);\n canvas->drawPoints(SkCanvas::kLines_PointMode, 3, points, paint);\n canvas->translate(0, 128);\n canvas->drawPoints(SkCanvas::kPolygon_PointMode, 3, points, paint);\n SkPath path;\n path.addPoly(points, 3, false);\n canvas->translate(-128, 0);\n canvas->drawPath(path, paint);\n}\n", @@ -7281,44 +7265,36 @@ "name": "SkPixmap::extractSubset" }, "SkPixmap_readPixels": { - "code": "void draw(SkCanvas* canvas) {\n SkImageInfo srgb = SkImageInfo::MakeS32(image->width(), image->height(),\n kPremul_SkAlphaType);\n SkImageInfo linear = srgb.makeColorSpace(srgb.colorSpace()->makeLinearGamma());\n std::vector srcPixels;\n size_t rowBytes = image->width() * 4;\n srcPixels.resize(image->height() * rowBytes);\n SkPixmap pixmap(srgb, (const void*) &srcPixels.front(), rowBytes);\n image->readPixels(pixmap, 0, 0);\n int offset = -64;\n std::vector dstPixels;\n dstPixels.resize(image->height() * rowBytes);\n for (const auto& info : { srgb, linear } ) {\n for (auto behavior : { SkTransferFunctionBehavior::kRespect,\n SkTransferFunctionBehavior::kIgnore} ) {\n pixmap.readPixels(info, &dstPixels.front(), rowBytes, 0, 0, behavior);\n SkBitmap bitmap;\n SkPixmap dstmap(info, &dstPixels.front(), rowBytes);\n bitmap.installPixels(dstmap);\n canvas->drawBitmap(bitmap, 0, offset += 64);\n }\n }\n}\n", - "width": 256, - "height": 256, - "hash": "48ccfadec48f987c81a1e218e49cca68", - "file": "SkPixmap_Reference", - "name": "SkPixmap::readPixels" -}, - "SkPixmap_readPixels_2": { "code": "void draw(SkCanvas* canvas) {\n std::vector pixels;\n const int width = 256;\n const int height = 64;\n pixels.resize(height * width * 4);\n SkImageInfo srcInfo = SkImageInfo::MakeN32Premul(width, height);\n SkPixmap srcPixmap(srcInfo, (const void*) &pixels.front(), width * 4);\n SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };\n SkPoint gradPoints[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n SkBitmap bitmap;\n bitmap.installPixels(srcPixmap);\n SkCanvas srcCanvas(bitmap);\n srcCanvas.drawRect(SkRect::MakeWH(width, height), paint);\n canvas->drawBitmap(bitmap, 0, 0);\n std::vector dstPixels;\n dstPixels.resize(height * width * 2);\n SkImageInfo dstInfo = srcInfo.makeColorType(kARGB_4444_SkColorType);\n srcPixmap.readPixels(dstInfo, &dstPixels.front(), width * 2);\n SkPixmap dstPixmap(dstInfo, &dstPixels.front(), width * 2);\n bitmap.installPixels(dstPixmap);\n canvas->drawBitmap(bitmap, 0, 128);\n}", "width": 256, "height": 128, "hash": "df4e355c4845350daede833b4fd21ec1", "file": "SkPixmap_Reference", - "name": "SkPixmap::readPixels_2" + "name": "SkPixmap::readPixels" }, - "SkPixmap_readPixels_3": { + "SkPixmap_readPixels_2": { "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());\n std::vector srcPixels;\n const int rowBytes = image->width() * 4;\n srcPixels.resize(image->height() * rowBytes);\n SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);\n image->readPixels(pixmap, 0, 0);\n for (int offset : { 32, 64, 96 } ) {\n std::vector dstPixels;\n dstPixels.resize(image->height() * rowBytes);\n pixmap.readPixels(info, &dstPixels.front(), rowBytes, offset, 0);\n SkBitmap bitmap;\n SkPixmap dstmap(info, &dstPixels.front(), rowBytes);\n bitmap.installPixels(dstmap);\n canvas->translate(32, 32);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}\n", "width": 256, "height": 256, "hash": "094ca0bd37588cc7be241bb387a3e17b", "file": "SkPixmap_Reference", - "name": "SkPixmap::readPixels_3" + "name": "SkPixmap::readPixels_2" }, - "SkPixmap_readPixels_4": { + "SkPixmap_readPixels_3": { "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());\n std::vector srcPixels;\n const int rowBytes = image->width() * 4;\n srcPixels.resize(image->height() * rowBytes);\n SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);\n image->readPixels(pixmap, 0, 0);\n for (int offset : { 32, 64, 96 } ) {\n std::vector dstPixels;\n dstPixels.resize(image->height() * rowBytes);\n SkPixmap dstmap(info, &dstPixels.front(), rowBytes);\n pixmap.readPixels(dstmap, offset, 0);\n SkBitmap bitmap;\n bitmap.installPixels(dstmap);\n canvas->translate(32, 32);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}\n", "width": 256, "height": 256, "hash": "6ec7f7b2cc163cd29f627eef6d4b061c", "file": "SkPixmap_Reference", - "name": "SkPixmap::readPixels_4" + "name": "SkPixmap::readPixels_3" }, - "SkPixmap_readPixels_5": { + "SkPixmap_readPixels_4": { "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());\n std::vector srcPixels;\n const int rowBytes = image->width() * 4;\n srcPixels.resize(image->height() * rowBytes);\n SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);\n image->readPixels(pixmap, 0, 0);\n for (int index = 0; index < 3; ++index ) {\n std::vector dstPixels;\n dstPixels.resize(image->height() * rowBytes);\n SkPixmap dstmap(info, &dstPixels.front(), rowBytes);\n pixmap.readPixels(dstmap);\n SkBitmap bitmap;\n bitmap.installPixels(dstmap);\n canvas->translate(32, 32);\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}\n", "width": 256, "height": 256, "hash": "e18549b5ee1039cb61b0bb38c2104fc9", "file": "SkPixmap_Reference", - "name": "SkPixmap::readPixels_5" + "name": "SkPixmap::readPixels_4" }, "SkPixmap_reset_2": { "code": "void draw(SkCanvas* canvas) {\n std::vector pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n int x = 0;\n for (auto colorType : { kRGBA_8888_SkColorType, kBGRA_8888_SkColorType } ) {\n pixmap.reset(SkImageInfo::Make(image->width(), image->height(), colorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, x, 0);\n x += 128;\n }\n}\n", diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 7f46c73924..3ef43a360d 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -80,28 +80,6 @@ static bool Equals(const Enum SkTransferFunctionBehavior - -### Constants - - - - - - - - - - - - - - - -
ConstValueDescription
SkTransferFunctionBehavior::kRespect0 -
SkTransferFunctionBehavior::kIgnore1 -
- # Coons Patch # Core Graphics -- cgit v1.2.3