From ffb3d688b0e76ad7d1517657b00e4525cc603f40 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 17 May 2018 12:17:28 -0400 Subject: Color Documentation - treat Color, ARGB, etc as things not requiring definitions - fix links to Anti-alias, RGB-565 - finish everything marked incomplete, color and elsewhere - add #Code blocks for #Typedef R=caryclark@google.com Docs-Preview: https://skia.org/?cl=128547 Bug: skia:6898 Change-Id: Icf12fe70bc2bf1a8b1a5b31380b2454610949f23 Reviewed-on: https://skia-review.googlesource.com/128547 Reviewed-by: Cary Clark Commit-Queue: Cary Clark Auto-Submit: Cary Clark --- site/user/api/SkBitmap_Reference.md | 22 +-- site/user/api/SkCanvas_Reference.md | 72 ++++----- site/user/api/SkColor4f_Reference.md | 174 ++++++++++++++++------ site/user/api/SkColor_Reference.md | 265 ++++++++++++++++----------------- site/user/api/SkIPoint_Reference.md | 2 +- site/user/api/SkImageInfo_Reference.md | 76 +++++----- site/user/api/SkImage_Reference.md | 39 +++-- site/user/api/SkMatrix_Reference.md | 60 ++++---- site/user/api/SkPaint_Reference.md | 78 +++++----- site/user/api/SkPoint_Reference.md | 2 +- site/user/api/SkSurface_Reference.md | 4 +- site/user/api/catalog.htm | 186 +++++++++++------------ site/user/api/undocumented.md | 4 +- 13 files changed, 533 insertions(+), 451 deletions(-) (limited to 'site') diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 08898bce08..b55f8cc832 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -219,7 +219,7 @@ SkBitmap member functions read and modify the structure properties. allocN32Pixels - allocates compatible Color ARGB pixels, or aborts + allocates compatible ARGB pixels, or aborts allocPixels @@ -439,7 +439,7 @@ SkBitmap member functions read and modify the structure properties. tryAllocN32Pixels - allocates compatible Color ARGB pixels if possible + allocates compatible ARGB pixels if possible tryAllocPixels @@ -2132,7 +2132,7 @@ Instructs tryAllocPixelsFlags and Description allocN32Pixels - allocates compatible Color ARGB pixels, or aborts + allocates compatible ARGB pixels, or aborts allocPixels @@ -2176,7 +2176,7 @@ Instructs tryAllocPixelsFlags and tryAllocN32Pixels - allocates compatible Color ARGB pixels if possible + allocates compatible ARGB pixels if possible tryAllocPixels @@ -3170,8 +3170,8 @@ void eraseColor(c. All pixels contained by bounds are affected. If the colorType is kGray_8_SkColorType or k565_SkColorType, then Color Alpha -is ignored; Color RGB is treated as opaque. If colorType is kAlpha_8_SkColorType, -then Color RGB is ignored. +is ignored; RGB is treated as opaque. If colorType is kAlpha_8_SkColorType, +then RGB is ignored. ### Parameters @@ -3209,13 +3209,13 @@ then r, gamount of Color Alpha, from fully transparent (0) to fully opaque (255) r - amount of Color RGB Red, from no red (0) to full red (255) + amount of red, from no red (0) to full red (255) g - amount of Color RGB Green, from no green (0) to full green (255) + amount of green, from no green (0) to full green (255) b - amount of Color RGB Blue, from no blue (0) to full blue (255) + amount of blue, from no blue (0) to full blue (255) @@ -3251,8 +3251,8 @@ Replaces pixel values inside area with colorType is kGray_8_SkColorType or k565_SkColorType, then Color Alpha -is ignored; Color RGB is treated as opaque. If colorType is kAlpha_8_SkColorType, -then Color RGB is ignored. +is ignored; RGB is treated as opaque. If colorType is kAlpha_8_SkColorType, +then RGB is ignored. ### Parameters diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 17f6e37c3c..297c37c9be 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -1543,7 +1543,7 @@ The copied quarter circles overdraw the original circle.
Canvas returned by Raster Surface has Premultiplied pixel values. clear takes Unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580. readPixels converts pixel back to Unpremultiplied value 0x8056A9FF, introducing error.
@@ -1625,7 +1625,7 @@ true if pixels were copied ### Example
clear takes Unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580.
@@ -1705,7 +1705,7 @@ true if pixels were copied ### Example
clear takes Unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580.
@@ -2275,7 +2275,7 @@ depth of saved stack typedef uint32_t SaveLayerFlags; -# Typedef SkCanvas::SaveLayerFlags +## Typedef SkCanvas::SaveLayerFlags SaveLayerFlags provides options that may be used in any combination in SaveLayerRec, defining how Layer allocated by saveLayer operates. It may be set to zero, kPreserveLCDText SaveLayerFlag, kInitWithPrevious SaveLayerFlag, or both flags. @@ -2433,7 +2433,7 @@ contents of the previous Layer. ### Example -
Canvas Layer captures a red Anti-aliased circle and a blue Aliased circle scaled +
Canvas Layer captures a red Anti Aliased circle and a blue Aliased circle scaled up by four. After drawing another red circle without scaling on top, the Layer is transferred to the main canvas.
@@ -2846,9 +2846,9 @@ the result with Matrix.
Black text mimics an oblique text style by using a negative skew in x that shifts the geometry to the right as the y values decrease. -Red text uses a positive skew in y to shift the geometry down as the x values +Red text uses a positive skew in y to shift the geometry down as the x values increase. -Blue text combines x and y skew to rotate and scale. +Blue text combines x and y skew to rotate and scale.
### See Also @@ -2979,14 +2979,14 @@ prior Clip to form the replacement Clip. to subtract Path from Clip; use SkClipOp::kIntersect to intersect Path with Clip. -A clipping Path may be Anti-aliased; if Path, after transformation, is -composed of horizontal and vertical lines, clearing Anti-alias allows whole pixels +A clipping Path may be Anti Aliased; if Path, after transformation, is +composed of horizontal and vertical lines, clearing Anti Alias allows whole pixels to either be inside or outside the clip. The fastest drawing has a Aliased, rectangular clip. -If clipping Path has Anti-alias set, clip may partially clip a pixel, requiring +If clipping Path has Anti Alias set, clip may partially clip a pixel, requiring that drawing blend partially with the destination along the edge. A rotated -rectangular Anti-aliased clip looks smoother but draws slower. +rectangular Anti Aliased clip looks smoother but draws slower. Clip can combine with Rect and Round Rect primitives; like Path, these are transformed by Matrix before they are combined with Clip. @@ -2996,10 +2996,10 @@ and is unaffected by Matrix. ### Example -
Draw a red circle with an Aliased clip and an Anti-aliased clip. +
Draw a red circle with an Aliased clip and an Anti Aliased clip. Use an image filter to zoom into the pixels drawn. The edge of the Aliased clip fully draws pixels in the red circle. -The edge of the Anti-aliased clip partially draws pixels in the red circle. +The edge of the Anti Aliased clip partially draws pixels in the red circle.
@@ -3010,7 +3010,7 @@ void clipRect(const Clip with the intersection or difference of Clip and rect, -with an Aliased or Anti-aliased clip edge. rect is transformed by Matrix +with an Aliased or Anti Aliased clip edge. rect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -3022,7 +3022,7 @@ before it is combined with Clip. Clip Op to apply to Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased @@ -3083,14 +3083,14 @@ before it is combined with Clip. Rect to combine with Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased ### Example
A circle drawn in pieces looks uniform when drawn Aliased. -The same circle pieces blend with pixels more than once when Anti-aliased, +The same circle pieces blend with pixels more than once when Anti Aliased, visible as a thin pair of lines through the right circle.
@@ -3133,7 +3133,7 @@ void clipRRect(const Clip with the intersection or difference of Clip and rrect, -with an Aliased or Anti-aliased clip edge. +with an Aliased or Anti Aliased clip edge. rrect is transformed by Matrix before it is combined with Clip. @@ -3146,7 +3146,7 @@ before it is combined with Clip. Clip Op to apply to Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased @@ -3197,7 +3197,7 @@ void clipRRect(const Clip with the intersection of Clip and rrect, -with an Aliased or Anti-aliased clip edge. +with an Aliased or Anti Aliased clip edge. rrect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -3206,7 +3206,7 @@ with an Aliased or Anti-aliased clip edge. Round Rect to combine with Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased @@ -3228,7 +3228,7 @@ void clipPath(const Clip with the intersection or difference of Clip and path, -with an Aliased or Anti-aliased clip edge. Path Fill Type determines if path +with an Aliased or Anti Aliased clip edge. Path Fill Type determines if path describes the area inside or outside its contours; and if Path Contour overlaps itself or another Path Contour, whether the overlaps form part of the area. path is transformed by Matrix before it is combined with Clip. @@ -3242,7 +3242,7 @@ itself or another Path Contour, whether t Clip Op to apply to Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased @@ -3317,7 +3317,7 @@ itself or another Path Contour, whether t Path to combine with Clip doAntiAlias - true if Clip is to be Anti-aliased + true if Clip is to be Anti Aliased @@ -3475,7 +3475,7 @@ Return bounds of Clip, transformed by inverse of SkRect::MakeEmpty, where all Rect sides equal zero. Rect returned is outset by one to account for partial pixel coverage if Clip -is Anti-aliased. +is Anti Aliased. ### Return Value @@ -3514,7 +3514,7 @@ Return bounds of bounds to SkRect::MakeEmpty, where all Rect sides equal zero. bounds is outset by one to account for partial pixel coverage if Clip -is Anti-aliased. +is Anti Aliased. ### Parameters @@ -3819,12 +3819,12 @@ void drawColor(Clip with Color color. -mode determines how Color ARGB is combined with destination. +mode determines how ARGB is combined with destination. ### Parameters - + @@ -3854,7 +3854,7 @@ This has the effect of replacing all pixels contained by Clip - +
colorUnpremultiplied Color ARGBUnpremultiplied ARGB
mode SkBlendMode used to combine source color and destination
colorUnpremultiplied Color ARGBUnpremultiplied ARGB
@@ -5906,7 +5906,7 @@ ending with a char value of zero ### Example -
+
### See Also @@ -6242,7 +6242,7 @@ void drawTextBlob(const blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, -Paint Text Align, Paint Hinting, Anti-alias, Paint Fake Bold, +Paint Text Align, Paint Hinting, Anti Alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, Subpixel Text, and Paint Vertical Text. @@ -6287,7 +6287,7 @@ void drawTextBlob(const blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, -Paint Text Align, Paint Hinting, Anti-alias, Paint Fake Bold, +Paint Text Align, Paint Hinting, Anti Alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, Subpixel Text, and Paint Vertical Text. @@ -6644,7 +6644,7 @@ void drawAtlas(const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint. -paint uses Anti-alias, Color Alpha, Color Filter, Image Filter, and Blend Mode +paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Rect tex locates sprite in atlas, and RSXform xform transforms it into destination space. @@ -6700,7 +6700,7 @@ void drawAtlas(const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint. -paint uses Anti-alias, Color Alpha, Color Filter, Image Filter, and Blend Mode +paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Rect tex locates sprite in atlas, and RSXform xform transforms it into destination space. @@ -6755,7 +6755,7 @@ void drawAtlas(const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint. -paint uses Anti-alias, Color Alpha, Color Filter, Image Filter, and Blend Mode +paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Rect tex locates sprite in atlas, and RSXform xform transforms it into destination space. @@ -6803,7 +6803,7 @@ void drawAtlas(const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint. -paint uses Anti-alias, Color Alpha, Color Filter, Image Filter, and Blend Mode +paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Rect tex locates sprite in atlas, and RSXform xform transforms it into destination space. diff --git a/site/user/api/SkColor4f_Reference.md b/site/user/api/SkColor4f_Reference.md index 425b8c271c..6b3b01108b 100644 --- a/site/user/api/SkColor4f_Reference.md +++ b/site/user/api/SkColor4f_Reference.md @@ -14,22 +14,29 @@ SkColor4f members may be read and written directly without using a member functi Description fA - incomplete + alpha component fB - incomplete + blue component fG - incomplete + green component fR - incomplete + red component -The float values are 0...1 Unpremultiplied +Each component is stored as a 32-bit single precision floating point float value. +All values are allowed, but only the range from zero to one is meaningful. + +Each component is independent of the others; fA Alpha is not Premultiplied +with fG green, fB blue, or fR red. + +Values smaller than zero or larger than one are allowed. Values out of range +may be used with Blend Mode so that the final component is in range. ## Overview @@ -60,11 +67,11 @@ SkColor4f operators inline class member functions with arithmetic equivalents. Description operator!=(const SkColor4f& other) const - incomplete + compares colors for inequality operator==(const SkColor4f& other) const - incomplete + compares Color4f for equality @@ -78,23 +85,23 @@ SkColor4f member functions read and modify the structure properties. Description FromColor - incomplete + sets components from Color Pin - incomplete + sets components to valid range pin - incomplete + sets components to valid range toSkColor - incomplete + returns closest Color vec - incomplete + returns array of components @@ -109,25 +116,29 @@ SkColor4f member functions read and modify the structure properties. float fR -incomplete +Single precision float for red ranges from no red (0.0) to full red (1.0). + float fG -incomplete +Single precision float for green ranges from no green (0.0) to full green (1.0). + float fB -incomplete +Single precision float for blue ranges from no blue (0.0) to full blue (1.0). + float fA -incomplete +Single precision float for Alpha ranges from no Alpha (0.0) to full Alpha (1.0). + @@ -138,24 +149,34 @@ incomplete bool operator==(const SkColor4f& other) _const +Compares Color4f with other, and returns true if all components are equivalent. + ### Parameters - +
otherincompleteColor4f to compare
### Return Value -incomplete +true if Color4f equals other ### Example -
+
+ +#### Example Output + +~~~~ +colorRed == colorNamedRed +~~~~ + +
### See Also -incomplete +operator!=(const SkColor4f& other) const --- @@ -166,24 +187,35 @@ incomplete bool operator!=(const SkColor4f& other) _const +Compares Color4f with other, and returns true if all components are not +equivalent. + ### Parameters - +
otherincompleteColor4f to compare
### Return Value -incomplete +true if Color4f is not equal to other ### Example -
+
+ +#### Example Output + +~~~~ +colorGray != colorNamedGray +~~~~ + +
### See Also -incomplete +operator==(const SkColor4f& other) const --- @@ -194,17 +226,28 @@ incomplete const float* vec() const +Returns Color4f components as a read-only array. + ### Return Value -incomplete +components as read-only array ### Example -
+
+ +#### Example Output + +~~~~ +red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333 +[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=0.533333 +~~~~ + +
### See Also -incomplete +SkColor4f --- @@ -214,17 +257,28 @@ incomplete float* vec() +Returns Color4f components as a writable array. + ### Return Value -incomplete +components as writable array ### Example -
+
+ +#### Example Output + +~~~~ +red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333 +[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=1 +~~~~ + +
### See Also -incomplete +SkColor4f --- @@ -235,33 +289,35 @@ incomplete static SkColor4f Pin(float r, float g, float b, float a) +Constructs and returns Color4f with each component pinned from zero to one. + ### Parameters - + - + - + - +
rincompletered component
gincompletegreen component
bincompleteblue component
aincompleteAlpha component
### Return Value -incomplete +Color4f with valid components ### Example -
+
### See Also -incomplete +pin FromColor --- @@ -272,26 +328,35 @@ incomplete static SkColor4f FromColor(SkColor) -Convert to SkColor4f, assuming SkColor is sRGB +Converts to closest Color4f. ### Parameters - +
SkColorincompleteColor with Alpha, red, blue, and green components
### Return Value -incomplete +Color4f equivalent ### Example -
+
+ +#### Example Output + +~~~~ +red=0.0742136 green=0.130136 blue=0.318547 alpha=0.168627 +red=77 green=101 blue=153 alpha=43 +~~~~ + +
### See Also -incomplete +toSkColor --- @@ -302,17 +367,28 @@ incomplete SkColor toSkColor() const +Converts to closest SkColor. + ### Return Value -incomplete +closest Color ### Example -
+
+ +#### Example Output + +~~~~ +red=75 green=101 blue=153 alpha=43 +red=0.0703601 green=0.130136 blue=0.318547 alpha=0.168627 +~~~~ + +
### See Also -incomplete +FromColor --- @@ -323,17 +399,19 @@ incomplete SkColor4f pin() const +Returns Color4f with all components in the range from zero to one. + ### Return Value -incomplete +Color4f with valid components ### Example -
+
### See Also -incomplete +Pin --- diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md index f2a1475e1c..7677ebd971 100644 --- a/site/user/api/SkColor_Reference.md +++ b/site/user/api/SkColor_Reference.md @@ -40,15 +40,15 @@ SkColor uses preprocessor definitions to inline code and constants, and to abstr SkColorGetB - incomplete + returns blue component SkColorGetG - incomplete + returns green component SkColorGetR - incomplete + returns red component SkColorSetRGB @@ -133,11 +133,11 @@ SkColor related constants are defined by enum, enum classDescription SkColorSetA - incomplete + returns Color with transparency SkColorSetARGB - returns Color Alpha and Color RGB combined + returns Color Alpha and RGB combined SkColorToHSV @@ -153,7 +153,7 @@ SkColor related constants are defined by enum, enum class SkPreMultiplyARGB - converts Unpremultiplied ARGB to Premultiplied PMColor + converts Unpremultiplied ARGB to Premultiplied PMColor SkPreMultiplyColor @@ -161,7 +161,7 @@ SkColor related constants are defined by enum, enum class SkRGBToHSV - incomplete + converts RGB to HSV @@ -188,22 +188,6 @@ SkColor typedef define a data type. -## RGB - -## RGB Red - -## RGB Blue - -## RGB Green - -## ARGB - -## RBG - -## RGB-565 - -## Gray - ## Alpha Alpha represents the transparency of Color. Color with Alpha of zero is fully @@ -213,11 +197,21 @@ floating point values. Unsigned integer Alpha ranges from z transparent, to all bits set, fully opaque. Floating point Alpha ranges from zero, fully transparent, to one, fully opaque. -# Typedef SkAlpha +## Typedef SkAlpha + +
+typedef uint8_t SkAlpha;
+
+ 8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent. -# Typedef SkColor -32-bit ARGB Color value, Unpremultiplied. Color components are always in +## Typedef SkColor + +
+typedef uint32_t SkColor;
+
+ +32-bit ARGB Color value, Unpremultiplied. Color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor is the type used to specify colors in SkPaint and in gradients. @@ -247,13 +241,13 @@ than the largest of r, Alpha, from fully transparent (0) to fully opaque (255) r - amount of RGB Red, from no red (0) to full red (255) + amount of red, from no red (0) to full red (255) g - amount of RGB Green, from no green (0) to full green (255) + amount of green, from no green (0) to full green (255) b - amount of RGB Blue, from no blue (0) to full blue (255) + amount of blue, from no blue (0) to full blue (255) @@ -267,25 +261,11 @@ color and alpha, Unpremultiplied ### See Also -SkColorSetRGB SkPaint::setARGB SkPaint::setColor +SkColorSetRGB SkPaint::setARGB SkPaint::setColor SkColorSetA --- -
-    #define SkColorSetARGBInline SkColorSetARGB
-
- -Deprecated. - -soon - -
-    #define SkColorSetARGBMacro  SkColorSetARGB
-
- -Deprecated. - -soon +## Define SkColorSetRGB
     #define SkColorSetRGB(r, g, b)  SkColorSetARGB(0xFF, r, g, b)
@@ -297,13 +277,13 @@ fully opaque to 255.
 ### Parameters
 
 
-    
+    
-    
+    
-    
+    
ramount of RGB Red, from no red (0) to full red (255)amount of red, from no red (0) to full red (255)
gamount of RGB Green, from no green (0) to full green (255)amount of green, from no green (0) to full green (255)
bamount of RGB Blue, from no blue (0) to full blue (255)amount of blue, from no blue (0) to full blue (255)
@@ -317,7 +297,9 @@ color with opaque alpha ### See Also -incomplete +SkColorSetARGB + +## Define SkColorGetA
     #define SkColorGetA(color)      (((color) >> 24) & 0xFF)
@@ -334,11 +316,13 @@ Returns Alpha byte from Color value.
 
 ### Example
 
-
+
### See Also -incomplete +SkPaint::getAlpha + +## Define SkColorGetR
     #define SkColorGetR(color)      (((color) >> 16) & 0xFF)
@@ -359,11 +343,13 @@ red byte
 
 ### Example
 
-
+
### See Also -incomplete +SkColorGetG SkColorGetB + +## Define SkColorGetG
     #define SkColorGetG(color)      (((color) >>  8) & 0xFF)
@@ -384,11 +370,13 @@ green byte
 
 ### Example
 
-
+
### See Also -incomplete +SkColorGetR SkColorGetB + +## Define SkColorGetB
     #define SkColorGetB(color)      (((color) >>  0) & 0xFF)
@@ -409,11 +397,11 @@ blue byte
 
 ### Example
 
-
+
### See Also -incomplete +SkColorGetR SkColorGetG ## SkColorSetA @@ -422,29 +410,30 @@ incomplete static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a)
-Returns Color with red, blue, and green set from c; and alpha set from a. +Returns Unpremultiplied Color with red, blue, and green set from c; and alpha set +from a. Alpha component of c is ignored and is replaced by a in result. ### Parameters - + - +
cUnpremultiplied Color ARGBpacked RGB, eight bits per component
aincompleteAlpha: transparent at zero, fully opaque at 255
### Return Value -incomplete +Color with transparency ### Example -
+
### See Also -incomplete +SkColorSetARGB --- @@ -459,13 +448,13 @@ incomplete Value Description - Alpha_Constants - #In Constant + SK_AlphaTRANSPARENT + 0x00 fully transparent SkAlpha - Alpha_Constants - #In Constant + SK_AlphaOPAQUE + 0xFF fully opaque SkAlpha @@ -538,63 +527,63 @@ fully transparent; to 255, fully opaque. Value Description - Color_Constants - #In Constant + SK_ColorTRANSPARENT + 0x00000000 transparent Color - Color_Constants - #In Constant + SK_ColorBLACK + 0xFF000000 black Color - Color_Constants - #In Constant + SK_ColorDKGRAY + 0xFF444444 dark gray Color - Color_Constants - #In Constant + SK_ColorGRAY + 0xFF888888 gray Color - Color_Constants - #In Constant + SK_ColorLTGRAY + 0xFFCCCCCC light gray Color - Color_Constants - #In Constant + SK_ColorWHITE + 0xFFFFFFFF white Color - Color_Constants - #In Constant + SK_ColorRED + 0xFFFF0000 red Color - Color_Constants - #In Constant + SK_ColorGREEN + 0xFF00FF00 green Color - Color_Constants - #In Constant + SK_ColorBLUE + 0xFF0000FF blue Color - Color_Constants - #In Constant + SK_ColorYELLOW + 0xFFFFFF00 yellow Color - Color_Constants - #In Constant + SK_ColorCYAN + 0xFF00FFFF cyan Color - Color_Constants - #In Constant + SK_ColorMAGENTA + 0xFFFF00FF magenta Color @@ -737,7 +726,7 @@ Represents fully opaque magenta. HTML_Fuchsia is equivalent. ### Example -
+
### See Also @@ -778,10 +767,10 @@ modulo 360, where zero degrees is red. ## SkRGBToHSV
-SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
+void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
 
-Converts RGB components to HSV. +Converts RGB to its HSV components. hsv[0] contains Hue, a value from zero to less than 360. hsv[1] contains Saturation, a value from zero to one. hsv[2] contains Value, a value from zero to one. @@ -802,17 +791,13 @@ Converts RGB components to HSV. -### Return Value - -incomplete - ### Example -
+
### See Also -incomplete +SkColorToHSV SkHSVToColor --- @@ -820,10 +805,10 @@ incomplete ## SkColorToHSV
-static inline void SkColorToHSV(SkColor color, SkScalar hsv[3])
+void SkColorToHSV(SkColor color, SkScalar hsv[3])
 
-Converts ARGB to its HSV components. Alpha in ARGB is ignored. +Converts ARGB to its HSV components. Alpha in ARGB is ignored. hsv[0] contains Hue, and is assigned a value from zero to less than 360. hsv[1] contains Saturation, a value from zero to one. hsv[2] contains Value, a value from zero to one. @@ -831,24 +816,20 @@ Converts ARGB to its HSV components. color - ARGB color to convert + ARGB color to convert hsv three element array which holds the resulting HSV components -### Return Value - -incomplete - ### Example -
+
### See Also -incomplete +SkRGBToHSV SkHSVToColor --- @@ -856,20 +837,20 @@ incomplete ## SkHSVToColor
-SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
+SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
 
-Converts HSV components to an ARGB color. The alpha component is passed through unchanged. +Converts HSV components to an ARGB color. Alpha is passed through unchanged. hsv[0] represents Hue, an angle from zero to less than 360. hsv[1] represents Saturation, and varies from zero to one. hsv[2] represents Value, and varies from zero to one. -If hsv values are out of range, they are pinned. +Out of range hsv values are pinned. ### Parameters - + @@ -878,57 +859,61 @@ If hsv values are out of range, they are pinned. ### Return Value -ARGB equivalent to HSV +ARGB equivalent to HSV ### Example -
+
### See Also -incomplete +SkColorToHSVSkRGBToHSV ---
-static inline SkColor SkHSVToColor(const SkScalar hsv[3])
+SkColor SkHSVToColor(const SkScalar hsv[3])
 
-Convert HSV components to an ARGB color. The alpha component set to 0xFF. +Convert HSV components to an ARGB color. Alpha is set to 0xFF. hsv[0] represents Hue, an angle from zero to less than 360. hsv[1] represents Saturation, and varies from zero to one. hsv[2] represents Value, and varies from zero to one. -If hsv values are out of range, they are pinned. +Out of range hsv values are pinned. ### Parameters
alphaAlpha component of the returned ARGB colorAlpha component of the returned ARGB color
hsv three element array which holds the input HSV components
- +
hsv3 element array which holds the input HSV components. -three element array which holds the input HSV components
### Return Value -the resulting ARGB color +RGB equivalent to HSV ### Example -
+
### See Also -incomplete +SkColorToHSV SkRGBToHSV --- ## PMColor -# Typedef SkPMColor -32-bit ARGB color value, Premultiplied. The byte order for this value is +## Typedef SkPMColor + +
+typedef uint32_t SkPMColor;
+
+ +32-bit ARGB color value, Premultiplied. The byte order for this value is configuration dependent, matching the format of kBGRA_8888_SkColorType bitmaps. This is different from SkColor, which is Unpremultiplied, and is always in the same byte order. @@ -937,38 +922,38 @@ same byte order. ## SkPreMultiplyARGB
-SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
+SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
 
-Return a SkPMColor value from Unpremultiplied 8-bit component values +Returns a SkPMColor value from Unpremultiplied 8-bit component values. ### Parameters - + - + - + - +
aincompleteamount of Alpha, from fully transparent (0) to fully opaque (255)
rincompleteamount of red, from no red (0) to full red (255)
gincompleteamount of green, from no green (0) to full green (255)
bincompleteamount of blue, from no blue (0) to full blue (255)
### Return Value -incomplete +Premultiplied Color ### Example -
+
### See Also -incomplete +SkPreMultiplyColor --- @@ -976,7 +961,7 @@ incomplete ## SkPreMultiplyColor
-SK_API SkPMColor SkPreMultiplyColor(SkColor c)
+SkPMColor SkPreMultiplyColor(SkColor c)
 
Returns PMColor closest to Color c. Multiplies c RGB components by the c Alpha, @@ -985,21 +970,21 @@ and arranges the bytes to match the format of c - incomplete + Unpremultiplied ARGB Color ### Return Value -incomplete +Premultiplied Color ### Example -
+
### See Also -incomplete +SkPreMultiplyARGB --- diff --git a/site/user/api/SkIPoint_Reference.md b/site/user/api/SkIPoint_Reference.md index 4648a6ca4b..68125d1348 100644 --- a/site/user/api/SkIPoint_Reference.md +++ b/site/user/api/SkIPoint_Reference.md @@ -717,7 +717,7 @@ Can also be used to add IVector to IVe ## IVector -# Typedef SkIVector +## Typedef SkIVector
     typedef SkIPoint SkIVector;
diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md
index eacaa9418a..f6cf52c5d7 100644
--- a/site/user/api/SkImageInfo_Reference.md
+++ b/site/user/api/SkImageInfo_Reference.md
@@ -69,7 +69,7 @@ SkImageInfo related constants are defined by enum, enum class
   
   
     kGray_8_SkColorType
-    pixel with Color Gray level in 8-bit byte
+    pixel with grayscale level in 8-bit byte
   
   
     kJPEG_SkYUVColorSpace
@@ -89,7 +89,7 @@ SkImageInfo related constants are defined by enum, enum class
   
   
     kN32_SkColorType
-    native Color ARGB 32-bit encoding
+    native ARGB 32-bit encoding
   
   
     kOpaque_SkAlphaType
@@ -172,8 +172,8 @@ color to create a new color. If alpha describes a weight from zero to one:
 
 In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.
 
-Color RGB may have Color Alpha included in each component value; the stored
-value is the original Color RGB multiplied by Color Alpha. Premultiplied color
+RGB may have Color Alpha included in each component value; the stored
+value is the original RGB multiplied by Color Alpha. Premultiplied color
 components improve performance.
 
 ### Constants
@@ -346,10 +346,10 @@ true if at equals Color RGB, or Color ARGB.
+grayscale, RGB, or ARGB.
 
-kN32_SkColorType selects the native 32-bit Color ARGB format. On Little_Endian
-processors, pixels containing 8-bit Color ARGB components pack into 32-bit
+kN32_SkColorType selects the native 32-bit ARGB format. On Little_Endian
+processors, pixels containing 8-bit ARGB components pack into 32-bit
 kBGRA_8888_SkColorType. On Big_Endian processors, pixels pack into 32-bit
 kRGBA_8888_SkColorType.
 
@@ -472,7 +472,7 @@ Used by tests to iterate through all valid values.
     4 or 6
     
     
-Encodes Color ARGB as either kRGBA_8888_SkColorType or
+Encodes ARGB as either kRGBA_8888_SkColorType or
 kBGRA_8888_SkColorType, whichever is native to the platform.
 
   
@@ -498,12 +498,12 @@ with its transparency set to alpha8 pixel value.
 
 ### See Also
 
-incomplete
+Alpha Gray 8
 
 ## Color Type RGB 565
 
-kRGB_565_SkColorType encodes Color RGB to fit in a 16-bit word. Red and Blue
-components use five bits describing 32 levels. Green components, more sensitive
+kRGB_565_SkColorType encodes RGB to fit in a 16-bit word. Red and blue
+components use five bits describing 32 levels. Green components, more sensitive
 to the eye, use six bits describing 64 levels. kRGB_565_SkColorType has no
 bits for Alpha.
 Pixels are fully opaque as if its Color Alpha was set to one, and should
@@ -517,11 +517,11 @@ always be paired with kOpaque_SkAlphaType.
 
 ### See Also
 
-incomplete
+ARGB 4444 RGBA 8888
 
 ## Color Type ARGB 4444
 
-kARGB_4444_SkColorType encodes Color ARGB to fit in 16-bit word. Each
+kARGB_4444_SkColorType encodes ARGB to fit in 16-bit word. Each
 component: alpha, blue, green, and red; use four bits, describing 16 levels.
 Note that kARGB_4444_SkColorType is misnamed; the acronym does not
 describe the actual component order.
@@ -546,11 +546,11 @@ less than 15, the drawn result is undefined.
 
 ### See Also
 
-incomplete
+RGBA 8888
 
 ## Color Type RGBA 8888
 
-kRGBA_8888_SkColorType encodes Color ARGB into a 32-bit word. Each component:
+kRGBA_8888_SkColorType encodes ARGB into a 32-bit word. Each component:
 red, green, blue, alpha; use eight bits, describing 256 levels.
 
 ![Color_Type_RGBA_8888](https://fiddle.skia.org/i/4ccd35f27fe73dce8cce8c75e18df23c_raster.png "")
@@ -577,11 +577,11 @@ will have the best performance. Use kN32_SkColorType
 
 ### See Also
 
-incomplete
+RGB 888 BGRA 8888
 
 ## Color Type RGB 888
 
-kRGB_888x_SkColorType encodes Color RGB into a 32-bit word. Each component:
+kRGB_888x_SkColorType encodes RGB into a 32-bit word. Each component:
 red, green, blue; use eight bits, describing 256 levels. Eight bits are
 unused. Pixels described by kRGB_888x_SkColorType are fully opaque as if
 their Color Alpha was set to one, and should always be paired with
@@ -593,9 +593,13 @@ their Color Alpha was set to one, and shou
 
 
+### See Also + +RGBA 8888 BGRA 8888 + ## Color Type BGRA 8888 -kBGRA_8888_SkColorType encodes Color ARGB into a 32-bit word. Each component: +kBGRA_8888_SkColorType encodes ARGB into a 32-bit word. Each component: blue, green, red, and alpha; use eight bits, describing 256 levels. ![Color_Type_BGRA_8888](https://fiddle.skia.org/i/babd0e12db21a88c74d4e88aa40268ab_raster.png "") @@ -626,7 +630,7 @@ and will have the best performance. Use kN32_SkColor ## Color Type RGBA 1010102 -kRGBA_1010102_SkColorType encodes Color ARGB into a 32-bit word. Each +kRGBA_1010102_SkColorType encodes ARGB into a 32-bit word. Each Color component: red, green, and blue; use ten bits, describing 1024 levels. Two bits contain alpha, describing four levels. Possible alpha values are zero: fully transparent; one: 33% opaque; two: 67% opaque; @@ -655,11 +659,11 @@ less than three, the drawn result is undefined. ### See Also -incomplete +RGB 101010 RGBA 8888 ## Color Type RGB 101010 -kRGB_101010x_SkColorType encodes Color RGB into a 32-bit word. Each +kRGB_101010x_SkColorType encodes RGB into a 32-bit word. Each Color component: red, green, and blue; use ten bits, describing 1024 levels. Two bits are unused. Pixels described by kRGB_101010x_SkColorType are fully opaque as if its Color Alpha was set to one, and should always be paired @@ -676,11 +680,11 @@ draw all colors possible to a kRGB_101010x_S ### See Also -incomplete +RGBA 1010102 ## Color Type Gray 8 -kGray_8_SkColorType encodes Color Gray level in eight bits that is equivalent +kGray_8_SkColorType encodes grayscale level in eight bits that is equivalent to equal values for red, blue, and green, representing colors from black to white. Pixels described by kGray_8_SkColorType are fully opaque as if its Color Alpha was set to one, and should always be paired with @@ -692,11 +696,11 @@ opaque as if its Color Alpha was set to on ### See Also -incomplete +Alpha 8 ## Color Type RGBA F16 -kRGBA_F16_SkColorType encodes Color ARGB into a 64-bit word. Each component: +kRGBA_F16_SkColorType encodes ARGB into a 64-bit word. Each component: blue, green, red, and alpha; use 16 bits, describing a floating point value. from -65500 to 65000 with 3.31 decimal digits of precision. @@ -727,7 +731,7 @@ less than 255, the drawn result is undefined. ### See Also -incomplete +SkColor4f ## SkColorTypeBytesPerPixel @@ -1130,7 +1134,7 @@ SkImageInfo global, struct, and class related member f Color Type ARGB 4444 - encodes Color ARGB in 16 bits + encodes ARGB in 16 bits Color Type Alpha 8 @@ -1138,35 +1142,35 @@ SkImageInfo global, struct, and class related member f Color Type BGRA 8888 - encodes Color ARGB Little_Endian in 32 bits + encodes ARGB Little_Endian in 32 bits Color Type Gray 8 - encodes level of Color Gray in 8 bits + encodes level of grayscale in 8 bits Color Type RGBA 1010102 - encodes Color ARGB ten bits per color component + encodes ARGB ten bits per color component Color Type RGBA 8888 - encodes Color ARGB Big_Endian in 32 bits + encodes ARGB Big_Endian in 32 bits Color Type RGBA F16 - encodes Color ARGB as half floats + encodes ARGB as half floats Color Type RGB 101010 - encodes Color RGB ten bits per color component + encodes RGB ten bits per color component Color Type RGB 565 - encodes Color RGB in 16 bits + encodes RGB in 16 bits Color Type RGB 888 - encodes Color RGB in 32 bits + encodes RGB in 32 bits Property @@ -2429,7 +2433,7 @@ bool operator!=(const SkImageInfo& other) _const
Compares Image Info with other, and returns true if width, height, Color Type, -Alpha Type, and Color Space are equivalent. +Alpha Type, and Color Space are not equivalent. ### Parameters diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index 6403e07b60..ddd4730b89 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -551,14 +551,24 @@ each dimension fits in 29 bits; --- -# Typedef SkImage::ReleaseContext +## Typedef SkImage::ReleaseContext + +
+typedef void* ReleaseContext;
+
+ Caller data passed to RasterReleaseProc; may be nullptr. ### See Also MakeFromRaster RasterReleaseProc -# Typedef SkImage::RasterReleaseProc +## Typedef SkImage::RasterReleaseProc + +
+typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext);
+
+ Function called when Image no longer shares pixels. ReleaseContext is provided by caller when Image is created, and may be nullptr. @@ -750,7 +760,12 @@ created Image, or nullptr --- -# Typedef SkImage::TextureReleaseProc +## Typedef SkImage::TextureReleaseProc + +
+typedef void (*TextureReleaseProc)(ReleaseContext releaseContext);
+
+ User function called when supplied texture may be deleted. ### See Also @@ -1163,14 +1178,14 @@ created Image, or nullptr SkImage::BitDepth::kU8 0 -Use 8 bits per Color ARGB component using unsigned integer format. +Use 8 bits per ARGB component using unsigned integer format. SkImage::BitDepth::kF16 1 -Use 16 bits per Color ARGB component using half-precision floating point format. +Use 16 bits per ARGB component using half-precision floating point format. @@ -1481,7 +1496,7 @@ or was parsed from encoded data. ### Example -
+
### See Also @@ -1504,7 +1519,7 @@ Returns Color Type if known; othe ### Example -
+
### See Also @@ -2499,8 +2514,14 @@ By translating canvas by returned offse --- -# Typedef SkImage::BackendTextureReleaseProc -BackendTextureReleaseProcDefines a function take one parameter of type +## Typedef SkImage::BackendTextureReleaseProc +BackendTextureReleaseProc + +
+typedef std::function BackendTextureReleaseProc;
+
+ +Defines a function take one parameter of type GrBackendTexture with no return value. diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md index f7596b414f..3a6852a560 100644 --- a/site/user/api/SkMatrix_Reference.md +++ b/site/user/api/SkMatrix_Reference.md @@ -1420,48 +1420,48 @@ Skews are not similar and do not preserve right angles. Value Description - MemberIndex - #In Constant + SkMatrix::kMScaleX + 0 horizontal scale factor - MemberIndex - #In Constant + SkMatrix::kMSkewX + 1 horizontal skew factor - MemberIndex - #In Constant + SkMatrix::kMTransX + 2 horizontal translation - MemberIndex - #In Constant + SkMatrix::kMSkewY + 3 vertical skew factor - MemberIndex - #In Constant + SkMatrix::kMScaleY + 4 vertical scale factor - MemberIndex - #In Constant + SkMatrix::kMTransY + 5 vertical translation - MemberIndex - #In Constant + SkMatrix::kMPersp0 + 6 input x perspective factor - MemberIndex - #In Constant + SkMatrix::kMPersp1 + 7 input y perspective factor - MemberIndex - #In Constant + SkMatrix::kMPersp2 + 8 perspective bias @@ -1563,33 +1563,33 @@ perspective bias Value Description - AffineIndex - #In Constant + SkMatrix::kAScaleX + 0 horizontal scale factor - AffineIndex - #In Constant + SkMatrix::kASkewY + 1 vertical skew factor - AffineIndex - #In Constant + SkMatrix::kASkewX + 2 horizontal skew factor - AffineIndex - #In Constant + SkMatrix::kAScaleY + 3 vertical scale factor - AffineIndex - #In Constant + SkMatrix::kATransX + 4 horizontal translation - AffineIndex - #In Constant + SkMatrix::kATransY + 5 vertical translation diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index 122a4d2b2a..66204867f9 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -23,7 +23,7 @@ algorithms that alter the drawing geometry, color, and transparency. For instanc The objects contained by Paint are opaque, and cannot be edited outside of the Paint to affect it. The implementation is free to defer computations associated with the Paint, or ignore them altogether. For instance, some GPU implementations draw all -Path geometries with Anti-aliasing, regardless of how SkPaint::kAntiAlias Flag +Path geometries with Anti Aliasing, regardless of how SkPaint::kAntiAlias Flag is set in Paint. Paint describes a single color, a single font, a single image quality, and so on. @@ -74,7 +74,7 @@ SkPaint global, struct, and class related member funct get and set Alpha - Anti-alias + Anti Alias approximating coverage with transparency @@ -151,7 +151,7 @@ SkPaint global, struct, and class related member funct LCD Text - text relying on the order of Color RGB stripes + text relying on the order of RGB stripes Linear Text @@ -301,7 +301,7 @@ SkPaint related constants are defined by enum, enum class kAntiAlias Flag - mask for setting Anti-alias + mask for setting Anti Alias kAutoHinting Flag @@ -557,7 +557,7 @@ SkPaint member functions read and modify the structure properties. getColor - returns Color Alpha and Color RGB, one drawing color + returns Color Alpha and RGB, one drawing color getColorFilter @@ -693,7 +693,7 @@ SkPaint member functions read and modify the structure properties. isAntiAlias - returns true if Anti-alias is set + returns true if Anti Alias is set isAutohinted @@ -781,7 +781,7 @@ SkPaint member functions read and modify the structure properties. setAntiAlias - sets or clears Anti-alias + sets or clears Anti Alias setAutohinted @@ -793,7 +793,7 @@ SkPaint member functions read and modify the structure properties. setColor - sets Color Alpha and Color RGB, one drawing color + sets Color Alpha and RGB, one drawing color setColorFilter @@ -927,7 +927,7 @@ Constructs Paint with default values. | attribute | default value | | --- | --- | -| Anti-alias | false | +| Anti Alias | false | | Blend Mode | SkBlendMode::kSrcOver | | Color | SK ColorBLACK | | Color Alpha | 255 | @@ -1478,7 +1478,7 @@ multiple settings at once. SkPaint::kAntiAlias_Flag 0x0001 -mask for setting Anti-alias +mask for setting Anti_Alias SkPaint::kDither_Flag @@ -1634,9 +1634,9 @@ paint.isDither() --- -## Anti-alias +## Anti Alias -Anti-alias drawing approximates partial pixel coverage with transparency. +Anti Alias drawing approximates partial pixel coverage with transparency. If kAntiAlias Flag is clear, pixel centers contained by the shape edge are drawn opaque. If kAntiAlias Flag is set, pixels are drawn with Color Alpha equal to their coverage. @@ -1646,14 +1646,14 @@ passing through the pixel center may, but is not required to, draw the pixel. Raster Engine draws Aliased pixels whose centers are on or to the right of the start of an active Path edge, and whose center is to the left of the end of the active Path edge. -A platform may only support Anti-aliased drawing. Some GPU-backed platforms use -Supersampling to Anti-alias all drawing, and have no mechanism to selectively +A platform may only support Anti Aliased drawing. Some GPU-backed platforms use +Supersampling to Anti Alias all drawing, and have no mechanism to selectively Alias. -The amount of coverage computed for Anti-aliased pixels also varies across platforms. +The amount of coverage computed for Anti Aliased pixels also varies across platforms. -Anti-alias is disabled by default. -Anti-alias can be enabled by default by setting SkPaintDefaults Flags to kAntiAlias Flag +Anti Alias is disabled by default. +Anti Alias can be enabled by default by setting SkPaintDefaults Flags to kAntiAlias Flag at compile time. ### Example @@ -1829,17 +1829,17 @@ paint1 == paint2 ### See Also -Gradient Color RGB-565 +Gradient kRGB_565_SkColorType ## Device Text LCD Text and Subpixel Text increase the precision of glyph position. -When set, Flags kLCDRenderText Flag takes advantage of the organization of Color RGB stripes that +When set, Flags kLCDRenderText Flag takes advantage of the organization of RGB stripes that create a color, and relies on the small size of the stripe and visual perception to make the color fringing imperceptible. LCD Text can be enabled on devices that orient stripes horizontally or vertically, and that order -the color components as Color RGB or Color RBG. +the color components as RGB or BGR. Flags kSubpixelText Flag uses the pixel transparency to represent a fractional offset. As the opaqueness @@ -1989,11 +1989,11 @@ paint1 == paint2 ## LCD Text -When set, Flags kLCDRenderText Flag takes advantage of the organization of Color RGB stripes that +When set, Flags kLCDRenderText Flag takes advantage of the organization of RGB stripes that create a color, and relies on the small size of the stripe and visual perception to make the color fringing imperceptible. LCD Text can be enabled on devices that orient stripes horizontally or vertically, and that order -the color components as Color RGB or Color RBG. +the color components as RGB or BGR. ## isLCDRenderText @@ -2544,22 +2544,22 @@ kHigh_SkFilterQuality == paint.getFilterQuality() | name | description | | --- | --- | -| getColor | returns Color Alpha and Color RGB, one drawing color | -| setColor | sets Color Alpha and Color RGB, one drawing color | +| getColor | returns Color Alpha and RGB, one drawing color | +| setColor | sets Color Alpha and RGB, one drawing color | -Color specifies the Color RGB Red, Color RGB Blue, Color RGB Green, and Color Alpha +Color specifies the red, blue, green, and Color Alpha values used to draw a filled or stroked shape in a 32-bit value. Each component occupies 8-bits, ranging from zero: no contribution; to 255: full intensity. All values in any combination are valid. Color is not Premultiplied; Color Alpha sets the transparency independent of -Color RGB: Color RGB Red, Color RGB Blue, and Color RGB Green. +RGB: red, blue, and green. -The bit positions of Color Alpha and Color RGB are independent of the bit +The bit positions of Color Alpha and RGB are independent of the bit positions on the output device, which may have more or fewer bits, and may have a different arrangement. -| bit positions | Color Alpha | Color RGB Red | Color RGB Blue | Color RGB Green | +| bit positions | Color Alpha | red | blue | green | | --- | --- | --- | --- | --- | | | 31 - 24 | 23 - 16 | 15 - 8 | 7 - 0 | @@ -2574,13 +2574,13 @@ a different arrangement. SkColor getColor() const
-Retrieves Alpha and Color RGB, Unpremultiplied, packed into 32 bits. +Retrieves Alpha and RGB, Unpremultiplied, packed into 32 bits. Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract a color component. ### Return Value -Unpremultiplied Color ARGB +Unpremultiplied ARGB ### Example @@ -2607,13 +2607,13 @@ Yellow is 100% red, 100% green, and 0% blue. void setColor(SkColor color)
-Sets Alpha and Color RGB used when stroking and filling. The color is a 32-bit value, -Unpremultiplied, packing 8-bit components for Alpha, Red, Blue, and Green. +Sets Alpha and RGB used when stroking and filling. The color is a 32-bit value, +Unpremultiplied, packing 8-bit components for Alpha, red, blue, and green. ### Parameters - +
colorUnpremultiplied Color ARGBUnpremultiplied ARGB
@@ -2637,7 +2637,7 @@ green1 == green2 ## Alpha Methods -Color Alpha sets the transparency independent of Color RGB: Color RGB Red, Color RGB Blue, and Color RGB Green. +Color Alpha sets the transparency independent of RGB: red, blue, and green. ## getAlpha @@ -2673,7 +2673,7 @@ Retrieves Alpha from the setAlpha(U8CPU a)
-Replaces Alpha, leaving Color RGB +Replaces Alpha, leaving RGB unchanged. An out of range value triggers an assert in the debug build. a is a value from zero to 255. a set to zero makes Color fully transparent; a set to 255 makes Color @@ -2708,7 +2708,7 @@ void setARGB(U8CPU Sets Color used when drawing solid fills. The color components range from 0 to 255. -The color is Unpremultiplied; Alpha sets the transparency independent of Color RGB. +The color is Unpremultiplied; Alpha sets the transparency independent of RGB. ### Parameters @@ -2716,13 +2716,13 @@ The color is Unpremultiplied; Color Alpha, from fully transparent (0) to fully opaque (255) r - amount of Color RGB Red, from no red (0) to full red (255) + amount of red, from no red (0) to full red (255) g - amount of Color RGB Green, from no green (0) to full green (255) + amount of green, from no green (0) to full green (255) b - amount of Color RGB Blue, from no blue (0) to full blue (255) + amount of blue, from no blue (0) to full blue (255) diff --git a/site/user/api/SkPoint_Reference.md b/site/user/api/SkPoint_Reference.md index 064bfd8068..a8145ed038 100644 --- a/site/user/api/SkPoint_Reference.md +++ b/site/user/api/SkPoint_Reference.md @@ -1738,7 +1738,7 @@ product of input magnitudes and cosine of the angle between them ## Vector -# Typedef SkVector +## Typedef SkVector
     typedef SkPoint SkVector;
diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md
index 0f38d735cf..559291e944 100644
--- a/site/user/api/SkSurface_Reference.md
+++ b/site/user/api/SkSurface_Reference.md
@@ -1849,7 +1849,7 @@ converting to Surface colorType() and 
 
 ### Example
 
-
+
### See Also @@ -1887,7 +1887,7 @@ converting to
Surface colorType() and ### Example -
+
### See Also diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index 7e6f3599df..698aed4ded 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -573,6 +573,48 @@ "file": "SkCanvas_Reference", "name": "SkCanvas::restoreToCount", "stdout": "depth = 1\\ndepth = 3\\ndepth = 1\\n" + }, + "SkColor4f_FromColor": { + "code": "void draw(SkCanvas* canvas) {\n uint8_t red = 77, green = 101, blue = 153, alpha = 43;\n SkColor argb = SkColorSetARGB(alpha, red, green, blue);\n SkColor4f color4f = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color4f.fR, color4f.fG, color4f.fB, color4f.fA);\n SkColor fromColor4f = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(fromColor4f),\n SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));\n}", + "hash": "33b029064e8d1928e42a587c953d0e4e", + "file": "SkColor4f_Reference", + "name": "SkColor4f::FromColor", + "stdout": "red=0.0742136 green=0.130136 blue=0.318547 alpha=0.168627\\nred=77 green=101 blue=153 alpha=43\\n" + }, + "SkColor4f_equal1_operator": { + "code": "void draw(SkCanvas* canvas) {\n SkColor4f colorRed = { 1, 0, 0, 1 };\n SkColor4f colorNamedRed = SkColor4f::FromColor(SK_ColorRED);\n SkDebugf(\"colorRed %c= colorNamedRed\", colorRed == colorNamedRed ? '=' : '!');\n}", + "hash": "e5b34bcb7f80f2ed890cdacaa059db0d", + "file": "SkColor4f_Reference", + "name": "SkColor4f::operator==(const SkColor4f& other)_const", + "stdout": "colorRed == colorNamedRed" + }, + "SkColor4f_notequal1_operator": { + "code": "void draw(SkCanvas* canvas) {\n SkColor4f colorGray = { .5, .5, .5, 1 };\n SkColor4f colorNamedGray = SkColor4f::FromColor(SK_ColorGRAY);\n SkDebugf(\"colorGray %c= colorNamedGray \", colorGray != colorNamedGray ? '!' : '=');\n}", + "hash": "82f1a9b4c2b27aa547061786d1f33dab", + "file": "SkColor4f_Reference", + "name": "SkColor4f::operator!=(const SkColor4f& other)_const", + "stdout": "colorGray != colorNamedGray" + }, + "SkColor4f_toSkColor": { + "code": "void draw(SkCanvas* canvas) {\n float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;\n SkColor4f color4f = { red, green, blue, alpha };\n SkColor argb = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(argb),\n SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));\n SkColor4f fromSkColor = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", fromSkColor.fR, fromSkColor.fG,\n fromSkColor.fB, fromSkColor.fA);\n}", + "hash": "edc5fd18d961f7607d2bcbf7f7d427e5", + "file": "SkColor4f_Reference", + "name": "SkColor4f::toSkColor", + "stdout": "red=75 green=101 blue=153 alpha=43\\nred=0.0703601 green=0.130136 blue=0.318547 alpha=0.168627\\n" + }, + "SkColor4f_vec": { + "code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n const float* array = color.vec();\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}", + "hash": "229057023515224358a36acf15508cf6", + "file": "SkColor4f_Reference", + "name": "SkColor4f::vec()", + "stdout": "red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333\\n[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=0.533333\\n" + }, + "SkColor4f_vec_2": { + "code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n float* array = color.vec();\n array[3] = 1;\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}", + "hash": "7420bf0a7cae5c6577c4c4a4613e7e7e", + "file": "SkColor4f_Reference", + "name": "SkColor4f::vec_2", + "stdout": "red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333\\n[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=1\\n" }, "SkIPoint_Make": { "code": "void draw(SkCanvas* canvas) {\n SkIPoint pt1 = {45, 66};\n SkIPoint pt2 = SkIPoint::Make(45, 66);\n SkDebugf(\"pt1 %c= pt2\\n\", pt1 == pt2 ? '=' : '!');\n}", @@ -3289,7 +3331,7 @@ "code": "void draw(SkCanvas* canvas) {\n std::vector srcPixels;\n constexpr int width = 256;\n constexpr int height = 256;\n srcPixels.resize(width * height);\n SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);\n SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());\n pixmap.erase(SK_ColorTRANSPARENT);\n pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );\n pixmap.erase(SK_ColorTRANSPARENT, { 48, 48, 168, 168 } );\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 48, 48);\n}", "width": 256, "height": 256, - "hash": "cfda8cd3b435bb28e2f4b9c7f15603a6", + "hash": "9ca1e2a5b9b4c92ecf4409d0813867d6", "file": "SkColor_Reference", "name": "Color_Constants_Transparent" }, @@ -3477,13 +3519,13 @@ "file": "SkMatrix_Reference", "name": "MemberIndex" }, - "Paint_Anti_alias": { + "Paint_Anti_Alias": { "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocN32Pixels(50, 50);\n SkCanvas offscreen(bitmap);\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(10);\n for (bool antialias : { false, true }) {\n paint.setColor(antialias ? SK_ColorRED : SK_ColorBLUE);\n paint.setAntiAlias(antialias);\n bitmap.eraseColor(0);\n offscreen.drawLine(5, 5, 15, 30, paint);\n canvas->drawLine(5, 5, 15, 30, paint);\n canvas->save();\n canvas->scale(10, 10);\n canvas->drawBitmap(bitmap, antialias ? 12 : 0, 0);\n canvas->restore();\n canvas->translate(15, 0);\n }\n}\n", "width": 512, "height": 256, "hash": "a6575a49467ce8d28bb01cc7638fa04d", "file": "SkPaint_Reference", - "name": "Anti-alias" + "name": "Anti_Alias" }, "Paint_Blend_Mode_Methods": { "code": "void draw(SkCanvas* canvas) {\n SkPaint normal, blender;\n normal.setColor(0xFF58a889);\n blender.setColor(0xFF8958a8);\n canvas->clear(0);\n for (SkBlendMode m : { SkBlendMode::kSrcOver, SkBlendMode::kSrcIn, SkBlendMode::kSrcOut } ) {\n normal.setBlendMode(SkBlendMode::kSrcOver);\n canvas->drawOval(SkRect::MakeXYWH(30, 30, 30, 80), normal);\n blender.setBlendMode(m);\n canvas->drawOval(SkRect::MakeXYWH(10, 50, 80, 30), blender);\n canvas->translate(70, 70);\n }\n}\n", @@ -4656,8 +4698,8 @@ "SkCanvas_drawString": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n canvas->drawString(\"a small hello\", 20, 20, paint);\n}", "width": 256, - "height": 256, - "hash": "65cc4b15cd1a8d067eb1dbfd7e2c17dd", + "height": 48, + "hash": "85442cf8d0bce6b5a777853bc36a4dc4", "file": "SkCanvas_Reference", "name": "SkCanvas::drawString" }, @@ -4868,108 +4910,60 @@ "hash": "8b128e067881f9251357653692fa28da", "file": "SkCanvas_Reference", "name": "SkCanvas::writePixels_2" -}, - "SkColor4f_FromColor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::FromColor" }, "SkColor4f_Pin": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { SkColor4f::Pin(1.5, 0.45f, 0.0, 1), \n SkColor4f::Pin(1, 0.45f, -0.25, 1),\n {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 40, + "hash": "c989cf16c7f8849874eb008cd701af76", "file": "SkColor4f_Reference", "name": "SkColor4f::Pin" -}, - "SkColor4f_equal1_operator": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::operator==(const SkColor4f& other)_const" -}, - "SkColor4f_notequal1_operator": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::operator!=(const SkColor4f& other)_const" }, "SkColor4f_pin": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n pixmap.erase(color4f.pin(), &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 40, + "hash": "9e349862c5189a44d2acef5da24f2e79", "file": "SkColor4f_Reference", "name": "SkColor4f::pin()" -}, - "SkColor4f_toSkColor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::toSkColor" -}, - "SkColor4f_vec": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::vec()" -}, - "SkColor4f_vec_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::vec_2" }, "SkColorGetA": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setColor(SK_ColorRED);\n for (int alpha = 255; alpha >= 0; alpha -= 17) {\n paint.setAlpha(alpha);\n canvas->drawRect({5, 5, 100, 20}, paint);\n SkAlpha alphaInPaint = SkColorGetA(paint.getColor());\n canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);\n canvas->translate(0, 15);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "896ce0316b489608a95af5439ca2aab1", "file": "SkColor_Reference", "name": "SkColorGetA" }, "SkColorGetB": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n SkPaint bgPaint;\n bgPaint.setColor(0xafffffff);\n canvas->drawRect({20, 50, 80, 70}, bgPaint);\n uint8_t blue = SkColorGetB(source.getColor(168, 170));\n canvas->drawString(std::to_string(blue).c_str(), 40, 65, SkPaint());\n canvas->drawLine(80, 70, 168, 170, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "9ee27675284faea375611dc88123a2c5", "file": "SkColor_Reference", "name": "SkColorGetB" }, "SkColorGetG": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n SkPaint bgPaint;\n bgPaint.setColor(0xafffffff);\n canvas->drawRect({20, 50, 80, 70}, bgPaint);\n uint8_t green = SkColorGetG(source.getColor(57, 192));\n canvas->drawString(std::to_string(green).c_str(), 40, 65, SkPaint());\n canvas->drawLine(80, 70, 57, 192, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "535d38b2c019299d915170f7b03d5fea", "file": "SkColor_Reference", "name": "SkColorGetG" }, "SkColorGetR": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n SkPaint bgPaint;\n bgPaint.setColor(0xafffffff);\n canvas->drawRect({20, 50, 80, 70}, bgPaint);\n uint8_t red = SkColorGetR(source.getColor(226, 128));\n canvas->drawString(std::to_string(red).c_str(), 40, 65, SkPaint());\n canvas->drawLine(80, 70, 226, 128, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "d6da38577f189eaa6d9df75f6c3ed252", "file": "SkColor_Reference", "name": "SkColorGetR" }, "SkColorSetA": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; y += 16) {\n for (int x = 0; x < 256; x += 16) {\n SkColor color = source.getColor(x + 8, y + 8);\n SkPaint paint;\n paint.setColor(SkColorSetA(color, x + y));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 16, 16), paint);\n }\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "18f6f376f771f5ffa56d5e5b2ebd20fb", "file": "SkColor_Reference", "name": "SkColorSetA" }, @@ -4990,10 +4984,10 @@ "name": "SkColorSetRGB" }, "SkColorToHSV": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; ++y) {\n for (int x = 0; x < 256; ++x) {\n SkScalar hsv[3];\n SkColorToHSV(source.getColor(x, y), hsv);\n SkTSwap(hsv[1], hsv[2]);\n SkPaint paint;\n paint.setColor(SkHSVToColor(hsv));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);\n }\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "7d7e427e2b181c651abad5732bc46cf7", "file": "SkColor_Reference", "name": "SkColorToHSV" }, @@ -5022,18 +5016,18 @@ "name": "SkColorTypeValidateAlphaType" }, "SkHSVToColor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; ++y) {\n for (int x = 0; x < 256; ++x) {\n SkColor color = source.getColor(x, y);\n SkScalar hsv[3];\n SkColorToHSV(color, hsv);\n hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;\n SkPaint paint;\n paint.setColor(SkHSVToColor(x + y, hsv));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);\n }\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "311a59931ac340b90f202cd6ac399a0a", "file": "SkColor_Reference", "name": "SkHSVToColor" }, "SkHSVToColor_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n for (int y = 0; y < 256; ++y) {\n for (int x = 0; x < 256; ++x) {\n SkColor color = source.getColor(x, y);\n SkScalar hsv[3];\n SkColorToHSV(color, hsv);\n hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;\n SkPaint paint;\n paint.setColor(SkHSVToColor(hsv));\n canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);\n }\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "d355a17547908cdbc2c38720974b5d11", "file": "SkColor_Reference", "name": "SkHSVToColor_2" }, @@ -5326,10 +5320,10 @@ "name": "SkImage::MakeRasterData" }, "SkImage_alphaType": { - "code": "void draw(SkCanvas* canvas) {\n const char* alphaTypeStr[] = { \"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\" };\n SkAlphaType alphaType = image->alphaType();\n canvas->drawImage(image, 16, 0);\n SkPaint paint;\n canvas->drawString(alphaTypeStr[(int) alphaType], 20, image->height() + 20, paint);\n}", + "code": "void draw(SkCanvas* canvas) {\n const char* alphaTypeStr[] = { \"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\" };\n SkAlphaType alphaType = image->alphaType();\n canvas->drawImage(image, 16, 0);\n canvas->drawString(alphaTypeStr[(int) alphaType], 20, image->height() + 20, SkPaint());\n}", "width": 256, "height": 96, - "hash": "dac1403132a42459d6881585efbfe74b", + "hash": "1b9f1f05026ceb14ccb6926a13cdaa83", "file": "SkImage_Reference", "name": "SkImage::alphaType" }, @@ -5358,10 +5352,10 @@ "name": "SkImage::colorSpace" }, "SkImage_colorType": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n const char* colors[] = { \"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\" };\n SkColorType colorType = image->colorType();\n canvas->drawImage(image, 16, 0);\n canvas->drawString(colors[(int) colorType], 20, image->height() + 20, SkPaint());\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 96, + "hash": "50396fad4a128f58e400ca00fe09711f", "file": "SkImage_Reference", "name": "SkImage::colorType" }, @@ -7150,26 +7144,26 @@ "name": "SkPoint::operator-=(const SkVector& v)" }, "SkPreMultiplyARGB": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "code": "void draw(SkCanvas* canvas) {\n SkPMColor premultiplied = SkPreMultiplyARGB(160, 128, 160, 192);\n canvas->drawString(\"Unpremultiplied:\", 20, 20, SkPaint());\n canvas->drawString(\"alpha=160 red=128 green=160 blue=192\", 20, 40, SkPaint());\n canvas->drawString(\"Premultiplied:\", 20, 80, SkPaint());\n std::string str = \"alpha=\" + std::to_string(SkColorGetA(premultiplied));\n str += \" red=\" + std::to_string(SkColorGetR(premultiplied));\n str += \" green=\" + std::to_string(SkColorGetG(premultiplied));\n str += \" blue=\" + std::to_string(SkColorGetB(premultiplied));\n canvas->drawString(str.c_str(), 20, 100, SkPaint());\n}", + "width": 300, + "height": 128, + "hash": "756345484fd48ca0ea7b6cec350f73b8", "file": "SkColor_Reference", "name": "SkPreMultiplyARGB" }, "SkPreMultiplyColor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "code": "void draw(SkCanvas* canvas) {\n SkColor unpremultiplied = SkColorSetARGB(160, 128, 160, 192);\n SkPMColor premultiplied = SkPreMultiplyColor(unpremultiplied);\n canvas->drawString(\"Unpremultiplied:\", 20, 20, SkPaint());\n std::string str = \"alpha=\" + std::to_string(SkColorGetA(unpremultiplied));\n str += \" red=\" + std::to_string(SkColorGetR(unpremultiplied));\n str += \" green=\" + std::to_string(SkColorGetG(unpremultiplied));\n str += \" blue=\" + std::to_string(SkColorGetB(unpremultiplied));\n canvas->drawString(str.c_str(), 20, 40, SkPaint());\n canvas->drawString(\"Premultiplied:\", 20, 80, SkPaint());\n str = \"alpha=\" + std::to_string(SkColorGetA(premultiplied));\n str += \" red=\" + std::to_string(SkColorGetR(premultiplied));\n str += \" green=\" + std::to_string(SkColorGetG(premultiplied));\n str += \" blue=\" + std::to_string(SkColorGetB(premultiplied));\n canvas->drawString(str.c_str(), 20, 100, SkPaint());\n}", + "width": 300, + "height": 128, + "hash": "0bcc0f86a2aefc899f3500503dce6968", "file": "SkColor_Reference", "name": "SkPreMultiplyColor" }, "SkRGBToHSV": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n SkPaint bgPaint;\n bgPaint.setColor(0xafffffff);\n canvas->drawRect({20, 30, 110, 90}, bgPaint);\n SkScalar hsv[3];\n SkColor c = source.getColor(226, 128);\n SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);\n canvas->drawString((\"h: \" + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());\n canvas->drawString((\"s: \" + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());\n canvas->drawString((\"v: \" + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());\n canvas->drawLine(110, 90, 226, 128, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "4fb2da4a3d9b14ca4ac24eefb0f5126a", "file": "SkColor_Reference", "name": "SkRGBToHSV" }, @@ -7302,18 +7296,18 @@ "name": "SkSurface::readPixels_3" }, "SkSurface_writePixels": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n sk_sp surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorRED);\n SkPaint paint;\n paint.setTextSize(40);\n surfCanvas->drawString(\"&\", 16, 40, paint);\n SkPixmap pixmap;\n if (surf->peekPixels(&pixmap)) {\n surf->writePixels(pixmap, 25, 25);\n sk_sp image(surf->makeImageSnapshot());\n canvas->drawImage(image, 0, 0);\n }\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 96, + "hash": "760793bcf0ef193fa61ea03e6e8fc825", "file": "SkSurface_Reference", "name": "SkSurface::writePixels" }, "SkSurface_writePixels_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n sk_sp surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorGREEN);\n surf->writePixels(source, 25, 25);\n sk_sp image(surf->makeImageSnapshot());\n canvas->drawImage(image, 0, 0);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 96, + "hash": "d77790dd3bc9f678fa4f582347fb8fba", "file": "SkSurface_Reference", "name": "SkSurface::writePixels_2" } diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index b4f83bd4b4..a3034eb73f 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -504,7 +504,7 @@ void
setImmutable() # Class SkRasterHandleAllocator -# Typedef SkRasterHandleAllocator::Handle +## Typedef SkRasterHandleAllocator::Handle # Struct SkRasterHandleAllocator::Rec @@ -579,7 +579,7 @@ void dumpHex() const # Scalar -# Typedef SkScalar +## Typedef SkScalar # Shader -- cgit v1.2.3