From 2d4bf5f288d91f8d2371c7a970bdfa70dacdd78a Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 16 Apr 2018 08:37:38 -0400 Subject: document SkColor.h SkColor.h uses #define liberally, and has many global symbols, two things bookmaker hasn't seen in other includes. Revised .h -> .bmh converter to work with SkColor.h as well as updating how .bmh indices are built. Generated SkColor_Reference.bmh for globals, and SkColor4f_Reference.bmh for class. Other than the existing comments, this doesn't update the documentation or add new examples. Docs-Preview: https://skia.org/?cl=118985 TBR=caryclark@google.com Bug: skia:6898 Change-Id: I5978257ee0e51319823efbe8dfc467a08c99ffe0 Reviewed-on: https://skia-review.googlesource.com/118985 Commit-Queue: Cary Clark Reviewed-by: Cary Clark --- site/user/api/SkBitmap_Reference.md | 100 ++--- site/user/api/SkCanvas_Reference.md | 117 +++--- site/user/api/SkColor4f_Reference.md | 268 +++++++++++++ site/user/api/SkColor_Reference.md | 681 +++++++++++++++++++++++++++++++++ site/user/api/SkImageInfo_Reference.md | 82 ++-- site/user/api/SkImage_Reference.md | 7 +- site/user/api/SkPaint_Reference.md | 110 +++--- site/user/api/SkPixmap_Reference.md | 36 +- site/user/api/SkSurface_Reference.md | 52 +-- site/user/api/catalog.htm | 296 +++++++++++++- site/user/api/undocumented.md | 97 ----- 11 files changed, 1468 insertions(+), 378 deletions(-) create mode 100644 site/user/api/SkColor4f_Reference.md create mode 100644 site/user/api/SkColor_Reference.md (limited to 'site') diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 9c9f7ecf8d..601ab104b6 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -50,7 +50,7 @@ is useful to position one or more Bitmaps within a shared | name | description | | --- | --- | | Allocate | allocates storage for pixels | -| Draw | set pixels to Color | +| Draw | set pixels to Color | | Pixels | read and write pixel values | | Property | metrics and attributes | | Row Bytes | interval from one row to the next | @@ -77,7 +77,7 @@ is useful to position one or more Bitmaps within a shared | SkBitmap() | constructs with default values | | SkBitmap(SkBitmap&& src) | takes ownership of pixels | | SkBitmap(const SkBitmap& src) | shares ownership of pixels | -| extractAlpha | creates Bitmap containing Alpha of pixels | +| extractAlpha | creates Bitmap containing Alpha of pixels | | | extractAlpha(SkBitmap* dst) const | | | extractAlpha(SkBitmap* dst, const SkPaint* paint, SkIPoint* offset) const | | | extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator, SkIPoint* offset) const | @@ -97,7 +97,7 @@ is useful to position one or more Bitmaps within a shared | name | description | | --- | --- | | ComputeIsOpaque | returns true if all pixels are opaque | -| allocN32Pixels | allocates compatible Color ARGB pixels, or aborts | +| allocN32Pixels | allocates compatible Color ARGB pixels, or aborts | | allocPixels | allocates pixels from Image Info, or aborts | | allocPixelsFlags | allocates pixels from Image Info with options, or aborts | | alphaType | returns Image Info Alpha Type | @@ -109,17 +109,17 @@ is useful to position one or more Bitmaps within a shared | dimensions | returns width and height | | drawsNothing | returns true if no width, no height, or no Pixel Ref | | empty | returns true if Image Info has zero width or height | -| erase | writes Color to rectangle of pixels | -| eraseARGB | writes Color to pixels | -| eraseColor | writes Color to pixels | -| extractAlpha | creates Bitmap containing Alpha of pixels | +| erase | writes Color to rectangle of pixels | +| eraseARGB | writes Color to pixels | +| eraseColor | writes Color to pixels | +| extractAlpha | creates Bitmap containing Alpha of pixels | | extractSubset | creates Bitmap, sharing pixels if possible | | getAddr | returns readable pixel address as void pointer | | getAddr16 | returns readable pixel address as 16-bit pointer | | getAddr32 | returns readable pixel address as 32-bit pointer | | getAddr8 | returns readable pixel address as 8-bit pointer | | getBounds | returns width and height as Rectangle | -| getColor | returns one pixel as Unpremultiplied Color | +| getColor | returns one pixel as Unpremultiplied Color | | getGenerationID | returns unique ID | | getPixels | returns address of pixels | | getSubset | returns bounds offset by origin | @@ -152,7 +152,7 @@ is useful to position one or more Bitmaps within a shared | shiftPerPixel | returns bit shift from pixels to bytes | | swap | exchanges Bitmap pair | | toString | converts Bitmap to machine readable form | -| tryAllocN32Pixels | allocates compatible Color ARGB pixels if possible | +| tryAllocN32Pixels | allocates compatible Color ARGB pixels if possible | | tryAllocPixels | allocates pixels from Image Info if possible | | tryAllocPixelsFlags | allocates pixels from Image Info with options if possible | | validate | asserts if Bitmap is invalid (debug only) | @@ -525,7 +525,7 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT | getBounds | returns width and height as Rectangle | | | getBounds(SkRect* bounds) const | | | getBounds(SkIRect* bounds) const | -| getColor | returns one pixel as Unpremultiplied Color | +| getColor | returns one pixel as Unpremultiplied Color | | getPixels | returns address of pixels | | getSubset | returns bounds offset by origin | | hasHardwareMipMap | returns Mip_Map support present; Android only | @@ -1290,10 +1290,10 @@ bool isOpaque() const Returns true if Alpha Type is set to hint that all pixels are opaque; their -Color Alpha value is implicitly or explicitly 1.0. If true, and all pixels are +Color Alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly. -Does not check if Color Type allows Alpha, or if any pixel value has +Does not check if Color Type allows Alpha, or if any pixel value has transparency. ### Return Value @@ -1431,15 +1431,15 @@ static bool ComputeIsOpaque(const SkBitmap& bm) Returns true if all pixels are opaque. Color Type determines how pixels -are encoded, and whether pixel describes Alpha. Returns true for Color Types +are encoded, and whether pixel describes Alpha. Returns true for Color Types without alpha in each pixel; for other Color Types, returns true if all pixels have alpha values equivalent to 1.0 or greater. For Color Types kRGB_565_SkColorType or kGray_8_SkColorType: always returns true. For Color Types kAlpha_8_SkColorType, kBGRA_8888_SkColorType, -kRGBA_8888_SkColorType: returns true if all pixel Alpha values are 255. -For Color Type kARGB_4444_SkColorType: returns true if all pixel Alpha values are 15. -For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or +kRGBA_8888_SkColorType: returns true if all pixel Alpha values are 255. +For Color Type kARGB_4444_SkColorType: returns true if all pixel Alpha values are 15. +For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or greater. Returns false for kUnknown_SkColorType. @@ -1472,7 +1472,7 @@ computeIsOpaque: true ### See Also -isOpaque Color Type Alpha +isOpaque Color Type Alpha --- @@ -1691,7 +1691,7 @@ true if Image Info set successful | name | description | | --- | --- | -| allocN32Pixels | allocates compatible Color ARGB pixels, or aborts | +| allocN32Pixels | allocates compatible Color ARGB pixels, or aborts | | allocPixels | allocates pixels from Image Info, or aborts | | | allocPixels(const SkImageInfo& info, size t rowBytes) | | | allocPixels(const SkImageInfo& info) | @@ -1702,7 +1702,7 @@ true if Image Info set successful | | installPixels(const SkImageInfo& info, void* pixels, size t rowBytes, void (*releaseProc) (void* addr, void* context) , void* context) | | | installPixels(const SkImageInfo& info, void* pixels, size t rowBytes) | | | installPixels(const SkPixmap& pixmap) | -| tryAllocN32Pixels | allocates compatible Color ARGB pixels if possible | +| tryAllocN32Pixels | allocates compatible Color ARGB pixels if possible | | tryAllocPixels | allocates pixels from Image Info if possible | | | tryAllocPixels(const SkImageInfo& info, size t rowBytes) | | | tryAllocPixels(const SkImageInfo& info) | @@ -1730,7 +1730,7 @@ implementation of malloc(), if fla kZeroPixels AllocFlag. flags set to kZeroPixels AllocFlag offers equal or better performance than -subsequently calling eraseColor with SK ColorTRANSPARENT. +subsequently calling eraseColor with SK ColorTRANSPARENT. ### Parameters @@ -1785,7 +1785,7 @@ implementation of malloc(), if flags< kZeroPixels AllocFlag. flags set to kZeroPixels AllocFlag offers equal or better performance than -subsequently calling eraseColor with SK ColorTRANSPARENT. +subsequently calling eraseColor with SK ColorTRANSPARENT. ### Parameters @@ -1978,7 +1978,7 @@ or height is negative. Returns false if allocation fails. -Use to create Bitmap that matches SkPMColor, the native pixel arrangement on +Use to create Bitmap that matches SkPMColor, the native pixel arrangement on the platform. Bitmap drawn to output device skips converting its pixel format. ### Parameters @@ -2021,7 +2021,7 @@ Aborts if width exceeds 29 bits or is negative, or height is negative, or allocation fails. Abort steps may be provided by the user at compile time by defining SK_ABORT. -Use to create Bitmap that matches SkPMColor, the native pixel arrangement on +Use to create Bitmap that matches SkPMColor, the native pixel arrangement on the platform. Bitmap drawn to output device skips converting its pixel format. ### Parameters @@ -2569,9 +2569,9 @@ Marks that pixels in Pixel Ref have changed | name | description | | --- | --- | -| erase | writes Color to rectangle of pixels | -| eraseARGB | writes Color to pixels | -| eraseColor | writes Color to pixels | +| erase | writes Color to rectangle of pixels | +| eraseARGB | writes Color to pixels | +| eraseColor | writes Color to pixels | ## eraseColor @@ -2581,14 +2581,14 @@ void eraseColor(SkColor c) const Replaces pixel values with 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. +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. ### Parameters +UnpremultipliedColor
c -Unpremultiplied Color
@@ -2609,7 +2609,7 @@ then Color RGB is ignored. void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const -Replaces pixel values with Unpremultiplied Color built from a, r, g, and b. +Replaces pixel values with Unpremultiplied Color built from a, r, g, and b. All pixels contained by bounds are affected. If the colorType is kGray_8_SkColorType or k565_SkColorType, then a is ignored; r, g, and b are treated as opaque. If colorType is kAlpha_8_SkColorType, @@ -2618,13 +2618,13 @@ then r, g a -amount of Color Alpha, from fully transparent (0) to fully opaque (255) +amount 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 Color RGB 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 Color RGB 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 Color RGB Blue, from no blue (0) to full blue (255) @@ -2657,14 +2657,14 @@ void erase(SkColor c, const SkIRect& area) const Replaces pixel values inside area with c. If area does not intersect bounds, call has no effect. -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. +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. ### Parameters +UnpremultipliedColor @@ -2696,16 +2696,16 @@ void eraseArea(const SkIRect& area, SkColor c) const SkColor getColor(int x, int y) const -Returns pixel at (x, y) as UnpremultipliedColor. -Returns black with Alpha if Color Type is kAlpha_8_SkColorType. +Returns pixel at (x, y) as UnpremultipliedColor. +Returns black with Alpha if Color Type is kAlpha_8_SkColorType. Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if SK_RELEASE is defined. Fails if Color Type is kUnknown_SkColorType or pixel address is nullptr. -Color Space in Image Info is ignored. Some Color precision may be lost in the -conversion to UnpremultipliedColor; original pixel data may have additional +Color Space in Image Info is ignored. Some Color precision may be lost in the +conversion to UnpremultipliedColor; original pixel data may have additional precision. ### Parameters @@ -2719,7 +2719,7 @@ row index, zero or greater, and less than height< ### Return Value -pixel converted to UnpremultipliedColor +pixel converted to UnpremultipliedColor ### Example @@ -3448,7 +3448,7 @@ sets state bool extractAlpha(SkBitmap* dst) const -Sets dst to Alpha described by pixels. Returns false if dst cannot be written to +Sets dst to Alpha described by pixels. Returns false if dst cannot be written to or dst pixels cannot be allocated. Uses HeapAllocator to reserve memory for dstPixel Ref. @@ -3462,7 +3462,7 @@ holds Pixel Ref to fill with alpha layerAlpha layer was constructed in dstPixel Ref +true if Alpha layer was constructed in dstPixel Ref ### Example @@ -3480,7 +3480,7 @@ true if Alpha layer was constructed in -Sets dst to Alpha described by pixels. Returns false if dst cannot be written to +Sets dst to Alpha described by pixels. Returns false if dst cannot be written to or dst pixels cannot be allocated. If paint is not nullptr and contains Mask Filter, SkMaskFilter @@ -3501,7 +3501,7 @@ top-left position for dst; may be nul ### Return Value -true if Alpha layer was constructed in dstPixel Ref +true if Alpha layer was constructed in dstPixel Ref ### Example @@ -3519,7 +3519,7 @@ true if Alpha layer was constructed in -Sets dst to Alpha described by pixels. Returns false if dst cannot be written to +Sets dst to Alpha described by pixels. Returns false if dst cannot be written to or dst pixels cannot be allocated. If paint is not nullptr and contains Mask Filter, SkMaskFilter @@ -3543,7 +3543,7 @@ top-left position for dst; may be nul ### Return Value -true if Alpha layer was constructed in dstPixel Ref +true if Alpha layer was constructed in dstPixel Ref ### Example diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index fe07eca728..a393168962 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -14,6 +14,7 @@ SkCanvas Reference | Constructor | functions that construct SkCanvas | | Member Function | static functions and member methods | | Related Function | similar methods grouped together | +| Typedef | types defined by other types | # Class SkCanvas Canvas provides an interface for drawing, and how the drawing is clipped and transformed. @@ -23,7 +24,7 @@ SkCanvas Reference Each Canvas draw call transforms the geometry of the object by the concatenation of all Matrix values in the stack. The transformed geometry is clipped by the intersection of all of Clip values in the stack. The Canvas draw calls use Paint to supply drawing -state such as Color, Typeface, text size, stroke width, Shader and so on. +state such as Color, Typeface, text size, stroke width, Shader and so on. To draw to a pixel-based destination, create Raster Surface or GPU Surface. Request Canvas from Surface to obtain the interface to draw. @@ -94,7 +95,7 @@ when no Surface is required, and some | accessTopLayerPixels | returns writable pixel access if available | | accessTopRasterHandle | returns context that tracks Clip and Matrix | | androidFramework setDeviceClipRestriction | for use by Android framework | -| clear | fills Clip with Color | +| clear | fills Clip with Color | | clipPath | combines Clip with Path | | clipRRect | combines Clip with Round Rect | | clipRect | combines Clip with Rect | @@ -109,7 +110,7 @@ when no Surface is required, and some | drawBitmapNine | draws Nine PatchBitmap | | drawBitmapRect | draws Bitmap, source Rect to destination Rect | | drawCircle | draws Circle using Clip, Matrix, and Paint | -| drawColor | fills Clip with Color and Blend Mode | +| drawColor | fills Clip with Color and Blend Mode | | drawDRRect | draws double Round Rect stroked or filled | | drawDrawable | draws Drawable, encapsulated drawing commands | | drawIRect | draws IRect using Clip, Matrix, and Paint | @@ -1034,8 +1035,8 @@ The copied quarter circles overdraw the original circle. ### Example
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 +clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580. readPixels converts pixel back to Unpremultiplied value 0x8056A9FF, introducing error.
@@ -1109,8 +1110,8 @@ 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 +
clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580.
@@ -1182,8 +1183,8 @@ 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 +
clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha to generate Premultiplied value 0x802B5580.
@@ -1508,7 +1509,7 @@ is restored, the Bitmap is drawn into th Layer may be initialized with the contents of the previous Layer. When Layer is restored, its Bitmap can be modified by Paint passed to Layer to apply -Color Alpha, Color Filter, Image Filter, and Blend Mode. +Color Alpha, Color Filter, Image Filter, and Blend Mode. ## saveLayer @@ -1529,7 +1530,7 @@ and draws the Bitmap. Rect bounds suggests but does not define the Bitmap size. To clip drawing to a specific rectangle, use clipRect. -Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and +Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and Blend Mode when restore is called. Call restoreToCount with returned value to restore this and subsequent saves. @@ -1577,7 +1578,7 @@ and draws the Bitmap. Rect bounds suggests but does not define the Layer size. To clip drawing to a specific rectangle, use clipRect. -Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and +Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and Blend Mode when restore is called. Call restoreToCount with returned value to restore this and subsequent saves. @@ -1628,7 +1629,7 @@ and draws Layer. Rect bounds suggests but does not define the Layer size. To clip drawing to a specific rectangle, use clipRect. -Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and +Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and Blend Mode when restore is called. Call restoreToCount with returned value to restore this and subsequent saves. @@ -1773,7 +1774,7 @@ a specific rectangle, use clipRect. const SkPaint* fPaint fPaint modifies how Layer overlays the prior Layer; may be nullptr. -Color Alpha, Blend Mode, Color Filter, Draw Looper, Image Filter, and +Color Alpha, Blend Mode, Color Filter, Draw Looper, Image Filter, and Mask Filter affect Layer draw. const SkImageFilter* fBackdrop @@ -1784,7 +1785,7 @@ prior Layer without an const SkImage* fClipMask -restore clips Layer by the Color Alpha channel of fClipMask when +restore clips Layer by the Color Alpha channel of fClipMask when Layer is copied to Device. fClipMask may be nullptr. . const SkMatrix* fClipMatrix @@ -1932,7 +1933,7 @@ SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* ba Not ready for general use. Sets fBounds, fPaint, fBackdrop, fClipMask, fClipMatrix, and fSaveLayerFlags. -clipMatrix uses Color Alpha channel of image, transformed by clipMatrix, to clip +clipMatrix uses Color Alpha channel of image, transformed by clipMatrix, to clip Layer when drawn to Canvas. Implementation is not complete; has no effect if Device is GPU-backed. @@ -1977,7 +1978,7 @@ Saves Matrix, Clip, and Bitmap for subsequent drawing. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and blends Bitmap with Color Alpha opacity onto the prior Layer. +and blends Bitmap with Color Alpha opacity onto the prior Layer. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, @@ -2189,9 +2190,9 @@ amount to skew in y
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 @@ -2957,7 +2958,7 @@ device bounds empty = true | name | description | | --- | --- | -| clear | fills Clip with Color | +| clear | fills Clip with Color | | drawAnnotation | associates a Rect with a key-value pair | | | drawAnnotation(const SkRect& rect, const char key[], SkData* value) | | | drawAnnotation(const SkRect& rect, const char key[], const sk sp<SkData>& value) | @@ -2970,7 +2971,7 @@ device bounds empty = true | drawCircle | draws Circle using Clip, Matrix, and Paint | | | drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint) | | | drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint) | -| drawColor | fills Clip with Color and Blend Mode | +| drawColor | fills Clip with Color and Blend Mode | | drawDRRect | draws double Round Rect stroked or filled | | drawDrawable | draws Drawable, encapsulated drawing commands | | | drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr) | @@ -3009,13 +3010,13 @@ device bounds empty = true void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver) -Fill Clip with Color color. -mode determines how Color ARGB is combined with destination. +Fill Clip with Color color. +mode determines how Color ARGB is combined with destination. ### Parameters
c -Unpremultiplied Color
area rectangle to fill
+UnpremultipliedColor ARGB @@ -3038,13 +3039,13 @@ Fill Clip with Color -Fill Clip with Colorcolor using SkBlendMode::kSrc. +Fill Clip with Colorcolor using SkBlendMode::kSrc. This has the effect of replacing all pixels contained by Clip with color. ### Parameters
color -Unpremultiplied Color ARGB
mode SkBlendMode used to combine source color and destination
+UnpremultipliedColor ARGB
color -Unpremultiplied Color ARGB
@@ -3782,7 +3783,7 @@ void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* Draw Image image, with its top-left corner at (left, top), using Clip, Matrix, and optional Paint paint. -If paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, +If paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just as Shader @@ -3823,7 +3824,7 @@ void drawImage(const sk_sp<SkImage>& image, SkScalar left, SkScalar top, Draw Image image, with its top-left corner at (left, top), using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just as Shader @@ -3912,7 +3913,7 @@ void drawImageRect(const SkImage* image, const SkRect& src, const SkRect& dst, c Draw Rect src of Image image, scaled and translated to fill Rect dst. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -3967,7 +3968,7 @@ Note that isrc is on integer pixel boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4015,7 +4016,7 @@ void drawImageRect(const SkImage* image, const SkRect& dst, const SkPaint* paint Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4061,7 +4062,7 @@ void drawImageRect(const sk_sp<SkImage>& image, const SkRect& src, const S Draw Rect src of Image image, scaled and translated to fill Rect dst. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4112,7 +4113,7 @@ void drawImageRect(const sk_sp<SkImage>& image, const SkIRect& isrc, const isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4160,7 +4161,7 @@ void drawImageRect(const sk_sp<SkImage>& image, const SkRect& dst, const S Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4211,7 +4212,7 @@ are larger than dst; Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4261,7 +4262,7 @@ are larger than dst; Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. @@ -4309,7 +4310,7 @@ void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPai Draw Bitmap bitmap, with its top-left corner at (left, top), using Clip, Matrix, and optional Paint paint. -If Paint paint is not nullptr, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is not nullptr, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4353,7 +4354,7 @@ void drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect& dst Draw Rect src of Bitmap bitmap, scaled and translated to fill Rect dst. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4403,7 +4404,7 @@ void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& d isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4453,7 +4454,7 @@ void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* pa bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4506,7 +4507,7 @@ space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4557,7 +4558,7 @@ and below center to fill the remai int fXCount; int fYCount; const SkIRect* fBounds; - const SkColor* fColors; + const SkColor* fColors; }; @@ -4669,7 +4670,7 @@ dimension. All other grid elements scale to fill the available space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -4726,7 +4727,7 @@ dimension. All other grid elements scale to fill the available space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. -If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. @@ -5319,7 +5320,7 @@ void drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint Draw Picture picture, using Clip and Matrix; transforming picture with -Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, +Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, Image Filter, and Blend Mode, if provided. matrix transformation is equivalent to: save, concat, drawPicture, restore. @@ -5353,7 +5354,7 @@ void drawPicture(const sk_sp<SkPicture>& picture, const SkMatrix* matrix, Draw Picture picture, using Clip and Matrix; transforming picture with -Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, +Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, Image Filter, and Blend Mode, if provided. matrix transformation is equivalent to: save, concat, drawPicture, restore. @@ -5455,15 +5456,15 @@ Draws a Coons_Patch: the interpolation of four Clip and Matrix, paint Shader, Color Filter, -Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated -as Coons_Patch texture; Blend Mode mode combines Color colors and Shader if +Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated +as Coons_Patch texture; Blend Mode mode combines Color colors and Shader if both are provided. Point array cubics specifies four Cubics starting at the top-left corner, in clockwise order, sharing every fourth point. The last Cubic ends at the first point. -Color array color associates colors with corners in top-left, top-right, +Color array color associates colors with corners in top-left, top-right, bottom-right, bottom-left order. If paint contains Shader, Point array texCoords maps Shader as texture to @@ -5474,7 +5475,7 @@ corners in top-left, top-right, bottom-right, bottom-left order. +Color array, one for each corner @@ -5507,15 +5508,15 @@ Draws Cubic Coons_Patch: the interpolation associating a color, and optionally a texture coordinate, with each corner. Coons_Patch uses Clip and Matrix, paintShader, Color Filter, -Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated -as Coons_Patch texture; Blend Mode mode combines Colorcolors and Shader if +Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated +as Coons_Patch texture; Blend Mode mode combines Colorcolors and Shader if both are provided. Point array cubics specifies four Cubics starting at the top-left corner, in clockwise order, sharing every fourth point. The last Cubic ends at the first point. -Color array color associates colors with corners in top-left, top-right, +Color array color associates colors with corners in top-left, top-right, bottom-right, bottom-left order. If paint contains Shader, Point array texCoords maps Shader as texture to @@ -5526,7 +5527,7 @@ corners in top-left, top-right, bottom-right, bottom-left order.
cubics Path Cubic array, sharing common points
colors -Color array, one for each corner
texCoords Point array of texture coordinates, mapping Shader to corners; may be nullptr
+Color array, one for each corner @@ -5560,7 +5561,7 @@ void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[] Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. -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, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -5609,7 +5610,7 @@ void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. -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, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -5657,7 +5658,7 @@ void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[] Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. -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, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -5700,7 +5701,7 @@ void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. -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, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. diff --git a/site/user/api/SkColor4f_Reference.md b/site/user/api/SkColor4f_Reference.md new file mode 100644 index 0000000000..9717ec4781 --- /dev/null +++ b/site/user/api/SkColor4f_Reference.md @@ -0,0 +1,268 @@ +SkColor4f Reference +=== + +# Color4f + +# Struct SkColor4f +The float values are 0...1 unpremultiplied + +## Overview + +## Overview Subtopic + +| name | description | +| --- | --- | +| Member Function | static functions and member methods | +| Member | member values | +| Operator | operator overloading methods | + +## Operator + +| name | description | +| --- | --- | +| operator!=(const SkColor4f& other) const | incomplete | +| operator==(const SkColor4f& other) const | incomplete | + +## Member Function + +| name | description | +| --- | --- | +| FromColor | incomplete | +| Pin | incomplete | +| pin | incomplete | +| premul | incomplete | +| toSkColor | incomplete | +| vec | incomplete | + + float fR + + float fG + + float fB + + float fA + + +## operator== + +
+bool operator==(const SkColor4f& other) _const
+
+ +### Parameters + +
cubics Path Cubic array, sharing common points
colors -Color array, one for each corner
texCoords Point array of texture coordinates, mapping Shader to corners; may be nullptr
+ +
other +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## operator!= + +
+bool operator!=(const SkColor4f& other) _const
+
+ +### Parameters + + + +
other +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## vec + +
+const float* vec() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+float* vec()
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## Pin + +
+static SkColor4f Pin(float r, float g, float b, float a)
+
+ +### Parameters + + + + + + +
r +incomplete
g +incomplete
b +incomplete
a +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## FromColor + +
+static SkColor4f FromColor(SkColor)
+
+ +Convert to SkColor4f, assuming SkColor is sRGB + +### Parameters + + + +
SkColor +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## toSkColor + +
+SkColor toSkColor() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## pin + +
+SkColor4f pin() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## premul + +
+SkPM4f premul() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md new file mode 100644 index 0000000000..42de657ae3 --- /dev/null +++ b/site/user/api/SkColor_Reference.md @@ -0,0 +1,681 @@ +SkColor Reference +=== + +# Color + +## Overview + +## Overview Subtopic + +| name | description | +| --- | --- | + +## Define + +| name | description | +| --- | --- | + +## Function + +| name | description | +| --- | --- | + +## Typedef + +| name | description | +| --- | --- | + +## Alpha + +## RGB + +## RGB Red + +## RGB Blue + +## RGB Green + +## ARGB + +## RBG + +## RGB-565 + +## Gray + +Types and macros for colors +8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent. +32 bit ARGB color value, not premultiplied. The 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. + + +## SkColorSetARGB + +
+static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
+
+ +Return a SkColor value from 8 bit component values + +### Parameters + + + + + + +
a +incomplete
r +incomplete
g +incomplete
b +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + +
+    #define SkColorSetARGBInline SkColorSetARGB
+
+ +Legacy aliases. + +### See Also + +incomplete + +
+    #define SkColorSetARGBMacro  SkColorSetARGB
+
+ +### See Also + +incomplete + +
+    #define SkColorSetRGB(r, g, b)  SkColorSetARGB(0xFF, r, g, b)
+
+ +Return a SkColor value from 8 bit component values, with an implied value +of 0xFF for alpha (fully opaque) + +### Parameters + + + + + +
r +incomplete
g +incomplete
b +incomplete
+ +### Example + +
+ +### See Also + +incomplete + +
+    #define SkColorGetA(color)      (((color) >> 24) & 0xFF)
+
+ +return the alpha byte from a SkColor value + +### Parameters + + + +
color +incomplete
+ +### Example + +
+ +### See Also + +incomplete + +
+    #define SkColorGetR(color)      (((color) >> 16) & 0xFF)
+
+ +return the red byte from a SkColor value + +### Parameters + + + +
color +incomplete
+ +### Example + +
+ +### See Also + +incomplete + +
+    #define SkColorGetG(color)      (((color) >>  8) & 0xFF)
+
+ +return the green byte from a SkColor value + +### Parameters + + + +
color +incomplete
+ +### Example + +
+ +### See Also + +incomplete + +
+    #define SkColorGetB(color)      (((color) >>  0) & 0xFF)
+
+ +return the blue byte from a SkColor value + +### Parameters + + + +
color +incomplete
+ +### Example + +
+ +### See Also + +incomplete + + +## SkColorSetA + +
+static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a)
+
+ +### Parameters + + + + +
c +incomplete
a +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + +
+    #define SK AlphaTRANSPARENT static_cast<SkAlpha>(0x00)
+
+ +common colors +transparent SkAlpha value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK AlphaOPAQUE      static_cast<SkAlpha>(0xFF)
+
+ +opaque SkAlpha value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorTRANSPARENT static_cast<SkColor>(0x00000000)
+
+ +transparent SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorBLACK       static_cast<SkColor>(0xFF000000)
+
+ +black SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorDKGRAY      static_cast<SkColor>(0xFF444444)
+
+ +dark gray SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorGRAY        static_cast<SkColor>(0xFF888888)
+
+ +gray SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorLTGRAY      static_cast<SkColor>(0xFFCCCCCC)
+
+ +light gray SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorWHITE       static_cast<SkColor>(0xFFFFFFFF)
+
+ +white SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorRED         static_cast<SkColor>(0xFFFF0000)
+
+ +red SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorGREEN       static_cast<SkColor>(0xFF00FF00)
+
+ +green SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorBLUE        static_cast<SkColor>(0xFF0000FF)
+
+ +blue SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorYELLOW      static_cast<SkColor>(0xFFFFFF00)
+
+ +yellow SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorCYAN        static_cast<SkColor>(0xFF00FFFF)
+
+ +cyan SkColor value + +### Example + +
+ +### See Also + +incomplete + +
+    #define SK ColorMAGENTA     static_cast<SkColor>(0xFFFF00FF)
+
+ +magenta SkColor value + +### Example + +
+ +### See Also + +incomplete + +## HSV + +## HSV Hue + +Hue represents an angle, in degrees, on a color wheel. Hue has a positive value +modulo 360, where zero degrees is red. + +## HSV Saturation + +## HSV Value + + +## SkRGBToHSV + +
+SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
+
+ +Convert RGB components to HSV. +hsv[0] is Hue [0 .. 360) +hsv[1] is Saturation [0...1] +hsv[2] is Value [0...1] + +### Parameters + + + + + + +
red +red component value [0..255] +
green +green component value [0..255] +
blue +blue component value [0..255] +
hsv +3 element array which holds the resulting HSV components. +
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## SkColorToHSV + +
+static inline void SkColorToHSV(SkColor color, SkScalar hsv[3])
+
+ +Convert the argb color to its HSV components. +hsv[0] represents Hue, and is assigned a value from zero to less than 360. +hsv[1] is Saturation [0...1] +hsv[2] is Value [0...1] + +### Parameters + + + + +
color +the argb color to convert. Note: the alpha component is ignored. +
hsv +3 element array which holds the resulting HSV components. +
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## SkHSVToColor + +
+SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
+
+ +Convert HSV components to an ARGB color. The alpha component 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. + +### Parameters + + + + +
alpha +the alpha component of the returned argb color. +
hsv +3 element array which holds the input HSV components. +
+ +### Return Value + +the resulting argb color + +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+static inline SkColor SkHSVToColor(const SkScalar hsv[3])
+
+ +Convert HSV components to an ARGB color. The alpha component 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. + +### Parameters + + + +
hsv +3 element array which holds the input HSV components. +
+ +### Return Value + +the resulting argb color + +### Example + +
+ +### See Also + +incomplete + +--- + +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 nonpremultiplied, and is always in the +same byte order. + + +## SkPreMultiplyARGB + +
+SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
+
+ +Return a SkPMColor value from unpremultiplied 8 bit component values + +### Parameters + + + + + + +
a +incomplete
r +incomplete
g +incomplete
b +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## SkPreMultiplyColor + +
+SK_API SkPMColor SkPreMultiplyColor(SkColor c)
+
+ +Return a SkPMColor value from a SkColor value. This is done by multiplying the color +components by the color's alpha, and by arranging the bytes in a configuration +dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. + +### Parameters + + + +
c +incomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md index 12742f7bcb..439f6d7155 100644 --- a/site/user/api/SkImageInfo_Reference.md +++ b/site/user/api/SkImageInfo_Reference.md @@ -4,7 +4,7 @@ SkImageInfo Reference # Image Info Image Info specifies the dimensions and encoding of the pixels in a Bitmap. The dimensions are integral width and height. The encoding is how pixel -bits describe Color Alpha, transparency; Color components red, blue, +bits describe Color Alpha, transparency; Color components red, blue, and green; and Color Space, the range and linearity of colors. Image Info describes an uncompressed raster pixels. In contrast, Image @@ -43,16 +43,16 @@ but Image and Color Alpha, describing multiple levels of transparency. +be opaque, or Color Alpha, describing multiple levels of transparency. -In simple blending, Color Alpha weights the draw color and the destination +In simple blending, Color Alpha weights the draw color and the destination color to create a new color. If alpha describes a weight from zero to one: new color = draw color * alpha + destination color * (1 - alpha) 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 +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 components improve performance. ### Constants @@ -96,9 +96,9 @@ undefined. ### Example -
SkPreMultiplyARGB parameter a is set to 255, its maximum value, and is interpreted -as Color Alpha of 1.0. kOpaque_SkAlphaType may be set to improve performance. -If SkPreMultiplyARGB parameter a is set to a value smaller than 255, +
SkPreMultiplyARGB parameter a is set to 255, its maximum value, and is interpreted +as Color Alpha of 1.0. kOpaque_SkAlphaType may be set to improve performance. +If SkPreMultiplyARGB parameter a is set to a value smaller than 255, kPremul_SkAlphaType must be used instead to avoid undefined results. The four displayed values are the original component values, though not necessarily in the same order. @@ -115,9 +115,9 @@ or the results are undefined. ### Example -
SkPreMultiplyARGB parameter a is set to 150, less than its maximum value, and is -interpreted as Color Alpha of about 0.6. kPremul_SkAlphaType must be set, since -SkPreMultiplyARGB parameter a is set to a value smaller than 255, +
SkPreMultiplyARGB parameter a is set to 150, less than its maximum value, and is +interpreted as Color Alpha of about 0.6. kPremul_SkAlphaType must be set, since +SkPreMultiplyARGB parameter a is set to a value smaller than 255, to avoid undefined results. The four displayed values reflect that the alpha component has been multiplied by the original color. @@ -130,8 +130,8 @@ Some drawing destinations may not support Unpremu ### Example -
SkColorSetARGB parameter a is set to 150, less than its maximum value, and is -interpreted as Color Alpha of about 0.6. color is not premultiplied; +
SkColorSetARGB parameter a is set to 150, less than its maximum value, and is +interpreted as Color Alpha of about 0.6. color is not premultiplied; color components may have values greater than color alpha. The four displayed values are the original component values, though not necessarily in the same order. @@ -145,9 +145,9 @@ static inline bool SkAlphaTypeIsOpaque(SkAlphaType at) Returns true if Alpha Type equals kOpaque_SkAlphaType. kOpaque_SkAlphaType is a -hint that the Color Type is opaque, or that all Color Alpha values are set to +hint that the Color Type is opaque, or that all Color Alpha values are set to their 1.0 equivalent. If Alpha Type is kOpaque_SkAlphaType, and Color Type is not -opaque, then the result of drawing any pixel with a Color Alpha value less than +opaque, then the result of drawing any pixel with a Color Alpha value less than 1.0 is undefined. ### Parameters @@ -190,16 +190,16 @@ true if at equals kN32_SkColorType = kRGBA_8888_SkColorType, #else - #error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order" + #error #endif }; Describes how pixel bits encode color. A pixel may be an alpha mask, a -gray level, Color RGB, or Color ARGB. +gray level, Color RGB, or Color 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 Color ARGB format. On Little_Endian +processors, pixels containing 8-bit Color ARGB components pack into 32-bit kBGRA_8888_SkColorType. On Big_Endian processors, pixels pack into 32-bit kRGBA_8888_SkColorType. @@ -211,43 +211,43 @@ processors, pixels containing 8-bit Color ARGB c - kAlpha_8_SkColorType 1Encodes Color Alpha as Alpha 8 pixel in an 8-bit byte. + kAlpha_8_SkColorType 1Encodes Color Alpha as Alpha 8 pixel in an 8-bit byte. - kRGB_565_SkColorType 2Encodes Color RGB as BGR 565 pixel in a 16-bit word. + kRGB_565_SkColorType 2Encodes Color RGB as BGR 565 pixel in a 16-bit word. - kARGB_4444_SkColorType 3Encodes Color ARGB as ABGR 4444 pixel in a 16-bit word. + kARGB_4444_SkColorType 3Encodes Color ARGB as ABGR 4444 pixel in a 16-bit word. - kRGBA_8888_SkColorType 4Encodes Color ARGB as RGBA 8888 pixel in a 32-bit word. + kRGBA_8888_SkColorType 4Encodes Color ARGB as RGBA 8888 pixel in a 32-bit word. - kRGB_888x_SkColorType 5Encodes Color RGB as RGB 888x pixel in a 32-bit word. + kRGB_888x_SkColorType 5Encodes Color RGB as RGB 888x pixel in a 32-bit word. - kBGRA_8888_SkColorType 6Encodes Color ARGB as BGRA 8888 pixel in a 32-bit word. + kBGRA_8888_SkColorType 6Encodes Color ARGB as BGRA 8888 pixel in a 32-bit word. - kRGBA_1010102_SkColorType 7Encodes Color ARGB as RGBA 1010102 pixel in a 32-bit word. + kRGBA_1010102_SkColorType 7Encodes Color ARGB as RGBA 1010102 pixel in a 32-bit word. - kRGB_101010x_SkColorType 8Encodes Color RGB as RGB 101010x pixel in a 32-bit word. + kRGB_101010x_SkColorType 8Encodes Color RGB as RGB 101010x pixel in a 32-bit word. - kGray_8_SkColorType 9Encodes Color Gray as Gray 8 in an 8-bit byte. + kGray_8_SkColorType 9Encodes Color Gray as Gray 8 in an 8-bit byte. - kRGBA_F16_SkColorType 10Encodes Color ARGB as RGBA F16 in a 64-bit word. + kRGBA_F16_SkColorType 10Encodes Color ARGB as RGBA F16 in a 64-bit word. @@ -256,7 +256,7 @@ processors, pixels containing 8-bit Color ARGB c - @@ -285,7 +285,7 @@ with its transparency set to alpha8 pixel value. BGR 565 is a 16-bit word pixel encoding that contains five bits of blue, six bits of green, and five bits of red. BGR 565 is fully opaque as if its -Color Alpha was set to one, and should always be paired with kOpaque_SkAlphaType. +Color Alpha was set to one, and should always be paired with kOpaque_SkAlphaType. ![Color_Type_BGR_565](https://fiddle.skia.org/i/b674a54eb4188d5ce66c04cebdb61089_raster.png "") @@ -347,7 +347,7 @@ the platform at compile time. RGB 888x is a 32-bit word pixel encoding that contains eight bits of red, eight bits of green, eight bits of blue, and eight unused bits. RGB 888x is fully -opaque as if its Color Alpha was set to one, and should always be paired with +opaque as if its Color Alpha was set to one, and should always be paired with kOpaque_SkAlphaType. ![Color_Type_RGB_888x](https://fiddle.skia.org/i/fecfe58c25cfc1b1e411e5eb50f7d8d1_raster.png "") @@ -412,7 +412,7 @@ less than 3, the drawn result is undefined. RGB 101010x is a 32-bit word pixel encoding that contains ten bits of red, ten bits of green, ten bits of blue, and two unused bits. RGB 101010x is fully -opaque as if its Color Alpha was set to one, and should always be paired with +opaque as if its Color Alpha was set to one, and should always be paired with kOpaque_SkAlphaType. ![Color_Type_RGB_101010x](https://fiddle.skia.org/i/c22477b11dabaa3e3a0b5bb33a7733cd_raster.png "") @@ -425,7 +425,7 @@ opaque as if its Color Alpha was set to one, an Gray 8 is an 8-bit byte pixel encoding that represents equal values for red, blue, and green, reprsenting colors from black to white. Gray 8 is fully -opaque as if its Color Alpha was set to one, and should always be paired with +opaque as if its Color Alpha was set to one, and should always be paired with kOpaque_SkAlphaType. ### Example @@ -503,8 +503,8 @@ bytes per pixel bool SkColorTypeIsAlwaysOpaque(SkColorType ct) -Returns true if Color Type always decodes Color Alpha to 1.0, making the pixel -fully opaque. If true, Color Type does not reserve bits to encode Color Alpha. +Returns true if Color Type always decodes Color Alpha to 1.0, making the pixel +fully opaque. If true, Color Type does not reserve bits to encode Color Alpha. ### Parameters @@ -518,7 +518,7 @@ one of: kUnknown_SkColorType, Color Alpha is always set to 1.0 +true if Color Alpha is always set to 1.0 ### Example @@ -652,7 +652,7 @@ can be created from Image Info. implementations may defer pixel depth, so may not completely specify Image Info. Image Info contains dimensions, the pixel integral width and height. It encodes -how pixel bits describe Color Alpha, transparency; Color components red, blue, +how pixel bits describe Color Alpha, transparency; Color components red, blue, and green; and Color Space, the range and linearity of colors. ## Member Function @@ -1293,10 +1293,10 @@ bool isOpaque() const Returns true if Alpha Type is set to hint that all pixels are opaque; their -Color Alpha value is implicitly or explicitly 1.0. If true, and all pixels are +Color Alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly. -Does not check if Color Type allows Alpha, or if any pixel value has +Does not check if Color Type allows Alpha, or if any pixel value has transparency. ### Return Value @@ -1320,7 +1320,7 @@ isOpaque: true ### See Also -Color AlphaSkColorTypeValidateAlphaTypeSkBitmap::isOpaqueSkImage::isOpaqueSkPixmap::isOpaque +Color AlphaSkColorTypeValidateAlphaTypeSkBitmap::isOpaqueSkImage::isOpaqueSkPixmap::isOpaque --- diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index c97b0845fa..1dd2c6e358 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -13,6 +13,7 @@ SkImage Reference | Constructor | functions that construct SkImage | | Member Function | static functions and member methods | | Related Function | similar methods grouped together | +| Typedef | types defined by other types | # Class SkImage Image describes a two dimensional array of pixels to draw. The pixels may be @@ -783,11 +784,11 @@ created Image, or nullptr
kN32_SkColorType 4Encodes Color ARGB as either RGBA 8888 or BGRA 8888, whichever + kN32_SkColorType 4Encodes Color ARGB as either RGBA 8888 or BGRA 8888, whichever is native to the platform.
- -
SkImage::BitDepth::kU8 0Use 8 bits per Color ARGB component using unsigned integer format. + SkImage::BitDepth::kU8 0Use 8 bits per Color ARGB component using unsigned integer format.
SkImage::BitDepth::kF16 1Use 16 bits per Color ARGB component using half-precision floating point format. + SkImage::BitDepth::kF16 1Use 16 bits per Color ARGB component using half-precision floating point format.
@@ -1173,7 +1174,7 @@ alphaOnly = true bool isOpaque() const -Returns true if pixels ignore their Alpha value and are treated as fully opaque. +Returns true if pixels ignore their Alpha value and are treated as fully opaque. ### Return Value diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index b5983555e7..a30e073b27 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -47,12 +47,12 @@ Multiple colors are drawn either by using multiple paints or with objects like | name | description | | --- | --- | -| Alpha Methods | get and set Alpha | +| Alpha Methods | get and set Alpha | | Anti-alias | approximating coverage with transparency | | Automatic Hinting | always adjust glyph paths | | Blend Mode Methods | get and set Blend Mode | | Color Filter Methods | get and set Color Filter | -| Color Methods | get and set Color | +| Color Methods | get and set Color | | Device Text | increase precision of glyph position | | Dither | distributing color error | | Draw Looper Methods | get and set Draw Looper | @@ -67,7 +67,7 @@ Multiple colors are drawn either by using multiple paints or with objects like | Hinting | glyph outline adjustment | | Image Filter Methods | get and set Image Filter | | Initializers | constructors and initialization | -| LCD Text | text relying on the order of Color RGB stripes | +| LCD Text | text relying on the order of Color RGB stripes | | Linear Text | selects text rendering as Glyph or Path | | Management | paint copying, moving, comparing | | Mask Filter Methods | get and set Mask Filter | @@ -143,9 +143,9 @@ Multiple colors are drawn either by using multiple paints or with objects like | containsText | returns if all text corresponds to Glyphs | | countText | returns number of Glyphs in text | | doComputeFastBounds | returns bounds for quick reject tests | -| getAlpha | returns Color Alpha, color opacity | +| getAlpha | returns Color Alpha, color opacity | | getBlendMode | returns Blend Mode, how colors combine with Device | -| getColor | returns Color Alpha and Color RGB, one drawing color | +| getColor | returns Color Alpha and Color RGB, one drawing color | | getColorFilter | returns Color Filter, how colors are altered | | getDrawLooper | returns Draw Looper, multiple layers | | getFillPath | returns fill path equivalent to stroke | @@ -201,11 +201,11 @@ Multiple colors are drawn either by using multiple paints or with objects like | refTypeface | references Typeface, font description | | reset | sets to default values | | setARGB | sets color by component | -| setAlpha | sets Color Alpha, color opacity | +| setAlpha | sets Color Alpha, color opacity | | setAntiAlias | sets or clears Anti-alias | | setAutohinted | sets Glyphs to always be hinted | | setBlendMode | sets Blend Mode, how colors combine with destination | -| setColor | sets Color Alpha and Color RGB, one drawing color | +| setColor | sets Color Alpha and Color RGB, one drawing color | | setColorFilter | sets Color Filter, alters color | | setDevKernText | sets or clears Full Hinting Spacing | | setDither | sets or clears Dither | @@ -252,8 +252,8 @@ Constructs Paint with default values. | --- | --- | | Anti-alias | false | | Blend Mode | SkBlendMode::kSrcOver | -| Color | SK ColorBLACK | -| Color Alpha | 255 | +| Color | SK ColorBLACK | +| Color Alpha | 255 | | Color Filter | nullptr | | Dither | false | | Draw Looper | nullptr | @@ -903,7 +903,7 @@ paint.isDither() 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. +If kAntiAlias Flag is set, pixels are drawn with Color Alpha equal to their coverage. The rule for Aliased pixels is inconsistent across platforms. A shape edge passing through the pixel center may, but is not required to, draw the pixel. @@ -1093,17 +1093,17 @@ paint1 == paint2 ### See Also -Gradient Color RGB-565 +Gradient Color RGB-565 ## 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 Color 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 Color RGB or Color RBG. Flags kSubpixelText Flag uses the pixel transparency to represent a fractional offset. As the opaqueness @@ -1253,11 +1253,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 Color 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 Color RGB or Color RBG. ## isLCDRenderText @@ -1836,22 +1836,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 Color RGB, one drawing color | +| setColor | sets Color Alpha and Color RGB, one drawing color | -Color specifies the Color RGB Red, Color RGB Blue, Color RGB Green, and Color Alpha +Color specifies the Color RGB Red, Color RGB Blue, Color RGB 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. +Color is not Premultiplied; Color Alpha sets the transparency independent of +Color RGB: Color RGB Red, Color RGB Blue, and Color RGB Green. -The bit positions of Color Alpha and Color RGB are independent of the bit +The bit positions of Color Alpha and Color 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 | Color RGB Red | Color RGB Blue | Color RGB Green | | --- | --- | --- | --- | --- | | | 31 - 24 | 23 - 16 | 15 - 8 | 7 - 0 | @@ -1866,13 +1866,13 @@ a different arrangement. SkColor getColor() const -Retrieves Alpha and Color RGB, Unpremultiplied, packed into 32 bits. -Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract +Retrieves Alpha and Color RGB, Unpremultiplied, packed into 32 bits. +Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract a color component. ### Return Value -Unpremultiplied Color ARGB +Unpremultiplied Color ARGB ### Example @@ -1888,7 +1888,7 @@ Yellow is 100% red, 100% green, and 0% blue. ### See Also -SkColor +SkColor --- @@ -1899,13 +1899,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 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. ### Parameters +UnpremultipliedColor ARGB
color -Unpremultiplied Color ARGB
@@ -1923,13 +1923,13 @@ green1 == green2 ### See Also -SkColor setARGB SkColorSetARGB +SkColor setARGB SkColorSetARGB --- ## 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 Color RGB: Color RGB Red, Color RGB Blue, and Color RGB Green. ## getAlpha @@ -1938,11 +1938,11 @@ green1 == green2 uint8_t getAlpha() const -Retrieves Alpha from the Color used when stroking and filling. +Retrieves Alpha from the Color used when stroking and filling. ### Return Value -Alpha ranging from zero, fully transparent, to 255, fully opaque +Alpha ranging from zero, fully transparent, to 255, fully opaque ### Example @@ -1965,16 +1965,16 @@ Retrieves Alpha from the Alpha, leaving Color RGB +Replaces Alpha, leaving Color 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 +a set to zero makes Color fully transparent; a set to 255 makes Color fully opaque. ### Parameters +Alpha component of Color
a -Alpha component of Color
@@ -1999,19 +1999,19 @@ fully opaque. void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) -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. +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. ### Parameters +amount of Color Alpha, from fully transparent (0) to fully opaque (255) +amount of Color RGB Red, from no red (0) to full red (255) +amount of Color RGB Green, from no green (0) to full green (255) +amount of Color RGB Blue, from no blue (0) to full blue (255)
a -amount 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)
g -amount of Color RGB Green, from no green (0) to full green (255)
b -amount of Color RGB Blue, from no blue (0) to full blue (255)
@@ -2029,7 +2029,7 @@ transRed1 == transRed2 ### See Also -setColor SkColorSetARGB +setColor SkColorSetARGB --- @@ -2057,7 +2057,7 @@ The area covered where the shape turns a corner is described by Stroke Width gets smaller, the drawn path frame is thinner. Stroke Width less than one -may have gaps, and if kAntiAlias Flag is set, Color Alpha will increase to visually decrease coverage. +may have gaps, and if kAntiAlias Flag is set, Color Alpha will increase to visually decrease coverage. ## Style Hairline @@ -2774,19 +2774,19 @@ true if the path represents Style Fill, or false if it Shader defines the colors used when drawing a shape. Shader may be an image, a gradient, or a computed fill. -If Paint has no Shader, then Color fills the shape. +If Paint has no Shader, then Color fills the shape. -Shader is modulated by Color Alpha component of Color. -If Shader object defines only Color Alpha, then Color modulated by Color Alpha describes +Shader is modulated by Color Alpha component of Color. +If Shader object defines only Color Alpha, then Color modulated by Color Alpha describes the fill. -The drawn transparency can be modified without altering Shader, by changing Color Alpha. +The drawn transparency can be modified without altering Shader, by changing Color Alpha. ### Example
-If Shader generates only Color Alpha then all components of Color modulate the output. +If Shader generates only Color Alpha then all components of Color modulate the output. ### Example @@ -2867,7 +2867,7 @@ Increments shader shader -how geometry is filled with color; if nullptr, Color is used instead +how geometry is filled with color; if nullptr, Color is used instead @@ -2883,7 +2883,7 @@ how geometry is filled with color; if nullptr, Colo Color Filter may apply Blend Mode, transform the color through a matrix, or composite multiple filters. If Paint has no Color Filter, the color is unaltered. -The drawn transparency can be modified without altering Color Filter, by changing Color Alpha. +The drawn transparency can be modified without altering Color Filter, by changing Color Alpha. ### Example @@ -2974,7 +2974,7 @@ Increments filter Reference Count by ## Blend Mode Methods -Blend Mode describes how Color combines with the destination color. +Blend Mode describes how Color combines with the destination color. The default setting, SkBlendMode::kSrcOver, draws the source color over the destination color. @@ -3369,7 +3369,7 @@ with Blend Mode set to Blend Mode. Image Filter is higher level than Mask Filter; for instance, an Image Filter -can operate on all channels of Color, while Mask Filter generates Alpha only. +can operate on all channels of Color, while Mask Filter generates Alpha only. Image Filter operates independently of and can be used in combination with Mask Filter. @@ -5001,8 +5001,8 @@ bool nothingToDraw() const Returns true if Paint prevents all drawing; otherwise, the Paint may or may not allow drawing. -Returns true if, for example, Blend Mode combined with Color Alpha computes a -new Alpha of zero. +Returns true if, for example, Blend Mode combined with Color Alpha computes a +new Alpha of zero. ### Return Value diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md index c0a760e5cd..d76a2ffd5b 100644 --- a/site/user/api/SkPixmap_Reference.md +++ b/site/user/api/SkPixmap_Reference.md @@ -59,9 +59,9 @@ to manage pixel memory; Pixel Ref is safe a | colorType | returns Image Info Color Type | | computeByteSize | returns size required for pixels | | computeIsOpaque | returns true if all pixels are opaque | -| erase | writes Color to pixels | +| erase | writes Color to pixels | | extractSubset | sets pointer to portion of original | -| getColor | returns one pixel as Unpremultiplied Color | +| getColor | returns one pixel as Unpremultiplied Color | | height | returns pixel row count | | info | returns Image Info | | isOpaque | returns true if Image Info describes opaque pixels | @@ -604,7 +604,7 @@ bool isOpaque() const Returns true if Alpha Type is kOpaque_SkAlphaType. -Does not check if Color Type allows Alpha, or if any pixel value has +Does not check if Color Type allows Alpha, or if any pixel value has transparency. ### Return Value @@ -795,15 +795,15 @@ bool computeIsOpaque() const Returns true if all pixels are opaque. Color Type determines how pixels -are encoded, and whether pixel describes Alpha. Returns true for Color Types +are encoded, and whether pixel describes Alpha. Returns true for Color Types without alpha in each pixel; for other Color Types, returns true if all pixels have alpha values equivalent to 1.0 or greater. For Color Types kRGB_565_SkColorType or kGray_8_SkColorType: always returns true. For Color Types kAlpha_8_SkColorType, kBGRA_8888_SkColorType, -kRGBA_8888_SkColorType: returns true if all pixel Alpha values are 255. -For Color Type kARGB_4444_SkColorType: returns true if all pixel Alpha values are 15. -For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or +kRGBA_8888_SkColorType: returns true if all pixel Alpha values are 255. +For Color Type kARGB_4444_SkColorType: returns true if all pixel Alpha values are 15. +For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or greater. Returns false for kUnknown_SkColorType. @@ -829,7 +829,7 @@ computeIsOpaque: true ### See Also -isOpaque Color Type Alpha +isOpaque Color Type Alpha --- @@ -840,16 +840,16 @@ computeIsOpaque: true SkColor getColor(int x, int y) const -Returns pixel at (x, y) as Unpremultiplied Color. -Returns black with Alpha if Color Type is kAlpha_8_SkColorType. +Returns pixel at (x, y) as Unpremultiplied Color. +Returns black with Alpha if Color Type is kAlpha_8_SkColorType. Input is not validated: out of bounds values of x or y trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if SK_RELEASE is defined. Fails if Color Type is kUnknown_SkColorType or pixel address is nullptr. -Color Space in Image Info is ignored. Some Color precision may be lost in the -conversion to Unpremultiplied Color; original pixel data may have additional +Color Space in Image Info is ignored. Some Color precision may be lost in the +conversion to Unpremultiplied Color; original pixel data may have additional precision. ### Parameters @@ -863,7 +863,7 @@ row index, zero or greater, and less than height< ### Return Value -pixel converted to Unpremultiplied Color +pixel converted to Unpremultiplied Color ### Example @@ -1490,7 +1490,7 @@ writable unsigned 16-bit pointer to pixel ### Example
Draw a five by five bitmap, and draw it again with a center black pixel. -The low nibble of the 16-bit word is Alpha. +The low nibble of the 16-bit word is Alpha.
### See Also @@ -1615,7 +1615,7 @@ is drawn after overwriting bottom half float color with top half float color. | name | description | | --- | --- | -| erase | writes Color to pixels | +| erase | writes Color to pixels | | | erase(SkColor color, const SkIRect& subset) const | | | erase(SkColor color) const | | | erase(const SkColor4f& color, const SkIRect* subset = nullptr) const | @@ -1952,7 +1952,7 @@ not intersect bounds. ### Parameters +UnpremultipliedColor to write @@ -1985,7 +1985,7 @@ is empty. ### Parameters
color -Unpremultiplied Color to write
subset bounding integer Rect of written pixels
+UnpremultipliedColor to write
color -Unpremultiplied Color to write
@@ -2017,7 +2017,7 @@ not intersect bounds, or if color -Unpremultiplied Color to write +Unpremultiplied Color to write subset bounding integer Rect of pixels to write; may be nullptr diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index 2b312c25cc..a9c6a916d9 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -52,7 +52,6 @@ of the requested dimensions are zero, then nullptr will be returned. | getBackendRenderTarget | returns the GPU reference to render target | | getBackendTexture | returns the GPU reference to texture | | getCanvas | returns Canvas that draws into Surface | -| getRenderTargetHandle | returns the GPU reference to render target | | getTextureHandle | returns the GPU reference to texture | | height | returns pixel row count | | makeImageSnapshot | creates Image capturing Surface contents | @@ -327,7 +326,7 @@ Internally, sets Image Info to wi Surface is returned if width and height are greater than zero. -Use to create Surface that matches SkPMColor, the native pixel arrangement on +Use to create Surface that matches SkPMColor, the native pixel arrangement on the platform. Surface drawn to output device skips converting its pixel format. ### Parameters @@ -808,7 +807,6 @@ surf->makeImageSnapshot() == nullptr | getBackendRenderTarget | returns the GPU reference to render target | | getBackendTexture | returns the GPU reference to texture | | getCanvas | returns Canvas that draws into Surface | -| getRenderTargetHandle | returns the GPU reference to render target | | getTextureHandle | returns the GPU reference to texture | | height | returns pixel row count | | props | returns Surface Properties | @@ -1025,7 +1023,7 @@ one of: kDiscard ContentChangeMo ### See Also -getTextureHandle getRenderTargetHandle +getTextureHandle @@ -1060,49 +1058,7 @@ GPU texture reference ### See Also -getRenderTargetHandle GrBackendObject BackendHandleAccess - ---- - - -## getRenderTargetHandle - -
-bool getRenderTargetHandle(GrBackendObject* backendObject, BackendHandleAccess backendHandleAccess)
-
- -Returns true and stores the GPU back-end reference of the render target used -by Surface in backendObject. - -Return false if Surface is not backed by a GPU render target, and leaves -backendObject unchanged. - -The returned render target handle is only valid until the next draw into Surface, -or when Surface is deleted. - -In OpenGL this returns the frame buffer object ID. - -### Parameters - - - - -
backendObject -GPU intermediate memory buffer
backendHandleAccess -one of: kFlushRead BackendHandleAccess, -kFlushWrite BackendHandleAccess, kDiscardWrite BackendHandleAccess
- -### Return Value - -true if Surface is backed by GPU texture - -### Example - -
- -### See Also - -getTextureHandle GrBackendObject BackendHandleAccess +GrBackendObject BackendHandleAccess --- @@ -1280,7 +1236,7 @@ void draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) Draws Surface contents to canvas, with its top-left corner at (x, y). -If Paint paint is not nullptr, apply Color Filter, Color Alpha, Image Filter, +If Paint paint is not nullptr, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. ### Parameters diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index a731ed91c7..e81a37df5e 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -3738,6 +3738,118 @@ "hash": "36a995442c081ee779ecab2962d36e69", "file": "SkPath_Reference", "name": "Path_2" +}, + "SK_AlphaOPAQUE": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_AlphaOPAQUE" +}, + "SK_AlphaTRANSPARENT": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_AlphaTRANSPARENT" +}, + "SK_ColorBLACK": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorBLACK" +}, + "SK_ColorBLUE": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorBLUE" +}, + "SK_ColorCYAN": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorCYAN" +}, + "SK_ColorDKGRAY": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorDKGRAY" +}, + "SK_ColorGRAY": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorGRAY" +}, + "SK_ColorGREEN": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorGREEN" +}, + "SK_ColorLTGRAY": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorLTGRAY" +}, + "SK_ColorMAGENTA": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorMAGENTA" +}, + "SK_ColorRED": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorRED" +}, + "SK_ColorTRANSPARENT": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorTRANSPARENT" +}, + "SK_ColorWHITE": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorWHITE" +}, + "SK_ColorYELLOW": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SK_ColorYELLOW" }, "SkAutoCanvasRestore_SkCanvas_star": { "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n p.setTextSize(64);\n for (SkScalar sx : { -1, 1 } ) {\n for (SkScalar sy : { -1, 1 } ) {\n SkAutoCanvasRestore autoRestore(canvas, true);\n SkMatrix m = SkMatrix::MakeAll(sx, 1, 96, 0, sy, 64, 0, 0, 1);\n canvas->concat(m);\n canvas->drawString(\"R\", 0, 0, p);\n }\n }\n}", @@ -4826,6 +4938,142 @@ "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}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "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}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor4f_Reference", + "name": "SkColor4f::pin()" +}, + "SkColor4f_premul": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor4f_Reference", + "name": "SkColor4f::premul()" +}, + "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}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorGetA" +}, + "SkColorGetB": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorGetB" +}, + "SkColorGetG": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorGetG" +}, + "SkColorGetR": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorGetR" +}, + "SkColorSetA": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorSetA" +}, + "SkColorSetARGB": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorSetARGB" +}, + "SkColorSetRGB": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorSetRGB" +}, + "SkColorToHSV": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkColorToHSV" }, "SkColorTypeBytesPerPixel": { "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 SkPaint paint;\n paint.setTypeface(SkTypeface::MakeFromName(\"monospace\", SkFontStyle()));\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n int y = 15;\n canvas->drawString(\" colorType bytes\", 10, y, paint);\n for (SkColorType colorType : {\n kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,\n kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType,\n kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType,\n kGray_8_SkColorType, kRGBA_F16_SkColorType\n } ) {\n int result = SkColorTypeBytesPerPixel(colorType);\n SkString string;\n string.printf(\"%13s %4d\", colors[(int) colorType], result);\n canvas->drawString(string, 10, y += 14, paint);\n }\n}", @@ -4850,6 +5098,22 @@ "hash": "befac1c29ed21507d367e4d824383a04", "file": "SkImageInfo_Reference", "name": "SkColorTypeValidateAlphaType" +}, + "SkHSVToColor": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkHSVToColor" +}, + "SkHSVToColor_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkHSVToColor_2" }, "SkIPoint_add_operator": { "code": "void draw(SkCanvas* canvas) {\n auto draw_lines = [=](const SkIPoint pts[], size_t count, SkPaint& paint) -> void {\n for (size_t i = 0; i < count - 1; ++i) {\n SkPoint p0, p1;\n p0.iset(pts[i]);\n p1.iset(pts[i + 1]);\n canvas->drawLine(p0, p1, paint);\n }\n };\n SkIPoint points[] = { { 3, 1 }, { 4, 2 }, { 5, 1 }, { 7, 3 } };\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n canvas->scale(30, 15);\n draw_lines(points, SK_ARRAY_COUNT(points), paint);\n SkIPoint mod = {4, 1};\n for (auto& point : points) {\n point = point + mod;\n mod.fX -= 1;\n mod.fY += 1;\n }\n paint.setColor(SK_ColorRED);\n draw_lines(points, SK_ARRAY_COUNT(points), paint);\n}", @@ -6978,6 +7242,30 @@ "hash": "86c0399704d8dff4091bf87b8d87d40b", "file": "SkPoint_Reference", "name": "SkPoint::operator-=(const SkVector& v)" +}, + "SkPreMultiplyARGB": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkPreMultiplyARGB" +}, + "SkPreMultiplyColor": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkPreMultiplyColor" +}, + "SkRGBToHSV": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkColor_Reference", + "name": "SkRGBToHSV" }, "SkSurface_BackendHandleAccess": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp gpuSurface = SkSurface::MakeRenderTarget(\n context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(10, 10));\n int y = 20;\n SkString str;\n paint.setTextSize(16);\n for (auto access : { SkSurface::kFlushRead_BackendHandleAccess, \n SkSurface::kFlushWrite_BackendHandleAccess,\n SkSurface::kDiscardWrite_BackendHandleAccess } ) {\n sk_sp image(gpuSurface->makeImageSnapshot());\n str.printf(\"uniqueID=%d\", image->uniqueID());\n canvas->drawString(str, 20, y += 20, paint);\n GrBackendObject backendObject = gpuSurface->getTextureHandle(access);\n str.printf(\"backendObject %c= 0\", backendObject != 0 ? '!' : '=');\n canvas->drawString(str, 20, y += 20, paint);\n }\n sk_sp image(gpuSurface->makeImageSnapshot());\n str.printf(\"final image uniqueID=%d\", image->uniqueID());\n canvas->drawString(str, 20, y += 20, paint);\n}", @@ -7058,14 +7346,6 @@ "hash": "33d0c5ad5a4810e533ae1010e29f8b75", "file": "SkSurface_Reference", "name": "SkSurface::getCanvas" -}, - "SkSurface_getRenderTargetHandle": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp gpuSurface = SkSurface::MakeRenderTarget(\n context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(10, 10));\n GrBackendObject backendObject;\n if (gpuSurface->getRenderTargetHandle(&backendObject, \n SkSurface::kFlushRead_BackendHandleAccess)) {\n SkString str;\n str.printf(\"backendObject=%ld\", backendObject);\n paint.setTextSize(16);\n canvas->drawString(str, 20, 40, paint);\n }\n}", - "width": 256, - "height": 64, - "hash": "dbc6c0e01a177ba03c87c00c32a43148", - "file": "SkSurface_Reference", - "name": "SkSurface::getRenderTargetHandle" }, "SkSurface_getTextureHandle": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp gpuSurface = SkSurface::MakeRenderTarget(\n context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(10, 10));\n GrBackendObject backendObject = gpuSurface->getTextureHandle(\n SkSurface::kFlushRead_BackendHandleAccess);\n if (backendObject) {\n SkString str;\n str.printf(\"backendObject=%08lx\", backendObject);\n paint.setTextSize(16);\n canvas->drawString(str, 20, 40, paint);\n }\n}", diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 4f1da9b830..95846019b0 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -52,103 +52,6 @@ undocumented -# Color - - -## SkColorGetA - -
-int SkColorGetA(color)
-
- ---- - - -## SkColorGetR - -
-int SkColorGetR(color)
-
- ---- - - -## SkColorGetG - -
-int SkColorGetG(color)
-
- ---- - - -## SkColorGetB - -
-int SkColorGetB(color)
-
- ---- - - -## SkColorSetARGB - -
-int SkColorSetARGB(a, r, g, b)
-
- ---- - - -## SkPreMultiplyARGB - -
-SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
-
- ---- - -### Constants - - - - - - - - - - - - - - - - - - - - -
SK_ColorBLACK 0xFF000000
SK_ColorBLUE 0xFF0000FF
SK_ColorGREEN 0xFF00FF00
SK_ColorRED 0xFFFF0000
SK_ColorWHITE 0xFFFFFFFF
SK_ColorTRANSPARENT 0x00000000
- -## Alpha - -## RGB - -## RGB Red - -## RGB Blue - -## RGB Green - -## ARGB - -## RBG - -## RGB-565 - -## Gray - # Color Filter # Class SkColorFilter -- cgit v1.2.3