aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/SkBitmap_Reference.bmh
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-07-17 13:19:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-17 17:27:10 +0000
commite80cd44cb2c549b709022a62a1fa9f8d6a7822ec (patch)
tree76b90d88c667317886c85002040c77ee9b07def9 /docs/SkBitmap_Reference.bmh
parenta8cdbd7431b6a27d28db1bc80d7557cedf7e66d0 (diff)
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 <caryclark@skia.org> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs/SkBitmap_Reference.bmh')
-rw-r--r--docs/SkBitmap_Reference.bmh157
1 files changed, 2 insertions, 155 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 1fd2b520de..5bf8e1b2e4 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -2743,94 +2743,9 @@ subset: 1000, 100, 1000, 200 success; false
# ------------------------------------------------------------------------------
#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
- int srcX, int srcY, SkTransferFunctionBehavior behavior) const
-#In Pixels
-#Line # copies and converts pixels ##
-
-Copies Rect of pixels from Bitmap pixels 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:
-#List
-# dstInfo.addr() equals nullptr ##
-# dstRowBytes is less than dstInfo.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
-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
-#Formula
-abs(srcX) >= Bitmap width()
-##
-, or if
-#Formula
-abs(srcY) >= Bitmap 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.
-
-#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ##
-#Param dstPixels destination pixel storage ##
-#Param dstRowBytes destination row length ##
-#Param srcX column index whose absolute value is less than width() ##
-#Param srcY row index whose absolute value is less than height() ##
-#Param behavior one of: SkTransferFunctionBehavior::kRespect,
- SkTransferFunctionBehavior::kIgnore
-##
-
-#Return true if pixels are copied to dstPixels ##
-
-#Example
-#Height 64
-void draw(SkCanvas* canvas) {
- const int width = 256;
- const int height = 32;
- std::vector<int32_t> dstPixels;
- dstPixels.resize(height * width * 4);
- SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };
- SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };
- SkPaint gradPaint;
- gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,
- SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));
- for (auto behavior : { SkTransferFunctionBehavior::kRespect,
- SkTransferFunctionBehavior::kIgnore} ) {
- SkBitmap bitmap;
- bitmap.allocPixels(info);
- SkCanvas srcCanvas(bitmap);
- srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint);
- if (bitmap.readPixels(info, &dstPixels.front(), width * 4, 0, 0, behavior)) {
- SkPixmap dstPixmap(info, &dstPixels.front(), width * 4);
- bitmap.installPixels(dstPixmap);
- canvas->drawBitmap(bitmap, 0, 0);
- }
- canvas->translate(0, height);
- }
-}
-##
-
-#SeeAlso writePixels SkPixmap::readPixels SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
int srcX, int srcY) const
+#In Pixels
+#Line # copies and converts pixels ##
Copies a Rect of pixels from Bitmap to dstPixels. Copy starts at (srcX, srcY),
and does not exceed Bitmap (width(), height()).
@@ -3129,74 +3044,6 @@ false if pixel conversion is not possible.
# ------------------------------------------------------------------------------
-#Method 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:
-#List
-# 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.
-
-#Param src source Pixmap: Image_Info, pixels, row bytes ##
-#Param x column index whose absolute value is less than width() ##
-#Param y row index whose absolute value is less than height() ##
-#Param behavior one of: SkTransferFunctionBehavior::kRespect,
- SkTransferFunctionBehavior::kIgnore
-##
-
-#Return true if src pixels are copied to Bitmap ##
-
-#Example
-#Height 64
- const int width = 256;
- const int height = 32;
- std::vector<int32_t> dstPixels;
- dstPixels.resize(height * width * 4);
- SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };
- SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };
- SkPaint gradPaint;
- gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,
- SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));
- for (auto behavior : { SkTransferFunctionBehavior::kRespect,
- SkTransferFunctionBehavior::kIgnore} ) {
- SkPixmap dstPixmap(info, &dstPixels.front(), width * 4);
- SkBitmap bitmap;
- bitmap.installPixels(dstPixmap);
- SkCanvas srcCanvas(bitmap);
- srcCanvas.drawRect(SkRect::MakeWH(width, height), gradPaint);
- if (bitmap.writePixels(dstPixmap, 0, 0, behavior)) {
- canvas->drawBitmap(bitmap, 0, 0);
- }
- canvas->translate(0, height);
- }
-##
-
-#SeeAlso readPixels
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method bool hasHardwareMipMap() const
#In Property
#Line # returns Mip_Map support present; Android only ##