Generate bookmaker indices
First cut at splitting bookmaker documentation into reference and overview. Reference starts with a hyperlinked index, generated from a public include. This moves towards typing once, minimizing the information duplicated in the .h file and the .bmh file. TBR=caryclark@google.com Docs-Preview: https://skia.org/?cl=154630 Change-Id: I836622db9b1786bd28c0bce2536cd3caef6e5a32 Reviewed-on: https://skia-review.googlesource.com/c/154630 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
This commit is contained in:
parent
eba2624e2c
commit
61313f38e1
@ -2,22 +2,14 @@
|
||||
|
||||
#Class SkAutoCanvasRestore
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Stack helper class calls SkCanvas::restoreToCount when SkAutoCanvasRestore
|
||||
goes out of scope. Use this to guarantee that the canvas is restored to a known
|
||||
state.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)
|
||||
|
||||
#Line # preserves Canvas save count ##
|
||||
|
@ -3,6 +3,11 @@
|
||||
#Alias Bitmap_Reference ##
|
||||
|
||||
#Class SkBitmap
|
||||
#Line # two-dimensional raster pixel array ##
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Bitmap describes a two-dimensional raster pixel array. Bitmap is built on
|
||||
Image_Info, containing integer width and height, Color_Type and Alpha_Type
|
||||
@ -33,34 +38,6 @@ number of bytes in a pixel. Row_Bytes may be larger than the row requires. This
|
||||
is useful to position one or more Bitmaps within a shared pixel array.
|
||||
##
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Class
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Class Allocator
|
||||
@ -382,7 +359,6 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # metrics and attributes ##
|
||||
##
|
||||
|
||||
@ -1164,7 +1140,7 @@ consumption on Device.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void reset()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # sets to default values, releases pixel ownership ##
|
||||
Resets to its initial state; all fields are set to zero, as if Bitmap had
|
||||
been initialized by SkBitmap().
|
||||
@ -1448,11 +1424,10 @@ AllocFlags provides the option to zero pixel memory when allocated.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Allocate
|
||||
#Populate
|
||||
#Line # allocates storage for pixels ##
|
||||
##
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixelsFlags(const SkImageInfo& info, uint32_t flags)
|
||||
#Method bool tryAllocPixelsFlags(const SkImageInfo& info, uint32_t flags)
|
||||
#In Allocate
|
||||
#Line # allocates pixels from Image_Info with options if possible ##
|
||||
Sets Image_Info to info following the rules in setInfo and allocates pixel
|
||||
@ -1542,7 +1517,7 @@ canvas->drawBitmap(bitmap, 8, 8);
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info, size_t rowBytes)
|
||||
#Method bool tryAllocPixels(const SkImageInfo& info, size_t rowBytes)
|
||||
#In Allocate
|
||||
#Line # allocates pixels from Image_Info if possible ##
|
||||
#ToDo am I ever conflicted about setInfo rules. It needs to be able to be replicated
|
||||
@ -1628,7 +1603,7 @@ for (int y : { 0, 64, 128, 192 } ) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info)
|
||||
#Method bool tryAllocPixels(const SkImageInfo& info)
|
||||
|
||||
Sets Image_Info to info following the rules in setInfo and allocates pixel
|
||||
memory.
|
||||
@ -1698,7 +1673,7 @@ for (int y : { 0, 64, 128, 192 } ) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false)
|
||||
#Method bool tryAllocN32Pixels(int width, int height, bool isOpaque = false)
|
||||
#In Allocate
|
||||
#Line # allocates compatible ARGB pixels if possible ##
|
||||
Sets Image_Info to width, height, and Native_Color_Type; and allocates
|
||||
@ -1938,7 +1913,6 @@ Draw a five by five bitmap, and draw it again with a center white pixel.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Pixels
|
||||
#Populate
|
||||
#Line # read and write pixel values ##
|
||||
##
|
||||
|
||||
@ -1974,7 +1948,7 @@ of Bitmap and Pixel_Ref.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels()
|
||||
#Method bool tryAllocPixels()
|
||||
#In Allocate
|
||||
Allocates pixel memory with HeapAllocator, and replaces existing Pixel_Ref.
|
||||
The allocation size is determined by Image_Info width, height, and Color_Type.
|
||||
@ -2045,7 +2019,7 @@ Pixel_Ref with set2.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(Allocator* allocator)
|
||||
#Method bool tryAllocPixels(Allocator* allocator)
|
||||
|
||||
Allocates pixel memory with allocator, and replaces existing Pixel_Ref.
|
||||
The allocation size is determined by Image_Info width, height, and Color_Type.
|
||||
@ -2230,7 +2204,6 @@ subset origin: 32, 64
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Set
|
||||
#Line # updates values and attributes ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method void setPixelRef(sk_sp<SkPixelRef> pixelRef, int dx, int dy)
|
||||
@ -2348,7 +2321,6 @@ getGenerationID() return a different value.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Draw
|
||||
#Populate
|
||||
#Line # sets pixels to Color ##
|
||||
##
|
||||
|
||||
@ -2568,7 +2540,7 @@ addr interval == rowBytes
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline uint32_t* getAddr32(int x, int y) const
|
||||
#Method uint32_t* getAddr32(int x, int y) const
|
||||
#In Property
|
||||
#Line # returns readable pixel address as 32-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
@ -2603,7 +2575,7 @@ addr interval == rowBytes
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline uint16_t* getAddr16(int x, int y) const
|
||||
#Method uint16_t* getAddr16(int x, int y) const
|
||||
#In Property
|
||||
#Line # returns readable pixel address as 16-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
@ -2644,7 +2616,7 @@ addr interval == rowBytes
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline uint8_t* getAddr8(int x, int y) const
|
||||
#Method uint8_t* getAddr8(int x, int y) const
|
||||
#In Property
|
||||
#Line # returns readable pixel address as 8-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
@ -2684,7 +2656,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool extractSubset(SkBitmap* dst, const SkIRect& subset) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Bitmap, sharing pixels if possible ##
|
||||
Shares Pixel_Ref with dst. Pixels are not copied; Bitmap and dst point
|
||||
to the same pixels; dst bounds() are set to the intersection of subset
|
||||
@ -3063,7 +3035,7 @@ For use by Android framework only.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool extractAlpha(SkBitmap* dst) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Bitmap containing Alpha of pixels ##
|
||||
Sets dst to Alpha described by pixels. Returns false if dst cannot be written to
|
||||
or dst pixels cannot be allocated.
|
||||
@ -3247,7 +3219,6 @@ x---x-
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
|
89
docs/SkBlendMode_Overview.bmh
Normal file
89
docs/SkBlendMode_Overview.bmh
Normal file
@ -0,0 +1,89 @@
|
||||
#Topic Blend_Mode_Overview
|
||||
|
||||
Describes how destination pixel is replaced with a combination of itself and
|
||||
source pixel. Blend_Mode may use source, destination, or both. Blend_Mode may
|
||||
operate on each Color component independently, or may allow all source pixel
|
||||
components to contribute to one destination pixel component.
|
||||
|
||||
Blend_Mode does not use adjacent pixels to determine the outcome.
|
||||
|
||||
Blend_Mode uses source and read destination Alpha to determine written
|
||||
destination Alpha; both source and destination Alpha may also affect written
|
||||
destination Color components.
|
||||
|
||||
Regardless of how Alpha is encoded in source and destination pixel, nearly all
|
||||
Color_Types treat it as ranging from zero to one. And, nearly all Blend_Mode
|
||||
algorithms limit the output so that all results are also zero to one.
|
||||
|
||||
Two exceptions are SkBlendMode::kPlus and kRGBA_F16_SkColorType.
|
||||
|
||||
SkBlendMode::kPlus permits computing Alpha and Color component values larger
|
||||
than one. For Color_Types other than kRGBA_F16_SkColorType, resulting Alpha
|
||||
and component values are clamped to one.
|
||||
|
||||
kRGBA_F16_SkColorType permits values outside the zero to one range. It is up
|
||||
to the client to ensure that the result is within the range of zero to one,
|
||||
and therefore well-defined.
|
||||
|
||||
#Subtopic Porter_Duff
|
||||
#Alias Porter_Duff ##
|
||||
#Line # classic color blend algorithms ##
|
||||
|
||||
#A Compositing Digital Images # https://graphics.pixar.com/library/Compositing/paper.pdf ##
|
||||
describes Porter_Duff modes SkBlendMode::kClear through SkBlendMode::kXor.
|
||||
|
||||
Drawing a bitmap with transparency using Porter_Duff compositing is free to clear
|
||||
the destination.
|
||||
|
||||
#Illustration 1
|
||||
|
||||
Draw geometry with transparency using Porter_Duff compositing does not combine
|
||||
transparent source pixels, leaving the destination outside the geometry untouched.
|
||||
|
||||
#Illustration 2
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Lighten_Darken
|
||||
#Line # color blends to lighten or darken result ##
|
||||
|
||||
Modes SkBlendMode::kPlus and SkBlendMode::kScreen use
|
||||
simple arithmetic to lighten or darken the destination. Modes
|
||||
SkBlendMode::kOverlay through SkBlendMode::kMultiply use more complicated
|
||||
algorithms to lighten or darken; sometimes one mode does both, as described by
|
||||
#A Blend Modes # https://en.wikipedia.org/wiki/Blend_modes ##
|
||||
.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Modulate_Blend
|
||||
#Line # multiply color components ##
|
||||
|
||||
SkBlendMode::kModulate is a mashup of SkBlendMode::kSrcATop and SkBlendMode::kMultiply.
|
||||
It multiplies all components, including Alpha; unlike SkBlendMode::kMultiply, if either
|
||||
source or destination is transparent, result is transparent. SkBlendMode::kModulate
|
||||
uses Premultiplied values to compute the product; SkBlendMode::kMultiply uses Unpremultiplied
|
||||
values to compute the product.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Color_Blends
|
||||
#Line # non-separable blend modes ##
|
||||
|
||||
Modes SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor, and
|
||||
SkBlendMode::kLuminosity convert source and destination pixels using all
|
||||
components color information, using
|
||||
###$
|
||||
$A non-separable blend modes $ https://www.w3.org/TR/compositing-1/#blendingnonseparable $$
|
||||
$$$#
|
||||
.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
#Topic Blend_Mode_Overview ##
|
@ -1,99 +1,4 @@
|
||||
#Topic Blend_Mode
|
||||
#Alias BlendMode_Reference ##
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
Describes how destination pixel is replaced with a combination of itself and
|
||||
source pixel. Blend_Mode may use source, destination, or both. Blend_Mode may
|
||||
operate on each Color component independently, or may allow all source pixel
|
||||
components to contribute to one destination pixel component.
|
||||
|
||||
Blend_Mode does not use adjacent pixels to determine the outcome.
|
||||
|
||||
Blend_Mode uses source and read destination Alpha to determine written
|
||||
destination Alpha; both source and destination Alpha may also affect written
|
||||
destination Color components.
|
||||
|
||||
Regardless of how Alpha is encoded in source and destination pixel, nearly all
|
||||
Color_Types treat it as ranging from zero to one. And, nearly all Blend_Mode
|
||||
algorithms limit the output so that all results are also zero to one.
|
||||
|
||||
Two exceptions are SkBlendMode::kPlus and kRGBA_F16_SkColorType.
|
||||
|
||||
SkBlendMode::kPlus permits computing Alpha and Color component values larger
|
||||
than one. For Color_Types other than kRGBA_F16_SkColorType, resulting Alpha
|
||||
and component values are clamped to one.
|
||||
|
||||
kRGBA_F16_SkColorType permits values outside the zero to one range. It is up
|
||||
to the client to ensure that the result is within the range of zero to one,
|
||||
and therefore well-defined.
|
||||
|
||||
#Subtopic Porter_Duff
|
||||
|
||||
#A Compositing Digital Images # https://graphics.pixar.com/library/Compositing/paper.pdf ##
|
||||
describes Porter_Duff modes SkBlendMode::kClear through SkBlendMode::kXor.
|
||||
|
||||
Drawing a bitmap with transparency using Porter_Duff compositing is free to clear
|
||||
the destination.
|
||||
|
||||
#Illustration 1
|
||||
|
||||
Draw geometry with transparency using Porter_Duff compositing does not combine
|
||||
transparent source pixels, leaving the destination outside the geometry untouched.
|
||||
|
||||
#Illustration 2
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Lighten_Darken
|
||||
|
||||
Modes SkBlendMode::kPlus and SkBlendMode::kScreen use
|
||||
simple arithmetic to lighten or darken the destination. Modes
|
||||
SkBlendMode::kOverlay through SkBlendMode::kMultiply use more complicated
|
||||
algorithms to lighten or darken; sometimes one mode does both, as described by
|
||||
#A Blend Modes # https://en.wikipedia.org/wiki/Blend_modes ##
|
||||
.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Modulate_Blend
|
||||
SkBlendMode::kModulate is a mashup of SkBlendMode::kSrcATop and SkBlendMode::kMultiply.
|
||||
It multiplies all components, including Alpha; unlike SkBlendMode::kMultiply, if either
|
||||
source or destination is transparent, result is transparent. SkBlendMode::kModulate
|
||||
uses Premultiplied values to compute the product; SkBlendMode::kMultiply uses Unpremultiplied
|
||||
values to compute the product.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Color_Blends
|
||||
|
||||
Modes SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor, and
|
||||
SkBlendMode::kLuminosity convert source and destination pixels using all
|
||||
components color information, using
|
||||
###$
|
||||
$A non-separable blend modes $ https://www.w3.org/TR/compositing-1/#blendingnonseparable $$
|
||||
$$$#
|
||||
.
|
||||
|
||||
#Illustration
|
||||
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#PhraseDef list_of_blend_modes
|
||||
SkBlendMode::kClear, SkBlendMode::kSrc, SkBlendMode::kDst, SkBlendMode::kSrcOver,
|
||||
@ -108,45 +13,14 @@ SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor,
|
||||
SkBlendMode::kLuminosity
|
||||
##
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
#EnumClass SkBlendMode
|
||||
#Line # algorithm combining source and destination pixels ##
|
||||
|
||||
#Code
|
||||
enum class SkBlendMode {
|
||||
kClear,
|
||||
kSrc,
|
||||
kDst,
|
||||
kSrcOver,
|
||||
kDstOver,
|
||||
kSrcIn,
|
||||
kDstIn,
|
||||
kSrcOut,
|
||||
kDstOut,
|
||||
kSrcATop,
|
||||
kDstATop,
|
||||
kXor,
|
||||
kPlus,
|
||||
kModulate,
|
||||
kScreen,
|
||||
kLastCoeffMode = kScreen,
|
||||
kOverlay,
|
||||
kDarken,
|
||||
kLighten,
|
||||
kColorDodge,
|
||||
kColorBurn,
|
||||
kHardLight,
|
||||
kSoftLight,
|
||||
kDifference,
|
||||
kExclusion,
|
||||
kMultiply,
|
||||
kLastSeparableMode = kMultiply,
|
||||
kHue,
|
||||
kSaturation,
|
||||
kColor,
|
||||
kLuminosity,
|
||||
kLastMode = kLuminosity,
|
||||
};
|
||||
##
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Const kClear 0
|
||||
#Line # replaces destination with zero: fully transparent ##
|
||||
@ -352,8 +226,6 @@ Used by tests to iterate through all valid values.
|
||||
|
||||
#SeeAlso SkCanvas::drawColor SkCanvas::drawVertices SkPaint SkShader::MakeCompose SkXfermodeImageFilter
|
||||
|
||||
#EnumClass SkBlendMode ##
|
||||
|
||||
#Subtopic Clear
|
||||
#Line # makes destination pixels transparent ##
|
||||
SkBlendMode::kClear sets destination to: #Formula # [0, 0] ##.
|
||||
@ -1006,6 +878,8 @@ canvas->drawColor(0xFF00FF00, SkBlendMode::kLuminosity);
|
||||
##
|
||||
##
|
||||
|
||||
#EnumClass SkBlendMode ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SK_API const char* SkBlendMode_Name(SkBlendMode blendMode)
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#Class SkCanvas
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Canvas provides an interface for drawing, and how the drawing is clipped and transformed.
|
||||
Canvas contains a stack of Matrix and Clip values.
|
||||
|
||||
@ -24,36 +28,11 @@ destination.
|
||||
Canvas can be constructed to draw to Bitmap without first creating Raster_Surface.
|
||||
This approach may be deprecated in the future.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Struct
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Typedef
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Subtopic Constructors
|
||||
|
||||
Create the desired type of Surface to obtain its Canvas when possible. Useful
|
||||
when no Surface is required, and some helpers implicitly create Raster_Surface.
|
||||
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -61,7 +40,7 @@ when no Surface is required, and some helpers implicitly create Raster_Surface.
|
||||
#Method static std::unique_ptr<SkCanvas> MakeRasterDirect(const SkImageInfo& info, void* pixels,
|
||||
size_t rowBytes,
|
||||
const SkSurfaceProps* props = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Canvas that will draw directly into pixels.
|
||||
@ -136,7 +115,7 @@ void draw(SkCanvas* ) {
|
||||
|
||||
#Method static std::unique_ptr<SkCanvas> MakeRasterDirectN32(int width, int height, SkPMColor* pixels,
|
||||
size_t rowBytes)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates from image data and Pixel_Storage ##
|
||||
|
||||
Allocates raster Canvas specified by inline image specification. Subsequent Canvas
|
||||
@ -373,9 +352,7 @@ Android framework only.
|
||||
##
|
||||
|
||||
#Code
|
||||
enum class ColorBehavior {
|
||||
kLegacy,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
#Const kLegacy 0
|
||||
#Line # placeholder ##
|
||||
@ -498,7 +475,6 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # metrics and attributes ##
|
||||
##
|
||||
|
||||
@ -593,7 +569,6 @@ GPU_Surface, and returns true. Otherwise, returns false and leave props unchange
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
@ -669,7 +644,7 @@ smaller (due to clipping or saveLayer).
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkSurface> makeSurface(const SkImageInfo& info, const SkSurfaceProps* props = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface matching SkImageInfo and SkSurfaceProps ##
|
||||
Creates Surface matching info and props, and associates it with Canvas.
|
||||
Returns nullptr if no match found.
|
||||
@ -872,7 +847,6 @@ the drawing destination.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Pixels
|
||||
#Populate
|
||||
#Line # read and write pixel values ##
|
||||
##
|
||||
|
||||
@ -1683,14 +1657,7 @@ Call restoreToCount with returned value to restore this and subsequent saves.
|
||||
#Enum SaveLayerFlagsSet
|
||||
#Line # sets SaveLayerRec options ##
|
||||
#Code
|
||||
enum SaveLayerFlagsSet {
|
||||
kPreserveLCDText_SaveLayerFlag = 1 << 1,
|
||||
kInitWithPrevious_SaveLayerFlag = 1 << 2,
|
||||
kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag = 1 << 3,
|
||||
kDontClipToLayer_Legacy_SaveLayerFlag = kDontClipToLayer_PrivateSaveLayerFlag,
|
||||
};
|
||||
|
||||
typedef uint32_t SaveLayerFlags;
|
||||
#Populate
|
||||
##
|
||||
|
||||
|
||||
@ -1756,26 +1723,11 @@ void draw(SkCanvas* canvas) {
|
||||
#Line # contains the state used to create the Layer ##
|
||||
|
||||
#Code
|
||||
struct SaveLayerRec {
|
||||
SaveLayerRec*(...
|
||||
|
||||
const SkRect* fBounds;
|
||||
const SkPaint* fPaint;
|
||||
const SkImageFilter* fBackdrop;
|
||||
SaveLayerFlags fSaveLayerFlags;
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
SaveLayerRec contains the state used to create the Layer.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Member const SkRect* fBounds
|
||||
#Line # hints at Layer size limit ##
|
||||
fBounds is used as a hint to limit the size of Layer; may be nullptr.
|
||||
@ -1841,8 +1793,7 @@ void draw(SkCanvas* canvas) {
|
||||
}
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
#Subtopic Constructors
|
||||
##
|
||||
|
||||
#Method SaveLayerRec()
|
||||
@ -3018,7 +2969,6 @@ Unlike getLocalClipBounds, bounds is not outset.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Draw
|
||||
#Populate
|
||||
#Line # draws into Canvas ##
|
||||
##
|
||||
|
||||
@ -3130,11 +3080,7 @@ void draw(SkCanvas* canvas) {
|
||||
#Line # sets drawPoints options ##
|
||||
|
||||
#Code
|
||||
enum PointMode {
|
||||
kPoints_PointMode,
|
||||
kLines_PointMode,
|
||||
kPolygon_PointMode,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Selects if an array of points are drawn as discrete points, as lines, or as
|
||||
@ -3941,10 +3887,7 @@ void draw(SkCanvas* canvas) {
|
||||
#Line # sets drawImageRect options ##
|
||||
|
||||
#Code
|
||||
enum SrcRectConstraint {
|
||||
kStrict_SrcRectConstraint,
|
||||
kFast_SrcRectConstraint,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
SrcRectConstraint controls the behavior at the edge of source Rect,
|
||||
@ -4770,17 +4713,7 @@ void draw(SkCanvas* canvas) {
|
||||
#Line # divides Bitmap or Image into a rectangular grid ##
|
||||
|
||||
#Code
|
||||
struct Lattice {
|
||||
enum RectType ...
|
||||
|
||||
const int* fXDivs;
|
||||
const int* fYDivs;
|
||||
const RectType* fRectTypes;
|
||||
int fXCount;
|
||||
int fYCount;
|
||||
const SkIRect* fBounds;
|
||||
const SkColor* fColors;
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Lattice divides Bitmap or Image into a rectangular grid.
|
||||
@ -4791,22 +4724,10 @@ entries are proportionately scaled down to fit.
|
||||
The grid entries not on even columns and rows are scaled to fit the
|
||||
remaining space, if any.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Enum RectType
|
||||
#Line # optional setting per rectangular grid entry ##
|
||||
#Code
|
||||
enum RectType : uint8_t {
|
||||
kDefault = 0,
|
||||
kTransparent,
|
||||
kFixedColor,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Optional setting per rectangular grid entry to make it transparent,
|
||||
@ -4825,8 +4746,7 @@ remaining space, if any.
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
#Subtopic Members
|
||||
##
|
||||
|
||||
#Member const int* fXDivs
|
||||
@ -5041,7 +4961,6 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Draw_Text
|
||||
#Populate
|
||||
#Line # draws text into Canvas ##
|
||||
##
|
||||
|
||||
@ -5331,7 +5250,7 @@ Paint_Text_Encoding must be set to SkPaint::kGlyphID_TextEncoding.
|
||||
|
||||
Elements of paint: Anti_Alias, Blend_Mode, Color including Color_Alpha,
|
||||
Color_Filter, Paint_Dither, Draw_Looper, Mask_Filter, Path_Effect, Shader, and
|
||||
Paint_Style; apply to blob. If Paint contains SkPaint::kStroke_Style:
|
||||
Paint_Style; apply to blob. If Paint contains SkPaint::kStroke_Style:
|
||||
Paint_Miter_Limit, Paint_Stroke_Cap, Paint_Stroke_Join, and Paint_Stroke_Width;
|
||||
apply to Path created from blob.
|
||||
|
||||
|
@ -1,29 +1,30 @@
|
||||
#Topic Color4f
|
||||
#Alias Color4f_Reference ##
|
||||
#Substitute SkColor4f
|
||||
|
||||
#Struct SkColor4f
|
||||
#Struct SkPM4f
|
||||
##
|
||||
|
||||
#Struct SkRGBA4f
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Each component is stored as a 32-bit single precision floating point float value.
|
||||
All values are allowed, but only the range from zero to one is meaningful.
|
||||
|
||||
Each component is independent of the others; fA Alpha is not Premultiplied
|
||||
with fG green, fB blue, or fR red.
|
||||
Components are independent of the others if defined with kUnpremul_SkAlphaType;
|
||||
fA Alpha is may be greater or smaller than fG green, fB blue, or fR red.
|
||||
SkColor4f is shorthand for Unpremultiplied SkRGBA4f.
|
||||
|
||||
Components are connnected if defined with kPremul_SkAlphaType;
|
||||
fA Alpha is equal to or larger than fG green, fB blue, and fR red. The values
|
||||
stored in fG, fB, and fR combine the color component with the Alpha component.
|
||||
|
||||
Values smaller than zero or larger than one are allowed. Values out of range
|
||||
may be used with Blend_Mode so that the final component is in range.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Member float fR
|
||||
#Line # red component ##
|
||||
Single precision float for red ranges from no red (0.0) to full red (1.0).
|
||||
@ -44,17 +45,17 @@ Single precision float for blue ranges from no blue (0.0) to full blue (1.0).
|
||||
Single precision float for Alpha ranges from no Alpha (0.0) to full Alpha (1.0).
|
||||
##
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkColor4f& other)_const
|
||||
#In Operator
|
||||
#Line # compares Color4f for equality ##
|
||||
#Method bool operator==(const SkRGBA4f& other)_const
|
||||
#Line # compares SkRGBA4f for equality ##
|
||||
|
||||
Compares Color4f with other, and returns true if all components are equivalent.
|
||||
Compares SkRGBA4f with other, and returns true if all components are equivalent.
|
||||
|
||||
#Param other Color4f to compare ##
|
||||
#Param other SkRGBA4f to compare ##
|
||||
|
||||
#Return true if Color4f equals other ##
|
||||
#Return true if SkRGBA4f equals other ##
|
||||
|
||||
#Example
|
||||
SkColor4f colorRed = { 1, 0, 0, 1 };
|
||||
@ -65,22 +66,21 @@ colorRed == colorNamedRed
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso operator!=(const SkColor4f& other)_const
|
||||
#SeeAlso operator!=(const SkRGBA4f& other)_const
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator!=(const SkColor4f& other)_const
|
||||
#In Operator
|
||||
#Line # compares colors for inequality ##
|
||||
#Method bool operator!=(const SkRGBA4f& other)_const
|
||||
#Line # compares SkRGBA4f for inequality ##
|
||||
|
||||
Compares Color4f with other, and returns true if all components are not
|
||||
Compares SkRGBA4f with other, and returns true if all components are not
|
||||
equivalent.
|
||||
|
||||
#Param other Color4f to compare ##
|
||||
#Param other SkRGBA4f to compare ##
|
||||
|
||||
#Return true if Color4f is not equal to other ##
|
||||
#Return true if SkRGBA4f is not equal to other ##
|
||||
|
||||
#Example
|
||||
SkColor4f colorGray = { .5, .5, .5, 1 };
|
||||
@ -91,17 +91,52 @@ colorGray != colorNamedGray
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso operator==(const SkColor4f& other)_const
|
||||
#SeeAlso operator==(const SkRGBA4f& other)_const
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method SkRGBA4f operator*(float scale)_const
|
||||
#Line # multiplies components by scale ##
|
||||
|
||||
Multiplies each component by scale. Does not pin the result.
|
||||
|
||||
#Param scale component multiplier ##
|
||||
|
||||
#Return scaled color ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso SkBlendMode::kMultiply
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method SkRGBA4f operator*(const SkRGBA4f& scale)_const
|
||||
|
||||
Multiplies each component by scale component. Does not pin the result.
|
||||
|
||||
#Param scale SkRGBA4f component multipliers ##
|
||||
|
||||
#Return scaled color ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso SkBlendMode::kMultiply
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Property_Functions
|
||||
#Line # member values ##
|
||||
#Subtopic Property_Functions ##
|
||||
|
||||
#Method const float* vec() const
|
||||
#In Property
|
||||
#In Property_Functions
|
||||
#Line # returns array of components ##
|
||||
|
||||
Returns Color4f components as a read-only array.
|
||||
Returns SkRGBA4f components as a read-only array.
|
||||
|
||||
#Return components as read-only array ##
|
||||
|
||||
@ -123,10 +158,10 @@ red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method float* vec()
|
||||
#In Property
|
||||
#In Property_Functions
|
||||
#Line # returns array of components ##
|
||||
|
||||
Returns Color4f components as a writable array.
|
||||
Returns SkRGBA4f components as a writable array.
|
||||
|
||||
#Return components as writable array ##
|
||||
|
||||
@ -146,13 +181,68 @@ red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method float operator[](int index)_const
|
||||
#Line # returns component by index ##
|
||||
|
||||
Returns SkRGBA4f component by index, zero through three. index out of range
|
||||
triggers an assert in debug builds.
|
||||
|
||||
#Param index component, zero through three ##
|
||||
#Return component by index ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso vec
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method float& operator[](int index)
|
||||
#Line # returns writable component reference ##
|
||||
|
||||
Returns writable component reference by index, zero through three. index out of range
|
||||
triggers an assert in debug builds.
|
||||
|
||||
#Param index component, zero through three ##
|
||||
#Return writable component reference by index ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso vec
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkColor4f Pin(float r, float g, float b, float a)
|
||||
#In Utility
|
||||
#Subtopic Utility_Functions
|
||||
#Line # less common functions ##
|
||||
#Subtopic Utility_Functions ##
|
||||
|
||||
#Method bool isOpaque() const
|
||||
#In Utility_Functions
|
||||
#Line # returns if Alpha component is at maximum ##
|
||||
|
||||
Returns true if Alpha component is one. Color has no transparency regardless of
|
||||
whether color is Premultiplied or Unpremultiplied. Triggers a debugging assert
|
||||
if Alpha not valid.
|
||||
|
||||
#Return true if Alpha is one ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso vec SkColorGetA
|
||||
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRGBA4f Pin(float r, float g, float b, float a)
|
||||
#In Utility_Functions
|
||||
#Line # sets components to valid range ##
|
||||
|
||||
Constructs and returns Color4f with each component pinned from zero to one.
|
||||
Constructs and returns SkRGBA4f with each component pinned from zero to one.
|
||||
|
||||
#Param r red component ##
|
||||
#Param g green component ##
|
||||
@ -189,72 +279,13 @@ Constructs and returns Color4f with each component pinned from zero to one.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkColor4f FromColor(SkColor)
|
||||
#In Utility
|
||||
#Line # sets components from Color ##
|
||||
|
||||
Converts to closest Color4f.
|
||||
|
||||
#Param SkColor Color with Alpha, red, blue, and green components ##
|
||||
|
||||
#Return Color4f equivalent ##
|
||||
|
||||
#Example
|
||||
uint8_t red = 77, green = 101, blue = 153, alpha = 43;
|
||||
SkColor argb = SkColorSetARGB(alpha, red, green, blue);
|
||||
SkColor4f color4f = SkColor4f::FromColor(argb);
|
||||
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color4f.fR, color4f.fG, color4f.fB, color4f.fA);
|
||||
SkColor fromColor4f = color4f.toSkColor();
|
||||
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(fromColor4f),
|
||||
SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));
|
||||
#StdOut
|
||||
red=0.301961 green=0.396078 blue=0.6 alpha=0.168627
|
||||
red=77 green=101 blue=153 alpha=43
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso toSkColor
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor toSkColor() const
|
||||
#In Utility
|
||||
#Line # returns closest Color ##
|
||||
|
||||
Converts to closest SkColor.
|
||||
|
||||
#Return closest Color ##
|
||||
|
||||
#Example
|
||||
float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;
|
||||
SkColor4f color4f = { red, green, blue, alpha };
|
||||
SkColor argb = color4f.toSkColor();
|
||||
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(argb),
|
||||
SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));
|
||||
SkColor4f fromSkColor = SkColor4f::FromColor(argb);
|
||||
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", fromSkColor.fR, fromSkColor.fG,
|
||||
fromSkColor.fB, fromSkColor.fA);
|
||||
#StdOut
|
||||
red=18 green=33 blue=82 alpha=43
|
||||
red=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso FromColor
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor4f pin() const
|
||||
#In Utility
|
||||
#Method SkRGBA4f pin() const
|
||||
#In Utility_Functions
|
||||
#Line # sets components to valid range ##
|
||||
|
||||
Returns Color4f with all components in the range from zero to one.
|
||||
Returns SkRGBA4f with all components in the range from zero to one.
|
||||
|
||||
#Return Color4f with valid components ##
|
||||
#Return SkRGBA4f with valid components ##
|
||||
|
||||
#Example
|
||||
#Height 40
|
||||
@ -284,7 +315,86 @@ Returns Color4f with all components in the range from zero to one.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor4f premul() const
|
||||
#Method static SkRGBA4f FromColor(SkColor)
|
||||
#In Utility_Functions
|
||||
#Line # sets components from Color ##
|
||||
|
||||
Converts to closest SkRGBA4f.
|
||||
|
||||
#Param SkColor Color with Alpha, red, blue, and green components ##
|
||||
|
||||
#Return SkRGBA4f equivalent ##
|
||||
|
||||
#Example
|
||||
uint8_t red = 77, green = 101, blue = 153, alpha = 43;
|
||||
SkColor argb = SkColorSetARGB(alpha, red, green, blue);
|
||||
SkColor4f color4f = SkColor4f::FromColor(argb);
|
||||
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color4f.fR, color4f.fG, color4f.fB, color4f.fA);
|
||||
SkColor fromColor4f = color4f.toSkColor();
|
||||
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(fromColor4f),
|
||||
SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));
|
||||
#StdOut
|
||||
red=0.301961 green=0.396078 blue=0.6 alpha=0.168627
|
||||
red=77 green=101 blue=153 alpha=43
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso toSkColor
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor toSkColor() const
|
||||
#In Utility_Functions
|
||||
#Line # returns closest Color ##
|
||||
|
||||
Converts to closest SkColor.
|
||||
|
||||
#Return closest Color ##
|
||||
|
||||
#Example
|
||||
float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;
|
||||
SkColor4f color4f = { red, green, blue, alpha };
|
||||
SkColor argb = color4f.toSkColor();
|
||||
SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(argb),
|
||||
SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));
|
||||
SkColor4f fromSkColor = SkColor4f::FromColor(argb);
|
||||
SkDebugf("red=%g green=%g blue=%g alpha=%g\n", fromSkColor.fR, fromSkColor.fG,
|
||||
fromSkColor.fB, fromSkColor.fA);
|
||||
#StdOut
|
||||
red=18 green=33 blue=82 alpha=43
|
||||
red=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso FromColor
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRGBA4f FromPMColor(SkPMColor)
|
||||
#In Utility_Functions
|
||||
#Line # converts from Premultiplied Color ##
|
||||
|
||||
Converts from Premultiplied integer components to Unpremultiplied float
|
||||
components.
|
||||
|
||||
#Param SkPMColor Premultiplied color ##
|
||||
|
||||
#Return Unpremultiplied color ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso FromColor
|
||||
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRGBA4f<kPremul_SkAlphaType> premul() const
|
||||
#In Utility
|
||||
#Line # returns Premultiplied color ##
|
||||
|
||||
@ -299,11 +409,11 @@ Returns SkColor4f with all components premultiplied by Alpha.
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method SkColor4f unpremul() const
|
||||
#Method SkRGBA4f<kUnpremul_SkAlphaType> unpremul() const
|
||||
#In Utility
|
||||
#Line # returns Unpremultiplied color ##
|
||||
|
||||
Returns SkColor4f with all components independent of Alpha.
|
||||
Returns SkRGBA4f with all components independent of Alpha.
|
||||
|
||||
#Return Unpremultiplied color ##
|
||||
|
||||
@ -314,21 +424,15 @@ Returns SkColor4f with all components independent of Alpha.
|
||||
|
||||
#Method ##
|
||||
|
||||
#Method SkPM4f toPM4f() const
|
||||
#Line # is for internal use only ##
|
||||
#Struct ##
|
||||
|
||||
#Private
|
||||
Internal use only.
|
||||
#Typedef SkRGBA4f SkColor4f
|
||||
#Line # defines Unpremultiplied Color using floats ##
|
||||
|
||||
#Code
|
||||
using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>;
|
||||
##
|
||||
#Return premultiplied color ##
|
||||
#Method ##
|
||||
|
||||
#Struct SkColor4f ##
|
||||
|
||||
#Struct SkPM4f
|
||||
#Private
|
||||
Internal use only.
|
||||
##
|
||||
##
|
||||
|
||||
#Topic Color4f ##
|
||||
|
@ -1,15 +1,7 @@
|
||||
#Topic Color
|
||||
#Alias Color_Reference ##
|
||||
|
||||
#File
|
||||
Types, consts, functions, and macros for colors.
|
||||
##
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Define
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
@ -17,21 +9,14 @@ Color constants can be helpful to write code, documenting the meaning of values
|
||||
the represent transparency and color values. The use of Color constants is not
|
||||
required.
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Typedef
|
||||
#Populate
|
||||
#Subtopic Functions
|
||||
#Line # routines to read, write, and manipulate SkColor ##
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Alpha
|
||||
#Line # transparency of Color ##
|
||||
|
||||
Alpha represents the transparency of Color. Color with Alpha of zero is fully
|
||||
transparent. Color with Alpha of 255 is fully opaque. Some, but not all pixel
|
||||
@ -82,7 +67,7 @@ component values in a different order.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # returns Color_Alpha and RGB combined ##
|
||||
|
||||
Returns Color value from 8-bit component values. Asserts if SK_DEBUG is defined
|
||||
@ -156,16 +141,16 @@ Returns Alpha byte from Color value.
|
||||
#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
|
||||
|
||||
#Example
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setColor(SK_ColorRED);
|
||||
for (int alpha = 255; alpha >= 0; alpha -= 17) {
|
||||
paint.setAlpha(alpha);
|
||||
canvas->drawRect({5, 5, 100, 20}, paint);
|
||||
SkAlpha alphaInPaint = SkColorGetA(paint.getColor());
|
||||
canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);
|
||||
canvas->translate(0, 15);
|
||||
}
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setColor(SK_ColorRED);
|
||||
for (int alpha = 255; alpha >= 0; alpha -= 17) {
|
||||
paint.setAlpha(alpha);
|
||||
canvas->drawRect({5, 5, 100, 20}, paint);
|
||||
SkAlpha alphaInPaint = SkColorGetA(paint.getColor());
|
||||
canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);
|
||||
canvas->translate(0, 15);
|
||||
}
|
||||
##
|
||||
|
||||
#SeeAlso SkPaint::getAlpha
|
||||
@ -190,13 +175,13 @@ Returns red component of Color, from zero to 255.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t red = SkColorGetR(source.getColor(226, 128));
|
||||
canvas->drawString(std::to_string(red).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawLine(80, 70, 226, 128, SkPaint());
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t red = SkColorGetR(source.getColor(226, 128));
|
||||
canvas->drawString(std::to_string(red).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawLine(80, 70, 226, 128, SkPaint());
|
||||
##
|
||||
|
||||
#SeeAlso SkColorGetG SkColorGetB
|
||||
@ -221,12 +206,12 @@ Returns green component of Color, from zero to 255.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t green = SkColorGetG(source.getColor(57, 192));
|
||||
canvas->drawString(std::to_string(green).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t green = SkColorGetG(source.getColor(57, 192));
|
||||
canvas->drawString(std::to_string(green).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawLine(80, 70, 57, 192, SkPaint());
|
||||
##
|
||||
|
||||
@ -252,12 +237,12 @@ Returns blue component of Color, from zero to 255.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t blue = SkColorGetB(source.getColor(168, 170));
|
||||
canvas->drawString(std::to_string(blue).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 50, 80, 70}, bgPaint);
|
||||
uint8_t blue = SkColorGetB(source.getColor(168, 170));
|
||||
canvas->drawString(std::to_string(blue).c_str(), 40, 65, SkPaint());
|
||||
canvas->drawLine(80, 70, 168, 170, SkPaint());
|
||||
##
|
||||
|
||||
@ -268,7 +253,7 @@ Returns blue component of Color, from zero to 255.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a)
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # returns Color with transparency ##
|
||||
|
||||
Returns Unpremultiplied Color with red, blue, and green set from c; and alpha set
|
||||
@ -281,15 +266,15 @@ from a. Alpha component of c is ignored and is replaced by a in result.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; y += 16) {
|
||||
for (int x = 0; x < 256; x += 16) {
|
||||
SkColor color = source.getColor(x + 8, y + 8);
|
||||
SkPaint paint;
|
||||
paint.setColor(SkColorSetA(color, x + y));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 16, 16), paint);
|
||||
}
|
||||
}
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; y += 16) {
|
||||
for (int x = 0; x < 256; x += 16) {
|
||||
SkColor color = source.getColor(x + 8, y + 8);
|
||||
SkPaint paint;
|
||||
paint.setColor(SkColorSetA(color, x + y));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 16, 16), paint);
|
||||
}
|
||||
}
|
||||
##
|
||||
|
||||
#SeeAlso SkColorSetARGB
|
||||
@ -604,6 +589,7 @@ $$$#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic HSV
|
||||
#Line # hue saturation value color representation ##
|
||||
|
||||
#Subtopic Hue
|
||||
Hue represents an angle, in degrees, on a color wheel. Hue has a positive value
|
||||
@ -621,7 +607,7 @@ one, full brightness.
|
||||
##
|
||||
|
||||
#Method void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts RGB to HSV ##
|
||||
|
||||
Converts RGB to its HSV components.
|
||||
@ -637,17 +623,17 @@ hsv[2] contains HSV_Value, a value from zero to one.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 30, 110, 90}, bgPaint);
|
||||
SkScalar hsv[3];
|
||||
SkColor c = source.getColor(226, 128);
|
||||
SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);
|
||||
canvas->drawString(("h: " + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());
|
||||
canvas->drawString(("s: " + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());
|
||||
canvas->drawString(("v: " + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());
|
||||
canvas->drawLine(110, 90, 226, 128, SkPaint());
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
SkPaint bgPaint;
|
||||
bgPaint.setColor(0xafffffff);
|
||||
canvas->drawRect({20, 30, 110, 90}, bgPaint);
|
||||
SkScalar hsv[3];
|
||||
SkColor c = source.getColor(226, 128);
|
||||
SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);
|
||||
canvas->drawString(("h: " + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());
|
||||
canvas->drawString(("s: " + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());
|
||||
canvas->drawString(("v: " + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());
|
||||
canvas->drawLine(110, 90, 226, 128, SkPaint());
|
||||
##
|
||||
|
||||
#SeeAlso SkColorToHSV SkHSVToColor
|
||||
@ -657,7 +643,7 @@ hsv[2] contains HSV_Value, a value from zero to one.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void SkColorToHSV(SkColor color, SkScalar hsv[3])
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts RGB to HSV ##
|
||||
|
||||
Converts ARGB to its HSV components. Alpha in ARGB is ignored.
|
||||
@ -672,17 +658,17 @@ hsv[2] contains HSV_Value, a value from zero to one.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(source.getColor(x, y), hsv);
|
||||
hsv[1] = 1 - hsv[1];
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(source.getColor(x, y), hsv);
|
||||
hsv[1] = 1 - hsv[1];
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
##
|
||||
|
||||
#SeeAlso SkRGBToHSV SkHSVToColor
|
||||
@ -692,7 +678,7 @@ hsv[2] contains HSV_Value, a value from zero to one.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts HSV with Alpha to RGB ##
|
||||
|
||||
Converts HSV components to an ARGB color. Alpha is passed through unchanged.
|
||||
@ -712,18 +698,18 @@ Out of range hsv values are pinned.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkColor color = source.getColor(x, y);
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(color, hsv);
|
||||
hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(x + y, hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkColor color = source.getColor(x, y);
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(color, hsv);
|
||||
hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(x + y, hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
##
|
||||
|
||||
#SeeAlso SkColorToHSV SkRGBToHSV
|
||||
@ -733,7 +719,7 @@ Out of range hsv values are pinned.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkColor SkHSVToColor(const SkScalar hsv[3])
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts HSV to RGB ##
|
||||
|
||||
Converts HSV components to an ARGB color. Alpha is set to 255.
|
||||
@ -751,18 +737,18 @@ Out of range hsv values are pinned.
|
||||
|
||||
#Example
|
||||
#Image 3
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkColor color = source.getColor(x, y);
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(color, hsv);
|
||||
hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
canvas->drawBitmap(source, 0, 0);
|
||||
for (int y = 0; y < 256; ++y) {
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
SkColor color = source.getColor(x, y);
|
||||
SkScalar hsv[3];
|
||||
SkColorToHSV(color, hsv);
|
||||
hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
|
||||
SkPaint paint;
|
||||
paint.setColor(SkHSVToColor(hsv));
|
||||
canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
|
||||
}
|
||||
}
|
||||
##
|
||||
|
||||
#SeeAlso SkColorToHSV SkRGBToHSV
|
||||
@ -774,6 +760,7 @@ Out of range hsv values are pinned.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic PMColor
|
||||
#Line # color components premultiplied by Alpha ##
|
||||
|
||||
#Typedef uint32_t SkPMColor
|
||||
#Line # defines Premultiplied Color as 32 bits ##
|
||||
@ -792,7 +779,7 @@ same byte order.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts Unpremultiplied ARGB to Premultiplied PMColor ##
|
||||
|
||||
Returns a SkPMColor value from Unpremultiplied 8-bit component values.
|
||||
@ -807,14 +794,14 @@ Returns a SkPMColor value from Unpremultiplied 8-bit component values.
|
||||
#Example
|
||||
#Height 128
|
||||
#Width 300
|
||||
SkPMColor premultiplied = SkPreMultiplyARGB(160, 128, 160, 192);
|
||||
canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
|
||||
canvas->drawString("alpha=160 red=128 green=160 blue=192", 20, 40, SkPaint());
|
||||
canvas->drawString("Premultiplied:", 20, 80, SkPaint());
|
||||
std::string str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(premultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(premultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(premultiplied));
|
||||
SkPMColor premultiplied = SkPreMultiplyARGB(160, 128, 160, 192);
|
||||
canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
|
||||
canvas->drawString("alpha=160 red=128 green=160 blue=192", 20, 40, SkPaint());
|
||||
canvas->drawString("Premultiplied:", 20, 80, SkPaint());
|
||||
std::string str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(premultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(premultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(premultiplied));
|
||||
canvas->drawString(str.c_str(), 20, 100, SkPaint());
|
||||
##
|
||||
|
||||
@ -825,7 +812,7 @@ Returns a SkPMColor value from Unpremultiplied 8-bit component values.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPMColor SkPreMultiplyColor(SkColor c)
|
||||
#In Function
|
||||
#In Functions
|
||||
#Line # converts Unpremultiplied Color to Premultiplied PMColor ##
|
||||
|
||||
Returns PMColor closest to Color c. Multiplies c RGB components by the c Alpha,
|
||||
@ -838,19 +825,19 @@ and arranges the bytes to match the format of kN32_SkColorType.
|
||||
#Example
|
||||
#Height 128
|
||||
#Width 300
|
||||
SkColor unpremultiplied = SkColorSetARGB(160, 128, 160, 192);
|
||||
SkPMColor premultiplied = SkPreMultiplyColor(unpremultiplied);
|
||||
canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
|
||||
std::string str = "alpha=" + std::to_string(SkColorGetA(unpremultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(unpremultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(unpremultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(unpremultiplied));
|
||||
canvas->drawString(str.c_str(), 20, 40, SkPaint());
|
||||
canvas->drawString("Premultiplied:", 20, 80, SkPaint());
|
||||
str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(premultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(premultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(premultiplied));
|
||||
SkColor unpremultiplied = SkColorSetARGB(160, 128, 160, 192);
|
||||
SkPMColor premultiplied = SkPreMultiplyColor(unpremultiplied);
|
||||
canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
|
||||
std::string str = "alpha=" + std::to_string(SkColorGetA(unpremultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(unpremultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(unpremultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(unpremultiplied));
|
||||
canvas->drawString(str.c_str(), 20, 40, SkPaint());
|
||||
canvas->drawString("Premultiplied:", 20, 80, SkPaint());
|
||||
str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
|
||||
str += " red=" + std::to_string(SkColorGetR(premultiplied));
|
||||
str += " green=" + std::to_string(SkColorGetG(premultiplied));
|
||||
str += " blue=" + std::to_string(SkColorGetB(premultiplied));
|
||||
canvas->drawString(str.c_str(), 20, 100, SkPaint());
|
||||
##
|
||||
|
||||
|
@ -3,22 +3,14 @@
|
||||
|
||||
#Class SkDynamicMemoryWStream
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkDynamicMemoryWStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -34,7 +26,7 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method ~SkDynamicMemoryWStream() override
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Example
|
||||
|
@ -5,22 +5,14 @@
|
||||
|
||||
A stream that wraps a C FILE* file stream. */
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method explicit SkFILEStream(const char path[] = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
Initializes Stream by reading data contained by path.
|
||||
@ -42,7 +34,7 @@ Destructor is invoked.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method explicit SkFILEStream(FILE* file)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
Initialize the stream with an existing C_FILE stream.
|
||||
@ -65,7 +57,7 @@ The C_FILE stream is closed when SkFILEStream Destructor is invoked.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method ~SkFILEStream() override
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Example
|
||||
|
@ -5,22 +5,14 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkFILEWStream(const char path[])
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Param path incomplete ##
|
||||
@ -38,7 +30,7 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method ~SkFILEWStream() override
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Example
|
||||
|
@ -4,23 +4,12 @@
|
||||
|
||||
#Struct SkIPoint
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkIPoint holds two 32-bit integer coordinates.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
|
||||
#Member int32_t fX
|
||||
#Line # x-axis value ##
|
||||
x-axis value used by IPoint.
|
||||
@ -31,17 +20,11 @@ x-axis value used by IPoint.
|
||||
y-axis value used by IPoint.
|
||||
##
|
||||
|
||||
#Subtopic Member ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method static constexpr SkIPoint Make(int32_t x, int32_t y)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from integer inputs ##
|
||||
Sets fX to x, fY to y.
|
||||
|
||||
@ -63,12 +46,12 @@ pt1 == pt2
|
||||
|
||||
#Method ##
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Property
|
||||
#Line # member values ##
|
||||
#Populate
|
||||
##
|
||||
#Subtopic Property ##
|
||||
|
||||
#Method int32_t x() const
|
||||
#In Property
|
||||
@ -134,7 +117,6 @@ pt.isZero() == true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Set
|
||||
#Populate
|
||||
#Line # replaces all values ##
|
||||
##
|
||||
|
||||
@ -160,9 +142,6 @@ pt1 == pt2
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method SkIPoint operator-()_const
|
||||
|
||||
@ -264,7 +243,7 @@ Subtracts IVector v from IPoint. Sets IPoint to: #Formula # (fX - v.fX, fY - v.f
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool equals(int32_t x, int32_t y) const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if IPoint is equivalent to IPoint constructed from (x, y).
|
||||
|
||||
|
@ -4,26 +4,17 @@
|
||||
|
||||
#Struct SkIRect
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkIRect holds four 32-bit integer coordinates describing the upper and
|
||||
lower bounds of a rectangle. SkIRect may be created from outer bounds or
|
||||
from position, width, and height. SkIRect describes an area; if its right
|
||||
is less than or equal to its left, or if its bottom is less than or equal to
|
||||
its top, it is considered empty.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
#Subtopic ##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
#Subtopic ##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
#Subtopic Members
|
||||
|
||||
#Member int32_t fLeft
|
||||
#Line # smaller x-axis bounds ##
|
||||
@ -49,16 +40,15 @@ May contain any value. The larger of the vertical values when sorted.
|
||||
When equal to or less than fTop, IRect is empty.
|
||||
##
|
||||
|
||||
#Subtopic Member ##
|
||||
#Subtopic Members ##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
#Subtopic Constructors
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
#Method static constexpr SkIRect MakeEmpty()
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # returns bounds of (0, 0, 0, 0) ##
|
||||
Returns constructed IRect set to (0, 0, 0, 0).
|
||||
Many other rectangles are empty; if left is equal to or greater than right,
|
||||
@ -90,9 +80,9 @@ outset rect isEmpty: false
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
|
||||
#Method static constexpr SkIRect MakeWH(int32_t w, int32_t h)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, w, h). Does not validate input; w or h
|
||||
may be negative.
|
||||
@ -120,9 +110,9 @@ all equal
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
|
||||
#Method static constexpr SkIRect MakeSize(const SkISize& size)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from ISize returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, size.width(), size.height()).
|
||||
Does not validate input; size.width() or size.height() may be negative.
|
||||
@ -149,9 +139,9 @@ floor width: 25 height: 35
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
|
||||
#Method static constexpr SkIRect MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from int left, top, right, bottom ##
|
||||
Returns constructed IRect set to (l, t, r, b). Does not sort input; IRect may
|
||||
result in fLeft greater than fRight, or fTop greater than fBottom.
|
||||
@ -182,9 +172,9 @@ rect: 5, 25, 15, 35 isEmpty: false
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
|
||||
#Method static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (x, y, width, height) ##
|
||||
Returns constructed IRect set to: #Formula # (x, y, x + w, y + h) ##.
|
||||
Does not validate input; w or h may be negative.
|
||||
@ -213,11 +203,10 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Constructor ##
|
||||
#Subtopic Constructors ##
|
||||
|
||||
#Subtopic Property
|
||||
#Line # member values, center, validity ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@ -517,9 +506,9 @@ original rect: 20, 30, 40, 50 size: 20, 20
|
||||
|
||||
#In Property
|
||||
#Line # returns true if width or height are zero or negative or they exceed int32_t ##
|
||||
Returns true if width() or height() .
|
||||
Returns true if width() or height() are zero or negative or they exceed int32_t.
|
||||
|
||||
#Return true if width() or height() are zero or negative ##
|
||||
#Return true if width() or height() are not positive and valid ##
|
||||
|
||||
#Example
|
||||
SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
|
||||
@ -552,7 +541,7 @@ Returns true if fLeft is equal to or greater than fRight, or if fTop is equal
|
||||
to or greater than fBottom. Call sort() to reverse rectangles with negative
|
||||
width64() or height64().
|
||||
|
||||
#Return true if width64() or height64() are zero or negative ##
|
||||
#Return true if width64() or height64() are not positive ##
|
||||
|
||||
#Example
|
||||
SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
|
||||
@ -575,14 +564,13 @@ sorted: {20, 40, 20, 50} is empty
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
#Subtopic Operators
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
|
||||
identical to corresponding members in b.
|
||||
@ -609,7 +597,7 @@ test == sorted
|
||||
|
||||
#Method bool operator!=(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are unequal ##
|
||||
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
|
||||
identical to the corresponding member in b.
|
||||
@ -632,13 +620,12 @@ test != sorted
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Operator ##
|
||||
#Subtopic Operators ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Set
|
||||
#Line # replaces all values ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method void setEmpty()
|
||||
@ -764,7 +751,6 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Subtopic Inset_Outset_Offset
|
||||
#Line # moves sides ##
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@ -1025,8 +1011,6 @@ empty() returns false. The intersection of IRect pair can be described by:
|
||||
The intersection is only meaningful if the resulting IRect is not empty and
|
||||
describes an area: fLeft is less than fRight, and fTop is less than fBottom.
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void adjust(int32_t dL, int32_t dT, int32_t dR, int32_t dB)
|
||||
@ -1321,7 +1305,7 @@ be before or after the call to intersect.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b)
|
||||
#Method bool intersect(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
Returns true if a intersects b, and sets IRect to intersection.
|
||||
@ -1350,7 +1334,7 @@ Returns false if either a or b is empty, leaving IRect unchanged.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b)
|
||||
#Method bool intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
#Line # sets to shared area; returns true if not empty skips empty check ##
|
||||
@ -1475,7 +1459,6 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
|
||||
|
||||
#Subtopic Join
|
||||
#Line # sets to union of bounds ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method void join(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
@ -1536,7 +1519,6 @@ Has no effect if r is empty. Otherwise, if IRect is empty, sets IRect to r.
|
||||
|
||||
#Subtopic Sorting
|
||||
#Line # orders sides ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method void sort()
|
||||
@ -1567,7 +1549,7 @@ sorted: 20, 10, 30, 50
|
||||
#Method SkIRect makeSorted() const
|
||||
|
||||
#In Sorting
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs IRect, ordering sides from smaller to larger ##
|
||||
Returns IRect with fLeft and fRight swapped if fLeft is greater than fRight; and
|
||||
with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty;
|
||||
@ -1592,9 +1574,9 @@ sorted: 20, 10, 30, 50
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect()
|
||||
#Method static const SkIRect& EmptyIRect()
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # returns immutable bounds of (0, 0, 0, 0) ##
|
||||
Returns a reference to immutable empty IRect, set to (0, 0, 0, 0).
|
||||
|
||||
@ -1612,7 +1594,7 @@ rect: 0, 0, 0, 0
|
||||
|
||||
##
|
||||
|
||||
#Method static SkIRect SK_WARN_UNUSED_RESULT MakeLargest()
|
||||
#Method static SkIRect MakeLargest()
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
#Topic Image_Info
|
||||
#Alias Image_Info_Reference ##
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
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,
|
||||
@ -11,14 +15,6 @@ additionally describes compressed pixels like PNG, and Surface describes
|
||||
destinations on the GPU. Image and Surface may be specified by Image_Info,
|
||||
but Image and Surface may not contain Image_Info.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Alpha_Type
|
||||
#Line # encoding for pixel transparency ##
|
||||
@ -34,24 +30,15 @@ kUnpremul_SkAlphaType
|
||||
#Line # encoding for pixel transparency ##
|
||||
|
||||
#Code
|
||||
enum SkAlphaType {
|
||||
kUnknown_SkAlphaType,
|
||||
kOpaque_SkAlphaType,
|
||||
kPremul_SkAlphaType,
|
||||
kUnpremul_SkAlphaType,
|
||||
kLastEnum_SkAlphaType = kUnpremul_SkAlphaType,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Describes how to interpret the alpha component of a pixel. A pixel may
|
||||
be opaque, or Color_Alpha, describing multiple levels of transparency.
|
||||
|
||||
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:
|
||||
|
||||
#Code
|
||||
new color = draw color * alpha + destination color * (1 - alpha)
|
||||
##
|
||||
color to create a new color. If alpha describes a weight from zero to one,
|
||||
new color is set to: #Formula # draw color * alpha + destination color * (1 - alpha) ##.
|
||||
|
||||
In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.
|
||||
|
||||
@ -238,31 +225,8 @@ kGray_8_SkColorType, kRGBA_F16_SkColorType
|
||||
#Line # encoding for pixel color ##
|
||||
|
||||
#Code
|
||||
enum SkColorType {
|
||||
kUnknown_SkColorType,
|
||||
kAlpha_8_SkColorType,
|
||||
kRGB_565_SkColorType,
|
||||
kARGB_4444_SkColorType,
|
||||
kRGBA_8888_SkColorType,
|
||||
kRGB_888x_SkColorType,
|
||||
kBGRA_8888_SkColorType,
|
||||
kRGBA_1010102_SkColorType,
|
||||
kRGB_101010x_SkColorType,
|
||||
kGray_8_SkColorType,
|
||||
kRGBA_F16_SkColorType,
|
||||
kRGBA_F32_SkColorType,
|
||||
kLastEnum_SkColorType = kRGBA_F32_SkColorType,
|
||||
###$
|
||||
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
|
||||
kN32_SkColorType = kBGRA_8888_SkColorType,
|
||||
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
|
||||
kN32_SkColorType = kRGBA_8888_SkColorType,
|
||||
#else
|
||||
#error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order"
|
||||
#endif
|
||||
$$$#
|
||||
};
|
||||
#Code ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
Describes how pixel bits encode color. A pixel may be an alpha mask, a
|
||||
Grayscale, RGB, or ARGB.
|
||||
@ -883,29 +847,29 @@ kRGBA_8888_SkColorType.
|
||||
less than one, the drawn result is undefined.
|
||||
|
||||
#NoExample
|
||||
canvas->scale(16, 16);
|
||||
SkBitmap bitmap;
|
||||
SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F32_SkColorType, kPremul_SkAlphaType);
|
||||
bitmap.allocPixels(imageInfo);
|
||||
SkCanvas offscreen(bitmap);
|
||||
offscreen.clear(SK_ColorGREEN);
|
||||
canvas->drawBitmap(bitmap, 0, 0);
|
||||
// R G B A
|
||||
float red_f32[][4] = { { 1.0, 0.0, 0.0, 1.0 },
|
||||
{ .75, 0.0, 0.0, 1.0 },
|
||||
{ .50, 0.0, 0.0, 1.0 },
|
||||
{ .25, 0.0, 0.0, 1.0 } };
|
||||
float blue_f32[][4] = { { 0.0, 0.0, 1.0, 1.0 },
|
||||
{ 0.0, 0.0, .75, 1.0 },
|
||||
{ 0.0, 0.0, .50, 1.0 },
|
||||
{ 0.0, 0.0, .25, 1.0 } };
|
||||
SkPixmap redPixmap(imageInfo, red_f32, imageInfo.minRowBytes());
|
||||
if (bitmap.writePixels(redPixmap, 0, 0)) {
|
||||
canvas->drawBitmap(bitmap, 2, 2);
|
||||
}
|
||||
SkPixmap bluePixmap(imageInfo, blue_f32, imageInfo.minRowBytes());
|
||||
if (bitmap.writePixels(bluePixmap, 0, 0)) {
|
||||
canvas->drawBitmap(bitmap, 4, 4);
|
||||
canvas->scale(16, 16);
|
||||
SkBitmap bitmap;
|
||||
SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F32_SkColorType, kPremul_SkAlphaType);
|
||||
bitmap.allocPixels(imageInfo);
|
||||
SkCanvas offscreen(bitmap);
|
||||
offscreen.clear(SK_ColorGREEN);
|
||||
canvas->drawBitmap(bitmap, 0, 0);
|
||||
// R G B A
|
||||
float red_f32[][4] = { { 1.0, 0.0, 0.0, 1.0 },
|
||||
{ .75, 0.0, 0.0, 1.0 },
|
||||
{ .50, 0.0, 0.0, 1.0 },
|
||||
{ .25, 0.0, 0.0, 1.0 } };
|
||||
float blue_f32[][4] = { { 0.0, 0.0, 1.0, 1.0 },
|
||||
{ 0.0, 0.0, .75, 1.0 },
|
||||
{ 0.0, 0.0, .50, 1.0 },
|
||||
{ 0.0, 0.0, .25, 1.0 } };
|
||||
SkPixmap redPixmap(imageInfo, red_f32, imageInfo.minRowBytes());
|
||||
if (bitmap.writePixels(redPixmap, 0, 0)) {
|
||||
canvas->drawBitmap(bitmap, 2, 2);
|
||||
}
|
||||
SkPixmap bluePixmap(imageInfo, blue_f32, imageInfo.minRowBytes());
|
||||
if (bitmap.writePixels(bluePixmap, 0, 0)) {
|
||||
canvas->drawBitmap(bitmap, 4, 4);
|
||||
}
|
||||
##
|
||||
#SeeAlso SkColor4f
|
||||
@ -1053,12 +1017,7 @@ and return true if alphaType is not kUnknown_SkAlphaType.
|
||||
#Line # color range of YUV pixels ##
|
||||
|
||||
#Code
|
||||
enum SkYUVColorSpace {
|
||||
kJPEG_SkYUVColorSpace,
|
||||
kRec601_SkYUVColorSpace,
|
||||
kRec709_SkYUVColorSpace,
|
||||
kLastEnum_SkYUVColorSpace = kRec709_SkYUVColorSpace,
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Describes color range of YUV pixels. The color mapping from YUV to RGB varies
|
||||
@ -1107,6 +1066,10 @@ with studio range of 16 to 235 range for components.
|
||||
|
||||
#Struct SkImageInfo
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Describes pixel dimensions and encoding. Bitmap, Image, PixMap, and Surface
|
||||
can be created from Image_Info. Image_Info can be retrieved from Bitmap and
|
||||
Pixmap, but not from Image and Surface. For example, Image and Surface
|
||||
@ -1116,22 +1079,11 @@ Image_Info contains dimensions, the pixel integral width and height. It encodes
|
||||
how pixel bits describe Color_Alpha, transparency; Color components red, blue,
|
||||
and green; and Color_Space, the range and linearity of colors.
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method SkImageInfo()
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates with zeroed dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ##
|
||||
Creates an empty Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType,
|
||||
a width and height of zero, and no Color_Space.
|
||||
@ -1163,7 +1115,7 @@ for the Canvas actual Image_Info.
|
||||
|
||||
#Method static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
|
||||
sk_sp<SkColorSpace> cs = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ##
|
||||
Creates Image_Info from integral dimensions width and height, Color_Type ct,
|
||||
Alpha_Type at, and optionally Color_Space cs.
|
||||
@ -1207,7 +1159,7 @@ combination is supported.
|
||||
|
||||
#Method static SkImageInfo MakeN32(int width, int height, SkAlphaType at,
|
||||
sk_sp<SkColorSpace> cs = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type ##
|
||||
Creates Image_Info from integral dimensions width and height, kN32_SkColorType,
|
||||
Alpha_Type at, and optionally Color_Space cs. kN32_SkColorType will equal either
|
||||
@ -1247,7 +1199,7 @@ combination is supported.
|
||||
|
||||
#Method static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type, sRGB Color_Space ##
|
||||
Creates Image_Info from integral dimensions width and height, kN32_SkColorType,
|
||||
Alpha_Type at, with sRGB Color_Space.
|
||||
@ -1303,7 +1255,7 @@ middle gradient.
|
||||
|
||||
#Method static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ##
|
||||
Creates Image_Info from integral dimensions width and height, kN32_SkColorType,
|
||||
kPremul_SkAlphaType, with optional Color_Space.
|
||||
@ -1342,7 +1294,7 @@ combination is supported.
|
||||
|
||||
#Method static SkImageInfo MakeN32Premul(const SkISize& size)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
Creates Image_Info from integral dimensions width and height, kN32_SkColorType,
|
||||
kPremul_SkAlphaType, with Color_Space set to nullptr.
|
||||
|
||||
@ -1378,7 +1330,7 @@ combination is supported.
|
||||
|
||||
#Method static SkImageInfo MakeA8(int width, int height)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ##
|
||||
Creates Image_Info from integral dimensions width and height, kAlpha_8_SkColorType,
|
||||
kPremul_SkAlphaType, with Color_Space set to nullptr.
|
||||
@ -1418,7 +1370,7 @@ kPremul_SkAlphaType, with Color_Space set to nullptr.
|
||||
|
||||
#Method static SkImageInfo MakeUnknown(int width, int height)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ##
|
||||
Creates Image_Info from integral dimensions width and height, kUnknown_SkColorType,
|
||||
kUnknown_SkAlphaType, with Color_Space set to nullptr.
|
||||
@ -1450,7 +1402,7 @@ canvas->drawString(string, 0, 12, paint);
|
||||
|
||||
#Method static SkImageInfo MakeUnknown()
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
Creates Image_Info from integral dimensions width and height set to zero,
|
||||
kUnknown_SkColorType, kUnknown_SkAlphaType, with Color_Space set to nullptr.
|
||||
|
||||
@ -1477,7 +1429,6 @@ canvas->drawString(string, 0, 12, paint);
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # metrics and attributes ##
|
||||
##
|
||||
|
||||
@ -1814,7 +1765,7 @@ as well as a gamma curve described by a 2.2 exponent.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkImageInfo makeWH(int newWidth, int newHeight) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with changed dimensions ##
|
||||
Creates Image_Info with the same Color_Type, Color_Space, and Alpha_Type,
|
||||
with dimensions set to width and height.
|
||||
@ -1846,7 +1797,7 @@ with dimensions set to width and height.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with changed Alpha_Type ##
|
||||
Creates Image_Info with same Color_Type, Color_Space, width, and height,
|
||||
with Alpha_Type set to newAlphaType.
|
||||
@ -1891,7 +1842,7 @@ Color_Type, in which case Alpha_Type in Image_Info is ignored.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkImageInfo makeColorType(SkColorType newColorType) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with changed Color_Type ##
|
||||
Creates Image_Info with same Alpha_Type, Color_Space, width, and height,
|
||||
with Color_Type set to newColorType.
|
||||
@ -1932,7 +1883,7 @@ with Color_Type set to newColorType.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with changed Color_Space ##
|
||||
Creates Image_Info with same Alpha_Type, Color_Type, width, and height,
|
||||
with Color_Space set to cs.
|
||||
@ -2182,9 +2133,6 @@ rowBytes is smaller than minRowBytes, even though result may be incorrect.
|
||||
#Method ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method bool operator==(const SkImageInfo& other)_const
|
||||
#Line # compares Image_Info for equality ##
|
||||
@ -2381,7 +2329,7 @@ validRowBytes(68): true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void reset()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # sets zero dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ##
|
||||
Creates an empty Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType,
|
||||
a width and height of zero, and no Color_Space.
|
||||
@ -2406,7 +2354,6 @@ SkImageInfo() == reset copy
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#Class SkImage
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Image describes a two dimensional array of pixels to draw. The pixels may be
|
||||
decoded in a Raster_Bitmap, encoded in a Picture or compressed data stream,
|
||||
or located in GPU memory as a GPU_Texture.
|
||||
@ -41,26 +45,10 @@ Image is drawn. Lazy_Image caches result if possible to speed up repeated
|
||||
drawing.
|
||||
##
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkImage> MakeRasterCopy(const SkPixmap& pixmap)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Pixmap and copied pixels ##
|
||||
Creates Image from Pixmap and copy of pixels. Since pixels are copied, Pixmap
|
||||
pixels may be modified or deleted without affecting Image.
|
||||
@ -106,7 +94,7 @@ contains a copy of the pixels.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkImage> MakeRasterData(const SkImageInfo& info, sk_sp<SkData> pixels, size_t rowBytes)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Image_Info and shared pixels ##
|
||||
Creates Image from Image_Info, sharing pixels.
|
||||
|
||||
@ -172,7 +160,7 @@ provided by caller when Image is created, and may be nullptr.
|
||||
#Method static sk_sp<SkImage> MakeFromRaster(const SkPixmap& pixmap,
|
||||
RasterReleaseProc rasterReleaseProc,
|
||||
ReleaseContext releaseContext)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Pixmap, with release ##
|
||||
|
||||
Creates Image from pixmap, sharing Pixmap pixels. Pixels must remain valid and
|
||||
@ -226,7 +214,7 @@ after reset: 1
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromBitmap(const SkBitmap& bitmap)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Bitmap, sharing or copying pixels ##
|
||||
Creates Image from bitmap, sharing or copying bitmap pixels. If the bitmap
|
||||
is marked immutable, and its pixel memory is shareable, it may be shared
|
||||
@ -277,7 +265,7 @@ memory does not alter the second Image.
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromGenerator(std::unique_ptr<SkImageGenerator> imageGenerator,
|
||||
const SkIRect* subset = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from a stream of data ##
|
||||
|
||||
Creates Image from data returned by imageGenerator. Generated data is owned by Image and may not
|
||||
@ -317,7 +305,7 @@ The generator returning Picture cannot be shared; std::move transfers ownership
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromEncoded(sk_sp<SkData> encoded, const SkIRect* subset = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from encoded data ##
|
||||
Creates Image from encoded data.
|
||||
subset allows selecting a portion of the full image. Pass nullptr to select the entire image;
|
||||
@ -365,7 +353,7 @@ User function called when supplied texture may be deleted.
|
||||
SkColorType colorType,
|
||||
SkAlphaType alphaType,
|
||||
sk_sp<SkColorSpace> colorSpace)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from GPU_Texture ##
|
||||
Creates Image from GPU_Texture associated with context. Caller is responsible for
|
||||
managing the lifetime of GPU_Texture.
|
||||
@ -475,7 +463,7 @@ for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
|
||||
bool buildMips,
|
||||
SkColorSpace* dstColorSpace,
|
||||
bool limitToMaxTextureSize = false)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from encoded data, and uploads to GPU ##
|
||||
|
||||
Creates Image from encoded data. Image is uploaded to GPU back-end using context.
|
||||
@ -524,7 +512,7 @@ canvas->drawImage(image, 0, 0);
|
||||
bool buildMips,
|
||||
SkColorSpace* dstColorSpace,
|
||||
bool limitToMaxTextureSize = false)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Pixmap, and uploads to GPU ##
|
||||
|
||||
Creates Image from pixmap. Image is uploaded to GPU back-end using context.
|
||||
@ -577,7 +565,7 @@ if (source.peekPixels(&pixmap)) {
|
||||
SkColorType colorType,
|
||||
SkAlphaType alphaType = kPremul_SkAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from GPU_Texture, managed internally ##
|
||||
Creates Image from backendTexture associated with context. backendTexture and
|
||||
returned Image are managed internally, and are released when no longer needed.
|
||||
@ -633,23 +621,21 @@ Recognized formats vary by GPU back-end.
|
||||
sk_sp<SkColorSpace> imageColorSpace = nullptr)
|
||||
#In Constructor
|
||||
#Line # creates Image from YUV_ColorSpace data ##
|
||||
Creates an SkImage by flattening the specified YUVA planes into a single, interleaved RGBA image.
|
||||
Creates an SkImage by flattening the specified YUVA planes into a single,
|
||||
interleaved RGBA image.
|
||||
yuvaTextures points to array of up to four YUVA textures which reside on GPU.
|
||||
YUVA textures contain YUVA planes which may be interleaved.
|
||||
|
||||
#Param context GPU context ##
|
||||
#Param yuvColorSpace how the YUV values are converted to RGB. One of:
|
||||
kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace,
|
||||
kRec709_SkYUVColorSpace
|
||||
#Param yuvColorSpace one of: kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace,
|
||||
kRec709_SkYUVColorSpace
|
||||
##
|
||||
#Param yuvaTextures array of (up to four) YUVA textures on GPU which contain the,
|
||||
possibly interleaved, YUVA planes
|
||||
##
|
||||
#Param yuvaIndices array indicating which texture (in 'yuvaTextures') and channel
|
||||
(in the specified texture) maps to each of Y, U, V, and A.
|
||||
#Param yuvaTextures array of YUVA textures ##
|
||||
#Param yuvaIndices array indicating yuvaTextures element and channel
|
||||
that map to Y, U, V, and A
|
||||
##
|
||||
#Param imageSize size of the resulting image ##
|
||||
#Param imageOrigin origin of the resulting image. One of: kBottomLeft_GrSurfaceOrigin,
|
||||
kTopLeft_GrSurfaceOrigin
|
||||
##
|
||||
#Param imageOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ##
|
||||
#Param imageColorSpace range of colors of the resulting image; may be nullptr ##
|
||||
|
||||
#Return created SkImage, or nullptr ##
|
||||
@ -680,25 +666,22 @@ should this be moved to chrome only?
|
||||
#In Constructor
|
||||
#Line # creates Image from planar YUV_ColorSpace, stored in texture ##
|
||||
|
||||
Creates an SkImage by flattening the specified YUVA planes into a single, interleaved RGBA
|
||||
image. backendTexture is used to store the result of the flattening.
|
||||
Creates an SkImage by flattening the specified YUVA planes into a single,
|
||||
interleaved RGBA image. backendTexture is used to store the result of flattening.
|
||||
yuvaTextures points to array of up to four YUVA textures which reside on GPU.
|
||||
YUVA textures contain YUVA planes which may be interleaved.
|
||||
|
||||
#Param context GPU context ##
|
||||
#Param yuvColorSpace how the YUV values are converted to RGB. One of:
|
||||
kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace,
|
||||
kRec709_SkYUVColorSpace
|
||||
#Param yuvColorSpace one of: kJPEG_SkYUVColorSpace, kRec601_SkYUVColorSpace,
|
||||
kRec709_SkYUVColorSpace
|
||||
##
|
||||
#Param yuvaTextures array of (up to four) YUVA textures on GPU which contain the,
|
||||
possibly interleaved, YUVA planes
|
||||
##
|
||||
#Param yuvaIndices array indicating which texture (in 'yuvaTextures') and channel
|
||||
(in the specified texture) maps to each of Y, U, V, and A.
|
||||
#Param yuvaTextures array of YUVA textures ##
|
||||
#Param yuvaIndices array indicating yuvaTextures element and channel
|
||||
that map to Y, U, V, and A
|
||||
##
|
||||
#Param imageSize size of the resulting image ##
|
||||
#Param imageOrigin origin of the resulting image. One of: kBottomLeft_GrSurfaceOrigin,
|
||||
kTopLeft_GrSurfaceOrigin
|
||||
##
|
||||
#Param backendTexture the resource that stores the final pixels ##
|
||||
#Param imageOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ##
|
||||
#Param backendTexture resource that stores the final pixels ##
|
||||
#Param imageColorSpace range of colors of the resulting image; may be nullptr ##
|
||||
|
||||
#Return created SkImage, or nullptr ##
|
||||
@ -719,7 +702,7 @@ should this be moved to chrome only?
|
||||
const GrBackendTexture yuvTextures[3],
|
||||
GrSurfaceOrigin imageOrigin,
|
||||
sk_sp<SkColorSpace> imageColorSpace = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from YUV_ColorSpace data in three planes ##
|
||||
|
||||
Creates Image from copy of yuvTextures, an array of textures on GPU.
|
||||
@ -754,7 +737,7 @@ should this be moved to chrome only?
|
||||
GrContext* context, SkYUVColorSpace yuvColorSpace,
|
||||
const GrBackendTexture yuvTextures[3], GrSurfaceOrigin imageOrigin,
|
||||
const GrBackendTexture& backendTexture, sk_sp<SkColorSpace> imageColorSpace = nullptr);
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from planar YUV_ColorSpace, stored in texture ##
|
||||
|
||||
Creates Image from copy of yuvTextures, an array of textures on GPU.
|
||||
@ -768,7 +751,7 @@ convert to RGB colors.
|
||||
##
|
||||
#Param yuvTextures array of YUV textures on GPU ##
|
||||
#Param imageOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ##
|
||||
#Param backendTexture the resource that stores the final pixels ##
|
||||
#Param backendTexture resource that stores final pixels ##
|
||||
#Param imageColorSpace range of colors; may be nullptr ##
|
||||
|
||||
#Return created SkImage, or nullptr ##
|
||||
@ -792,7 +775,7 @@ should this be moved to chrome only?
|
||||
const GrBackendTexture nv12Textures[2],
|
||||
GrSurfaceOrigin imageOrigin,
|
||||
sk_sp<SkColorSpace> imageColorSpace = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from YUV_ColorSpace data in three planes ##
|
||||
|
||||
Creates Image from copy of nv12Textures, an array of textures on GPU.
|
||||
@ -831,7 +814,7 @@ should this be moved to chrome only?
|
||||
GrSurfaceOrigin imageOrigin,
|
||||
const GrBackendTexture& backendTexture,
|
||||
sk_sp<SkColorSpace> imageColorSpace = nullptr);
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from planar YUV_ColorSpace, stored in texture ##
|
||||
|
||||
Creates Image from copy of nv12Textures, an array of textures on GPU.
|
||||
@ -847,7 +830,7 @@ yuvColorSpace describes how YUV colors convert to RGB colors.
|
||||
##
|
||||
#Param nv12Textures array of YUV textures on GPU ##
|
||||
#Param imageOrigin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ##
|
||||
#Param backendTexture the resource that stores the final pixels ##
|
||||
#Param backendTexture resource that stores final pixels ##
|
||||
#Param imageColorSpace range of colors; may be nullptr ##
|
||||
|
||||
#Return created Image, or nullptr ##
|
||||
@ -900,7 +883,7 @@ Use 16 bits per ARGB component using half-precision floating point format.
|
||||
const SkMatrix* matrix, const SkPaint* paint,
|
||||
BitDepth bitDepth,
|
||||
sk_sp<SkColorSpace> colorSpace)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Picture ##
|
||||
|
||||
Creates Image from picture. Returned Image width and height are set by dimensions.
|
||||
@ -951,7 +934,7 @@ with default Paint. colorSpace may be nullptr.
|
||||
SkAlphaType alphaType = kPremul_SkAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr,
|
||||
GrSurfaceOrigin surfaceOrigin = kTopLeft_GrSurfaceOrigin)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image from Android hardware buffer ##
|
||||
|
||||
#Bug 7447
|
||||
@ -978,7 +961,6 @@ Only available on Android, when __ANDROID_API__ is defined to be 26 or greater.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # values and attributes ##
|
||||
##
|
||||
|
||||
@ -1297,7 +1279,7 @@ isOpaque = true
|
||||
|
||||
#Method sk_sp<SkShader> makeShader(SkShader::TileMode tileMode1, SkShader::TileMode tileMode2,
|
||||
const SkMatrix* localMatrix = nullptr) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Shader, Paint element that can tile Image ##
|
||||
|
||||
Creates Shader from Image. Shader dimensions are taken from Image. Shader uses
|
||||
@ -1356,7 +1338,6 @@ canvas->drawPaint(paint);
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Pixels
|
||||
#Populate
|
||||
#Line # read and write pixel values ##
|
||||
##
|
||||
|
||||
@ -1894,12 +1875,11 @@ Returns nullptr if Image contents are not encoded.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
#Method sk_sp<SkImage> makeSubset(const SkIRect& subset) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image containing part of original ##
|
||||
Returns subset of Image. subset must be fully contained by Image dimensions().
|
||||
The implementation may share pixels, or may copy them.
|
||||
@ -1932,7 +1912,7 @@ pixels in Image could not be read or copied.
|
||||
|
||||
#Method sk_sp<SkImage> makeTextureImage(GrContext* context, SkColorSpace* dstColorSpace,
|
||||
GrMipMapped mipMapped = GrMipMapped::kNo) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image matching Color_Space if possible ##
|
||||
Returns Image backed by GPU_Texture associated with context. Returned Image is
|
||||
compatible with Surface created with dstColorSpace. The returned Image respects
|
||||
@ -1982,7 +1962,7 @@ GrContext.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkImage> makeNonTextureImage() const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image without dependency on GPU_Texture ##
|
||||
Returns Raster_Image or Lazy_Image. Copies Image backed by GPU_Texture into
|
||||
CPU memory if needed. Returns original Image if decoded in Raster_Bitmap,
|
||||
@ -2024,7 +2004,7 @@ Returns nullptr if backed by GPU_Texture and copy fails.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkImage> makeRasterImage() const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image compatible with Raster_Surface if possible ##
|
||||
Returns Raster_Image. Copies Image backed by GPU_Texture into CPU memory,
|
||||
or decodes Image from Lazy_Image. Returns original Image if decoded in
|
||||
@ -2069,7 +2049,7 @@ Returns nullptr if copy, decode, or pixel read fails.
|
||||
#Method sk_sp<SkImage> makeWithFilter(const SkImageFilter* filter, const SkIRect& subset,
|
||||
const SkIRect& clipBounds, SkIRect* outSubset,
|
||||
SkIPoint* offset) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates filtered, clipped Image ##
|
||||
|
||||
Creates filtered Image. filter processes original Image, potentially changing
|
||||
@ -2148,7 +2128,7 @@ no return value. Function is called when back-end texture is to be released.
|
||||
sk_sp<SkImage> image,
|
||||
GrBackendTexture* backendTexture,
|
||||
BackendTextureReleaseProc* backendTextureReleaseProc)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates GPU_Texture from Image ##
|
||||
|
||||
Creates a GrBackendTexture from the provided SkImage. Returns true and
|
||||
@ -2231,7 +2211,7 @@ void draw(SkCanvas* canvas) {
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode legacyBitmapMode = kRO_LegacyBitmapMode) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # returns as Raster_Bitmap ##
|
||||
Creates raster Bitmap with same pixels as Image. If legacyBitmapMode is
|
||||
kRO_LegacyBitmapMode, returned bitmap is read-only and immutable.
|
||||
@ -2345,7 +2325,7 @@ void draw(SkCanvas* canvas) {
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkImage> makeColorSpace(sk_sp<SkColorSpace> target) const
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image matching Color_Space if possible ##
|
||||
|
||||
Creates Image in target Color_Space.
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
#Class SkMatrix
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Matrix holds a 3x3 matrix for transforming coordinates. This allows mapping
|
||||
Points and Vectors with translation, scaling, skewing, rotation, and
|
||||
perspective.
|
||||
@ -16,25 +20,10 @@ initializes all Matrix elements with the corresponding mapping.
|
||||
Matrix includes a hidden variable that classifies the type of matrix to
|
||||
improve performance. Matrix is not thread safe unless getType is called first.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy)
|
||||
#In Constructor
|
||||
#Method static SkMatrix MakeScale(SkScalar sx, SkScalar sy)
|
||||
#In Constructors
|
||||
#Line # constructs from scale in x and y ##
|
||||
Sets Matrix to scale by (sx, sy). Returned matrix is:
|
||||
|
||||
@ -62,7 +51,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar scale)
|
||||
#Method static SkMatrix MakeScale(SkScalar scale)
|
||||
|
||||
Sets Matrix to scale by (scale, scale). Returned matrix is:
|
||||
|
||||
@ -89,8 +78,8 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy)
|
||||
#In Constructor
|
||||
#Method static SkMatrix MakeTrans(SkScalar dx, SkScalar dy)
|
||||
#In Constructors
|
||||
#Line # constructs from translate in x and y ##
|
||||
Sets Matrix to translate by (dx, dy). Returned matrix is:
|
||||
|
||||
@ -121,10 +110,10 @@ for (int i = 0; i < 4; ++i) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX,
|
||||
#Method static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX,
|
||||
SkScalar skewY, SkScalar scaleY, SkScalar transY,
|
||||
SkScalar pers0, SkScalar pers1, SkScalar pers2)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs all nine values ##
|
||||
|
||||
|
||||
@ -243,7 +232,6 @@ after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # values and attributes ##
|
||||
##
|
||||
|
||||
@ -739,9 +727,6 @@ PDF and XPS.
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method SkScalar operator[](int index)_const
|
||||
|
||||
@ -1046,7 +1031,6 @@ after dirty cache: x = 66
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Set
|
||||
#Populate
|
||||
#Line # sets one or more matrix values ##
|
||||
##
|
||||
|
||||
@ -1372,7 +1356,7 @@ SkDebugf("{%g, %g, %g},\n{%g, %g, %g},\n{%g, %g, %g}\n", b[0], b[1], b[2],
|
||||
|
||||
#Method void set9(const SkScalar buffer[9])
|
||||
#In Set
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # sets all values from Scalar array ##
|
||||
Sets Matrix to nine Scalar values in buffer, in member value ascending order:
|
||||
kMScaleX, kMSkewX, kMTransX, kMSkewY, kMScaleY, kMTransY, kMPersp0, kMPersp1,
|
||||
@ -1409,7 +1393,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void reset()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets Matrix to identity ##
|
||||
Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
|
||||
@ -1440,7 +1424,7 @@ m.isIdentity(): true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setIdentity()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets Matrix to identity ##
|
||||
Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
|
||||
@ -1471,7 +1455,7 @@ m.isIdentity(): true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setTranslate(SkScalar dx, SkScalar dy)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to translate in x and y ##
|
||||
Sets Matrix to translate by (dx, dy).
|
||||
@ -1522,7 +1506,7 @@ canvas->drawString("translate", 8, 24, paint);
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to scale about a point ##
|
||||
Sets Matrix to scale by sx and sy, about a pivot point at (px, py).
|
||||
@ -1586,7 +1570,7 @@ Sets Matrix to scale by sx and sy about at pivot point at (0, 0).
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to rotate about a point ##
|
||||
Sets Matrix to rotate by degrees about a pivot point at (px, py).
|
||||
@ -1649,7 +1633,7 @@ Positive degrees rotates clockwise.
|
||||
|
||||
#Method void setSinCos(SkScalar sinValue, SkScalar cosValue,
|
||||
SkScalar px, SkScalar py)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to rotate and scale about a point ##
|
||||
|
||||
@ -1720,7 +1704,7 @@ Canvas needs offset after applying Matrix to pivot about Rect center.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkMatrix& setRSXform(const SkRSXform& rsxForm)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to rotate, scale, and translate ##
|
||||
Sets Matrix to rotate, scale, and translate using a compressed matrix form.
|
||||
@ -1758,7 +1742,7 @@ Canvas needs offset after applying Matrix to pivot about Rect center.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to skew about a point ##
|
||||
Sets Matrix to skew by kx and ky, about a pivot point at (px, py).
|
||||
@ -1820,7 +1804,7 @@ Sets Matrix to skew by kx and ky, about a pivot point at (0, 0).
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setConcat(const SkMatrix& a, const SkMatrix& b)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to Matrix parameter multiplied by Matrix parameter ##
|
||||
Sets Matrix to Matrix a multiplied by Matrix b. Either a or b may be this.
|
||||
@ -1870,7 +1854,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preTranslate(SkScalar dx, SkScalar dy)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # pre-multiplies Matrix by translation ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from translation (dx, dy).
|
||||
This can be thought of as moving the point to be mapped before applying Matrix.
|
||||
@ -1928,7 +1912,7 @@ Matrix * T(dx, dy) = | D E F | | 0 1 dy | = | D E D*dx+E*dy+F |
|
||||
|
||||
#Method void preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # pre-multiplies Matrix by scale ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from scaling by (sx, sy)
|
||||
about pivot point (px, py).
|
||||
@ -1984,7 +1968,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preScale(SkScalar sx, SkScalar sy)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from scaling by (sx, sy)
|
||||
about pivot point (0, 0).
|
||||
This can be thought of as scaling about the origin before applying Matrix.
|
||||
@ -2029,7 +2013,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # pre-multiplies Matrix by rotation ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from rotating by degrees
|
||||
about pivot point (px, py).
|
||||
@ -2141,7 +2125,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # pre-multiplies Matrix by skew ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from skewing by (kx, ky)
|
||||
about pivot point (px, py).
|
||||
@ -2241,7 +2225,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preConcat(const SkMatrix& other)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # pre-multiplies Matrix by Matrix parameter ##
|
||||
Sets Matrix to Matrix multiplied by Matrix other.
|
||||
This can be thought of mapping by other before applying Matrix.
|
||||
@ -2290,7 +2274,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postTranslate(SkScalar dx, SkScalar dy)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by translation ##
|
||||
Sets Matrix to Matrix constructed from translation (dx, dy) multiplied by Matrix.
|
||||
This can be thought of as moving the point to be mapped after applying Matrix.
|
||||
@ -2351,7 +2335,7 @@ Compare with preTranslate example.
|
||||
|
||||
#Method void postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by scale ##
|
||||
Sets Matrix to Matrix constructed from scaling by (sx, sy) about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
@ -2451,7 +2435,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method bool postIDiv(int divx, int divy)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by inverse scale ##
|
||||
Sets Matrix to Matrix constructed from scaling by #Formula # (1/divx, 1/divy) ##,
|
||||
about pivot point (px, py), multiplied by Matrix.
|
||||
@ -2508,7 +2492,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by rotation ##
|
||||
Sets Matrix to Matrix constructed from rotating by degrees about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
@ -2620,7 +2604,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by skew ##
|
||||
Sets Matrix to Matrix constructed from skewing by (kx, ky) about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
@ -2720,7 +2704,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postConcat(const SkMatrix& other)
|
||||
#In Set
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # post-multiplies Matrix by Matrix parameter ##
|
||||
Sets Matrix to Matrix other multiplied by Matrix.
|
||||
This can be thought of mapping by other after applying Matrix.
|
||||
@ -2890,7 +2874,7 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9 success: true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkMatrix MakeRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from source Rect to destination Rect ##
|
||||
Returns Matrix set to scale and translate src Rect to dst Rect. stf selects
|
||||
whether mapping completely fills dst or preserves the aspect ratio, and how to
|
||||
@ -2993,8 +2977,8 @@ perspective.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT invert(SkMatrix* inverse) const
|
||||
#In Operator
|
||||
#Method bool invert(SkMatrix* inverse) const
|
||||
#In Operators
|
||||
#Line # returns inverse, if possible ##
|
||||
Sets inverse to reciprocal matrix, returning true if Matrix can be inverted.
|
||||
Geometrically, if Matrix maps from source to destination, inverse Matrix
|
||||
@ -3032,7 +3016,7 @@ unchanged.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static void SetAffineIdentity(SkScalar affine[6])
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # sets 3x2 array to identity ##
|
||||
Fills affine with identity values in column major order.
|
||||
Sets affine to:
|
||||
@ -3066,8 +3050,8 @@ ScaleX: 1 SkewY: 0 SkewX: 0 ScaleY: 1 TransX: 0 TransY: 0
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT asAffine(SkScalar affine[6]) const
|
||||
#In Constructor
|
||||
#Method bool asAffine(SkScalar affine[6]) const
|
||||
#In Constructors
|
||||
#Line # copies to 3x2 array ##
|
||||
Fills affine in column major order. Sets affine to:
|
||||
|
||||
@ -3106,7 +3090,7 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setAffine(const SkScalar affine[6])
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets left two columns ##
|
||||
Sets Matrix to affine values, passed in column major order. Given affine,
|
||||
@ -3155,7 +3139,6 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Transform
|
||||
#Populate
|
||||
#Line # map points with Matrix ##
|
||||
##
|
||||
|
||||
@ -3966,7 +3949,7 @@ If isFixedStepInX is false, returned value is undefined.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool cheapEqualTo(const SkMatrix& m) const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # compares Matrix pair using memcmp() ##
|
||||
Returns true if Matrix equals m, using an efficient comparison.
|
||||
|
||||
@ -4074,7 +4057,6 @@ contains NaN, even if the other Matrix also contains NaN.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
@ -4156,7 +4138,7 @@ matrix.getMaxScale() 42
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const
|
||||
#Method bool getMinMaxScales(SkScalar scaleFactors[2]) const
|
||||
#In Property
|
||||
#Line # returns minimum and maximum scaling, if possible ##
|
||||
Sets scaleFactors[0] to the minimum scaling factor, and scaleFactors[1] to the
|
||||
@ -4241,7 +4223,7 @@ success: true scale: 0.5, 0.25
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static const SkMatrix& I()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # returns a reference to a const identity Matrix ##
|
||||
Returns reference to const identity Matrix. Returned Matrix is set to:
|
||||
|
||||
@ -4274,7 +4256,7 @@ m2 == m3
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static const SkMatrix& InvalidMatrix()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # returns a reference to a const invalid Matrix ##
|
||||
Returns reference to a const Matrix with invalid values. Returned Matrix is set
|
||||
to:
|
||||
@ -4302,7 +4284,7 @@ scaleX 3.40282e+38
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkMatrix Concat(const SkMatrix& a, const SkMatrix& b)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns the concatenation of Matrix pair ##
|
||||
Returns Matrix a multiplied by Matrix b.
|
||||
|
||||
@ -4384,7 +4366,7 @@ after dirty cache: x = 66
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#In Set
|
||||
#Line # sets to scale and translate ##
|
||||
Initializes Matrix with scale and translate elements.
|
||||
|
@ -3,22 +3,14 @@
|
||||
|
||||
#Class SkMemoryStream
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkMemoryStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -34,7 +26,7 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkMemoryStream(size_t length)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
We allocate (and free) the memory. Write to it via getMemoryBase()
|
||||
@ -54,7 +46,7 @@ We allocate (and free) the memory. Write to it via getMemoryBase()
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkMemoryStream(const void* data, size_t length, bool copyData = false)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
If copyData is true, the stream makes a private copy of the data.
|
||||
@ -76,7 +68,7 @@ If copyData is true, the stream makes a private copy of the data.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkMemoryStream(sk_sp<SkData> data)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
Creates the stream to read from the specified data
|
||||
@ -185,6 +177,7 @@ if copyData is true, the stream makes a private copy of the data
|
||||
#Line # incomplete ##
|
||||
|
||||
#Private
|
||||
Internal use only.
|
||||
##
|
||||
|
||||
#Param data incomplete ##
|
||||
|
@ -1,8 +1,19 @@
|
||||
#Topic Paint
|
||||
#Alias Paint_Reference ##
|
||||
|
||||
#PhraseDef paint_font_metrics
|
||||
Typeface, Paint_Text_Size, Paint_Text_Scale_X,
|
||||
Paint_Text_Skew_X, Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
|
||||
Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
|
||||
and Subpixel_Text
|
||||
##
|
||||
|
||||
#Class SkPaint
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Paint controls options applied when drawing and measuring. Paint collects all
|
||||
options outside of the Canvas_Clip and Canvas_Matrix.
|
||||
|
||||
@ -29,35 +40,6 @@ Paint describes a single color, a single font, a single image quality, and so on
|
||||
Multiple colors are drawn either by using multiple paints or with objects like
|
||||
Shader attached to Paint.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Struct
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Initializers
|
||||
#Line # constructors and initialization ##
|
||||
|
||||
@ -231,6 +213,7 @@ objects containing Reference_Count go to zero, they are deleted.
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Management
|
||||
#Line # paint copying, moving, comparing ##
|
||||
|
||||
@ -394,6 +377,7 @@ The hash returned is platform and implementation specific.
|
||||
#Subtopic Management ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Hinting
|
||||
#Line # glyph outline adjustment ##
|
||||
|
||||
@ -5162,7 +5146,6 @@ Paint may draw to.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
|
169
docs/SkPath_Overview.bmh
Normal file
169
docs/SkPath_Overview.bmh
Normal file
@ -0,0 +1,169 @@
|
||||
#Topic Path_Overview
|
||||
|
||||
Path contains Lines and Curves which can be stroked or filled. Contour is
|
||||
composed of a series of connected Lines and Curves. Path may contain zero,
|
||||
one, or more Contours.
|
||||
Each Line and Curve are described by Verb, Points, and optional Path_Conic_Weight.
|
||||
|
||||
Each pair of connected Lines and Curves share common Point; for instance, Path
|
||||
containing two connected Lines are described the Path_Verb sequence:
|
||||
SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb; and a Point sequence
|
||||
with three entries, sharing
|
||||
the middle entry as the end of the first Line and the start of the second Line.
|
||||
|
||||
Path components Arc, Rect, Round_Rect, Circle, and Oval are composed of
|
||||
Lines and Curves with as many Verbs and Points required
|
||||
for an exact description. Once added to Path, these components may lose their
|
||||
identity; although Path can be inspected to determine if it describes a single
|
||||
Rect, Oval, Round_Rect, and so on.
|
||||
|
||||
#Example
|
||||
#Height 192
|
||||
#Description
|
||||
Path contains three Contours: Line, Circle, and Quad. Line is stroked but
|
||||
not filled. Circle is stroked and filled; Circle stroke forms a loop. Quad
|
||||
is stroked and filled, but since it is not closed, Quad does not stroke a loop.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
SkPath path;
|
||||
path.moveTo(124, 108);
|
||||
path.lineTo(172, 24);
|
||||
path.addCircle(50, 50, 30);
|
||||
path.moveTo(36, 148);
|
||||
path.quadTo(66, 188, 120, 136);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setColor(SK_ColorBLUE);
|
||||
paint.setStrokeWidth(3);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
Path contains a Path_Fill_Type which determines whether overlapping Contours
|
||||
form fills or holes. Path_Fill_Type also determines whether area inside or outside
|
||||
Lines and Curves is filled.
|
||||
|
||||
#Example
|
||||
#Height 192
|
||||
#Description
|
||||
Path is drawn filled, then stroked, then stroked and filled.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.quadTo(66, 88, 120, 36);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setColor(SK_ColorBLUE);
|
||||
paint.setStrokeWidth(8);
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStrokeAndFill_Style);
|
||||
paint.setColor(SK_ColorRED);
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
Path contents are never shared. Copying Path by value effectively creates
|
||||
a new Path independent of the original. Internally, the copy does not duplicate
|
||||
its contents until it is edited, to reduce memory use and improve performance.
|
||||
|
||||
#Subtopic Contour
|
||||
#Alias Path_Contour ##
|
||||
#Alias Contour ##
|
||||
#Alias Contours ##
|
||||
#Line # loop of lines and curves ##
|
||||
|
||||
Contour contains one or more Verbs, and as many Points as
|
||||
are required to satisfy Path_Verb_Array. First Path_Verb in Path is always
|
||||
SkPath::kMove_Verb; each SkPath::kMove_Verb that follows starts a new Contour.
|
||||
|
||||
#Example
|
||||
#Description
|
||||
Each SkPath::moveTo starts a new Contour, and content after SkPath::close()
|
||||
also starts a new Contour. Since SkPath::conicTo is not preceded by
|
||||
SkPath::moveTo, the first Point of the third Contour starts at the last Point
|
||||
of the second Contour.
|
||||
##
|
||||
#Height 192
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
canvas->drawString("1st contour", 150, 100, paint);
|
||||
canvas->drawString("2nd contour", 130, 160, paint);
|
||||
canvas->drawString("3rd contour", 40, 30, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
SkPath path;
|
||||
path.moveTo(124, 108);
|
||||
path.lineTo(172, 24);
|
||||
path.moveTo(36, 148);
|
||||
path.quadTo(66, 188, 120, 136);
|
||||
path.close();
|
||||
path.conicTo(70, 20, 110, 40, 0.6f);
|
||||
canvas->drawPath(path, paint);
|
||||
##
|
||||
|
||||
If final Path_Verb in Contour is SkPath::kClose_Verb, Line connects Path_Last_Point in
|
||||
Contour with first Point. A closed Contour, stroked, draws
|
||||
Paint_Stroke_Join at Path_Last_Point and first Point. Without SkPath::kClose_Verb
|
||||
as final Verb, Path_Last_Point and first Point are not connected; Contour
|
||||
remains open. An open Contour, stroked, draws Paint_Stroke_Cap at
|
||||
Path_Last_Point and first Point.
|
||||
|
||||
#Example
|
||||
#Height 160
|
||||
#Description
|
||||
Path is drawn stroked, with an open Contour and a closed Contour.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setStrokeWidth(8);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.quadTo(66, 88, 120, 36);
|
||||
canvas->drawPath(path, paint);
|
||||
path.close();
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
#Subtopic Zero_Length
|
||||
#Alias Zero_Length_Contour ##
|
||||
#Line # consideration when contour has no length ##
|
||||
Contour length is distance traveled from first Point to Path_Last_Point,
|
||||
plus, if Contour is closed, distance from Path_Last_Point to first Point.
|
||||
Even if Contour length is zero, stroked Lines are drawn if Paint_Stroke_Cap
|
||||
makes them visible.
|
||||
|
||||
#Example
|
||||
#Height 64
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setStrokeWidth(8);
|
||||
paint.setStrokeCap(SkPaint::kRound_Cap);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.lineTo(36, 48);
|
||||
canvas->drawPath(path, paint);
|
||||
path.reset();
|
||||
paint.setStrokeCap(SkPaint::kSquare_Cap);
|
||||
path.moveTo(56, 48);
|
||||
path.close();
|
||||
canvas->drawPath(path, paint);
|
||||
##
|
||||
|
||||
#Subtopic Zero_Length ##
|
||||
|
||||
#Subtopic Contour ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Topic Path_Overview ##
|
@ -2,172 +2,12 @@
|
||||
#Alias Path_Reference ##
|
||||
#Alias Paths ##
|
||||
|
||||
Path contains Lines and Curves which can be stroked or filled. Contour is
|
||||
composed of a series of connected Lines and Curves. Path may contain zero,
|
||||
one, or more Contours.
|
||||
Each Line and Curve are described by Verb, Points, and optional Conic_Weight.
|
||||
|
||||
Each pair of connected Lines and Curves share common Point; for instance, Path
|
||||
containing two connected Lines are described the Verb sequence:
|
||||
SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb; and a Point sequence
|
||||
with three entries, sharing
|
||||
the middle entry as the end of the first Line and the start of the second Line.
|
||||
|
||||
Path components Arc, Rect, Round_Rect, Circle, and Oval are composed of
|
||||
Lines and Curves with as many Verbs and Points required
|
||||
for an exact description. Once added to Path, these components may lose their
|
||||
identity; although Path can be inspected to determine if it describes a single
|
||||
Rect, Oval, Round_Rect, and so on.
|
||||
|
||||
#Example
|
||||
#Height 192
|
||||
#Description
|
||||
Path contains three Contours: Line, Circle, and Quad. Line is stroked but
|
||||
not filled. Circle is stroked and filled; Circle stroke forms a loop. Quad
|
||||
is stroked and filled, but since it is not closed, Quad does not stroke a loop.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
SkPath path;
|
||||
path.moveTo(124, 108);
|
||||
path.lineTo(172, 24);
|
||||
path.addCircle(50, 50, 30);
|
||||
path.moveTo(36, 148);
|
||||
path.quadTo(66, 188, 120, 136);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setColor(SK_ColorBLUE);
|
||||
paint.setStrokeWidth(3);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
Path contains a Fill_Type which determines whether overlapping Contours
|
||||
form fills or holes. Fill_Type also determines whether area inside or outside
|
||||
Lines and Curves is filled.
|
||||
|
||||
#Example
|
||||
#Height 192
|
||||
#Description
|
||||
Path is drawn filled, then stroked, then stroked and filled.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.quadTo(66, 88, 120, 36);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setColor(SK_ColorBLUE);
|
||||
paint.setStrokeWidth(8);
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
paint.setStyle(SkPaint::kStrokeAndFill_Style);
|
||||
paint.setColor(SK_ColorRED);
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
Path contents are never shared. Copying Path by value effectively creates
|
||||
a new Path independent of the original. Internally, the copy does not duplicate
|
||||
its contents until it is edited, to reduce memory use and improve performance.
|
||||
|
||||
#Subtopic Contour
|
||||
#Alias Contours ##
|
||||
#Line # loop of lines and curves ##
|
||||
|
||||
Contour contains one or more Verbs, and as many Points as
|
||||
are required to satisfy Verb_Array. First Verb in Path is always
|
||||
SkPath::kMove_Verb; each SkPath::kMove_Verb that follows starts a new Contour.
|
||||
|
||||
#Example
|
||||
#Description
|
||||
Each SkPath::moveTo starts a new Contour, and content after SkPath::close()
|
||||
also starts a new Contour. Since SkPath::conicTo is not preceded by
|
||||
SkPath::moveTo, the first Point of the third Contour starts at the last Point
|
||||
of the second Contour.
|
||||
##
|
||||
#Height 192
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
canvas->drawString("1st contour", 150, 100, paint);
|
||||
canvas->drawString("2nd contour", 130, 160, paint);
|
||||
canvas->drawString("3rd contour", 40, 30, paint);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
SkPath path;
|
||||
path.moveTo(124, 108);
|
||||
path.lineTo(172, 24);
|
||||
path.moveTo(36, 148);
|
||||
path.quadTo(66, 188, 120, 136);
|
||||
path.close();
|
||||
path.conicTo(70, 20, 110, 40, 0.6f);
|
||||
canvas->drawPath(path, paint);
|
||||
##
|
||||
|
||||
If final Verb in Contour is SkPath::kClose_Verb, Line connects Last_Point in
|
||||
Contour with first Point. A closed Contour, stroked, draws
|
||||
Paint_Stroke_Join at Last_Point and first Point. Without SkPath::kClose_Verb
|
||||
as final Verb, Last_Point and first Point are not connected; Contour
|
||||
remains open. An open Contour, stroked, draws Paint_Stroke_Cap at
|
||||
Last_Point and first Point.
|
||||
|
||||
#Example
|
||||
#Height 160
|
||||
#Description
|
||||
Path is drawn stroked, with an open Contour and a closed Contour.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setStrokeWidth(8);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.quadTo(66, 88, 120, 36);
|
||||
canvas->drawPath(path, paint);
|
||||
path.close();
|
||||
canvas->translate(0, 50);
|
||||
canvas->drawPath(path, paint);
|
||||
}
|
||||
##
|
||||
|
||||
#Subtopic Zero_Length
|
||||
#Alias Zero_Length_Contour ##
|
||||
#Line # consideration when contour has no length ##
|
||||
Contour length is distance traveled from first Point to Last_Point,
|
||||
plus, if Contour is closed, distance from Last_Point to first Point.
|
||||
Even if Contour length is zero, stroked Lines are drawn if Paint_Stroke_Cap
|
||||
makes them visible.
|
||||
|
||||
#Example
|
||||
#Height 64
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setStrokeWidth(8);
|
||||
paint.setStrokeCap(SkPaint::kRound_Cap);
|
||||
SkPath path;
|
||||
path.moveTo(36, 48);
|
||||
path.lineTo(36, 48);
|
||||
canvas->drawPath(path, paint);
|
||||
path.reset();
|
||||
paint.setStrokeCap(SkPaint::kSquare_Cap);
|
||||
path.moveTo(56, 48);
|
||||
path.close();
|
||||
canvas->drawPath(path, paint);
|
||||
##
|
||||
|
||||
#Subtopic Zero_Length ##
|
||||
|
||||
#Subtopic Contour ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Class SkPath
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Paths contain geometry. Paths may be empty, or contain one or more Verbs that
|
||||
outline a figure. Path always starts with a move verb to a Cartesian_Coordinate,
|
||||
and may be followed by additional verbs that add lines or curves.
|
||||
@ -185,34 +25,6 @@ overlapping contours.
|
||||
Internally, Path lazily computes metrics likes bounds and convexity. Call
|
||||
SkPath::updateBoundsCache to make Path thread safe.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Class
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Verb
|
||||
#Alias Verbs ##
|
||||
#Line # line and curve type ##
|
||||
@ -395,7 +207,7 @@ void draw(SkCanvas* canvas) {
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPath()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs with default values ##
|
||||
Constucts an empty Path. By default, Path has no Verbs, no Points, and no Weights.
|
||||
Fill_Type is set to kWinding_FillType.
|
||||
@ -417,7 +229,7 @@ path is empty
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPath(const SkPath& path)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # makes a shallow copy ##
|
||||
Constructs a copy of an existing path.
|
||||
Copy constructor makes two paths identical by value. Internally, path and
|
||||
@ -608,7 +420,6 @@ convexity !=
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # metrics and attributes ##
|
||||
##
|
||||
|
||||
@ -648,7 +459,6 @@ paths are interpolatable
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Interpolate
|
||||
#Populate
|
||||
#Line # weighted average of Path pair ##
|
||||
##
|
||||
|
||||
@ -1219,7 +1029,7 @@ void draw(SkCanvas* canvas) {
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPath& reset()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # removes Verb_Array, Point_Array, and Weights; frees memory ##
|
||||
Sets Path to its initial state.
|
||||
Removes Verb_Array, Point_Array, and Weights, and sets FillType to kWinding_FillType.
|
||||
@ -1243,7 +1053,7 @@ Internal storage associated with Path is released.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkPath& rewind()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # removes Verb_Array, Point_Array, and Weights, keeping memory ##
|
||||
Sets Path to its initial state, preserving internal storage.
|
||||
Removes Verb_Array, Point_Array, and Weights, and sets FillType to kWinding_FillType.
|
||||
@ -1415,7 +1225,6 @@ volatile by default is false
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Volatile
|
||||
#Populate
|
||||
#Line # caching attribute ##
|
||||
##
|
||||
|
||||
@ -1864,7 +1673,7 @@ just right verb count: 3 move line line
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void swap(SkPath& other)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # exchanges Path pair ##
|
||||
Exchanges the Verb_Array, Point_Array, Weights, and Fill_Type with other.
|
||||
Cached state is also exchanged. swap() internally exchanges pointers, so
|
||||
@ -1939,7 +1748,6 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
@ -2137,7 +1945,6 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Build
|
||||
#Populate
|
||||
#Line # adds points and verbs to path ##
|
||||
##
|
||||
|
||||
@ -4763,7 +4570,6 @@ If dst is nullptr, Path is replaced by offset data.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Transform
|
||||
#Populate
|
||||
#Line # modify all points ##
|
||||
##
|
||||
|
||||
@ -5384,16 +5190,7 @@ empty genID = 1
|
||||
#Line # data iterator ##
|
||||
|
||||
#Code
|
||||
class Iter {
|
||||
public:
|
||||
Iter();
|
||||
Iter(const SkPath& path, bool forceClose);
|
||||
void setPath(const SkPath& path, bool forceClose);
|
||||
Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false);
|
||||
SkScalar conicWeight() const;
|
||||
bool isCloseLine() const;
|
||||
bool isClosedContour() const;
|
||||
};
|
||||
#Populate
|
||||
##
|
||||
|
||||
Iterates through Verb_Array, and associated Point_Array and Conic_Weight.
|
||||
@ -5780,20 +5577,13 @@ with close(), forceClose is true : isClosedContour returns true
|
||||
#Line # raw data iterator ##
|
||||
|
||||
#Code
|
||||
class RawIter {
|
||||
public:
|
||||
RawIter();
|
||||
RawIter(const SkPath& path);
|
||||
void setPath(const SkPath& path);
|
||||
Verb next(SkPoint pts[4]);
|
||||
Verb peek() const;
|
||||
SkScalar conicWeight() const;
|
||||
}
|
||||
#Populate
|
||||
##
|
||||
|
||||
Iterates through Verb_Array, and associated Point_Array and Conic_Weight.
|
||||
Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
|
||||
|
||||
|
||||
#Method RawIter()
|
||||
#Line # constructs empty Path iterator ##
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
#Class SkPicture
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Picture records drawing commands made to Canvas. The command stream may be
|
||||
played in whole or in part at a later time.
|
||||
|
||||
@ -15,18 +19,6 @@ Canvas_Matrix or Canvas_Clip. Picture has a cull Rect, which is used as
|
||||
a bounding box hint. To limit Picture bounds, use Canvas_Clip when
|
||||
recording or drawing Picture.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Class
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Class AbortCallback
|
||||
@ -50,7 +42,7 @@ If AbortCallback::abort returns true, SkPicture::playback is interrupted.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method AbortCallback()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # defines default constructor ##
|
||||
Has no effect.
|
||||
|
||||
@ -66,7 +58,7 @@ Has no effect.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method virtual ~AbortCallback()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # defines default destructor ##
|
||||
Has no effect.
|
||||
|
||||
@ -136,7 +128,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method static sk_sp<SkPicture> MakeFromStream(SkStream* stream,
|
||||
const SkDeserialProcs* procs = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Picture from stream ##
|
||||
|
||||
Recreates Picture that was serialized into a stream. Returns constructed Picture
|
||||
@ -176,7 +168,7 @@ is called with a pointer to data, data byte length, and user context.
|
||||
|
||||
#Method static sk_sp<SkPicture> MakeFromData(const SkData* data,
|
||||
const SkDeserialProcs* procs = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Picture from data ##
|
||||
|
||||
Recreates Picture that was serialized into data. Returns constructed Picture
|
||||
@ -414,7 +406,7 @@ is called with a pointer to Picture and user context.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkPicture> MakePlaceholder(SkRect cull)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs placeholder with unique identifier ##
|
||||
|
||||
Returns a placeholder SkPicture. Result does not draw, and contains only
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#Class SkPixmap
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Pixmap provides a utility to pair SkImageInfo with pixels and row bytes.
|
||||
Pixmap is a low level class which provides convenience functions to access
|
||||
raster destinations. Canvas can not draw Pixmap, nor does Pixmap provide
|
||||
@ -14,21 +18,6 @@ pixels referenced by Pixmap.
|
||||
Pixmap does not try to manage the lifetime of the pixel memory. Use Pixel_Ref
|
||||
to manage pixel memory; Pixel_Ref is safe across threads.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Initialization
|
||||
#Line # sets fields for use ##
|
||||
@ -232,13 +221,13 @@ is not unique
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask)
|
||||
#Method bool reset(const SkMask& mask)
|
||||
#Deprecated soon
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const
|
||||
#Method bool extractSubset(SkPixmap* subset, const SkIRect& area) const
|
||||
|
||||
#In Initialization
|
||||
#Line # sets pointer to portion of original ##
|
||||
@ -1501,7 +1490,6 @@ is drawn after overwriting bottom half float color with top half float color.
|
||||
#Subtopic Writable_Address ##
|
||||
|
||||
#Subtopic Pixels
|
||||
#Populate
|
||||
#Line # read and write pixel values ##
|
||||
##
|
||||
|
||||
|
@ -4,23 +4,12 @@
|
||||
|
||||
#Struct SkPoint
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkPoint holds two 32-bit floating point coordinates.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
|
||||
#Member SkScalar fX
|
||||
#Line # x-axis value ##
|
||||
x-axis value used by both Point and Vector. May contain any value, including
|
||||
@ -33,16 +22,10 @@ y-axis value used by both Point and Vector. May contain any value, including
|
||||
infinities and NaN.
|
||||
##
|
||||
|
||||
#Subtopic Member ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method static constexpr SkPoint Make(SkScalar x, SkScalar y)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar inputs ##
|
||||
Sets fX to x, fY to y. Used both to set Point and Vector.
|
||||
|
||||
@ -70,7 +53,6 @@ all equal
|
||||
|
||||
#Subtopic Property
|
||||
#Line # member values ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method SkScalar x() const
|
||||
@ -140,7 +122,6 @@ pt.isZero() == true
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Set
|
||||
#Populate
|
||||
#Line # replaces all values ##
|
||||
##
|
||||
|
||||
@ -251,7 +232,6 @@ pt: nan, -nan abs: nan, nan
|
||||
|
||||
#Subtopic Offset
|
||||
#Line # moves sides ##
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method static void Offset(SkPoint points[], int count, const SkVector& offset)
|
||||
@ -555,13 +535,9 @@ true.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method void scale(SkScalar scale, SkPoint* dst) const
|
||||
#In Offset
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # multiplies Point by scale factor ##
|
||||
Sets dst to Point times scale. dst may be Point to modify Point in place.
|
||||
|
||||
@ -613,7 +589,7 @@ Scales Point in place by scale.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void negate()
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # reverses the sign of both members ##
|
||||
Changes the sign of fX and fY.
|
||||
|
||||
@ -822,7 +798,7 @@ pt: nan, -1 finite: false
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool equals(SkScalar x, SkScalar y) const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if Points are equal ##
|
||||
Returns true if Point is equivalent to Point constructed from (x, y).
|
||||
|
||||
@ -1097,7 +1073,7 @@ Returns the Euclidean_Distance between a and b.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkScalar DotProduct(const SkVector& a, const SkVector& b)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns dot product ##
|
||||
Returns the dot product of Vector a and Vector b.
|
||||
|
||||
@ -1129,7 +1105,7 @@ Returns the dot product of Vector a and Vector b.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkScalar CrossProduct(const SkVector& a, const SkVector& b)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns cross product ##
|
||||
Returns the cross product of Vector a and Vector b.
|
||||
|
||||
@ -1169,7 +1145,7 @@ to zero. The cross product z-axis component is returned.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkScalar cross(const SkVector& vec) const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns cross product ##
|
||||
Returns the cross product of Vector and vec.
|
||||
|
||||
@ -1208,7 +1184,7 @@ equal to zero. The cross product z-axis component is returned.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkScalar dot(const SkVector& vec) const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns dot product ##
|
||||
Returns the dot product of Vector and Vector vec.
|
||||
|
||||
|
@ -4,6 +4,78 @@
|
||||
|
||||
#Class SkRRect
|
||||
|
||||
#Code
|
||||
class SkRRect {
|
||||
public:
|
||||
SkRRect() = default;
|
||||
SkRRect(const SkRRect& rrect) = default;
|
||||
SkRRect& operator=(const SkRRect& rrect) = default;
|
||||
|
||||
enum Type {
|
||||
kEmpty_Type,
|
||||
kRect_Type,
|
||||
kOval_Type,
|
||||
kSimple_Type,
|
||||
kNinePatch_Type,
|
||||
kComplex_Type,
|
||||
kLastType = kComplex_Type,
|
||||
};
|
||||
|
||||
Type getType() const;
|
||||
Type type() const;
|
||||
bool isEmpty() const;
|
||||
bool isRect() const;
|
||||
bool isOval() const;
|
||||
bool isSimple() const;
|
||||
bool isNinePatch() const;
|
||||
bool isComplex() const;
|
||||
SkScalar width() const;
|
||||
SkScalar height() const;
|
||||
SkVector getSimpleRadii() const;
|
||||
void setEmpty();
|
||||
void setRect(const SkRect& rect);
|
||||
static SkRRect MakeEmpty();
|
||||
static SkRRect MakeRect(const SkRect& r);
|
||||
static SkRRect MakeOval(const SkRect& oval);
|
||||
static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad);
|
||||
void setOval(const SkRect& oval);
|
||||
void setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad);
|
||||
void setNinePatch(const SkRect& rect, SkScalar leftRad, SkScalar topRad,
|
||||
SkScalar rightRad, SkScalar bottomRad);
|
||||
void setRectRadii(const SkRect& rect, const SkVector radii[4]);
|
||||
|
||||
enum Corner {
|
||||
kUpperLeft_Corner,
|
||||
kUpperRight_Corner,
|
||||
kLowerRight_Corner,
|
||||
kLowerLeft_Corner,
|
||||
};
|
||||
|
||||
const SkRect& rect() const;
|
||||
SkVector radii(Corner corner) const;
|
||||
const SkRect& getBounds() const;
|
||||
friend bool operator==(const SkRRect& a, const SkRRect& b);
|
||||
friend bool operator!=(const SkRRect& a, const SkRRect& b);
|
||||
void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const;
|
||||
void inset(SkScalar dx, SkScalar dy);
|
||||
void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const;
|
||||
void outset(SkScalar dx, SkScalar dy);
|
||||
void offset(SkScalar dx, SkScalar dy);
|
||||
SkRRect makeOffset(SkScalar dx, SkScalar dy) const;
|
||||
bool contains(const SkRect& rect) const;
|
||||
bool isValid() const;
|
||||
|
||||
static constexpr size_t kSizeInMemory = 12 * sizeof(SkScalar);
|
||||
|
||||
size_t writeToMemory(void* buffer) const;
|
||||
size_t readFromMemory(const void* buffer, size_t length);
|
||||
bool transform(const SkMatrix& matrix, SkRRect* dst) const;
|
||||
void dump(bool asHex) const;
|
||||
void dump() const;
|
||||
void dumpHex() const;
|
||||
};
|
||||
##
|
||||
|
||||
SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
|
||||
The bounds and radii can be set so that SkRRect describes: a rectangle with sharp corners;
|
||||
a Circle; an Oval; or a rectangle with one or more rounded corners.
|
||||
@ -16,26 +88,10 @@ SkRRect may modify the provided parameters when initializing bounds and radii.
|
||||
If either axis radii is zero or less: radii are stored as zero; corner is square.
|
||||
If corner curves overlap, radii are proportionally reduced to fit within bounds.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRRect()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates with zeroed bounds and corner radii ##
|
||||
|
||||
Initializes bounds at (0, 0), the origin, with zero width and height.
|
||||
@ -61,7 +117,7 @@ Initializes corner radii to (0, 0), and sets type of kEmpty_Type.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRRect(const SkRRect& rrect)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # copies bounds and corner radii ##
|
||||
|
||||
Initializes to copy of rrect bounds and corner radii.
|
||||
@ -90,7 +146,7 @@ Initializes to copy of rrect bounds and corner radii.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRRect& operator=(const SkRRect& rrect)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # copies bounds and corner radii ##
|
||||
|
||||
Copies rrect bounds and corner radii.
|
||||
@ -278,7 +334,7 @@ inset() has made rrect2 empty.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isEmpty() const
|
||||
#Method bool isEmpty() const
|
||||
#In Property
|
||||
#Line # returns true if width or height are zero ##
|
||||
Returns true if rect().fLeft is equal to rect().fRight, or if rect().fTop is equal
|
||||
@ -307,7 +363,7 @@ to rect().fBottom.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isRect() const
|
||||
#Method bool isRect() const
|
||||
#In Property
|
||||
#Line # returns true if not empty, and one radius at each corner is zero ##
|
||||
Returns true if not empty, and if either x-axis or y-axis radius at each corner
|
||||
@ -337,7 +393,7 @@ is zero.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isOval() const
|
||||
#Method bool isOval() const
|
||||
#In Property
|
||||
#Line # returns true if not empty, axes radii are equal, radii fill bounds ##
|
||||
Returns true if not empty, if all x-axis radii are equal, if all y-axis radii
|
||||
@ -373,7 +429,7 @@ dimensions; right Round_Rect is an oval.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isSimple() const
|
||||
#Method bool isSimple() const
|
||||
#In Property
|
||||
#Line # returns true if not empty, Rect or Oval; and axes radii are equal ##
|
||||
Returns true if not empty, if all x-axis radii are equal but not zero,
|
||||
@ -407,7 +463,7 @@ width(), or y-axis radius is less than half height().
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isNinePatch() const
|
||||
#Method bool isNinePatch() const
|
||||
#In Property
|
||||
#Line # returns true if not empty, Rect, Oval or simple; and radii are axis-aligned ##
|
||||
Returns true if isEmpty, isRect, isOval, and isSimple return false; and if
|
||||
@ -441,7 +497,7 @@ equal, and bottom y-axis radii are equal.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method inline bool isComplex() const
|
||||
#Method bool isComplex() const
|
||||
#In Property
|
||||
#Line # returns true if not empty, Rect, Oval, simple, or nine-patch ##
|
||||
|
||||
@ -623,7 +679,7 @@ otherwise, sets type to kEmpty_Type.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRRect MakeEmpty()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates with zeroed bounds and corner radii ##
|
||||
|
||||
Initializes bounds at (0, 0), the origin, with zero width and height.
|
||||
@ -653,7 +709,7 @@ Initializes corner radii to (0, 0), and sets type of kEmpty_Type.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRRect MakeRect(const SkRect& r)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # copies bounds and zeroes corner radii ##
|
||||
|
||||
Initializes to copy of r bounds and zeroes corner radii.
|
||||
@ -679,7 +735,7 @@ Initializes to copy of r bounds and zeroes corner radii.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRRect MakeOval(const SkRect& oval)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Oval to fit bounds ##
|
||||
|
||||
Sets bounds to oval, x-axis radii to half oval.width(), and all y-axis radii
|
||||
@ -708,7 +764,7 @@ Otherwise, sets to kOval_Type.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates rounded rectangle ##
|
||||
|
||||
Sets to rounded rectangle with the same radii for all four corners.
|
||||
@ -1040,7 +1096,7 @@ Result is identical to rect().
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkRRect& a, const SkRRect& b)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if bounds and radii in a are equal to bounds and radii in b.
|
||||
|
||||
@ -1074,7 +1130,7 @@ contain zeroes width different signs.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator!=(const SkRRect& a, const SkRRect& b)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are unequal ##
|
||||
Returns true if bounds and radii in a are not equal to bounds and radii in b.
|
||||
|
||||
@ -1277,7 +1333,7 @@ Translates Round_Rect by (dx, dy).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const
|
||||
#Method SkRRect makeOffset(SkScalar dx, SkScalar dy) const
|
||||
#In Inset_Outset_Offset
|
||||
#Line # offsets bounds and radii ##
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
#Struct SkRect
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkRect holds four SkScalar coordinates describing the upper and
|
||||
lower bounds of a rectangle. SkRect may be created from outer bounds or
|
||||
from position, width, and height. SkRect describes an area; if its right
|
||||
@ -14,21 +18,6 @@ its top, it is considered empty.
|
||||
SkRect can be constructed from int values to avoid compiler warnings that
|
||||
integer input cannot convert to SkScalar without loss of precision.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
|
||||
#Member SkScalar fLeft
|
||||
#Line # smaller x-axis bounds ##
|
||||
May contain any value, including infinities and NaN. The smaller of the
|
||||
@ -53,16 +42,13 @@ May contain any value, including infinities and NaN. The larger of the
|
||||
vertical values when sorted. When equal to or less than fTop, Rect is empty.
|
||||
##
|
||||
|
||||
#Subtopic Member ##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
#Subtopic Constructors
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
#Method static constexpr SkRect MakeEmpty()
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from bounds of (0, 0, 0, 0) ##
|
||||
Returns constructed Rect set to (0, 0, 0, 0).
|
||||
Many other rectangles are empty; if left is equal to or greater than right,
|
||||
@ -94,9 +80,9 @@ outset rect isEmpty: false
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
|
||||
#Method static constexpr SkRect MakeWH(SkScalar w, SkScalar h)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar input returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to SkScalar values (0, 0, w, h). Does not
|
||||
validate input; w or h may be negative.
|
||||
@ -127,9 +113,9 @@ all equal
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h)
|
||||
#Method static SkRect MakeIWH(int w, int h)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to integer values (0, 0, w, h). Does not validate
|
||||
input; w or h may be negative.
|
||||
@ -161,9 +147,9 @@ i_rect width: 125000111 f_rect width:125000112
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
|
||||
#Method static constexpr SkRect MakeSize(const SkSize& size)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from Size returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to (0, 0, size.width(), size.height()). Does not
|
||||
validate input; size.width() or size.height() may be negative.
|
||||
@ -191,9 +177,9 @@ floor width: 25 height: 35
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r,
|
||||
#Method static constexpr SkRect MakeLTRB(SkScalar l, SkScalar t, SkScalar r,
|
||||
SkScalar b)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar left, top, right, bottom ##
|
||||
|
||||
Returns constructed Rect set to (l, t, r, b). Does not sort input; Rect may
|
||||
@ -225,9 +211,9 @@ rect: 5, 25, 15, 35 isEmpty: false
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
|
||||
#Method static constexpr SkRect MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar input returning (x, y, width, height) ##
|
||||
Returns constructed Rect set to #Formula # (x, y, x + w, y + h) ##.
|
||||
Does not validate input; w or h may be negative.
|
||||
@ -260,7 +246,7 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Method static SkRect Make(const SkISize& size)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs from ISize returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, size.width(), size.height()).
|
||||
Does not validate input; size.width() or size.height() may be negative.
|
||||
@ -284,9 +270,9 @@ rect1 == rect2
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect)
|
||||
#Method static SkRect Make(const SkIRect& irect)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
Returns constructed IRect set to irect, promoting integers to Scalar.
|
||||
Does not validate input; fLeft may be greater than fRight, fTop may be greater
|
||||
than fBottom.
|
||||
@ -308,11 +294,10 @@ than fBottom.
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Constructor ##
|
||||
#Subtopic Constructors ##
|
||||
|
||||
#Subtopic Property
|
||||
#Line # member values, center, validity ##
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@ -324,7 +309,7 @@ Returns true if fLeft is equal to or greater than fRight, or if fTop is equal
|
||||
to or greater than fBottom. Call sort() to reverse rectangles with negative
|
||||
width() or height().
|
||||
|
||||
#Return true if width() or height() are zero or negative ##
|
||||
#Return true if width() or height() are not positive and valid ##
|
||||
|
||||
#Example
|
||||
SkRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
|
||||
@ -678,15 +663,13 @@ left: 2e+38 right: 3e+38 centerX: 2.5e+38 safe mid x: 2.5e+38
|
||||
|
||||
#Subtopic Property ##
|
||||
|
||||
#Subtopic Operator
|
||||
|
||||
#Populate
|
||||
#Subtopic Operators
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
|
||||
equal to the corresponding members in b.
|
||||
@ -731,7 +714,7 @@ tests are equal
|
||||
|
||||
#Method bool operator!=(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # returns true if members are unequal ##
|
||||
Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not
|
||||
equal the corresponding members in b.
|
||||
@ -756,13 +739,11 @@ test with NaN is not equal to itself
|
||||
|
||||
##
|
||||
|
||||
#Subtopic Operator ##
|
||||
#Subtopic Operators ##
|
||||
|
||||
#Subtopic As_Points
|
||||
#Line # conversion to and from Points ##
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void toQuad(SkPoint quad[4]) const
|
||||
@ -887,7 +868,6 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
|
||||
|
||||
#Subtopic Set
|
||||
#Line # replaces all values ##
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@ -1170,8 +1150,6 @@ rect: -15, 0, 0, 25 isEmpty: false
|
||||
#Subtopic From_Integers
|
||||
#Line # sets Scalar values from integer input ##
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void iset(int left, int top, int right, int bottom)
|
||||
@ -1238,8 +1216,6 @@ rect2: {0, 0, 1, 2}
|
||||
#Subtopic Inset_Outset_Offset
|
||||
#Line # moves sides ##
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRect makeOffset(SkScalar dx, SkScalar dy) const
|
||||
@ -1499,8 +1475,6 @@ empty() returns false. The intersection of Rect pair can be described by:
|
||||
The intersection is only meaningful if the resulting Rect is not empty and
|
||||
describes an area: fLeft is less than fRight, and fTop is less than fBottom.
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool contains(SkScalar x, SkScalar y) const
|
||||
@ -1679,7 +1653,7 @@ be before or after the call to intersect.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersect(const SkRect& a, const SkRect& b)
|
||||
#Method bool intersect(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Intersection
|
||||
Returns true if a intersects b, and sets Rect to intersection.
|
||||
@ -1791,8 +1765,6 @@ Returns false if either a or b is empty, or do not intersect.
|
||||
#Subtopic Join
|
||||
#Line # sets to union of bounds ##
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
|
||||
@ -1924,8 +1896,6 @@ sorted: 10, 0, 55, 100
|
||||
#Subtopic Rounding
|
||||
#Line # adjust to integer bounds ##
|
||||
|
||||
#Populate
|
||||
|
||||
#Method void round(SkIRect* dst) const
|
||||
|
||||
#In Rounding
|
||||
@ -2084,8 +2054,6 @@ round: 30, 50, 41, 61
|
||||
#Subtopic Sorting
|
||||
#Line # orders sides ##
|
||||
|
||||
#Populate
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void sort()
|
||||
@ -2116,7 +2084,7 @@ sorted: 20.5, 10.5, 30.5, 50.5
|
||||
#Method SkRect makeSorted() const
|
||||
|
||||
#In Sorting
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Rect, ordering sides from smaller to larger ##
|
||||
Returns Rect with fLeft and fRight swapped if fLeft is greater than fRight; and
|
||||
with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty;
|
||||
@ -2252,7 +2220,7 @@ rect is equal to copy
|
||||
|
||||
##
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT MakeLargest()
|
||||
#Method static SkRect MakeLargest()
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
|
@ -20,36 +20,16 @@ kReplace_Op
|
||||
|
||||
#Class SkRegion
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkRegion describes the set of pixels used to clip Canvas. SkRegion is compact,
|
||||
efficiently storing a single integer rectangle, or a run length encoded array
|
||||
of rectangles. SkRegion may reduce the current Canvas_Clip, or may be drawn as
|
||||
one or more integer rectangles. SkRegion iterator returns the scan lines or
|
||||
rectangles contained by it, optionally intersecting a bounding rectangle.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Class
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Operator
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Class Iterator
|
||||
@ -526,7 +506,7 @@ after set rect: result=true left=2 right=3
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRegion()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs with default values ##
|
||||
|
||||
Constructs an empty Region. Region is set to empty bounds
|
||||
@ -550,7 +530,7 @@ region bounds: {0, 0, 0, 0}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRegion(const SkRegion& region)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # makes a shallow copy ##
|
||||
Constructs a copy of an existing region.
|
||||
Copy constructor makes two regions identical by value. Internally, region and
|
||||
@ -594,7 +574,7 @@ region2 bounds: {1,2,3,4}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method explicit SkRegion(const SkIRect& rect)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Region matching IRect ##
|
||||
Constructs a rectangular Region matching the bounds of rect.
|
||||
|
||||
@ -616,7 +596,7 @@ Constructs a rectangular Region matching the bounds of rect.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method ~SkRegion()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # decreases Reference_Count of owned objects ##
|
||||
Releases ownership of any shared data and deletes data if Region is sole owner.
|
||||
|
||||
@ -641,7 +621,7 @@ region2 bounds: {1,2,3,4}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkRegion& operator=(const SkRegion& region)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # makes a shallow copy ##
|
||||
Constructs a copy of an existing region.
|
||||
Makes two regions identical by value. Internally, region and
|
||||
@ -678,7 +658,7 @@ region2 bounds: {1,2,3,4}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkRegion& other)_const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # compares Regions for equality ##
|
||||
|
||||
Compares Region and other; returns true if they enclose exactly
|
||||
@ -713,7 +693,7 @@ set empty one == two
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator!=(const SkRegion& other)_const
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # compares Regions for inequality ##
|
||||
|
||||
Compares Region and other; returns true if they do not enclose the same area.
|
||||
@ -748,7 +728,7 @@ union rect one == two
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool set(const SkRegion& src)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # makes a shallow copy ##
|
||||
|
||||
Sets Region to src, and returns true if src bounds is not empty.
|
||||
@ -787,7 +767,7 @@ region2 bounds: {1,2,3,4}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method void swap(SkRegion& other)
|
||||
#In Operator
|
||||
#In Operators
|
||||
#Line # exchanges Region pair ##
|
||||
|
||||
Exchanges IRect array of Region and other. swap() internally exchanges pointers,
|
||||
@ -1009,7 +989,7 @@ unmodified.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setEmpty()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs with default values ##
|
||||
|
||||
Constructs an empty Region. Region is set to empty bounds
|
||||
@ -1041,7 +1021,7 @@ at (0, 0) with zero width and height. Always returns false.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setRect(const SkIRect& rect)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Region matching IRect ##
|
||||
|
||||
Constructs a rectangular Region matching the bounds of rect.
|
||||
@ -1071,7 +1051,7 @@ setEmpty: false
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setRect(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Region matching bounds ##
|
||||
|
||||
Constructs Region with bounds (left, top, right, bottom).
|
||||
@ -1109,7 +1089,7 @@ set to: 3,2,1,4: success:false {0,0,0,0}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setRects(const SkIRect rects[], int count)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # sets IRect array ##
|
||||
|
||||
Constructs Region as the union of IRect in rects array. If count is
|
||||
@ -1143,7 +1123,7 @@ May be faster than repeated calls to op().
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setRegion(const SkRegion& region)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # copies Region ##
|
||||
|
||||
Constructs a copy of an existing region.
|
||||
@ -1189,7 +1169,7 @@ region2 bounds: {0,0,0,0}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool setPath(const SkPath& path, const SkRegion& clip)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Region from clipped Path ##
|
||||
|
||||
Constructs Region to match outline of path within clip.
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#Class SkStream
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkStream describes an abstract class that provides readable serial access to
|
||||
data. Subclass SkFILEStream stores readable data in a file. Subclass
|
||||
SkMemoryStream stores readable data in memory.
|
||||
@ -12,22 +16,10 @@ returns only as many bytes as were available when Stream was created. Unlike
|
||||
traditional streams, additional data will not become available at a later time
|
||||
or on a subsequent read request.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method virtual ~SkStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Example
|
||||
@ -41,7 +33,7 @@ or on a subsequent read request.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -172,7 +164,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readS8(int8_t* i)
|
||||
#Method bool readS8(int8_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -190,7 +182,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readS16(int16_t* i)
|
||||
#Method bool readS16(int16_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -208,7 +200,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readS32(int32_t* i)
|
||||
#Method bool readS32(int32_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -226,7 +218,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readU8(uint8_t* i)
|
||||
#Method bool readU8(uint8_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -244,7 +236,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readU16(uint16_t* i)
|
||||
#Method bool readU16(uint16_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -262,7 +254,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readU32(uint32_t* i)
|
||||
#Method bool readU32(uint32_t* i)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -280,7 +272,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readBool(bool* b)
|
||||
#Method bool readBool(bool* b)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -298,7 +290,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readScalar(SkScalar* s)
|
||||
#Method bool readScalar(SkScalar* s)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
@ -316,7 +308,7 @@ or late (after the first unsuccessful read).
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT readPackedUInt(size_t* u)
|
||||
#Method bool readPackedUInt(size_t* u)
|
||||
#In incomplete
|
||||
#Line # incomplete ##
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#Class SkSurface
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkSurface is responsible for managing the pixels that a canvas draws into. The pixels can be
|
||||
allocated either in CPU memory (a raster surface) or on the GPU (a GrRenderTarget surface).
|
||||
SkSurface takes care of allocating a SkCanvas that will draw into the surface. Call
|
||||
@ -10,31 +14,12 @@ surface->getCanvas() to use that canvas (but don't delete it, it is owned by the
|
||||
SkSurface always has non-zero dimensions. If there is a request for a new surface, and either
|
||||
of the requested dimensions are zero, then nullptr will be returned.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constant
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Related_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo& imageInfo, void* pixels,
|
||||
size_t rowBytes,
|
||||
const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
@ -98,7 +83,7 @@ void draw(SkCanvas* ) {
|
||||
size_t rowBytes,
|
||||
void (*releaseProc)(void* pixels, void* context),
|
||||
void* context, const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
@ -174,7 +159,7 @@ expected release context
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, size_t rowBytes,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from SkImageInfo ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
@ -291,7 +276,7 @@ void draw(SkCanvas* ) {
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height,
|
||||
const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from width, height matching output ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
@ -354,7 +339,7 @@ void draw(SkCanvas* ) {
|
||||
SkColorType colorType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from GPU texture ##
|
||||
|
||||
Wraps a GPU-backed texture into Surface. Caller must ensure the texture is
|
||||
@ -414,7 +399,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
SkColorType colorType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from GPU render target ##
|
||||
|
||||
Wraps a GPU-backed buffer into Surface. Caller must ensure backendRenderTarget
|
||||
@ -473,7 +458,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
SkColorType colorType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface from GPU back-end render target ##
|
||||
|
||||
Wraps a GPU-backed texture into Surface. Caller must ensure backendTexture is
|
||||
@ -535,7 +520,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
int sampleCount, GrSurfaceOrigin surfaceOrigin,
|
||||
const SkSurfaceProps* surfaceProps,
|
||||
bool shouldCreateWithMips = false)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface pointing to new GPU memory buffer ##
|
||||
|
||||
Returns Surface on GPU indicated by context. Allocates memory for
|
||||
@ -740,7 +725,7 @@ characterization. budgeted selects whether allocation for pixels is tracked by c
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeNull(int width, int height)
|
||||
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Surface without backing pixels ##
|
||||
Returns Surface without backing pixels. Drawing to Canvas returned from Surface
|
||||
has no effect. Calling makeImageSnapshot() on returned Surface returns nullptr.
|
||||
@ -772,7 +757,6 @@ surf->makeImageSnapshot() == nullptr
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Property
|
||||
#Populate
|
||||
#Line # member values ##
|
||||
##
|
||||
|
||||
@ -891,7 +875,6 @@ If a snapshot has been generated, this copies the Surface contents.
|
||||
##
|
||||
|
||||
#Subtopic Miscellaneous
|
||||
#Populate
|
||||
#Line # other functions ##
|
||||
##
|
||||
|
||||
@ -1080,7 +1063,7 @@ is deleted.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkSurface> makeSurface(const SkImageInfo& imageInfo)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates a compatible Surface ##
|
||||
Returns a compatible Surface, or nullptr. Returned Surface contains
|
||||
the same raster, GPU, or null properties as the original. Returned Surface
|
||||
@ -1121,7 +1104,7 @@ is incompatible with Surface.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkImage> makeImageSnapshot()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # creates Image capturing Surface contents ##
|
||||
Returns Image capturing Surface contents. Subsequent drawing to Surface contents
|
||||
are not captured. Image allocation is accounted for if Surface was created with
|
||||
@ -1148,7 +1131,6 @@ SkBudgeted::kYes.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Pixels
|
||||
#Populate
|
||||
#Line # functions with pixel access ##
|
||||
##
|
||||
|
||||
@ -1505,7 +1487,6 @@ surf.props(): kRGB_H_SkPixelGeometry
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#Subtopic Utility
|
||||
#Populate
|
||||
#Line # rarely called management functions ##
|
||||
##
|
||||
|
||||
|
@ -3,24 +3,12 @@
|
||||
|
||||
#Class SkTextBlobBuilder
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
Helper class for constructing SkTextBlob.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Class
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Struct RunBuffer
|
||||
@ -44,10 +32,6 @@ determine the advance to subsequent Glyphs; by specifying a baseline, and
|
||||
the position on that baseline for each Glyph in run; or by providing Point
|
||||
array, one per Glyph.
|
||||
|
||||
#Subtopic Member
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Member SkGlyphID* glyphs
|
||||
#Line # storage for Glyphs in run ##
|
||||
glyphs points to memory for one or more Glyphs. glyphs memory must be
|
||||
@ -78,7 +62,7 @@ array, one per Glyph.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkTextBlobBuilder()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs with default values ##
|
||||
|
||||
Constructs empty Text_Blob_Builder. By default, Text_Blob_Builder has no runs.
|
||||
@ -101,7 +85,7 @@ blob equals nullptr
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method ~SkTextBlobBuilder()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # deletes storage ##
|
||||
Deletes data allocated internally by Text_Blob_Builder.
|
||||
|
||||
@ -115,7 +99,7 @@ Deletes data allocated internally by Text_Blob_Builder.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method sk_sp<SkTextBlob> make()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Text_Blob from bulider ##
|
||||
|
||||
Returns Text_Blob built from runs of Glyphs added by builder. Returned
|
||||
|
@ -1,39 +1,12 @@
|
||||
#Topic Text_Blob
|
||||
#Alias Text_Blob_Reference ##
|
||||
|
||||
#PhraseDef paint_font_metrics
|
||||
Typeface, Paint_Text_Size, Paint_Text_Scale_X,
|
||||
Paint_Text_Skew_X, Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
|
||||
Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
|
||||
and Subpixel_Text
|
||||
##
|
||||
|
||||
Text_Blob holds one or more runs of text. Each run associates a string of Glyphs
|
||||
with a position and Paint. Each Paint contains attributes used
|
||||
to define the run text: #paint_font_metrics#.
|
||||
|
||||
Text_Blob runs of text use Glyph_ID encoding; each run Paint must set
|
||||
Paint_Text_Encoding to SkPaint::kGlyphID_TextEncoding.
|
||||
|
||||
Text_Blob is constructed with SkTextBlob::MakeFromText or Text_Blob_Builder.
|
||||
Once created, Text_Blob can not be modified.
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Class SkTextBlob
|
||||
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
SkTextBlob combines multiple text runs into an immutable container. Each text
|
||||
run consists of Glyphs, Paint, and position. Only parts of Paint related to
|
||||
fonts and text rendering are used by run.
|
||||
@ -129,7 +102,7 @@ for (int index = 0; index < 2; ++index) {
|
||||
|
||||
#Method static sk_sp<SkTextBlob> MakeFromText(
|
||||
const void* text, size_t byteLength, const SkPaint& paint)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Text_Blob with one run ##
|
||||
|
||||
Creates Text_Blob with a single run. text meaning depends on Paint_Text_Encoding;
|
||||
@ -163,7 +136,7 @@ paint contains attributes used to define the run text: #paint_font_metrics#.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkTextBlob> MakeFromString(const char* string, const SkPaint& paint)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Text_Blob with one run ##
|
||||
|
||||
Creates Text_Blob with a single run. string meaning depends on Paint_Text_Encoding;
|
||||
@ -276,7 +249,7 @@ $$$#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method static sk_sp<SkTextBlob> Deserialize(const void* data, size_t size, const SkDeserialProcs& procs)
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # constructs Text_Blob from memory ##
|
||||
|
||||
Recreates Text_Blob that was serialized into data. Returns constructed Text_Blob
|
||||
|
@ -3,22 +3,14 @@
|
||||
|
||||
#Class SkWStream
|
||||
|
||||
#Subtopic Overview
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Constructor
|
||||
#Populate
|
||||
##
|
||||
|
||||
#Subtopic Member_Function
|
||||
#Code
|
||||
#Populate
|
||||
##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method virtual ~SkWStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Example
|
||||
@ -32,7 +24,7 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method SkWStream()
|
||||
#In Constructor
|
||||
#In Constructors
|
||||
#Line # incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
|
@ -529,7 +529,7 @@ void draw(SkCanvas* canvas) {
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Blend_Mode_Porter_Duff
|
||||
#Subtopic Blend_Mode_Overview_Porter_Duff
|
||||
#Example
|
||||
#Width 480
|
||||
#Height 330
|
||||
@ -571,7 +571,7 @@ void draw(SkCanvas* canvas) {
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Blend_Mode_Porter_Duff_2
|
||||
#Subtopic Blend_Mode_Overview_Porter_Duff_2
|
||||
#Example
|
||||
#Width 480
|
||||
#Height 330
|
||||
@ -611,7 +611,7 @@ void draw(SkCanvas* canvas) {
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Blend_Mode_Lighten_Darken
|
||||
#Subtopic Blend_Mode_Overview_Lighten_Darken
|
||||
#Example
|
||||
#Width 480
|
||||
#Height 330
|
||||
@ -646,7 +646,7 @@ void draw(SkCanvas* canvas) {
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Blend_Mode_Color_Blends
|
||||
#Subtopic Blend_Mode_Overview_Color_Blends
|
||||
#Example
|
||||
#Width 480
|
||||
#Height 110
|
||||
@ -676,7 +676,7 @@ void draw(SkCanvas* canvas) {
|
||||
##
|
||||
##
|
||||
|
||||
#Subtopic Blend_Mode_Modulate_Blend
|
||||
#Subtopic Blend_Mode_Overview_Modulate_Blend
|
||||
#Example
|
||||
#Width 480
|
||||
#Height 110
|
||||
|
@ -5,6 +5,7 @@
|
||||
"SkBitmap.h",
|
||||
"SkBlendMode.h",
|
||||
"SkCanvas.h",
|
||||
"SkColor.h",
|
||||
"SkImage.h",
|
||||
"SkImageInfo.h",
|
||||
"SkMatrix.h",
|
||||
@ -49,16 +50,17 @@
|
||||
"InProgress": {
|
||||
"include": {
|
||||
"core": [
|
||||
"SkColor.h",
|
||||
"SkStream.h"
|
||||
]
|
||||
},
|
||||
"docs": [
|
||||
"SkBlendMode_Overview.bmh",
|
||||
"SkColor4f_Reference.bmh",
|
||||
"SkDynamicMemoryWStream_Reference.bmh",
|
||||
"SkFILEStream_Reference.bmh",
|
||||
"SkFILEWStream_Reference.bmh",
|
||||
"SkMemoryStream_Reference.bmh",
|
||||
"SkPath_Overview.bmh",
|
||||
"SkStream_Reference.bmh",
|
||||
"SkWStream_Reference.bmh",
|
||||
"overview.bmh",
|
||||
|
@ -36,7 +36,6 @@
|
||||
SK_HAS_WEBP_LIBRARY # ditto
|
||||
SK_IGNORE_GPU_DITHER # ditto
|
||||
SK_PMCOLOR_BYTE_ORDER # ditto
|
||||
SK_WARN_UNUSED_RESULT # ditto
|
||||
|
||||
# FreeType related
|
||||
FT_LOAD_TARGET_LIGHT
|
||||
@ -804,3 +803,7 @@ FT_Load_Glyph
|
||||
#Class SkXfermodeImageFilter
|
||||
##
|
||||
##
|
||||
|
||||
# temporary while ref is separated from overview
|
||||
#Topic Zero_Length_Contour
|
||||
##
|
||||
|
@ -1,59 +1,21 @@
|
||||
SkAutoCanvasRestore Reference
|
||||
===
|
||||
|
||||
# <a name='Automatic_Canvas_Restore'>Automatic Canvas Restore</a>
|
||||
<a name='SkAutoCanvasRestore'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a> {
|
||||
public:
|
||||
<a href='#SkAutoCanvasRestore_SkCanvas_star'>SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a>;
|
||||
<a href='#SkAutoCanvasRestore_destructor'>~SkAutoCanvasRestore()</a>;
|
||||
void <a href='#SkAutoCanvasRestore_restore'>restore</a>();
|
||||
};
|
||||
</pre>
|
||||
|
||||
# <a name='SkAutoCanvasRestore'>Class SkAutoCanvasRestore</a>
|
||||
Stack helper class calls <a href='SkCanvas_Reference#SkCanvas_restoreToCount'>SkCanvas::restoreToCount</a> when <a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a>
|
||||
goes out of scope. Use this to guarantee that the canvas is restored to a known
|
||||
state.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkAutoCanvasRestore can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_SkCanvas_star'>SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preserves <a href='SkCanvas_Reference#Canvas'>Canvas</a> save count</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_destructor'>~SkAutoCanvasRestore()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkAutoCanvasRestore member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_restore'>restore</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkAutoCanvasRestore_SkCanvas_star'></a>
|
||||
## SkAutoCanvasRestore
|
||||
|
||||
@ -69,7 +31,7 @@ Preserves <a href='SkCanvas_Reference#Canvas'>Canvas</a> save count. Optionally
|
||||
<td><a href='SkCanvas_Reference#Canvas'>Canvas</a> to guard</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkAutoCanvasRestore_SkCanvas_star_doSave'><code><strong>doSave</strong></code></a></td>
|
||||
<td>call <a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save()</a></td>
|
||||
<td>call <a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save</a>()</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,287 +1,48 @@
|
||||
SkBlendMode Reference
|
||||
===
|
||||
|
||||
# <a name='Blend_Mode'>Blend Mode</a>
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkBlendMode member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_Name'>SkBlendMode Name</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns mode as C string</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkBlendMode related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode'>SkBlendMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>algorithm combining source and destination pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kClear'>SkBlendMode::kClear</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces destination with zero: fully transparent</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kColor'>SkBlendMode::kColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>hue and saturation of source with luminosity of destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kColorBurn'>SkBlendMode::kColorBurn</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>darken destination to reflect source</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kColorDodge'>SkBlendMode::kColorDodge</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>brighten destination to reflect source</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDarken'>SkBlendMode::kDarken</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>darker of source and destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDifference'>SkBlendMode::kDifference</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtract darker from lighter with higher contrast</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDst'>SkBlendMode::kDst</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preserves destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDstATop'>SkBlendMode::kDstATop</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>destination inside source blended with source</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDstIn'>SkBlendMode::kDstIn</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>destination trimmed by source</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDstOut'>SkBlendMode::kDstOut</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>destination trimmed outside source</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kDstOver'>SkBlendMode::kDstOver</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>destination over source</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kExclusion'>SkBlendMode::kExclusion</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtract darker from lighter with lower contrast</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kHardLight'>SkBlendMode::kHardLight</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiply or screen, depending on source</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kHue'>SkBlendMode::kHue</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>hue of source with saturation and luminosity of destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kLastCoeffMode'>SkBlendMode::kLastCoeffMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last <a href='#Porter_Duff'>Porter Duff</a> blend mode</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kLastMode'>SkBlendMode::kLastMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kLastSeparableMode'>SkBlendMode::kLastSeparableMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last blend mode operating separately on components</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kLighten'>SkBlendMode::kLighten</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>lighter of source and destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kLuminosity'>SkBlendMode::kLuminosity</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>luminosity of source with hue and saturation of destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kModulate'>SkBlendMode::kModulate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>product of <a href='undocumented#Premultiply'>Premultiplied</a> colors; darkens destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiply source with destination, darkening image</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kOverlay'>SkBlendMode::kOverlay</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiply or screen, depending on destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kPlus'>SkBlendMode::kPlus</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sum of colors</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSaturation'>SkBlendMode::kSaturation</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>saturation of source with hue and luminosity of destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kScreen'>SkBlendMode::kScreen</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiply inverse of pixels, inverting result; brightens destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSoftLight'>SkBlendMode::kSoftLight</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>lighten or darken, depending on source</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSrc'>SkBlendMode::kSrc</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSrcATop'>SkBlendMode::kSrcATop</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>source inside destination blended with destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSrcIn'>SkBlendMode::kSrcIn</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>source trimmed inside destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSrcOut'>SkBlendMode::kSrcOut</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>source trimmed outside destination</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>source over destination</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBlendMode_kXor'>SkBlendMode::kXor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>each of source and destination trimmed outside the other</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Describes how destination pixel is replaced with a combination of itself and
|
||||
source pixel. <a href='#Blend_Mode'>Blend Mode</a> may use source, destination, or both. <a href='#Blend_Mode'>Blend Mode</a> may
|
||||
operate on each <a href='#Color'>Color</a> component independently, or may allow all source pixel
|
||||
components to contribute to one destination pixel component.
|
||||
|
||||
<a href='#Blend_Mode'>Blend Mode</a> does not use adjacent pixels to determine the outcome.
|
||||
|
||||
<a href='#Blend_Mode'>Blend Mode</a> uses source and read destination <a href='SkColor_Reference#Alpha'>Alpha</a> to determine written
|
||||
destination <a href='SkColor_Reference#Alpha'>Alpha</a>; both source and destination <a href='SkColor_Reference#Alpha'>Alpha</a> may also affect written
|
||||
destination <a href='#Color'>Color</a> components.
|
||||
|
||||
Regardless of how <a href='SkColor_Reference#Alpha'>Alpha</a> is encoded in source and destination pixel, nearly all
|
||||
<a href='SkImageInfo_Reference#Color_Type'>Color Types</a> treat it as ranging from zero to one. And, nearly all <a href='#Blend_Mode'>Blend Mode</a>
|
||||
algorithms limit the output so that all results are also zero to one.
|
||||
|
||||
Two exceptions are <a href='#SkBlendMode_kPlus'>SkBlendMode::kPlus</a> and <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>.
|
||||
|
||||
<a href='#SkBlendMode_kPlus'>SkBlendMode::kPlus</a> permits computing <a href='SkColor_Reference#Alpha'>Alpha</a> and <a href='#Color'>Color</a> component values larger
|
||||
than one. For <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> other than <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>, resulting <a href='SkColor_Reference#Alpha'>Alpha</a>
|
||||
and component values are clamped to one.
|
||||
|
||||
<a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> permits values outside the zero to one range. It is up
|
||||
to the client to ensure that the result is within the range of zero to one,
|
||||
and therefore well-defined.
|
||||
|
||||
## <a name='Porter_Duff'>Porter Duff</a>
|
||||
|
||||
<a href='https://graphics.pixar.com/library/Compositing/paper.pdf'>Compositing Digital Images</a></a> describes <a href='#Porter_Duff'>Porter Duff</a> modes <a href='#SkBlendMode_kClear'>SkBlendMode::kClear</a> through <a href='#SkBlendMode_kXor'>SkBlendMode::kXor</a>.
|
||||
|
||||
Drawing a bitmap with transparency using <a href='#Porter_Duff'>Porter Duff</a> compositing is free to clear
|
||||
the destination.
|
||||
|
||||
![Porter_Duff](https://fiddle.skia.org/i/8c27fb2a58f63505cffa74c1c79e16ba_raster.png "")
|
||||
|
||||
Draw geometry with transparency using <a href='#Porter_Duff'>Porter Duff</a> compositing does not combine
|
||||
transparent source pixels, leaving the destination outside the geometry untouched.
|
||||
|
||||
![Porter_Duff](https://fiddle.skia.org/i/50ebbb0162bbf60524a196236d66c915_raster.png "")
|
||||
|
||||
## <a name='Lighten_Darken'>Lighten Darken</a>
|
||||
|
||||
Modes <a href='#SkBlendMode_kPlus'>SkBlendMode::kPlus</a> and <a href='#SkBlendMode_kScreen'>SkBlendMode::kScreen</a> use
|
||||
simple arithmetic to lighten or darken the destination. Modes
|
||||
<a href='#SkBlendMode_kOverlay'>SkBlendMode::kOverlay</a> through <a href='#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a> use more complicated
|
||||
algorithms to lighten or darken; sometimes one mode does both, as described by <a href='https://en.wikipedia.org/wiki/Blend_modes'>Blend Modes</a></a> .
|
||||
|
||||
![Lighten_Darken](https://fiddle.skia.org/i/8e04f89252632da0fffe713f07f2296f_raster.png "")
|
||||
|
||||
## <a name='Modulate_Blend'>Modulate Blend</a>
|
||||
|
||||
<a href='#SkBlendMode_kModulate'>SkBlendMode::kModulate</a> is a mashup of <a href='#SkBlendMode_kSrcATop'>SkBlendMode::kSrcATop</a> and <a href='#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a>.
|
||||
It multiplies all components, including <a href='SkColor_Reference#Alpha'>Alpha</a>; unlike <a href='#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a>, if either
|
||||
source or destination is transparent, result is transparent. <a href='#SkBlendMode_kModulate'>SkBlendMode::kModulate</a>
|
||||
uses <a href='undocumented#Premultiply'>Premultiplied</a> values to compute the product; <a href='#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a> uses <a href='undocumented#Unpremultiply'>Unpremultiplied</a>
|
||||
values to compute the product.
|
||||
|
||||
![Modulate_Blend](https://fiddle.skia.org/i/d8abdd8fb56f9e69342d745d425c4a17_raster.png "")
|
||||
|
||||
## <a name='Color_Blends'>Color Blends</a>
|
||||
|
||||
Modes <a href='#SkBlendMode_kHue'>SkBlendMode::kHue</a>, <a href='#SkBlendMode_kSaturation'>SkBlendMode::kSaturation</a>, <a href='#SkBlendMode_kColor'>SkBlendMode::kColor</a>, and
|
||||
<a href='#SkBlendMode_kLuminosity'>SkBlendMode::kLuminosity</a> convert source and destination pixels using all
|
||||
components color information, using <a href='https://www.w3.org/TR/compositing-1/#blendingnonseparable'>non-separable blend modes</a></a> .
|
||||
|
||||
![Color_Blends](https://fiddle.skia.org/i/03710c1770728da885fa4ac24a19d5d1_raster.png "")
|
||||
|
||||
## <a name='SkBlendMode'>Enum SkBlendMode</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum class <a href='#SkBlendMode'>SkBlendMode</a> {
|
||||
<a href='#SkBlendMode_kClear'>kClear</a>,
|
||||
<a href='#SkBlendMode_kSrc'>kSrc</a>,
|
||||
<a href='#SkBlendMode_kDst'>kDst</a>,
|
||||
<a href='#SkBlendMode_kSrcOver'>kSrcOver</a>,
|
||||
<a href='#SkBlendMode_kDstOver'>kDstOver</a>,
|
||||
<a href='#SkBlendMode_kSrcIn'>kSrcIn</a>,
|
||||
<a href='#SkBlendMode_kDstIn'>kDstIn</a>,
|
||||
<a href='#SkBlendMode_kSrcOut'>kSrcOut</a>,
|
||||
<a href='#SkBlendMode_kDstOut'>kDstOut</a>,
|
||||
<a href='#SkBlendMode_kSrcATop'>kSrcATop</a>,
|
||||
<a href='#SkBlendMode_kDstATop'>kDstATop</a>,
|
||||
<a href='#SkBlendMode_kXor'>kXor</a>,
|
||||
<a href='#SkBlendMode_kPlus'>kPlus</a>,
|
||||
<a href='#SkBlendMode_kModulate'>kModulate</a>,
|
||||
<a href='#SkBlendMode_kScreen'>kScreen</a>,
|
||||
<a href='#SkBlendMode_kLastCoeffMode'>kLastCoeffMode</a> = <a href='#SkBlendMode_kScreen'>kScreen</a>,
|
||||
<a href='#SkBlendMode_kOverlay'>kOverlay</a>,
|
||||
<a href='#SkBlendMode_kDarken'>kDarken</a>,
|
||||
<a href='#SkBlendMode_kLighten'>kLighten</a>,
|
||||
<a href='#SkBlendMode_kColorDodge'>kColorDodge</a>,
|
||||
<a href='#SkBlendMode_kColorBurn'>kColorBurn</a>,
|
||||
<a href='#SkBlendMode_kHardLight'>kHardLight</a>,
|
||||
<a href='#SkBlendMode_kSoftLight'>kSoftLight</a>,
|
||||
<a href='#SkBlendMode_kDifference'>kDifference</a>,
|
||||
<a href='#SkBlendMode_kExclusion'>kExclusion</a>,
|
||||
<a href='#SkBlendMode_kMultiply'>kMultiply</a>,
|
||||
<a href='#SkBlendMode_kLastSeparableMode'>kLastSeparableMode</a> = <a href='#SkBlendMode_kMultiply'>kMultiply</a>,
|
||||
<a href='#SkBlendMode_kHue'>kHue</a>,
|
||||
<a href='#SkBlendMode_kSaturation'>kSaturation</a>,
|
||||
<a href='#SkBlendMode_kColor'>kColor</a>,
|
||||
<a href='#SkBlendMode_kLuminosity'>kLuminosity</a>,
|
||||
<a href='#SkBlendMode_kLastMode'>kLastMode</a> = <a href='#SkBlendMode_kLuminosity'>kLuminosity</a>,
|
||||
};
|
||||
enum class <a href='#SkBlendMode'>SkBlendMode</a> {
|
||||
<a href='#SkBlendMode_kClear'>kClear</a>,
|
||||
<a href='#SkBlendMode_kSrc'>kSrc</a>,
|
||||
<a href='#SkBlendMode_kDst'>kDst</a>,
|
||||
<a href='#SkBlendMode_kSrcOver'>kSrcOver</a>,
|
||||
<a href='#SkBlendMode_kDstOver'>kDstOver</a>,
|
||||
<a href='#SkBlendMode_kSrcIn'>kSrcIn</a>,
|
||||
<a href='#SkBlendMode_kDstIn'>kDstIn</a>,
|
||||
<a href='#SkBlendMode_kSrcOut'>kSrcOut</a>,
|
||||
<a href='#SkBlendMode_kDstOut'>kDstOut</a>,
|
||||
<a href='#SkBlendMode_kSrcATop'>kSrcATop</a>,
|
||||
<a href='#SkBlendMode_kDstATop'>kDstATop</a>,
|
||||
<a href='#SkBlendMode_kXor'>kXor</a>,
|
||||
<a href='#SkBlendMode_kPlus'>kPlus</a>,
|
||||
<a href='#SkBlendMode_kModulate'>kModulate</a>,
|
||||
<a href='#SkBlendMode_kScreen'>kScreen</a>,
|
||||
<a href='#SkBlendMode_kLastCoeffMode'>kLastCoeffMode</a> = <a href='#SkBlendMode_kScreen'>kScreen</a>,
|
||||
<a href='#SkBlendMode_kOverlay'>kOverlay</a>,
|
||||
<a href='#SkBlendMode_kDarken'>kDarken</a>,
|
||||
<a href='#SkBlendMode_kLighten'>kLighten</a>,
|
||||
<a href='#SkBlendMode_kColorDodge'>kColorDodge</a>,
|
||||
<a href='#SkBlendMode_kColorBurn'>kColorBurn</a>,
|
||||
<a href='#SkBlendMode_kHardLight'>kHardLight</a>,
|
||||
<a href='#SkBlendMode_kSoftLight'>kSoftLight</a>,
|
||||
<a href='#SkBlendMode_kDifference'>kDifference</a>,
|
||||
<a href='#SkBlendMode_kExclusion'>kExclusion</a>,
|
||||
<a href='#SkBlendMode_kMultiply'>kMultiply</a>,
|
||||
<a href='#SkBlendMode_kLastSeparableMode'>kLastSeparableMode</a> = <a href='#SkBlendMode_kMultiply'>kMultiply</a>,
|
||||
<a href='#SkBlendMode_kHue'>kHue</a>,
|
||||
<a href='#SkBlendMode_kSaturation'>kSaturation</a>,
|
||||
<a href='#SkBlendMode_kColor'>kColor</a>,
|
||||
<a href='#SkBlendMode_kLuminosity'>kLuminosity</a>,
|
||||
<a href='#SkBlendMode_kLastMode'>kLastMode</a> = <a href='#SkBlendMode_kLuminosity'>kLuminosity</a>,
|
||||
};
|
||||
|
||||
const char* <a href='#SkBlendMode_Name'>SkBlendMode_Name</a>(<a href='#SkBlendMode'>SkBlendMode</a> blendMode);
|
||||
</pre>
|
||||
|
||||
## <a name='SkBlendMode'>Enum SkBlendMode</a>
|
||||
|
||||
### Constants
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
@ -890,7 +651,7 @@ the product of <a href='undocumented#Unpremultiply'>Unpremultiplied</a> source a
|
||||
Given: <code>Sa</code> as source <a href='SkColor_Reference#Alpha'>Alpha</a>, <code>S</code> as source <a href='#Color'>Color</a>,
|
||||
<code>Da</code> as destination <a href='SkColor_Reference#Alpha'>Alpha</a>, <code>D</code> as destination <a href='#Color'>Color</a>;
|
||||
<a href='#SkBlendMode_kHue'>SkBlendMode::kHue</a> replaces destination with:
|
||||
<code>\[Sa \+ Da \- Sa \* Da, SetLuminosity(SetSaturation(S, Saturation(D)\), <a href='#Luminosity'>Luminosity(D)</a>\)\]</code>,
|
||||
<code>\[Sa \+ Da \- Sa \* Da, SetLuminosity(SetSaturation(S, Saturation(D)\), <a href='#Luminosity'>Luminosity</a>(D\)\)\]</code>,
|
||||
source hue, leaving destination luminosity and saturation unchanged.
|
||||
|
||||
### Example
|
||||
@ -902,7 +663,7 @@ source hue, leaving destination luminosity and saturation unchanged.
|
||||
Given: <code>Sa</code> as source <a href='SkColor_Reference#Alpha'>Alpha</a>, <code>S</code> as source <a href='#Color'>Color</a>,
|
||||
<code>Da</code> as destination <a href='SkColor_Reference#Alpha'>Alpha</a>, <code>D</code> as destination <a href='#Color'>Color</a>;
|
||||
<a href='#SkBlendMode_kHue'>SkBlendMode::kHue</a> replaces destination with:
|
||||
<code>\[Sa \+ Da \- Sa \* Da, SetLuminosity(SetSaturation(D, Saturation(S)\), <a href='#Luminosity'>Luminosity(D)</a>\)\]</code>,
|
||||
<code>\[Sa \+ Da \- Sa \* Da, SetLuminosity(SetSaturation(D, Saturation(S)\), <a href='#Luminosity'>Luminosity</a>(D\)\)\]</code>,
|
||||
source hue, leaving destination luminosity and saturation unchanged.
|
||||
|
||||
### Example
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,177 +1,101 @@
|
||||
SkColor4f Reference
|
||||
===
|
||||
|
||||
# <a name='Color4f'>Color4f</a>
|
||||
<a name='SkPM4f'></a>
|
||||
<a name='SkRGBA4f'></a>
|
||||
|
||||
# <a name='SkColor4f'>Struct SkColor4f</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkRGBA4f'>SkRGBA4f</a> {
|
||||
float <a href='#SkRGBA4f_fR'>fR</a>;
|
||||
float <a href='#SkRGBA4f_fG'>fG</a>;
|
||||
float <a href='#SkRGBA4f_fB'>fB</a>;
|
||||
float <a href='#SkRGBA4f_fA'>fA</a>;
|
||||
|
||||
## <a name='Member'>Member</a>
|
||||
|
||||
|
||||
SkColor4f members may be read and written directly without using a member function.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fA'>fA</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>alpha component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fB'>fB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>blue component</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fG'>fG</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>green component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fR'>fR</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>red component</td>
|
||||
</tr>
|
||||
</table>
|
||||
bool <a href='#SkRGBA4f_equal1_operator'>operator==(const SkRGBA4f& other)_const</a>;
|
||||
bool <a href='#SkRGBA4f_notequal1_operator'>operator!=(const SkRGBA4f& other)_const</a>;
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_multiply_operator'>operator*(float scale)_const</a>;
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_multiply1_operator'>operator*(const SkRGBA4f& scale)_const</a>;
|
||||
const float* <a href='#SkRGBA4f_vec'>vec</a>() const;
|
||||
float* <a href='#SkRGBA4f_vec'>vec</a>();
|
||||
float <a href='#SkRGBA4f_array_operator'>operator[](int index)_const</a>;
|
||||
float& <a href='#SkRGBA4f_array1_operator'>operator[](int index)</a>;
|
||||
bool <a href='#SkRGBA4f_isOpaque'>isOpaque</a>() const;
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_Pin'>Pin</a>(float r, float g, float b, float a);
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_pin'>pin</a>() const;
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_FromColor'>FromColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a>);
|
||||
<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkRGBA4f_toSkColor'>toSkColor</a>() const;
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_FromPMColor'>FromPMColor</a>(<a href='SkColor_Reference#SkPMColor'>SkPMColor</a>);
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a><<a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>> <a href='#SkRGBA4f_premul'>premul</a>() const;
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a><<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>> <a href='#SkRGBA4f_unpremul'>unpremul</a>() const;
|
||||
};
|
||||
</pre>
|
||||
|
||||
Each component is stored as a 32-bit single precision floating point float value.
|
||||
All values are allowed, but only the range from zero to one is meaningful.
|
||||
|
||||
Each component is independent of the others; <a href='#SkColor4f_fA'>fA</a> <a href='SkColor_Reference#Alpha'>Alpha</a> is not <a href='undocumented#Premultiply'>Premultiplied</a>
|
||||
with <a href='#SkColor4f_fG'>fG</a> green, <a href='#SkColor4f_fB'>fB</a> blue, or <a href='#SkColor4f_fR'>fR</a> red.
|
||||
Components are independent of the others if defined with <a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>;
|
||||
<a href='#SkRGBA4f_fA'>fA</a> <a href='SkColor_Reference#Alpha'>Alpha</a> is may be greater or smaller than <a href='#SkRGBA4f_fG'>fG</a> green, <a href='#SkRGBA4f_fB'>fB</a> blue, or <a href='#SkRGBA4f_fR'>fR</a> red.
|
||||
<a href='#SkColor4f'>SkColor4f</a> is shorthand for <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='#SkRGBA4f'>SkRGBA4f</a>.
|
||||
|
||||
Components are connnected if defined with <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>;
|
||||
<a href='#SkRGBA4f_fA'>fA</a> <a href='SkColor_Reference#Alpha'>Alpha</a> is equal to or larger than <a href='#SkRGBA4f_fG'>fG</a> green, <a href='#SkRGBA4f_fB'>fB</a> blue, and <a href='#SkRGBA4f_fR'>fR</a> red. The values
|
||||
stored in <a href='#SkRGBA4f_fG'>fG</a>, <a href='#SkRGBA4f_fB'>fB</a>, and <a href='#SkRGBA4f_fR'>fR</a> combine the color component with the <a href='SkColor_Reference#Alpha'>Alpha</a> component.
|
||||
|
||||
Values smaller than zero or larger than one are allowed. Values out of range
|
||||
may be used with <a href='SkBlendMode_Reference#Blend_Mode'>Blend Mode</a> so that the final component is in range.
|
||||
may be used with <a href='SkBlendMode_Reference#Blend_Mode'>Blend Mode</a> so that the final component is in range.<table style='border-collapse: collapse; width: 62.5em'>
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkColor4f operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_notequal1_operator'>operator!=(const SkColor4f& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares colors for inequality</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_equal1_operator'>operator==(const SkColor4f& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Color4f'>Color4f</a> for equality</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkColor4f member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_FromColor'>FromColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets components from <a href='SkColor_Reference#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_Pin'>Pin</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets components to valid range</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_pin'>pin</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets components to valid range</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_premul'>premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Premultiply'>Premultiplied</a> color</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_toPM4f'>toPM4f</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is for internal use only</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_toSkColor'>toSkColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns closest <a href='SkColor_Reference#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_unpremul'>unpremul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Unpremultiply'>Unpremultiplied</a> color</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_vec'>vec</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns array of components</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fR'><code>fR</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRGBA4f_fR'><code>fR</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
|
||||
Single precision float for red ranges from no red (0.0) to full red (1.0).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fG'><code>fG</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRGBA4f_fG'><code>fG</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
|
||||
Single precision float for green ranges from no green (0.0) to full green (1.0).
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fB'><code>fB</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRGBA4f_fB'><code>fB</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
|
||||
Single precision float for blue ranges from no blue (0.0) to full blue (1.0).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fA'><code>fA</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRGBA4f_fA'><code>fA</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
|
||||
Single precision float for <a href='SkColor_Reference#Alpha'>Alpha</a> ranges from no <a href='SkColor_Reference#Alpha'>Alpha</a> (0.0) to full <a href='SkColor_Reference#Alpha'>Alpha</a> (1.0).
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkColor4f_equal1_operator'></a>
|
||||
<a name='SkRGBA4f_equal1_operator'></a>
|
||||
## operator==
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator==(const SkColor4f& other) _const
|
||||
bool operator==(const SkRGBA4f& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Color4f'>Color4f</a> with <a href='#SkColor4f_equal1_operator_other'>other</a>, and returns true if all components are equivalent.
|
||||
Compares <a href='#SkRGBA4f'>SkRGBA4f</a> with <a href='#SkRGBA4f_equal1_operator_other'>other</a>, and returns true if all components are equivalent.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkColor4f_equal1_operator_other'><code><strong>other</strong></code></a></td>
|
||||
<td><a href='#Color4f'>Color4f</a> to compare</td>
|
||||
<table> <tr> <td><a name='SkRGBA4f_equal1_operator_other'><code><strong>other</strong></code></a></td>
|
||||
<td><a href='#SkRGBA4f'>SkRGBA4f</a> to compare</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='#Color4f'>Color4f</a> equals <a href='#SkColor4f_equal1_operator_other'>other</a>
|
||||
true if <a href='#SkRGBA4f'>SkRGBA4f</a> equals <a href='#SkRGBA4f_equal1_operator_other'>other</a>
|
||||
|
||||
### Example
|
||||
|
||||
@ -187,30 +111,30 @@ colorRed == colorNamedRed
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_notequal1_operator'>operator!=(const SkColor4f& other) const</a>
|
||||
<a href='#SkRGBA4f_notequal1_operator'>operator!=(const SkRGBA4f& other) const</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_notequal1_operator'></a>
|
||||
<a name='SkRGBA4f_notequal1_operator'></a>
|
||||
## operator!=
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator!=(const SkColor4f& other) _const
|
||||
bool operator!=(const SkRGBA4f& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Color4f'>Color4f</a> with <a href='#SkColor4f_notequal1_operator_other'>other</a>, and returns true if all components are not
|
||||
Compares <a href='#SkRGBA4f'>SkRGBA4f</a> with <a href='#SkRGBA4f_notequal1_operator_other'>other</a>, and returns true if all components are not
|
||||
equivalent.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkColor4f_notequal1_operator_other'><code><strong>other</strong></code></a></td>
|
||||
<td><a href='#Color4f'>Color4f</a> to compare</td>
|
||||
<table> <tr> <td><a name='SkRGBA4f_notequal1_operator_other'><code><strong>other</strong></code></a></td>
|
||||
<td><a href='#SkRGBA4f'>SkRGBA4f</a> to compare</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='#Color4f'>Color4f</a> is not equal to <a href='#SkColor4f_notequal1_operator_other'>other</a>
|
||||
true if <a href='#SkRGBA4f'>SkRGBA4f</a> is not equal to <a href='#SkRGBA4f_notequal1_operator_other'>other</a>
|
||||
|
||||
### Example
|
||||
|
||||
@ -226,18 +150,72 @@ colorGray != colorNamedGray
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_equal1_operator'>operator==(const SkColor4f& other) const</a>
|
||||
<a href='#SkRGBA4f_equal1_operator'>operator==(const SkRGBA4f& other) const</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_vec'></a>
|
||||
<a name='SkRGBA4f_multiply_operator'></a>
|
||||
## operator*
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> operator*(float scale) const
|
||||
</pre>
|
||||
|
||||
Multiplies each component by <a href='#SkRGBA4f_multiply_operator_scale'>scale</a>. Does not pin the result.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRGBA4f_multiply_operator_scale'><code><strong>scale</strong></code></a></td>
|
||||
<td>component multiplier</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
scaled color
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='SkBlendMode_Reference#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkRGBA4f_multiply1_operator'></a>
|
||||
## operator*
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> operator*(const SkRGBA4f& scale) const
|
||||
</pre>
|
||||
|
||||
Multiplies each component by <a href='#SkRGBA4f_multiply1_operator_scale'>scale</a> component. Does not pin the result.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRGBA4f_multiply1_operator_scale'><code><strong>scale</strong></code></a></td>
|
||||
<td><a href='#SkRGBA4f'>SkRGBA4f</a> component multipliers</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
scaled color
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='SkBlendMode_Reference#SkBlendMode_kMultiply'>SkBlendMode::kMultiply</a>
|
||||
|
||||
---
|
||||
|
||||
## <a name='Property_Functions'>Property Functions</a>
|
||||
|
||||
<a name='SkRGBA4f_vec'></a>
|
||||
## vec
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
const float* <a href='#SkColor4f_vec'>vec</a>() const
|
||||
const float* <a href='#SkRGBA4f_vec'>vec</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Color4f'>Color4f</a> components as a read-only array.
|
||||
Returns <a href='#SkRGBA4f'>SkRGBA4f</a> components as a read-only array.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -262,13 +240,13 @@ red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_vec_2'></a>
|
||||
<a name='SkRGBA4f_vec_2'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
float* <a href='#SkColor4f_vec'>vec</a>()
|
||||
float* <a href='#SkRGBA4f_vec'>vec</a>()
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Color4f'>Color4f</a> components as a writable array.
|
||||
Returns <a href='#SkRGBA4f'>SkRGBA4f</a> components as a writable array.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -293,27 +271,104 @@ red=0.266667 green=0.533333 blue=0.8 alpha=0.533333
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_Pin'></a>
|
||||
## Pin
|
||||
<a name='SkRGBA4f_array_operator'></a>
|
||||
## operator[]
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static <a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_Pin'>Pin</a>(float r, float g, float b, float a)
|
||||
float <a href='#SkRGBA4f_array1_operator'>operator[](int index)</a> const
|
||||
</pre>
|
||||
|
||||
Constructs and returns <a href='#Color4f'>Color4f</a> with each component pinned from zero to one.
|
||||
Returns <a href='#SkRGBA4f'>SkRGBA4f</a> component by <a href='#SkRGBA4f_array_operator_index'>index</a>, zero through three. <a href='#SkRGBA4f_array_operator_index'>index</a> out of range
|
||||
triggers an assert in debug builds.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkColor4f_Pin_r'><code><strong>r</strong></code></a></td>
|
||||
<table> <tr> <td><a name='SkRGBA4f_array_operator_index'><code><strong>index</strong></code></a></td>
|
||||
<td>component, zero through three</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
component by <a href='#SkRGBA4f_array_operator_index'>index</a>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkRGBA4f_vec'>vec</a><sup><a href='#SkRGBA4f_vec_2'>[2]</a></sup>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkRGBA4f_array1_operator'></a>
|
||||
## operator[]
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
float& <a href='#SkRGBA4f_array1_operator'>operator[](int index)</a>
|
||||
</pre>
|
||||
|
||||
Returns writable component reference by <a href='#SkRGBA4f_array1_operator_index'>index</a>, zero through three. <a href='#SkRGBA4f_array1_operator_index'>index</a> out of range
|
||||
triggers an assert in debug builds.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRGBA4f_array1_operator_index'><code><strong>index</strong></code></a></td>
|
||||
<td>component, zero through three</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
writable component reference by <a href='#SkRGBA4f_array1_operator_index'>index</a>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkRGBA4f_vec'>vec</a><sup><a href='#SkRGBA4f_vec_2'>[2]</a></sup>
|
||||
|
||||
---
|
||||
|
||||
## <a name='Utility_Functions'>Utility Functions</a>
|
||||
|
||||
<a name='SkRGBA4f_isOpaque'></a>
|
||||
## isOpaque
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool <a href='#SkRGBA4f_isOpaque'>isOpaque</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='SkColor_Reference#Alpha'>Alpha</a> component is one. <a href='SkColor_Reference#Color'>Color</a> has no transparency regardless of
|
||||
whether color is <a href='undocumented#Premultiply'>Premultiplied</a> or <a href='undocumented#Unpremultiply'>Unpremultiplied</a>. Triggers a debugging assert
|
||||
if <a href='SkColor_Reference#Alpha'>Alpha</a> not valid.
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='SkColor_Reference#Alpha'>Alpha</a> is one
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkRGBA4f_vec'>vec</a><sup><a href='#SkRGBA4f_vec_2'>[2]</a></sup> <a href='SkColor_Reference#SkColorGetA'>SkColorGetA</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkRGBA4f_Pin'></a>
|
||||
## Pin
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_Pin'>Pin</a>(float r, float g, float b, float a)
|
||||
</pre>
|
||||
|
||||
Constructs and returns <a href='#SkRGBA4f'>SkRGBA4f</a> with each component pinned from zero to one.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRGBA4f_Pin_r'><code><strong>r</strong></code></a></td>
|
||||
<td>red component</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkColor4f_Pin_g'><code><strong>g</strong></code></a></td>
|
||||
<tr> <td><a name='SkRGBA4f_Pin_g'><code><strong>g</strong></code></a></td>
|
||||
<td>green component</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkColor4f_Pin_b'><code><strong>b</strong></code></a></td>
|
||||
<tr> <td><a name='SkRGBA4f_Pin_b'><code><strong>b</strong></code></a></td>
|
||||
<td>blue component</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkColor4f_Pin_a'><code><strong>a</strong></code></a></td>
|
||||
<tr> <td><a name='SkRGBA4f_Pin_a'><code><strong>a</strong></code></a></td>
|
||||
<td><a href='SkColor_Reference#Alpha'>Alpha</a> component</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -328,29 +383,52 @@ Constructs and returns <a href='#Color4f'>Color4f</a> with each component pinned
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_pin'>pin</a> <a href='#SkColor4f_FromColor'>FromColor</a>
|
||||
<a href='#SkRGBA4f_pin'>pin</a>() <a href='#SkRGBA4f_FromColor'>FromColor</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_FromColor'></a>
|
||||
<a name='SkRGBA4f_pin'></a>
|
||||
## pin
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_pin'>pin</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#SkRGBA4f'>SkRGBA4f</a> with all components in the range from zero to one.
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> with valid components
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="9e349862c5189a44d2acef5da24f2e79"></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkRGBA4f_Pin'>Pin</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkRGBA4f_FromColor'></a>
|
||||
## FromColor
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static <a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_FromColor'>FromColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a>)
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_FromColor'>FromColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a>)
|
||||
</pre>
|
||||
|
||||
Converts to closest <a href='#Color4f'>Color4f</a>.
|
||||
Converts to closest <a href='#SkRGBA4f'>SkRGBA4f</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkColor4f_FromColor_SkColor'><code><strong>SkColor</strong></code></a></td>
|
||||
<table> <tr> <td><a name='SkRGBA4f_FromColor_SkColor'><code><strong>SkColor</strong></code></a></td>
|
||||
<td><a href='SkColor_Reference#Color'>Color</a> with <a href='SkColor_Reference#Alpha'>Alpha</a>, red, blue, and green components</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href='#Color4f'>Color4f</a> equivalent
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a> equivalent
|
||||
|
||||
### Example
|
||||
|
||||
@ -367,15 +445,15 @@ red=77 green=101 blue=153 alpha=43
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_toSkColor'>toSkColor</a>
|
||||
<a href='#SkRGBA4f_toSkColor'>toSkColor</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_toSkColor'></a>
|
||||
<a name='SkRGBA4f_toSkColor'></a>
|
||||
## toSkColor
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkColor4f_toSkColor'>toSkColor</a>() const
|
||||
<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkRGBA4f_toSkColor'>toSkColor</a>() const
|
||||
</pre>
|
||||
|
||||
Converts to closest <a href='SkColor_Reference#SkColor'>SkColor</a>.
|
||||
@ -399,38 +477,42 @@ red=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_FromColor'>FromColor</a>
|
||||
<a href='#SkRGBA4f_FromColor'>FromColor</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_pin'></a>
|
||||
## pin
|
||||
<a name='SkRGBA4f_FromPMColor'></a>
|
||||
## FromPMColor
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_pin'>pin</a>() const
|
||||
static <a href='#SkRGBA4f'>SkRGBA4f</a> <a href='#SkRGBA4f_FromPMColor'>FromPMColor</a>(<a href='SkColor_Reference#SkPMColor'>SkPMColor</a>)
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Color4f'>Color4f</a> with all components in the range from zero to one.
|
||||
Converts from <a href='undocumented#Premultiply'>Premultiplied</a> integer components to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> float
|
||||
components.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRGBA4f_FromPMColor_SkPMColor'><code><strong>SkPMColor</strong></code></a></td>
|
||||
<td><a href='undocumented#Premultiply'>Premultiplied</a> color</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href='#Color4f'>Color4f</a> with valid components
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="9e349862c5189a44d2acef5da24f2e79"></fiddle-embed></div>
|
||||
<a href='undocumented#Unpremultiply'>Unpremultiplied</a> color
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_Pin'>Pin</a>
|
||||
<a href='#SkRGBA4f_FromColor'>FromColor</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_premul'></a>
|
||||
<a name='SkRGBA4f_premul'></a>
|
||||
## premul
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_premul'>premul</a>() const
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a><<a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>> <a href='#SkRGBA4f_premul'>premul</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#SkColor4f'>SkColor4f</a> with all components premultiplied by <a href='SkColor_Reference#Alpha'>Alpha</a>.
|
||||
@ -441,18 +523,18 @@ Returns <a href='#SkColor4f'>SkColor4f</a> with all components premultiplied by
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_unpremul'>unpremul</a>
|
||||
<a href='#SkRGBA4f_unpremul'>unpremul</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_unpremul'></a>
|
||||
<a name='SkRGBA4f_unpremul'></a>
|
||||
## unpremul
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_unpremul'>unpremul</a>() const
|
||||
<a href='#SkRGBA4f'>SkRGBA4f</a><<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>> <a href='#SkRGBA4f_unpremul'>unpremul</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#SkColor4f'>SkColor4f</a> with all components independent of <a href='SkColor_Reference#Alpha'>Alpha</a>.
|
||||
Returns <a href='#SkRGBA4f'>SkRGBA4f</a> with all components independent of <a href='SkColor_Reference#Alpha'>Alpha</a>.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -460,21 +542,13 @@ Returns <a href='#SkColor4f'>SkColor4f</a> with all components independent of <a
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkColor4f_premul'>premul</a>
|
||||
<a href='#SkRGBA4f_premul'>premul</a>
|
||||
|
||||
---
|
||||
|
||||
<a name='SkColor4f_toPM4f'></a>
|
||||
## toPM4f
|
||||
## <a name='SkColor4f'>Typedef SkColor4f</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkPM4f'>SkPM4f</a> <a href='#SkColor4f_toPM4f'>toPM4f</a>() const
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
using <a href='#SkColor4f'>SkColor4f</a> = <a href='#SkRGBA4f'>SkRGBA4f</a><<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>>;
|
||||
</pre>
|
||||
|
||||
### Return Value
|
||||
|
||||
premultiplied color
|
||||
|
||||
---
|
||||
|
||||
# <a name='SkPM4f'>Struct SkPM4f</a>
|
||||
|
@ -1,191 +1,59 @@
|
||||
SkColor Reference
|
||||
===
|
||||
|
||||
# <a name='Color'>Color</a>
|
||||
Types, consts, functions, and macros for colors.
|
||||
|
||||
## Overview
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
typedef uint8_t <a href='#SkAlpha'>SkAlpha</a>;
|
||||
typedef uint32_t <a href='#SkColor'>SkColor</a>;
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Define'>Defines</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preprocessor definitions of functions, values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Typedef'>Typedef Declarations</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>types defined by other types</td>
|
||||
</tr>
|
||||
</table>
|
||||
static constexpr <a href='#SkColor'>SkColor</a> <a href='#SkColorSetARGB'>SkColorSetARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b);
|
||||
#define <a href='#SkColorSetRGB'>SkColorSetRGB</a>(r, g, b) <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, r, g, b)
|
||||
#define <a href='#SkColorGetA'>SkColorGetA</a>(color) (((color) >> 24) & 0xFF)
|
||||
#define <a href='#SkColorGetR'>SkColorGetR</a>(color) (((color) >> 16) & 0xFF)
|
||||
#define <a href='#SkColorGetG'>SkColorGetG</a>(color) (((color) >> 8) & 0xFF)
|
||||
#define <a href='#SkColorGetB'>SkColorGetB</a>(color) (((color) >> 0) & 0xFF)
|
||||
|
||||
static constexpr <a href='#SkColor'>SkColor</a> <a href='#SkColorSetA'>SkColorSetA</a>(<a href='#SkColor'>SkColor</a> c, <a href='undocumented#U8CPU'>U8CPU</a> a);
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaTRANSPARENT'>SK_AlphaTRANSPARENT</a> = 0x00;
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaOPAQUE'>SK_AlphaOPAQUE</a> = 0xFF;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK_ColorTRANSPARENT</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0x00, 0x00, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLACK'>SK_ColorBLACK</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorDKGRAY'>SK_ColorDKGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x44, 0x44, 0x44);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK_ColorGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x88, 0x88, 0x88);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK_ColorLTGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xCC, 0xCC, 0xCC);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK_ColorWHITE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0xFF, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorRED'>SK_ColorRED</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGREEN'>SK_ColorGREEN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0xFF, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK_ColorBLUE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0x00, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorYELLOW'>SK_ColorYELLOW</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0xFF, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK_ColorCYAN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0xFF, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK_ColorMAGENTA</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0x00, 0xFF);
|
||||
|
||||
## <a name='Define'>Define</a>
|
||||
void <a href='#SkRGBToHSV'>SkRGBToHSV</a>(<a href='undocumented#U8CPU'>U8CPU</a> red, <a href='undocumented#U8CPU'>U8CPU</a> green, <a href='undocumented#U8CPU'>U8CPU</a> blue, <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]);
|
||||
|
||||
static void <a href='#SkColorToHSV'>SkColorToHSV</a>(<a href='#SkColor'>SkColor</a> color, <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]);
|
||||
|
||||
SkColor uses preprocessor definitions to inline code and constants, and to abstract platform-specific functionality.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetA'>SkColorGetA</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha'>Alpha</a> component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetB'>SkColorGetB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns blue component</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetG'>SkColorGetG</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns green component</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetR'>SkColorGetR</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns red component</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetRGB'>SkColorSetRGB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns opaque <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href='#SkColor'>SkColor</a> <a href='#SkHSVToColor'>SkHSVToColor</a>(<a href='undocumented#U8CPU'>U8CPU</a> alpha, const <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]);
|
||||
|
||||
static <a href='#SkColor'>SkColor</a> <a href='#SkHSVToColor_2'>SkHSVToColor</a>(const <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]);
|
||||
typedef uint32_t <a href='#SkPMColor'>SkPMColor</a>;
|
||||
|
||||
<a href='#SkPMColor'>SkPMColor</a> <a href='#SkPreMultiplyARGB'>SkPreMultiplyARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b);
|
||||
|
||||
<a href='#SkPMColor'>SkPMColor</a> <a href='#SkPreMultiplyColor'>SkPreMultiplyColor</a>(<a href='#SkColor'>SkColor</a> c);
|
||||
template <<a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> kAT>
|
||||
struct <a href='SkColor4f_Reference#SkRGBA4f'>SkRGBA4f</a> {
|
||||
// <i><a href='#SkRGBA4f'>SkRGBA4f</a> interface</i>
|
||||
};
|
||||
template <> <a href='SkColor4f_Reference#SkColor4f'>SkColor4f</a> SkColor4f::FromColor(SkColor);
|
||||
template <> <a href='#SkColor'>SkColor</a> SkColor4f::toSkColor() const;
|
||||
</pre>
|
||||
|
||||
<a href='#Color'>Color</a> constants can be helpful to write code, documenting the meaning of values
|
||||
the represent transparency and color values. The use of <a href='#Color'>Color</a> constants is not
|
||||
required.
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkColor related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_AlphaOPAQUE'>SK AlphaOPAQUE</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully opaque <a href='#SkAlpha'>SkAlpha</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully transparent <a href='#SkAlpha'>SkAlpha</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorBLACK'>SK ColorBLACK</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>black <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorBLUE'>SK ColorBLUE</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>blue <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorCYAN'>SK ColorCYAN</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>cyan <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorDKGRAY'>SK ColorDKGRAY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>dark gray <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorGRAY'>SK ColorGRAY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>gray <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorGREEN'>SK ColorGREEN</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>green <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorLTGRAY'>SK ColorLTGRAY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>light gray <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorMAGENTA'>SK ColorMAGENTA</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>magenta <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorRED'>SK ColorRED</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>red <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>transparent <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorWHITE'>SK ColorWHITE</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>white <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorYELLOW'>SK ColorYELLOW</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>yellow <a href='#Color'>Color</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Function'>Function</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetA'>SkColorSetA</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color'>Color</a> with transparency</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetARGB'>SkColorSetARGB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha'>Color Alpha</a> and RGB combined</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorToHSV'>SkColorToHSV</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts RGB to <a href='#HSV'>HSV</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkHSVToColor'>SkHSVToColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#HSV'>HSV</a> with <a href='#Alpha'>Alpha</a> to RGB</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkHSVToColor'>SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPreMultiplyARGB'>SkPreMultiplyARGB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Unpremultiply'>Unpremultiplied</a> ARGB to <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#PMColor'>PMColor</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPreMultiplyColor'>SkPreMultiplyColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='#Color'>Color</a> to <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#PMColor'>PMColor</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRGBToHSV'>SkRGBToHSV</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts RGB to <a href='#HSV'>HSV</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Typedef'>Typedef</a>
|
||||
|
||||
|
||||
SkColor <code>typedef</code> define a data type.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlpha'>SkAlpha</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='#Alpha'>Alpha</a> as eight bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor'>SkColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='#Color'>Color</a> as 32 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPMColor'>SkPMColor</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#Color'>Color</a> as 32 bits</td>
|
||||
</tr>
|
||||
</table>
|
||||
## <a name='Functions'>Functions</a>
|
||||
|
||||
## <a name='Alpha'>Alpha</a>
|
||||
|
||||
@ -267,7 +135,7 @@ color and alpha, <a href='undocumented#Unpremultiply'>Unpremultiplied</a>
|
||||
## <a name='SkColorSetRGB'>Define SkColorSetRGB</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
#define <a href='#SkColorSetRGB'>SkColorSetRGB(r, g, b)</a> <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, r, g, b)</a>
|
||||
#define <a href='#SkColorSetRGB'>SkColorSetRGB</a>(r, g, b) <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, r, g, b)
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Color'>Color</a> value from 8-bit component values, with <a href='#Alpha'>Alpha</a> set
|
||||
@ -301,7 +169,7 @@ color with opaque alpha
|
||||
## <a name='SkColorGetA'>Define SkColorGetA</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
#define <a href='#SkColorGetA'>SkColorGetA(color)</a> (((color) >> 24) & 0xFF)
|
||||
#define <a href='#SkColorGetA'>SkColorGetA</a>(color) (((color) >> 24) & 0xFF)
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Alpha'>Alpha</a> byte from <a href='#Color'>Color</a> value.
|
||||
@ -324,7 +192,7 @@ Returns <a href='#Alpha'>Alpha</a> byte from <a href='#Color'>Color</a> value.
|
||||
## <a name='SkColorGetR'>Define SkColorGetR</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
#define <a href='#SkColorGetR'>SkColorGetR(color)</a> (((color) >> 16) & 0xFF)
|
||||
#define <a href='#SkColorGetR'>SkColorGetR</a>(color) (((color) >> 16) & 0xFF)
|
||||
</pre>
|
||||
|
||||
Returns red component of <a href='#Color'>Color</a>, from zero to 255.
|
||||
@ -351,7 +219,7 @@ red byte
|
||||
## <a name='SkColorGetG'>Define SkColorGetG</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
#define <a href='#SkColorGetG'>SkColorGetG(color)</a> (((color) >> 8) & 0xFF)
|
||||
#define <a href='#SkColorGetG'>SkColorGetG</a>(color) (((color) >> 8) & 0xFF)
|
||||
</pre>
|
||||
|
||||
Returns green component of <a href='#Color'>Color</a>, from zero to 255.
|
||||
@ -378,7 +246,7 @@ green byte
|
||||
## <a name='SkColorGetB'>Define SkColorGetB</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
#define <a href='#SkColorGetB'>SkColorGetB(color)</a> (((color) >> 0) & 0xFF)
|
||||
#define <a href='#SkColorGetB'>SkColorGetB</a>(color) (((color) >> 0) & 0xFF)
|
||||
</pre>
|
||||
|
||||
Returns blue component of <a href='#Color'>Color</a>, from zero to 255.
|
||||
@ -460,8 +328,8 @@ from <a href='#SkColorSetA_a'>a</a>. <a href='#Alpha'>Alpha</a> component of <a
|
||||
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a> = 0x00;
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaOPAQUE'>SK AlphaOPAQUE</a> = 0xFF;
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaTRANSPARENT'>SK_AlphaTRANSPARENT</a> = 0x00;
|
||||
constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaOPAQUE'>SK_AlphaOPAQUE</a> = 0xFF;
|
||||
</pre>
|
||||
|
||||
<a href='#Alpha'>Alpha</a> constants are conveniences to represent fully transparent and fully
|
||||
@ -589,18 +457,18 @@ fully transparent; to 255, fully opaque.
|
||||
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0x00, 0x00, 0x00, 0x00)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLACK'>SK ColorBLACK</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0x00, 0x00)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorDKGRAY'>SK ColorDKGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x44, 0x44, 0x44)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK ColorGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x88, 0x88, 0x88)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK ColorLTGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xCC, 0xCC, 0xCC)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK ColorWHITE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorRED'>SK ColorRED</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGREEN'>SK ColorGREEN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK ColorBLUE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorYELLOW'>SK ColorYELLOW</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0xFF, 0x00)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK ColorCYAN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0xFF, 0xFF)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK ColorMAGENTA</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0x00, 0xFF)</a>;
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK_ColorTRANSPARENT</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0x00, 0x00, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLACK'>SK_ColorBLACK</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorDKGRAY'>SK_ColorDKGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x44, 0x44, 0x44);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK_ColorGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x88, 0x88, 0x88);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK_ColorLTGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xCC, 0xCC, 0xCC);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK_ColorWHITE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0xFF, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorRED'>SK_ColorRED</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0x00, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGREEN'>SK_ColorGREEN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0xFF, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK_ColorBLUE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0x00, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorYELLOW'>SK_ColorYELLOW</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0xFF, 0x00);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK_ColorCYAN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0x00, 0xFF, 0xFF);
|
||||
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK_ColorMAGENTA</a> = <a href='#SkColorSetARGB'>SkColorSetARGB</a>(0xFF, 0xFF, 0x00, 0xFF);
|
||||
</pre>
|
||||
|
||||
<a href='#Color'>Color</a> names are provided as conveniences, but are not otherwise special.
|
||||
|
@ -1,145 +1,33 @@
|
||||
SkIPoint Reference
|
||||
===
|
||||
|
||||
# <a name='IPoint'>IPoint</a>
|
||||
<a name='SkIPoint'></a>
|
||||
|
||||
# <a name='SkIPoint'>Struct SkIPoint</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkIPoint'>SkIPoint</a> {
|
||||
int32_t <a href='#SkIPoint_fX'>fX</a>;
|
||||
int32_t <a href='#SkIPoint_fY'>fY</a>;
|
||||
|
||||
## <a name='Typedef'>Typedef</a>
|
||||
static constexpr <a href='#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_Make'>Make</a>(int32_t x, int32_t y);
|
||||
int32_t <a href='#SkIPoint_x'>x</a>() const;
|
||||
int32_t <a href='#SkIPoint_y'>y</a>() const;
|
||||
bool <a href='#SkIPoint_isZero'>isZero</a>() const;
|
||||
void <a href='#SkIPoint_set'>set</a>(int32_t x, int32_t y);
|
||||
<a href='#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_minus_operator'>operator-()_const</a>;
|
||||
void <a href='#SkIPoint_addto_operator'>operator+=(const SkIVector& v)</a>;
|
||||
void <a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a>;
|
||||
bool <a href='#SkIPoint_equals'>equals</a>(int32_t x, int32_t y) const;
|
||||
friend bool <a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a>;
|
||||
friend bool <a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a>;
|
||||
friend <a href='#SkIVector'>SkIVector</a> <a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a>;
|
||||
friend <a href='#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_add_operator'>operator+(const SkIPoint& a, const SkIVector& b)</a>;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#SkIPoint'>SkIPoint</a> holds two 32-bit integer coordinates.<table style='border-collapse: collapse; width: 62.5em'>
|
||||
|
||||
SkIPoint <code>typedef</code> define a data type.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
</table>
|
||||
|
||||
<a href='#SkIPoint'>SkIPoint</a> holds two 32-bit integer coordinates.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkIPoint'>SkIPoint</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Related_Function'>Related Function</a>
|
||||
|
||||
|
||||
SkIPoint global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#IVector'>IVector</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>alias for <a href='#IPoint'>IPoint</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkIPoint member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from integer inputs</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equals'>equals</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_isZero'>isZero</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fX'>fX</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fY'>fY</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member'>Member</a>
|
||||
|
||||
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fX'><code>fX</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fY'><code>fY</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
SkIPoint members may be read and written directly without using a member function.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_fX'>fX</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_fY'>fY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
|
||||
@ -155,19 +43,6 @@ x-axis value used by <a href='#IPoint'>IPoint</a>.
|
||||
y-axis value used by <a href='#IPoint'>IPoint</a>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkIPoint can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from integer inputs</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIPoint_Make'></a>
|
||||
@ -207,30 +82,12 @@ pt1 == pt2
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIPoint_set'>set</a> <a href='SkPoint_Reference#SkPoint_iset'>SkPoint::iset()</a><sup><a href='SkPoint_Reference#SkPoint_iset_2'>[2]</a></sup> <a href='SkPoint_Reference#SkPoint_Make'>SkPoint::Make</a>
|
||||
<a href='#SkIPoint_set'>set</a>() <a href='SkPoint_Reference#SkPoint_iset'>SkPoint::iset</a><sup><a href='SkPoint_Reference#SkPoint_iset_2'>[2]</a></sup>() <a href='SkPoint_Reference#SkPoint_Make'>SkPoint::Make</a>
|
||||
|
||||
---
|
||||
|
||||
## <a name='Property'>Property</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_isZero'>isZero</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fX'>fX</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fY'>fY</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIPoint_x'></a>
|
||||
## x
|
||||
|
||||
@ -258,7 +115,7 @@ pt1.fX == pt1.x()
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIPoint_y'>y</a> <a href='SkPoint_Reference#SkPoint_x'>SkPoint::x()</a>
|
||||
<a href='#SkIPoint_y'>y</a>() <a href='SkPoint_Reference#SkPoint_x'>SkPoint::x</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -289,7 +146,7 @@ pt1.fY == pt1.y()
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIPoint_x'>x</a> <a href='SkPoint_Reference#SkPoint_y'>SkPoint::y()</a>
|
||||
<a href='#SkIPoint_x'>x</a>() <a href='SkPoint_Reference#SkPoint_y'>SkPoint::y</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -326,16 +183,6 @@ pt.isZero() == true
|
||||
|
||||
## <a name='Set'>Set</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIPoint_set'></a>
|
||||
## set
|
||||
|
||||
@ -373,52 +220,11 @@ pt1 == pt2
|
||||
|
||||
---
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkIPoint operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equals'>equals</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#IPoint'>IPoints</a> are unequal</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_add_operator'>operator+(const SkIPoint& a, const SkIVector& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#IPoint'>IPoint</a> offset by <a href='#IVector'>IVector</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_addto_operator'>operator+=(const SkIVector& v)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#IVector'>IVector</a> to <a href='#IPoint'>IPoint</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_minus_operator'>operator-() const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses sign of <a href='#IPoint'>IPoint</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#IVector'>IVector</a> between <a href='#IPoint'>IPoints</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtracts <a href='#IVector'>IVector</a> from <a href='#IPoint'>IPoint</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#IPoint'>IPoints</a> are equal</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIPoint_minus_operator'></a>
|
||||
## operator-
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkIPoint'>SkIPoint</a> operator-() _const
|
||||
<a href='#SkIPoint'>SkIPoint</a> operator-() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#IPoint'>IPoint</a> changing the signs of <a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_fY'>fY</a>.
|
||||
@ -584,7 +390,7 @@ pt: -2147483648, -1 == pt
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIPoint_equals'>equals</a> <a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a>
|
||||
<a href='#SkIPoint_equals'>equals</a>() <a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a>
|
||||
|
||||
---
|
||||
|
||||
@ -628,7 +434,7 @@ pt: -2147483648, -1 == pt
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a> <a href='#SkIPoint_equals'>equals</a>
|
||||
<a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a> <a href='#SkIPoint_equals'>equals</a>()
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,246 +1,79 @@
|
||||
SkIRect Reference
|
||||
===
|
||||
|
||||
# <a name='IRect'>IRect</a>
|
||||
<a name='SkIRect'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkIRect'>SkIRect</a> {
|
||||
int32_t <a href='#SkIRect_fLeft'>fLeft</a>;
|
||||
int32_t <a href='#SkIRect_fTop'>fTop</a>;
|
||||
int32_t <a href='#SkIRect_fRight'>fRight</a>;
|
||||
int32_t <a href='#SkIRect_fBottom'>fBottom</a>;
|
||||
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>();
|
||||
static <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLargest'>MakeLargest</a>();
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h);
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& size);
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t,
|
||||
int32_t r, int32_t b);
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y,
|
||||
int32_t w, int32_t h);
|
||||
int32_t <a href='#SkIRect_left'>left</a>() const;
|
||||
int32_t <a href='#SkIRect_top'>top</a>() const;
|
||||
int32_t <a href='#SkIRect_right'>right</a>() const;
|
||||
int32_t <a href='#SkIRect_bottom'>bottom</a>() const;
|
||||
int32_t <a href='#SkIRect_x'>x</a>() const;
|
||||
int32_t <a href='#SkIRect_y'>y</a>() const;
|
||||
int32_t <a href='#SkIRect_width'>width</a>() const;
|
||||
int32_t <a href='#SkIRect_height'>height</a>() const;
|
||||
<a href='undocumented#SkISize'>SkISize</a> <a href='#SkIRect_size'>size</a>() const;
|
||||
int64_t <a href='#SkIRect_width64'>width64</a>() const;
|
||||
int64_t <a href='#SkIRect_height64'>height64</a>() const;
|
||||
bool <a href='#SkIRect_isEmpty64'>isEmpty64</a>() const;
|
||||
bool <a href='#SkIRect_isEmpty'>isEmpty</a>() const;
|
||||
friend bool <a href='#SkIRect_equal_operator'>operator==(const SkIRect& a, const SkIRect& b)</a>;
|
||||
friend bool <a href='#SkIRect_notequal_operator'>operator!=(const SkIRect& a, const SkIRect& b)</a>;
|
||||
void <a href='#SkIRect_setEmpty'>setEmpty</a>();
|
||||
void <a href='#SkIRect_set'>set</a>(int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void <a href='#SkIRect_setLTRB'>setLTRB</a>(int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void <a href='#SkIRect_setXYWH'>setXYWH</a>(int32_t x, int32_t y, int32_t width, int32_t height);
|
||||
<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOffset'>makeOffset</a>(int32_t dx, int32_t dy) const;
|
||||
<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeInset'>makeInset</a>(int32_t dx, int32_t dy) const;
|
||||
<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOutset'>makeOutset</a>(int32_t dx, int32_t dy) const;
|
||||
void <a href='#SkIRect_offset'>offset</a>(int32_t dx, int32_t dy);
|
||||
void <a href='#SkIRect_offset_2'>offset</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& delta);
|
||||
void <a href='#SkIRect_offsetTo'>offsetTo</a>(int32_t newX, int32_t newY);
|
||||
void <a href='#SkIRect_inset'>inset</a>(int32_t dx, int32_t dy);
|
||||
void <a href='#SkIRect_outset'>outset</a>(int32_t dx, int32_t dy);
|
||||
void <a href='#SkIRect_adjust'>adjust</a>(int32_t dL, int32_t dT, int32_t dR, int32_t dB);
|
||||
bool <a href='#SkIRect_contains'>contains</a>(int32_t x, int32_t y) const;
|
||||
bool <a href='#SkIRect_contains_2'>contains</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) const;
|
||||
bool <a href='#SkIRect_contains_3'>contains</a>(const <a href='#SkIRect'>SkIRect</a>& r) const;
|
||||
bool <a href='#SkIRect_contains_4'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& r) const;
|
||||
bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(int32_t left, int32_t top,
|
||||
int32_t right, int32_t bottom) const;
|
||||
bool <a href='#SkIRect_containsNoEmptyCheck_2'>containsNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& r) const;
|
||||
bool <a href='#SkIRect_intersect'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& r);
|
||||
bool <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b);
|
||||
bool <a href='#SkIRect_intersect_2'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b);
|
||||
bool <a href='#SkIRect_intersect_3'>intersect</a>(int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
static bool <a href='#SkIRect_Intersects'>Intersects</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b);
|
||||
static bool <a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b);
|
||||
void <a href='#SkIRect_join'>join</a>(int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void <a href='#SkIRect_join_2'>join</a>(const <a href='#SkIRect'>SkIRect</a>& r);
|
||||
void <a href='#SkIRect_sort'>sort</a>();
|
||||
<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeSorted'>makeSorted</a>() const;
|
||||
static const <a href='#SkIRect'>SkIRect</a>& <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>();
|
||||
};
|
||||
</pre>
|
||||
|
||||
# <a name='SkIRect'>Struct SkIRect</a>
|
||||
<a href='#SkIRect'>SkIRect</a> holds four 32-bit integer coordinates describing the upper and
|
||||
lower bounds of a rectangle. <a href='#SkIRect'>SkIRect</a> may be created from outer bounds or
|
||||
from position, width, and height. <a href='#SkIRect'>SkIRect</a> describes an area; if its right
|
||||
is less than or equal to its left, or if its bottom is less than or equal to
|
||||
its top, it is considered empty.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkIRect'>SkIRect</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Related_Function'>Related Function</a>
|
||||
|
||||
|
||||
SkIRect global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Inset_Outset_Offset'>Inset Outset Offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves sides</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Intersection'>Intersection</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Join'>Join</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values, center, validity</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Sorting'>Sorting</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkIRect member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_EmptyIRect'>EmptyIRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns immutable bounds of (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_Intersects'>Intersects</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap skips empty check</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeEmpty'>MakeEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeLTRB'>MakeLTRB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int left, top, right, bottom</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeSize'>MakeSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeWH'>MakeWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeXYWH'>MakeXYWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (x, y, width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_adjust'>adjust</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides independently relative to their original locations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_bottom'>bottom</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkIPoint_Reference#IPoint'>IPoint</a> (x, y) is equal or inside</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if contains unsorted <a href='#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height64'>height64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_inset'>inset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty skips empty check</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative or they exceed int32_t</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty64'>isEmpty64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_left'>left</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeInset'>makeInset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOffset'>makeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOutset'>makeOutset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeSorted'>makeSorted</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#IRect'>IRect</a>, ordering sides from smaller to larger</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offsetTo'>offsetTo</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_outset'>outset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_right'>right</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (left, top, right, bottom)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setEmpty'>setEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setLTRB'>setLTRB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setXYWH'>setXYWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (x, y, width, height)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_size'>size</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#ISize'>ISize</a> (width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_sort'>sort</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_top'>top</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width64'>width64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member'>Member</a>
|
||||
## <a name='Members'>Members</a>
|
||||
|
||||
|
||||
|
||||
@ -248,7 +81,7 @@ SkIRect member functions read and modify the structure properties.
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
|
||||
@ -271,35 +104,9 @@ SkIRect member functions read and modify the structure properties.
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
SkIRect members may be read and written directly without using a member function.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fBottom'>fBottom</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fLeft'>fLeft</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller x-axis bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fRight'>fRight</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger x-axis bounds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fTop'>fTop</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller y-axis bounds</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td>
|
||||
@ -335,60 +142,13 @@ When equal to or less than <a href='#SkIRect_fTop'>fTop</a>, <a href='#IRect'>IR
|
||||
</tr>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkIRect can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_EmptyIRect'>EmptyIRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns immutable bounds of (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeEmpty'>MakeEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeLTRB'>MakeLTRB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int left, top, right, bottom</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeSize'>MakeSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeWH'>MakeWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeXYWH'>MakeXYWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (x, y, width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeInset'>makeInset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOffset'>makeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOutset'>makeOutset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeSorted'>makeSorted</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#IRect'>IRect</a>, ordering sides from smaller to larger</td>
|
||||
</tr>
|
||||
</table>
|
||||
## <a name='Constructors'>Constructors</a>
|
||||
|
||||
<a name='SkIRect_MakeEmpty'></a>
|
||||
## MakeEmpty
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>()
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>()
|
||||
</pre>
|
||||
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, 0, 0).
|
||||
@ -425,7 +185,7 @@ outset rect isEmpty: false
|
||||
## MakeWH
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h)
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h)
|
||||
</pre>
|
||||
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, <a href='#SkIRect_MakeWH_w'>w</a>, <a href='#SkIRect_MakeWH_h'>h</a>). Does not validate input; <a href='#SkIRect_MakeWH_w'>w</a> or <a href='#SkIRect_MakeWH_h'>h</a>
|
||||
@ -467,11 +227,11 @@ all equal
|
||||
## MakeSize
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& size)
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& size)
|
||||
</pre>
|
||||
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, size.<a href='#SkIRect_width'>width</a>, size.<a href='#SkIRect_height'>height</a>).
|
||||
Does not validate input; size.<a href='#SkIRect_width'>width</a> or size.<a href='#SkIRect_height'>height</a> may be negative.
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, size.<a href='#SkIRect_width'>width</a>(), size.<a href='#SkIRect_height'>height</a>()).
|
||||
Does not validate input; size.<a href='#SkIRect_width'>width</a>() or size.<a href='#SkIRect_height'>height</a>() may be negative.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -482,7 +242,7 @@ Does not validate input; size.<a href='#SkIRect_width'>width</a> or size.<a href
|
||||
|
||||
### Return Value
|
||||
|
||||
bounds (0, 0, size.<a href='#SkIRect_width'>width</a>, size.<a href='#SkIRect_height'>height</a>)
|
||||
bounds (0, 0, size.<a href='#SkIRect_width'>width</a>(), size.<a href='#SkIRect_height'>height</a>())
|
||||
|
||||
### Example
|
||||
|
||||
@ -507,7 +267,7 @@ floor width: 25 height: 35
|
||||
## MakeLTRB
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t, int32_t r, int32_t b)
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t, int32_t r, int32_t b)
|
||||
</pre>
|
||||
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to (<a href='#SkIRect_MakeLTRB_l'>l</a>, <a href='#SkIRect_MakeLTRB_t'>t</a>, <a href='#SkIRect_MakeLTRB_r'>r</a>, <a href='#SkIRect_MakeLTRB_b'>b</a>). Does not sort input; <a href='#IRect'>IRect</a> may
|
||||
@ -556,7 +316,7 @@ rect: 5, 25, 15, 35 isEmpty: false
|
||||
## MakeXYWH
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y, int32_t w, int32_t h)
|
||||
static constexpr <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y, int32_t w, int32_t h)
|
||||
</pre>
|
||||
|
||||
Returns constructed <a href='#IRect'>IRect</a> set to: <code>\(x, y, x \+ <a href='#SkIRect_MakeXYWH_w'>w</a>, y \+ <a href='#SkIRect_MakeXYWH_h'>h</a>\)</code>.
|
||||
@ -603,64 +363,6 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
## <a name='Property'>Property</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_bottom'>bottom</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height64'>height64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative or they exceed int32_t</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty64'>isEmpty64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_left'>left</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_right'>right</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_size'>size</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#ISize'>ISize</a> (width, height)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_top'>top</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width64'>width64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_left'></a>
|
||||
## left
|
||||
|
||||
@ -669,7 +371,7 @@ int32_t <a href='#SkIRect_left'>left</a>() const
|
||||
</pre>
|
||||
|
||||
Returns left edge of <a href='#IRect'>IRect</a>, if sorted.
|
||||
Call <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
Call <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -690,7 +392,7 @@ sorted.fLeft: 10 sorted.left(): 10
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_x'>x</a> <a href='SkRect_Reference#SkRect_left'>SkRect::left()</a>
|
||||
<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_x'>x</a>() <a href='SkRect_Reference#SkRect_left'>SkRect::left</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -702,7 +404,7 @@ int32_t <a href='#SkIRect_top'>top</a>() const
|
||||
</pre>
|
||||
|
||||
Returns top edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid,
|
||||
and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
and <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -723,7 +425,7 @@ sorted.fTop: 5 sorted.top(): 5
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_y'>y</a> <a href='SkRect_Reference#SkRect_top'>SkRect::top()</a>
|
||||
<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_y'>y</a>() <a href='SkRect_Reference#SkRect_top'>SkRect::top</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -735,7 +437,7 @@ int32_t <a href='#SkIRect_right'>right</a>() const
|
||||
</pre>
|
||||
|
||||
Returns right edge of <a href='#IRect'>IRect</a>, if sorted.
|
||||
Call <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
Call <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -756,7 +458,7 @@ sorted.fRight: 15 sorted.right(): 15
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fRight'>fRight</a> <a href='SkRect_Reference#SkRect_right'>SkRect::right()</a>
|
||||
<a href='#SkIRect_fRight'>fRight</a> <a href='SkRect_Reference#SkRect_right'>SkRect::right</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -768,7 +470,7 @@ int32_t <a href='#SkIRect_bottom'>bottom</a>() const
|
||||
</pre>
|
||||
|
||||
Returns bottom edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid,
|
||||
and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
and <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -789,7 +491,7 @@ sorted.fBottom: 25 sorted.bottom(): 25
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fBottom'>fBottom</a> <a href='SkRect_Reference#SkRect_bottom'>SkRect::bottom()</a>
|
||||
<a href='#SkIRect_fBottom'>fBottom</a> <a href='SkRect_Reference#SkRect_bottom'>SkRect::bottom</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -801,7 +503,7 @@ int32_t <a href='#SkIRect_x'>x</a>() const
|
||||
</pre>
|
||||
|
||||
Returns left edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid,
|
||||
and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
and <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -822,7 +524,7 @@ sorted.fLeft: 10 sorted.x(): 10
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_left'>left</a> <a href='#SkIRect_y'>y</a> <a href='SkRect_Reference#SkRect_x'>SkRect::x()</a>
|
||||
<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_left'>left</a>() <a href='#SkIRect_y'>y</a>() <a href='SkRect_Reference#SkRect_x'>SkRect::x</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -834,7 +536,7 @@ int32_t <a href='#SkIRect_y'>y</a>() const
|
||||
</pre>
|
||||
|
||||
Returns top edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid,
|
||||
and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
and <a href='#SkIRect_sort'>sort</a>() to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -855,7 +557,7 @@ sorted.fTop: 5 sorted.y(): 5
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_top'>top</a> <a href='#SkIRect_x'>x</a> <a href='SkRect_Reference#SkRect_y'>SkRect::y()</a>
|
||||
<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_top'>top</a>() <a href='#SkIRect_x'>x</a>() <a href='SkRect_Reference#SkRect_y'>SkRect::y</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -888,7 +590,7 @@ large width: -5
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_height'>height</a> <a href='#SkIRect_width64'>width64</a> <a href='#SkIRect_height64'>height64</a> <a href='SkRect_Reference#SkRect_width'>SkRect::width()</a>
|
||||
<a href='#SkIRect_height'>height</a>() <a href='#SkIRect_width64'>width64</a>() <a href='#SkIRect_height64'>height64</a>() <a href='SkRect_Reference#SkRect_width'>SkRect::width</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -900,7 +602,7 @@ int64_t <a href='#SkIRect_width64'>width64</a>() const
|
||||
</pre>
|
||||
|
||||
Returns span on the x-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, so the
|
||||
result may be negative. This is safer than calling <a href='#SkIRect_width'>width</a> since <a href='#SkIRect_width'>width</a> might
|
||||
result may be negative. This is safer than calling <a href='#SkIRect_width'>width</a>() since <a href='#SkIRect_width'>width</a>() might
|
||||
overflow in its calculation.
|
||||
|
||||
### Return Value
|
||||
@ -921,7 +623,7 @@ width: -5 width64: 4294967291
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_width'>width</a> <a href='#SkIRect_height'>height</a> <a href='#SkIRect_height64'>height64</a> <a href='SkRect_Reference#SkRect_width'>SkRect::width()</a>
|
||||
<a href='#SkIRect_width'>width</a>() <a href='#SkIRect_height'>height</a>() <a href='#SkIRect_height64'>height64</a>() <a href='SkRect_Reference#SkRect_width'>SkRect::width</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -954,7 +656,7 @@ large height: -5
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_width'>width</a> <a href='SkRect_Reference#SkRect_height'>SkRect::height()</a>
|
||||
<a href='#SkIRect_width'>width</a>() <a href='SkRect_Reference#SkRect_height'>SkRect::height</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -966,7 +668,7 @@ int64_t <a href='#SkIRect_height64'>height64</a>() const
|
||||
</pre>
|
||||
|
||||
Returns span on the y-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, so the
|
||||
result may be negative. This is safer than calling <a href='#SkIRect_height'>height</a> since <a href='#SkIRect_height'>height</a> might
|
||||
result may be negative. This is safer than calling <a href='#SkIRect_height'>height</a>() since <a href='#SkIRect_height'>height</a>() might
|
||||
overflow in its calculation.
|
||||
|
||||
### Return Value
|
||||
@ -987,7 +689,7 @@ height: -5 height64: 4294967291
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_width'>width</a> <a href='#SkIRect_height'>height</a> <a href='#SkIRect_width64'>width64</a> <a href='SkRect_Reference#SkRect_height'>SkRect::height()</a>
|
||||
<a href='#SkIRect_width'>width</a>() <a href='#SkIRect_height'>height</a>() <a href='#SkIRect_width64'>width64</a>() <a href='SkRect_Reference#SkRect_height'>SkRect::height</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1021,7 +723,7 @@ outset rect: 20, 30, 80, 90 size: 60, 60
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_height'>height</a> <a href='#SkIRect_width'>width</a> <a href='#SkIRect_MakeSize'>MakeSize</a>
|
||||
<a href='#SkIRect_height'>height</a>() <a href='#SkIRect_width'>width</a>() <a href='#SkIRect_MakeSize'>MakeSize</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1032,11 +734,11 @@ outset rect: 20, 30, 80, 90 size: 60, 60
|
||||
bool <a href='#SkIRect_isEmpty'>isEmpty</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkIRect_width'>width</a> or <a href='#SkIRect_height'>height</a> .
|
||||
Returns true if <a href='#SkIRect_width'>width</a>() or <a href='#SkIRect_height'>height</a>() are zero or negative or they exceed int32_t.
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='#SkIRect_width'>width</a> or <a href='#SkIRect_height'>height</a> are zero or negative
|
||||
true if <a href='#SkIRect_width'>width</a>() or <a href='#SkIRect_height'>height</a>() are not positive and valid
|
||||
|
||||
### Example
|
||||
|
||||
@ -1067,12 +769,12 @@ bool <a href='#SkIRect_isEmpty64'>isEmpty64</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkIRect_fLeft'>fLeft</a> is equal to or greater than <a href='#SkIRect_fRight'>fRight</a>, or if <a href='#SkIRect_fTop'>fTop</a> is equal
|
||||
to or greater than <a href='#SkIRect_fBottom'>fBottom</a>. Call <a href='#SkIRect_sort'>sort</a> to reverse rectangles with negative
|
||||
<a href='#SkIRect_width64'>width64</a> or <a href='#SkIRect_height64'>height64</a>.
|
||||
to or greater than <a href='#SkIRect_fBottom'>fBottom</a>. Call <a href='#SkIRect_sort'>sort</a>() to reverse rectangles with negative
|
||||
<a href='#SkIRect_width64'>width64</a>() or <a href='#SkIRect_height64'>height64</a>().
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='#SkIRect_width64'>width64</a> or <a href='#SkIRect_height64'>height64</a> are zero or negative
|
||||
true if <a href='#SkIRect_width64'>width64</a>() or <a href='#SkIRect_height64'>height64</a>() are not positive
|
||||
|
||||
### Example
|
||||
|
||||
@ -1095,22 +797,7 @@ sorted: {20, 40, 20, 50} is empty
|
||||
|
||||
---
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkIRect operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_notequal_operator'>operator!=(const SkIRect& a, const SkIRect& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_equal_operator'>operator==(const SkIRect& a, const SkIRect& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td>
|
||||
</tr>
|
||||
</table>
|
||||
## <a name='Operators'>Operators</a>
|
||||
|
||||
<a name='SkIRect_equal_operator'></a>
|
||||
## operator==
|
||||
@ -1198,28 +885,6 @@ test != sorted
|
||||
|
||||
## <a name='Set'>Set</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (left, top, right, bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setEmpty'>setEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setLTRB'>setLTRB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setXYWH'>setXYWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (x, y, width, height)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_setEmpty'></a>
|
||||
## setEmpty
|
||||
|
||||
@ -1391,36 +1056,6 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
## <a name='Inset_Outset_Offset'>Inset Outset Offset</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_adjust'>adjust</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides independently relative to their original locations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_inset'>inset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset(int32 t dx, int32 t dy)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offsetTo'>offsetTo</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_outset'>outset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_makeOffset'></a>
|
||||
## makeOffset
|
||||
|
||||
@ -1464,7 +1099,7 @@ rect: 25, 82, 35, 92 isEmpty: false
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_offset'>offset</a><sup><a href='#SkIRect_offset_2'>[2]</a></sup> <a href='#SkIRect_makeInset'>makeInset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeOffset'>SkRect::makeOffset</a>
|
||||
<a href='#SkIRect_offset'>offset</a><sup><a href='#SkIRect_offset_2'>[2]</a></sup>() <a href='#SkIRect_makeInset'>makeInset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeOffset'>SkRect::makeOffset</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1511,7 +1146,7 @@ rect: 25, 82, 5, 28 isEmpty: true
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_inset'>inset</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeInset'>SkRect::makeInset</a>
|
||||
<a href='#SkIRect_inset'>inset</a>() <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeInset'>SkRect::makeInset</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1558,7 +1193,7 @@ rect: -5, 18, 35, 92 isEmpty: false
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkIRect_outset'>outset</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeInset'>makeInset</a> <a href='SkRect_Reference#SkRect_makeOutset'>SkRect::makeOutset</a>
|
||||
<a href='#SkIRect_outset'>outset</a>() <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeInset'>makeInset</a> <a href='SkRect_Reference#SkRect_makeOutset'>SkRect::makeOutset</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1656,10 +1291,10 @@ are unchanged.
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkIRect_offsetTo_newX'><code><strong>newX</strong></code></a></td>
|
||||
<td>stored in <a href='#SkIRect_fLeft'>fLeft</a>, preserving <a href='#SkIRect_width'>width</a></td>
|
||||
<td>stored in <a href='#SkIRect_fLeft'>fLeft</a>, preserving <a href='#SkIRect_width'>width</a>()</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkIRect_offsetTo_newY'><code><strong>newY</strong></code></a></td>
|
||||
<td>stored in <a href='#SkIRect_fTop'>fTop</a>, preserving <a href='#SkIRect_height'>height</a></td>
|
||||
<td>stored in <a href='#SkIRect_fTop'>fTop</a>, preserving <a href='#SkIRect_height'>height</a>()</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1776,48 +1411,6 @@ empty() returns false. The intersection of <a href='#IRect'>IRect</a> pair can b
|
||||
The intersection is only meaningful if the resulting <a href='#IRect'>IRect</a> is not empty and
|
||||
describes an area: <a href='#SkIRect_fLeft'>fLeft</a> is less than <a href='#SkIRect_fRight'>fRight</a>, and <a href='#SkIRect_fTop'>fTop</a> is less than <a href='#SkIRect_fBottom'>fBottom</a>.
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_Intersects'>Intersects</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap skips empty check</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkIPoint_Reference#IPoint'>IPoint</a> (x, y) is equal or inside</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains(int32 t x, int32 t y)</a> const</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if contains unsorted <a href='#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck(int32 t left, int32 t top, int32 t right, int32 t bottom)</a> const</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect(const SkIRect& r)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty skips empty check</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_adjust'></a>
|
||||
## adjust
|
||||
|
||||
@ -1833,7 +1426,7 @@ If <a href='#SkIRect_adjust_dR'>dR</a> is positive, narrows <a href='#IRect'>IRe
|
||||
If <a href='#SkIRect_adjust_dB'>dB</a> is positive, shrinks <a href='#IRect'>IRect</a> on the bottom. If negative, lengthens it on the bottom.
|
||||
|
||||
The resulting <a href='#IRect'>IRect</a> is not checked for validity. Thus, if the resulting <a href='#IRect'>IRect</a> left is
|
||||
greater than right, the <a href='#IRect'>IRect</a> will be considered empty. Call <a href='#SkIRect_sort'>sort</a> after this call
|
||||
greater than right, the <a href='#IRect'>IRect</a> will be considered empty. Call <a href='#SkIRect_sort'>sort</a>() after this call
|
||||
if that is not the desired behavior.
|
||||
|
||||
### Parameters
|
||||
@ -2197,7 +1790,7 @@ intersection: 30, 60, 50, 80
|
||||
<a name='SkIRect_intersect_2'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool SK_WARN_UNUSED_RESULT <a href='#SkIRect_intersect'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b)
|
||||
bool <a href='#SkIRect_intersect'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b)
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkIRect_intersect_2_a'>a</a> intersects <a href='#SkIRect_intersect_2_b'>b</a>, and sets <a href='#IRect'>IRect</a> to intersection.
|
||||
@ -2241,7 +1834,7 @@ intersection: 30, 60, 50, 80
|
||||
## intersectNoEmptyCheck
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool SK_WARN_UNUSED_RESULT <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b)
|
||||
bool <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b)
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkIRect_intersectNoEmptyCheck_a'>a</a> intersects <a href='#SkIRect_intersectNoEmptyCheck_b'>b</a>, and sets <a href='#IRect'>IRect</a> to intersection.
|
||||
@ -2422,24 +2015,6 @@ intersection
|
||||
|
||||
## <a name='Join'>Join</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join(int32 t left, int32 t top, int32 t right, int32 t bottom)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join_2'>join(const SkIRect& r)</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_join'></a>
|
||||
## join
|
||||
|
||||
@ -2526,16 +2101,6 @@ join: 10, 20, 55, 65
|
||||
|
||||
## <a name='Sorting'>Sorting</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_sort'>sort</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkIRect_sort'></a>
|
||||
## sort
|
||||
|
||||
@ -2545,7 +2110,7 @@ void <a href='#SkIRect_sort'>sort</a>()
|
||||
|
||||
Swaps <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if <a href='#SkIRect_fLeft'>fLeft</a> is greater than <a href='#SkIRect_fRight'>fRight</a>; and swaps
|
||||
<a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if <a href='#SkIRect_fTop'>fTop</a> is greater than <a href='#SkIRect_fBottom'>fBottom</a>. Result may be empty,
|
||||
and <a href='#SkIRect_width'>width</a> and <a href='#SkIRect_height'>height</a> will be zero or positive.
|
||||
and <a href='#SkIRect_width'>width</a>() and <a href='#SkIRect_height'>height</a>() will be zero or positive.
|
||||
|
||||
### Example
|
||||
|
||||
@ -2575,7 +2140,7 @@ sorted: 20, 10, 30, 50
|
||||
|
||||
Returns <a href='#IRect'>IRect</a> with <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> swapped if <a href='#SkIRect_fLeft'>fLeft</a> is greater than <a href='#SkIRect_fRight'>fRight</a>; and
|
||||
with <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> swapped if <a href='#SkIRect_fTop'>fTop</a> is greater than <a href='#SkIRect_fBottom'>fBottom</a>. Result may be empty;
|
||||
and <a href='#SkIRect_width'>width</a> and <a href='#SkIRect_height'>height</a> will be zero or positive.
|
||||
and <a href='#SkIRect_width'>width</a>() and <a href='#SkIRect_height'>height</a>() will be zero or positive.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -2604,7 +2169,7 @@ sorted: 20, 10, 30, 50
|
||||
## EmptyIRect
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static const <a href='#SkIRect'>SkIRect</a>& SK_WARN_UNUSED_RESULT <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>()
|
||||
static const <a href='#SkIRect'>SkIRect</a>& <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>()
|
||||
</pre>
|
||||
|
||||
Returns a reference to immutable empty <a href='#IRect'>IRect</a>, set to (0, 0, 0, 0).
|
||||
@ -2635,7 +2200,7 @@ rect: 0, 0, 0, 0
|
||||
## MakeLargest
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
static <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeLargest'>MakeLargest</a>()
|
||||
static <a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLargest'>MakeLargest</a>()
|
||||
</pre>
|
||||
|
||||
Deprecated.
|
||||
|
@ -1,7 +1,55 @@
|
||||
SkImageInfo Reference
|
||||
===
|
||||
|
||||
# <a name='Image_Info'>Image Info</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkAlphaType'>SkAlphaType</a> {
|
||||
<a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>,
|
||||
<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>,
|
||||
<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>,
|
||||
<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
<a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a> = <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
};
|
||||
|
||||
static bool <a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a>(<a href='#SkAlphaType'>SkAlphaType</a> at);
|
||||
|
||||
enum <a href='#SkColorType'>SkColorType</a> {
|
||||
<a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>,
|
||||
<a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>,
|
||||
<a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>,
|
||||
<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>,
|
||||
<a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
<a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>,
|
||||
<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
<a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>,
|
||||
<a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>,
|
||||
<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>,
|
||||
<a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>,
|
||||
<a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
<a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a> = <a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
};
|
||||
|
||||
int <a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a>(<a href='#SkColorType'>SkColorType</a> ct);
|
||||
|
||||
bool <a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a>(<a href='#SkColorType'>SkColorType</a> ct);
|
||||
|
||||
bool <a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a>(<a href='#SkColorType'>SkColorType</a> colorType, <a href='#SkAlphaType'>SkAlphaType</a> alphaType,
|
||||
<a href='#SkAlphaType'>SkAlphaType</a>* canonical = nullptr);
|
||||
|
||||
enum <a href='#SkYUVColorSpace'>SkYUVColorSpace</a> {
|
||||
<a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>,
|
||||
<a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>,
|
||||
<a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
<a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a> = <a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
};
|
||||
|
||||
struct <a href='#SkImageInfo'>SkImageInfo</a> {
|
||||
// <i><a href='#SkImageInfo'>SkImageInfo</a> interface</i>
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#Image_Info'>Image Info</a> specifies the dimensions and encoding of the pixels in a <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>.
|
||||
The dimensions are integral width and height. The encoding is how pixel
|
||||
bits describe <a href='SkColor_Reference#Alpha'>Color Alpha</a>, transparency; <a href='SkColor_Reference#Color'>Color</a> components red, blue,
|
||||
@ -12,166 +60,26 @@ additionally describes compressed pixels like PNG, and <a href='SkSurface_Refere
|
||||
destinations on the GPU. <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a> may be specified by <a href='#Image_Info'>Image Info</a>,
|
||||
but <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a> may not contain <a href='#Image_Info'>Image Info</a>.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkImageInfo'>SkImageInfo</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkImageInfo related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaType'>SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel transparency</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorType'>SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel color</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkYUVColorSpace'>SkYUVColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>color range of YUV pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 4 bits for alpha, red, green, blue; in 16-bit word</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with <a href='SkColor_Reference#Alpha'>Alpha</a> in 8-bit byte</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits for blue, green, red, alpha; in 32-bit word</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with <a href='undocumented#Grayscale'>Grayscale</a> level in 8-bit byte</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes full range</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kN32_SkColorType'>kN32_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>native ARGB 32-bit encoding</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel is opaque</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel components are <a href='undocumented#Premultiply'>Premultiplied</a> by <a href='SkColor_Reference#Alpha'>Alpha</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>10 bits for red, green, blue; 2 bits for alpha; in 32-bit word</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits for red, green, blue, alpha; in 32-bit word</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with half floats for red, green, blue, alpha; in 64-bit word</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel using C float for red, green, blue, alpha; in 128-bit word</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 10 bits each for red, green, blue; in 32-bit word</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits each for red, green, blue; in 32-bit word</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes SDTV range</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes HDTV range</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uninitialized</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uninitialized</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel components are independent of <a href='SkColor_Reference#Alpha'>Alpha</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Alpha_Type'>Alpha Type</a>
|
||||
|
||||
## <a name='SkAlphaType'>Enum SkAlphaType</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkAlphaType'>SkAlphaType</a> {
|
||||
<a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>,
|
||||
<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>,
|
||||
<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>,
|
||||
<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
<a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a> = <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
};
|
||||
enum <a href='#SkAlphaType'>SkAlphaType</a> {
|
||||
<a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>,
|
||||
<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>,
|
||||
<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>,
|
||||
<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
<a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a> = <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
Describes how to interpret the alpha component of a pixel. A pixel may
|
||||
be opaque, or <a href='SkColor_Reference#Alpha'>Color Alpha</a>, describing multiple levels of transparency.
|
||||
|
||||
In simple blending, <a href='SkColor_Reference#Alpha'>Color Alpha</a> weights the draw color and the destination
|
||||
color to create a new color. If alpha describes a weight from zero to one:
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
new color = draw color * alpha + destination color * (1 - alpha)
|
||||
</pre>
|
||||
color to create a new color. If alpha describes a weight from zero to one,
|
||||
new color is set to: <code>draw color \* alpha \+ destination color \* \(1 \- alpha\)</code>.
|
||||
|
||||
In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.
|
||||
|
||||
@ -324,28 +232,23 @@ true if <a href='#SkAlphaTypeIsOpaque_at'>at</a> equals <a href='#kOpaque_SkAlph
|
||||
## <a name='SkColorType'>Enum SkColorType</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkColorType'>SkColorType</a> {
|
||||
<a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>,
|
||||
<a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>,
|
||||
<a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>,
|
||||
<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>,
|
||||
<a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
<a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>,
|
||||
<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
<a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>,
|
||||
<a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>,
|
||||
<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>,
|
||||
<a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>,
|
||||
<a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
<a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a> = <a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
};
|
||||
enum <a href='#SkColorType'>SkColorType</a> {
|
||||
<a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>,
|
||||
<a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>,
|
||||
<a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>,
|
||||
<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>,
|
||||
<a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
<a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>,
|
||||
<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
<a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>,
|
||||
<a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>,
|
||||
<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>,
|
||||
<a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>,
|
||||
<a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
<a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a> = <a href='#kRGBA_F32_SkColorType'>kRGBA_F32_SkColorType</a>,
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>,
|
||||
<a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
Describes how pixel bits encode color. A pixel may be an alpha mask, a
|
||||
@ -917,12 +820,12 @@ true if valid <a href='#Alpha_Type'>Alpha Type</a> can be associated with <a hre
|
||||
## <a name='SkYUVColorSpace'>Enum SkYUVColorSpace</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkYUVColorSpace'>SkYUVColorSpace</a> {
|
||||
<a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>,
|
||||
<a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>,
|
||||
<a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
<a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a> = <a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
};
|
||||
enum <a href='#SkYUVColorSpace'>SkYUVColorSpace</a> {
|
||||
<a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>,
|
||||
<a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>,
|
||||
<a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
<a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a> = <a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
Describes color range of YUV pixels. The color mapping from YUV to RGB varies
|
||||
@ -977,16 +880,52 @@ Used by tests to iterate through all valid values.
|
||||
|
||||
<a href='SkImage_Reference#SkImage_MakeFromYUVTexturesCopy'>SkImage::MakeFromYUVTexturesCopy</a> <a href='SkImage_Reference#SkImage_MakeFromNV12TexturesCopy'>SkImage::MakeFromNV12TexturesCopy</a>
|
||||
|
||||
# <a name='SkImageInfo'>Struct SkImageInfo</a>
|
||||
<a name='SkImageInfo'></a>
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkImageInfo related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
</table>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkImageInfo'>SkImageInfo</a> {
|
||||
public:
|
||||
<a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a>;
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_Make'>Make</a>(int width, int height, <a href='#SkColorType'>SkColorType</a> ct, <a href='#SkAlphaType'>SkAlphaType</a> at,
|
||||
sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a>(int width, int height, <a href='#SkAlphaType'>SkAlphaType</a> at,
|
||||
sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a>(int width, int height, <a href='#SkAlphaType'>SkAlphaType</a> at);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a>(int width, int height, sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32Premul_2'>MakeN32Premul</a>(const <a href='undocumented#SkISize'>SkISize</a>& size);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a>(int width, int height);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a>(int width, int height);
|
||||
static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeUnknown_2'>MakeUnknown</a>();
|
||||
int <a href='#SkImageInfo_width'>width</a>() const;
|
||||
int <a href='#SkImageInfo_height'>height</a>() const;
|
||||
<a href='#SkColorType'>SkColorType</a> <a href='#SkImageInfo_colorType'>colorType</a>() const;
|
||||
<a href='#SkAlphaType'>SkAlphaType</a> <a href='#SkImageInfo_alphaType'>alphaType</a>() const;
|
||||
<a href='undocumented#SkColorSpace'>SkColorSpace</a>* <a href='#SkImageInfo_colorSpace'>colorSpace</a>() const;
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImageInfo_refColorSpace'>refColorSpace</a>() const;
|
||||
bool <a href='#SkImageInfo_isEmpty'>isEmpty</a>() const;
|
||||
bool <a href='#SkImageInfo_isOpaque'>isOpaque</a>() const;
|
||||
<a href='undocumented#SkISize'>SkISize</a> <a href='#SkImageInfo_dimensions'>dimensions</a>() const;
|
||||
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkImageInfo_bounds'>bounds</a>() const;
|
||||
bool <a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a>() const;
|
||||
<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeWH'>makeWH</a>(int newWidth, int newHeight) const;
|
||||
<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a>(<a href='#SkAlphaType'>SkAlphaType</a> newAlphaType) const;
|
||||
<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeColorType'>makeColorType</a>(<a href='#SkColorType'>SkColorType</a> newColorType) const;
|
||||
<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a>(sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs) const;
|
||||
int <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>() const;
|
||||
int <a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a>() const;
|
||||
uint64_t <a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a>() const;
|
||||
size_t <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>() const;
|
||||
size_t <a href='#SkImageInfo_computeOffset'>computeOffset</a>(int x, int y, size_t rowBytes) const;
|
||||
bool <a href='#SkImageInfo_equal1_operator'>operator==(const SkImageInfo& other)_const</a>;
|
||||
bool <a href='#SkImageInfo_notequal1_operator'>operator!=(const SkImageInfo& other)_const</a>;
|
||||
size_t <a href='#SkImageInfo_computeByteSize'>computeByteSize</a>(size_t rowBytes) const;
|
||||
size_t <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a>() const;
|
||||
static bool <a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a>(size_t byteSize);
|
||||
bool <a href='#SkImageInfo_validRowBytes'>validRowBytes</a>(size_t rowBytes) const;
|
||||
void <a href='#SkImageInfo_reset'>reset</a>();
|
||||
void <a href='#SkImageInfo_validate'>validate</a>() const;
|
||||
};
|
||||
</pre>
|
||||
|
||||
Describes pixel dimensions and encoding. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, <a href='SkImage_Reference#Image'>Image</a>, PixMap, and <a href='SkSurface_Reference#Surface'>Surface</a>
|
||||
can be created from <a href='#Image_Info'>Image Info</a>. <a href='#Image_Info'>Image Info</a> can be retrieved from <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> and
|
||||
@ -997,317 +936,6 @@ implementations may defer pixel depth, so may not completely specify <a href='#I
|
||||
how pixel bits describe <a href='SkColor_Reference#Alpha'>Color Alpha</a>, transparency; <a href='SkColor_Reference#Color'>Color</a> components red, blue,
|
||||
and green; and <a href='undocumented#Color_Space'>Color Space</a>, the range and linearity of colors.
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkImageInfo member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks result of <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> and <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> from dimensions, <a href='#Color_Type'>Color Type</a>, <a href='#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeA8'>MakeA8</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32'>MakeN32</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeS32'>MakeS32</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, sRGB <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a> byte size</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Color_Type'>Color Type</a> includes <a href='SkColor_Reference#Alpha'>Color Alpha</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is valid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_alphaType'>alphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha_Type'>Alpha Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bounds'>bounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> as Rectangle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorSpace'>colorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorType'>colorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeByteSize'>computeByteSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns memory required by pixel buffer with given row bytes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns least memory required by pixel buffer</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeOffset'>computeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns byte offset within pixel array</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_dimensions'>dimensions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if dimensions contain pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isOpaque'>isOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Alpha_Type'>Alpha Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorType'>makeColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeWH'>makeWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed dimensions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes'>minRowBytes</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 32 bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 64 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_refColorSpace'>refColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_reset'>reset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets zero dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validRowBytes'>validRowBytes</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks if row bytes is large enough to contain pixel row</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validate'>validate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Image_Info'>Image Info</a> is invalid (debug only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Related_Function'>Related Function</a>
|
||||
|
||||
|
||||
SkImageInfo global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type'>Alpha Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel transparency</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Opaque'>Alpha Type Opaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>hints all pixels are opaque</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Premul'>Alpha Type Premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stores components scaled by <a href='SkColor_Reference#Alpha'>Alpha</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Unpremul'>Alpha Type Unpremul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stores components without <a href='SkColor_Reference#Alpha'>Alpha</a> scaling</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type'>Color Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel color</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_ARGB_4444'>Color Type ARGB 4444</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB in 16 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Alpha_8'>Color Type Alpha 8</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes transparency only</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_BGRA_8888'>Color Type BGRA 8888</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB <a href='undocumented#Little_Endian'>Little Endian</a> in 32 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Gray_8'>Color Type Gray 8</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes level of <a href='undocumented#Grayscale'>Grayscale</a> in 8 bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_1010102'>Color Type RGBA 1010102</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB ten bits per color component</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_8888'>Color Type RGBA 8888</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB <a href='undocumented#Big_Endian'>Big Endian</a> in 32 bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_F16'>Color Type RGBA F16</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB as half floats</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_F32'>Color Type RGBA F32</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes ARGB as single precision floats</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_101010'>Color Type RGB 101010</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes RGB ten bits per color component</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_565'>Color Type RGB 565</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes RGB in 16 bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_888'>Color Type RGB 888</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes RGB in 32 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>metrics and attributes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#YUV_ColorSpace'>YUV ColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>color range of YUV pixels</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkImageInfo can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> from dimensions, <a href='#Color_Type'>Color Type</a>, <a href='#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeA8'>MakeA8</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32'>MakeN32</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul(int width, int height, sk sp<SkColorSpace> cs = nullptr)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul_2'>MakeN32Premul(const SkISize& size)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeS32'>MakeS32</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, sRGB <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown(int width, int height)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown_2'>MakeUnknown()</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with zeroed dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Alpha_Type'>Alpha Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorType'>makeColorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeWH'>makeWH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed dimensions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_reset'>reset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets zero dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkImageInfo_empty_constructor'></a>
|
||||
## SkImageInfo
|
||||
|
||||
@ -1660,88 +1288,6 @@ created <a href='#Image_Info'>Image Info</a>
|
||||
|
||||
## <a name='Property'>Property</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a> byte size</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Color_Type'>Color Type</a> includes <a href='SkColor_Reference#Alpha'>Color Alpha</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is valid</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_alphaType'>alphaType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha_Type'>Alpha Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bounds'>bounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> as Rectangle</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorSpace'>colorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorType'>colorType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_dimensions'>dimensions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if dimensions contain pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isOpaque'>isOpaque</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes'>minRowBytes</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 32 bits</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 64 bits</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_refColorSpace'>refColorSpace</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkImageInfo_width'></a>
|
||||
## width
|
||||
|
||||
@ -1996,11 +1542,11 @@ isOpaque: true
|
||||
<a href='undocumented#SkISize'>SkISize</a> <a href='#SkImageInfo_dimensions'>dimensions</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='undocumented#ISize'>ISize</a> { <a href='#SkImageInfo_width'>width</a>, <a href='#SkImageInfo_height'>height</a> }.
|
||||
Returns <a href='undocumented#ISize'>ISize</a> { <a href='#SkImageInfo_width'>width</a>(), <a href='#SkImageInfo_height'>height</a>() }.
|
||||
|
||||
### Return Value
|
||||
|
||||
integral size of <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a>
|
||||
integral size of <a href='#SkImageInfo_width'>width</a>() and <a href='#SkImageInfo_height'>height</a>()
|
||||
|
||||
### Example
|
||||
|
||||
@ -2027,11 +1573,11 @@ dimensionsAsBounds == bounds
|
||||
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkImageInfo_bounds'>bounds</a>() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkImageInfo_width'>width</a>, <a href='#SkImageInfo_height'>height</a> }.
|
||||
Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkImageInfo_width'>width</a>(), <a href='#SkImageInfo_height'>height</a>() }.
|
||||
|
||||
### Return Value
|
||||
|
||||
integral rectangle from origin to <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a>
|
||||
integral rectangle from origin to <a href='#SkImageInfo_width'>width</a>() and <a href='#SkImageInfo_height'>height</a>()
|
||||
|
||||
### Example
|
||||
|
||||
@ -2299,13 +1845,13 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3
|
||||
uint64_t <a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a>() const
|
||||
</pre>
|
||||
|
||||
Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a> and <a href='#Color_Type'>Color Type</a>, which
|
||||
specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit
|
||||
Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a>() and <a href='#Color_Type'>Color Type</a>, which
|
||||
specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>(). <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit
|
||||
in 31 bits.
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as unsigned 64-bit integer
|
||||
<a href='#SkImageInfo_width'>width</a>() times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as unsigned 64-bit integer
|
||||
|
||||
### Example
|
||||
|
||||
@ -2339,13 +1885,13 @@ RGBA_F16 width -2147483648 (0x80000000) too large
|
||||
size_t <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>() const
|
||||
</pre>
|
||||
|
||||
Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a> and <a href='#Color_Type'>Color Type</a>, which
|
||||
specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit
|
||||
Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a>() and <a href='#Color_Type'>Color Type</a>, which
|
||||
specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>(). <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit
|
||||
in 31 bits.
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as signed 32-bit integer
|
||||
<a href='#SkImageInfo_width'>width</a>() times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as signed 32-bit integer
|
||||
|
||||
### Example
|
||||
|
||||
@ -2387,10 +1933,10 @@ Asserts in debug build if <a href='#SkImageInfo_computeOffset_x'>x</a> or <a hre
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkImageInfo_computeOffset_x'><code><strong>x</strong></code></a></td>
|
||||
<td>column index, zero or greater, and less than <a href='#SkImageInfo_width'>width</a></td>
|
||||
<td>column index, zero or greater, and less than <a href='#SkImageInfo_width'>width</a>()</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkImageInfo_computeOffset_y'><code><strong>y</strong></code></a></td>
|
||||
<td>row index, zero or greater, and less than <a href='#SkImageInfo_height'>height</a></td>
|
||||
<td>row index, zero or greater, and less than <a href='#SkImageInfo_height'>height</a>()</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkImageInfo_computeOffset_rowBytes'><code><strong>rowBytes</strong></code></a></td>
|
||||
<td>size of pixel row or larger</td>
|
||||
@ -2411,28 +1957,11 @@ offset within pixel array
|
||||
|
||||
---
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkImageInfo operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_notequal1_operator'>operator!=(const SkImageInfo& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Image_Info'>Image Info</a> for inequality</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_equal1_operator'>operator==(const SkImageInfo& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Image_Info'>Image Info</a> for equality</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkImageInfo_equal1_operator'></a>
|
||||
## operator==
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator==(const SkImageInfo& other) _const
|
||||
bool operator==(const SkImageInfo& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Image_Info'>Image Info</a> with <a href='#SkImageInfo_equal1_operator_other'>other</a>, and returns true if width, height, <a href='#Color_Type'>Color Type</a>,
|
||||
@ -2474,7 +2003,7 @@ info1 == info2
|
||||
## operator!=
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator!=(const SkImageInfo& other) _const
|
||||
bool operator!=(const SkImageInfo& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Image_Info'>Image Info</a> with <a href='#SkImageInfo_notequal1_operator_other'>other</a>, and returns true if width, height, <a href='#Color_Type'>Color Type</a>,
|
||||
@ -2520,7 +2049,7 @@ size_t <a href='#SkImageInfo_computeByteSize'>computeByteSize</a>(size_t rowByte
|
||||
</pre>
|
||||
|
||||
Returns storage required by pixel array, given <a href='#Image_Info'>Image Info</a> dimensions, <a href='#Color_Type'>Color Type</a>,
|
||||
and <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a>. <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a> is assumed to be at least as large as <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>.
|
||||
and <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a>. <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a> is assumed to be at least as large as <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>().
|
||||
|
||||
Returns zero if height is zero.
|
||||
Returns SIZE_MAX if answer exceeds the range of size_t.
|
||||
@ -2554,7 +2083,7 @@ size_t <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a>() const
|
||||
</pre>
|
||||
|
||||
Returns storage required by pixel array, given <a href='#Image_Info'>Image Info</a> dimensions, and
|
||||
<a href='#Color_Type'>Color Type</a>. Uses <a href='#SkImageInfo_minRowBytes'>minRowBytes</a> to compute bytes for pixel row.
|
||||
<a href='#Color_Type'>Color Type</a>. Uses <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>() to compute bytes for pixel row.
|
||||
|
||||
Returns zero if height is zero.
|
||||
Returns SIZE_MAX if answer exceeds the range of size_t.
|
||||
@ -2688,36 +2217,6 @@ SkImageInfo() == reset copy
|
||||
|
||||
## <a name='Utility'>Utility</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks result of <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> and <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeByteSize'>computeByteSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns memory required by pixel buffer with given row bytes</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns least memory required by pixel buffer</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeOffset'>computeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns byte offset within pixel array</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validRowBytes'>validRowBytes</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks if row bytes is large enough to contain pixel row</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validate'>validate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Image_Info'>Image Info</a> is invalid (debug only)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkImageInfo_validate'></a>
|
||||
## validate
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,30 +1,35 @@
|
||||
SkPicture Reference
|
||||
===
|
||||
|
||||
# <a name='Picture'>Picture</a>
|
||||
<a name='SkPicture'></a>
|
||||
|
||||
# <a name='SkPicture'>Class SkPicture</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkPicture'>SkPicture</a> : public <a href='undocumented#SkRefCnt'>SkRefCnt</a> {
|
||||
public:
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkPicture'>SkPicture</a>> <a href='#SkPicture_MakeFromStream'>MakeFromStream</a>(<a href='SkStream_Reference#SkStream'>SkStream</a>* stream,
|
||||
const <a href='undocumented#SkDeserialProcs'>SkDeserialProcs</a>* procs = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkPicture'>SkPicture</a>> <a href='#SkPicture_MakeFromData'>MakeFromData</a>(const <a href='undocumented#SkData'>SkData</a>* data,
|
||||
const <a href='undocumented#SkDeserialProcs'>SkDeserialProcs</a>* procs = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkPicture'>SkPicture</a>> <a href='#SkPicture_MakeFromData_2'>MakeFromData</a>(const void* data, size_t size,
|
||||
const <a href='undocumented#SkDeserialProcs'>SkDeserialProcs</a>* procs = nullptr);
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
class <a href='#SkPicture_AbortCallback'>AbortCallback</a> {
|
||||
public:
|
||||
<a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback()</a>;
|
||||
virtual <a href='#SkPicture_AbortCallback_destructor'>~AbortCallback()</a>;
|
||||
virtual bool <a href='#SkPicture_AbortCallback_abort'>abort</a>() = 0;
|
||||
};
|
||||
|
||||
|
||||
SkPicture can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakeFromData'>MakeFromData</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Picture'>Picture</a> from data</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakeFromStream'>MakeFromStream</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Picture'>Picture</a> from stream</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakePlaceholder'>MakePlaceholder</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs placeholder with unique identifier</td>
|
||||
</tr>
|
||||
</table>
|
||||
virtual void <a href='#SkPicture_playback'>playback</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* canvas, <a href='#SkPicture_AbortCallback'>AbortCallback</a>* callback = nullptr) const = 0;
|
||||
virtual <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPicture_cullRect'>cullRect</a>() const = 0;
|
||||
uint32_t <a href='#SkPicture_uniqueID'>uniqueID</a>() const;
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkPicture_serialize'>serialize</a>(const <a href='undocumented#SkSerialProcs'>SkSerialProcs</a>* procs = nullptr) const;
|
||||
void <a href='#SkPicture_serialize_2'>serialize</a>(<a href='SkWStream_Reference#SkWStream'>SkWStream</a>* stream, const <a href='undocumented#SkSerialProcs'>SkSerialProcs</a>* procs = nullptr) const;
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkPicture'>SkPicture</a>> <a href='#SkPicture_MakePlaceholder'>MakePlaceholder</a>(<a href='SkRect_Reference#SkRect'>SkRect</a> cull);
|
||||
virtual int <a href='#SkPicture_approximateOpCount'>approximateOpCount</a>() const = 0;
|
||||
virtual size_t <a href='#SkPicture_approximateBytesUsed'>approximateBytesUsed</a>() const = 0;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#Picture'>Picture</a> records drawing commands made to <a href='SkCanvas_Reference#Canvas'>Canvas</a>. The command stream may be
|
||||
played in whole or in part at a later time.
|
||||
@ -37,126 +42,14 @@ or <a href='undocumented#Drawable'>Drawable</a>, or from <a href='#Picture'>Pict
|
||||
a bounding box hint. To limit <a href='#Picture'>Picture</a> bounds, use <a href='SkCanvas_Reference#Clip'>Canvas Clip</a> when
|
||||
recording or drawing <a href='#Picture'>Picture</a>.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Class'>Class Declarations</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded class members</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPicture'>SkPicture</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Class'>Class</a>
|
||||
|
||||
|
||||
SkPicture uses C++ classes to declare the public data structures and interfaces.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_AbortCallback'>AbortCallback</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>utility to stop picture playback</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkPicture member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakeFromData'>MakeFromData</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Picture'>Picture</a> from data</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakeFromStream'>MakeFromStream</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Picture'>Picture</a> from stream</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_MakePlaceholder'>MakePlaceholder</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs placeholder with unique identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_approximateBytesUsed'>approximateBytesUsed</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns approximate size</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_approximateOpCount'>approximateOpCount</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns approximate operation count</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_cullRect'>cullRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds used to record <a href='#Picture'>Picture</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_playback'>playback</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replays drawing commands on canvas</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_serialize'>serialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='#Picture'>Picture</a> to <a href='undocumented#Data'>Data</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_uniqueID'>uniqueID</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns identifier for <a href='#Picture'>Picture</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# <a name='SkPicture_AbortCallback'>Class SkPicture::AbortCallback</a>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkPicture::AbortCallback can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines default constructor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_AbortCallback_destructor'>~AbortCallback()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines default destructor</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member_Function</a>
|
||||
|
||||
|
||||
SkPicture::AbortCallback member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines default constructor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPicture_AbortCallback_abort'>abort</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>aborts playback by callback</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a name='SkPicture_AbortCallback'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback</a> {
|
||||
public:
|
||||
<a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback()</a> {}
|
||||
virtual <a href='#SkPicture_AbortCallback_destructor'>~AbortCallback()</a> {}
|
||||
virtual bool <a href='#SkPicture_AbortCallback_abort'>abort</a> = 0;
|
||||
virtual bool <a href='#SkPicture_AbortCallback_abort'>abort</a>() = 0;
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -208,12 +101,12 @@ virtual bool <a href='#SkPicture_AbortCallback_abort'>abort</a>() = 0
|
||||
</pre>
|
||||
|
||||
Stops <a href='#Picture'>Picture</a> playback when some condition is met. A subclass of
|
||||
<a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback</a> provides an override for <a href='#SkPicture_AbortCallback_abort'>abort</a> that can stop <a href='#SkPicture_playback'>SkPicture::playback</a>.
|
||||
<a href='#SkPicture_AbortCallback_AbortCallback'>AbortCallback</a> provides an override for <a href='#SkPicture_AbortCallback_abort'>abort</a>() that can stop <a href='#SkPicture_playback'>SkPicture::playback</a>.
|
||||
|
||||
The part of <a href='#Picture'>Picture</a> drawn when aborted is undefined. <a href='#Picture'>Picture</a> instantiations are
|
||||
free to stop drawing at different points during playback.
|
||||
|
||||
If the abort happens inside one or more calls to <a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save()</a>, stack
|
||||
If the abort happens inside one or more calls to <a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save</a>(), stack
|
||||
of <a href='SkCanvas_Reference#Matrix'>Canvas Matrix</a> and <a href='SkCanvas_Reference#Clip'>Canvas Clip</a> values is restored to its state before
|
||||
<a href='#SkPicture_playback'>SkPicture::playback</a> was called.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,225 +1,58 @@
|
||||
SkPoint Reference
|
||||
===
|
||||
|
||||
# <a name='Point'>Point</a>
|
||||
<a name='SkPoint'></a>
|
||||
|
||||
# <a name='SkPoint'>Struct SkPoint</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkPoint'>SkPoint</a> {
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_fX'>fX</a>;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_fY'>fY</a>;
|
||||
|
||||
## <a name='Typedef'>Typedef</a>
|
||||
static constexpr <a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_Make'>Make</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y);
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_x'>x</a>() const;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_y'>y</a>() const;
|
||||
bool <a href='#SkPoint_isZero'>isZero</a>() const;
|
||||
void <a href='#SkPoint_set'>set</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y);
|
||||
void <a href='#SkPoint_iset'>iset</a>(int32_t x, int32_t y);
|
||||
void <a href='#SkPoint_iset_2'>iset</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& p);
|
||||
void <a href='#SkPoint_setAbs'>setAbs</a>(const <a href='#SkPoint'>SkPoint</a>& pt);
|
||||
static void <a href='#SkPoint_Offset'>Offset</a>(<a href='#SkPoint'>SkPoint</a> points[], int count, const <a href='#SkVector'>SkVector</a>& offset);
|
||||
static void <a href='#SkPoint_Offset_2'>Offset</a>(<a href='#SkPoint'>SkPoint</a> points[], int count, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
|
||||
void <a href='#SkPoint_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_length'>length</a>() const;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a>() const;
|
||||
bool <a href='#SkPoint_normalize'>normalize</a>();
|
||||
bool <a href='#SkPoint_setNormalize'>setNormalize</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y);
|
||||
bool <a href='#SkPoint_setLength'>setLength</a>(<a href='undocumented#SkScalar'>SkScalar</a> length);
|
||||
bool <a href='#SkPoint_setLength_2'>setLength</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> length);
|
||||
void <a href='#SkPoint_scale'>scale</a>(<a href='undocumented#SkScalar'>SkScalar</a> scale, <a href='#SkPoint'>SkPoint</a>* dst) const;
|
||||
void <a href='#SkPoint_scale_2'>scale</a>(<a href='undocumented#SkScalar'>SkScalar</a> value);
|
||||
void <a href='#SkPoint_negate'>negate</a>();
|
||||
<a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_minus_operator'>operator-()_const</a>;
|
||||
void <a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a>;
|
||||
void <a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a>;
|
||||
<a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_multiply_operator'>operator*(SkScalar scale)_const</a>;
|
||||
<a href='#SkPoint'>SkPoint</a>& <a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a>;
|
||||
bool <a href='#SkPoint_isFinite'>isFinite</a>() const;
|
||||
bool <a href='#SkPoint_equals'>equals</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const;
|
||||
friend bool <a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a>;
|
||||
friend bool <a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a>;
|
||||
friend <a href='#SkVector'>SkVector</a> <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a>;
|
||||
friend <a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a>;
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Length'>Length</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y);
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Normalize'>Normalize</a>(<a href='#SkVector'>SkVector</a>* vec);
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Distance'>Distance</a>(const <a href='#SkPoint'>SkPoint</a>& a, const <a href='#SkPoint'>SkPoint</a>& b);
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_DotProduct'>DotProduct</a>(const <a href='#SkVector'>SkVector</a>& a, const <a href='#SkVector'>SkVector</a>& b);
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_CrossProduct'>CrossProduct</a>(const <a href='#SkVector'>SkVector</a>& a, const <a href='#SkVector'>SkVector</a>& b);
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_cross'>cross</a>(const <a href='#SkVector'>SkVector</a>& vec) const;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_dot'>dot</a>(const <a href='#SkVector'>SkVector</a>& vec) const;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#SkPoint'>SkPoint</a> holds two 32-bit floating point coordinates.<table style='border-collapse: collapse; width: 62.5em'>
|
||||
|
||||
SkPoint <code>typedef</code> define a data type.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
</table>
|
||||
|
||||
<a href='#SkPoint'>SkPoint</a> holds two 32-bit floating point coordinates.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPoint'>SkPoint</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Related_Function'>Related Function</a>
|
||||
|
||||
|
||||
SkPoint global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves sides</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Vector'>Vector</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>alias for <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkPoint member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_CrossProduct'>CrossProduct</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Distance'>Distance</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance between points</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_DotProduct'>DotProduct</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Length'>Length</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> inputs</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Normalize'>Normalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, and returns prior length</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a> array</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_cross'>cross</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_dot'>dot</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equals'>equals</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Points</a> are equal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isFinite'>isFinite</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isZero'>isZero</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_length'>length</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_negate'>negate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses the sign of both members</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_normalize'>normalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, preserving direction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_offset'>offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setAbs'>setAbs</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets sign of both members to positive</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setNormalize'>setNormalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, in direction of (x, y)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fX'>fX</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fY'>fY</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member'>Member</a>
|
||||
|
||||
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fX'><code>fX</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fY'><code>fY</code></a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
SkPoint members may be read and written directly without using a member function.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_fX'>fX</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_fY'>fY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td>
|
||||
@ -237,19 +70,6 @@ y-axis value used by both <a href='#Point'>Point</a> and <a href='#Vector'>Vecto
|
||||
infinities and NaN.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkPoint can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Make'>Make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> inputs</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkPoint_Make'></a>
|
||||
@ -289,50 +109,12 @@ all equal
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_set'>set</a> <a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup> <a href='SkIPoint_Reference#SkIPoint_Make'>SkIPoint::Make</a>
|
||||
<a href='#SkPoint_set'>set</a>() <a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup>() <a href='SkIPoint_Reference#SkIPoint_Make'>SkIPoint::Make</a>
|
||||
|
||||
---
|
||||
|
||||
## <a name='Property'>Property</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Distance'>Distance</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance between points</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Length'>Length</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isFinite'>isFinite</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isZero'>isZero</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_length'>length</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_x'>x</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fX'>fX</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_y'>y</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fY'>fY</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkPoint_x'></a>
|
||||
## x
|
||||
|
||||
@ -360,7 +142,7 @@ pt1.fX == pt1.x()
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_y'>y</a> <a href='SkIPoint_Reference#SkIPoint_x'>SkIPoint::x()</a>
|
||||
<a href='#SkPoint_y'>y</a>() <a href='SkIPoint_Reference#SkIPoint_x'>SkIPoint::x</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -391,7 +173,7 @@ pt1.fY == pt1.y()
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_x'>x</a> <a href='SkIPoint_Reference#SkIPoint_y'>SkIPoint::y()</a>
|
||||
<a href='#SkPoint_x'>x</a>() <a href='SkIPoint_Reference#SkIPoint_y'>SkIPoint::y</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -429,52 +211,6 @@ pt.isZero() == true
|
||||
|
||||
## <a name='Set'>Set</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset(int32 t x, int32 t y)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset_2'>iset(const SkIPoint& p)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_normalize'>normalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, preserving direction</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setAbs'>setAbs</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets sign of both members to positive</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets straight-line distance to origin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength(SkScalar length)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength_2'>setLength(SkScalar x, SkScalar y, SkScalar length)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setNormalize'>setNormalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, in direction of (x, y)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkPoint_set'></a>
|
||||
## set
|
||||
|
||||
@ -508,7 +244,7 @@ pt1 == pt2
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup> <a href='#SkPoint_Make'>Make</a>
|
||||
<a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup>() <a href='#SkPoint_Make'>Make</a>
|
||||
|
||||
---
|
||||
|
||||
@ -622,44 +358,6 @@ pt: nan, -nan abs: nan, nan
|
||||
|
||||
## <a name='Offset'>Offset</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Normalize'>Normalize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, and returns prior length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a> array</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset(SkPoint points[], int count, const SkVector& offset)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset_2'>Offset(SkPoint points[], int count, SkScalar dx, SkScalar dy)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_offset'>offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale(SkScalar scale, SkPoint* dst)</a> const</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale_2'>scale(SkScalar value)</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkPoint_Offset'></a>
|
||||
## Offset
|
||||
|
||||
@ -820,7 +518,7 @@ straight-line distance to origin
|
||||
bool <a href='#SkPoint_normalize'>normalize</a>()
|
||||
</pre>
|
||||
|
||||
Scales (<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a> returns one, while preserving ratio of <a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_fY'>fY</a>,
|
||||
Scales (<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a>() returns one, while preserving ratio of <a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_fY'>fY</a>,
|
||||
if possible. If prior length is nearly zero, sets <a href='#Vector'>Vector</a> to (0, 0) and returns
|
||||
false; otherwise returns true.
|
||||
|
||||
@ -845,7 +543,7 @@ true if former length is not zero or nearly zero
|
||||
bool <a href='#SkPoint_setNormalize'>setNormalize</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y)
|
||||
</pre>
|
||||
|
||||
Sets <a href='#Vector'>Vector</a> to (x, y) scaled so <a href='#SkPoint_length'>length</a> returns one, and so that
|
||||
Sets <a href='#Vector'>Vector</a> to (x, y) scaled so <a href='#SkPoint_length'>length</a>() returns one, and so that
|
||||
(<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a>) is proportional to (x, y). If (x, y) length is nearly zero,
|
||||
sets <a href='#Vector'>Vector</a> to (0, 0) and returns false; otherwise returns true.
|
||||
|
||||
@ -942,75 +640,6 @@ true if (x, y) length is not zero or nearly zero
|
||||
|
||||
---
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkPoint operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_CrossProduct'>CrossProduct</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_DotProduct'>DotProduct</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_cross'>cross</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_dot'>dot</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equals'>equals</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Points</a> are equal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_negate'>negate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses the sign of both members</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Point</a> are unequal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point'>Point</a> multiplied by scale</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point'>Point</a> offset by <a href='#Vector'>Vector</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#Vector'>Vector</a> to <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_minus_operator'>operator-() const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses sign of <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Vector'>Vector</a> between <a href='#Point'>Points</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtracts <a href='#Vector'>Vector</a> from <a href='#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Point</a> are equal</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkPoint_scale'></a>
|
||||
## scale
|
||||
|
||||
@ -1099,7 +728,7 @@ pt: nan, -nan negate: -nan, nan
|
||||
## operator-
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkPoint'>SkPoint</a> operator-() _const
|
||||
<a href='#SkPoint'>SkPoint</a> operator-() const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Point'>Point</a> changing the signs of <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a>.
|
||||
@ -1151,7 +780,7 @@ Adds <a href='#Vector'>Vector</a> <a href='#SkPoint_addto_operator_v'>v</a> to <
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a> <a href='SkIPoint_Reference#SkIPoint_addto_operator'>SkIPoint::operator+=(const SkIVector& v)</a>
|
||||
<a href='#SkPoint_offset'>offset</a>() <a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a> <a href='SkIPoint_Reference#SkIPoint_addto_operator'>SkIPoint::operator+=(const SkIVector& v)</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1177,7 +806,7 @@ Subtracts <a href='#Vector'>Vector</a> <a href='#SkPoint_subtractfrom_operator_v
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a> <a href='SkIPoint_Reference#SkIPoint_subtractfrom_operator'>SkIPoint::operator-=(const SkIVector& v)</a>
|
||||
<a href='#SkPoint_offset'>offset</a>() <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a> <a href='SkIPoint_Reference#SkIPoint_subtractfrom_operator'>SkIPoint::operator-=(const SkIVector& v)</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1185,7 +814,7 @@ Subtracts <a href='#Vector'>Vector</a> <a href='#SkPoint_subtractfrom_operator_v
|
||||
## operator*
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkPoint'>SkPoint</a> operator*(SkScalar scale) _const
|
||||
<a href='#SkPoint'>SkPoint</a> operator*(SkScalar scale) const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Point'>Point</a> multiplied by scale.
|
||||
@ -1207,7 +836,7 @@ Returns <a href='#Point'>Point</a> multiplied by scale.
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a>
|
||||
<a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup>() <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1237,7 +866,7 @@ reference to <a href='#Point'>Point</a>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a>
|
||||
<a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup>() <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1359,7 +988,7 @@ pt: nan, -1 != pt
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_equals'>equals</a> <a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a>
|
||||
<a href='#SkPoint_equals'>equals</a>() <a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1403,7 +1032,7 @@ pt: nan, -1 != pt
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a> <a href='#SkPoint_equals'>equals</a>
|
||||
<a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a> <a href='#SkPoint_equals'>equals</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1439,7 +1068,7 @@ Can also be used to subtract <a href='#Vector'>Vector</a> from <a href='#Vector'
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a>
|
||||
<a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1476,7 +1105,7 @@ Can also be used to add <a href='#Vector'>Vector</a> to <a href='#Vector'>Vector
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a>
|
||||
<a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1515,7 +1144,7 @@ straight-line distance to origin
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_length'>length</a> <a href='#SkPoint_Distance'>Distance</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup>
|
||||
<a href='#SkPoint_length'>length</a>() <a href='#SkPoint_Distance'>Distance</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup>
|
||||
|
||||
---
|
||||
|
||||
@ -1526,13 +1155,13 @@ straight-line distance to origin
|
||||
static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Normalize'>Normalize</a>(<a href='#SkVector'>SkVector</a>* vec)
|
||||
</pre>
|
||||
|
||||
Scales (<a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a> returns one, while preserving ratio of <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>,
|
||||
Scales (<a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a>() returns one, while preserving ratio of <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>,
|
||||
if possible. If original length is nearly zero, sets <a href='#SkPoint_Normalize_vec'>vec</a> to (0, 0) and returns zero;
|
||||
otherwise, returns length of <a href='#SkPoint_Normalize_vec'>vec</a> before <a href='#SkPoint_Normalize_vec'>vec</a> is scaled.
|
||||
|
||||
Returned prior length may be <a href='undocumented#SK_ScalarInfinity'>SK ScalarInfinity</a> if it can not be represented by <a href='undocumented#SkScalar'>SkScalar</a>.
|
||||
|
||||
Note that <a href='#SkPoint_normalize'>normalize</a> is faster if prior length is not required.
|
||||
Note that <a href='#SkPoint_normalize'>normalize</a>() is faster if prior length is not required.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -1551,7 +1180,7 @@ original <a href='#SkPoint_Normalize_vec'>vec</a> length
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_normalize'>normalize</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_Length'>Length</a>
|
||||
<a href='#SkPoint_normalize'>normalize</a>() <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_Length'>Length</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1584,7 +1213,7 @@ straight-line distance from <a href='#SkPoint_Distance_a'>a</a> to <a href='#SkP
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkPoint_length'>length</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup>
|
||||
<a href='#SkPoint_length'>length</a>() <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup>
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,87 +1,79 @@
|
||||
SkRRect Reference
|
||||
===
|
||||
|
||||
# <a name='RRect'>RRect</a>
|
||||
<a name='SkRRect'></a>
|
||||
|
||||
# <a name='SkRRect'>Class SkRRect</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkRRect'>SkRRect</a> {
|
||||
public:
|
||||
<a href='#SkRRect_empty_constructor'>SkRRect()</a> = default;
|
||||
<a href='#SkRRect_copy_const_SkRRect'>SkRRect(const SkRRect& rrect)</a> = default;
|
||||
<a href='#SkRRect'>SkRRect</a>& <a href='#SkRRect_copy_operator'>operator=(const SkRRect& rrect)</a> = default;
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
enum <a href='#SkRRect_Type'>Type</a> {
|
||||
<a href='#SkRRect_kEmpty_Type'>kEmpty_Type</a>,
|
||||
<a href='#SkRRect_kRect_Type'>kRect_Type</a>,
|
||||
<a href='#SkRRect_kOval_Type'>kOval_Type</a>,
|
||||
<a href='#SkRRect_kSimple_Type'>kSimple_Type</a>,
|
||||
<a href='#SkRRect_kNinePatch_Type'>kNinePatch_Type</a>,
|
||||
<a href='#SkRRect_kComplex_Type'>kComplex_Type</a>,
|
||||
<a href='#SkRRect_kLastType'>kLastType</a> = <a href='#SkRRect_kComplex_Type'>kComplex_Type</a>,
|
||||
};
|
||||
|
||||
<a href='#SkRRect_Type'>Type</a> <a href='#SkRRect_getType'>getType</a>() const;
|
||||
<a href='#SkRRect_Type'>Type</a> <a href='#SkRRect_type'>type</a>() const;
|
||||
bool <a href='#SkRRect_isEmpty'>isEmpty</a>() const;
|
||||
bool <a href='#SkRRect_isRect'>isRect</a>() const;
|
||||
bool <a href='#SkRRect_isOval'>isOval</a>() const;
|
||||
bool <a href='#SkRRect_isSimple'>isSimple</a>() const;
|
||||
bool <a href='#SkRRect_isNinePatch'>isNinePatch</a>() const;
|
||||
bool <a href='#SkRRect_isComplex'>isComplex</a>() const;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRRect_width'>width</a>() const;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRRect_height'>height</a>() const;
|
||||
<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkRRect_getSimpleRadii'>getSimpleRadii</a>() const;
|
||||
void <a href='#SkRRect_setEmpty'>setEmpty</a>();
|
||||
void <a href='#SkRRect_setRect'>setRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect);
|
||||
static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeEmpty'>MakeEmpty</a>();
|
||||
static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeRect'>MakeRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& r);
|
||||
static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeOval'>MakeOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval);
|
||||
static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeRectXY'>MakeRectXY</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkScalar'>SkScalar</a> xRad, <a href='undocumented#SkScalar'>SkScalar</a> yRad);
|
||||
void <a href='#SkRRect_setOval'>setOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval);
|
||||
void <a href='#SkRRect_setRectXY'>setRectXY</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkScalar'>SkScalar</a> xRad, <a href='undocumented#SkScalar'>SkScalar</a> yRad);
|
||||
void <a href='#SkRRect_setNinePatch'>setNinePatch</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkScalar'>SkScalar</a> leftRad, <a href='undocumented#SkScalar'>SkScalar</a> topRad,
|
||||
<a href='undocumented#SkScalar'>SkScalar</a> rightRad, <a href='undocumented#SkScalar'>SkScalar</a> bottomRad);
|
||||
void <a href='#SkRRect_setRectRadii'>setRectRadii</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, const <a href='SkPoint_Reference#SkVector'>SkVector</a> radii[4]);
|
||||
|
||||
SkRRect related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Corner'>Corner</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>corner radii order</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Type'>Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>specialization of <a href='#RRect'>Round Rect</a> geometry</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kComplex_Type'>kComplex Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>non-zero width and height with arbitrary radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kEmpty_Type'>kEmpty Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>zero width or height</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLastType'>kLastType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>largest <a href='#SkRRect_Type'>Type</a> value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft Corner</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-left corner radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLowerRight_Corner'>kLowerRight Corner</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-right corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>non-zero width and height with axis-aligned radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kOval_Type'>kOval Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>non-zero width and height filled with radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kRect_Type'>kRect Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>non-zero width and height, and zeroed radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kSimple_Type'>kSimple Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>non-zero width and height with equal radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kSizeInMemory'>kSizeInMemory</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>storage space for <a href='#RRect'>Round Rect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft Corner</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-left corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kUpperRight_Corner'>kUpperRight Corner</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-right corner radii</td>
|
||||
</tr>
|
||||
</table>
|
||||
enum <a href='#SkRRect_Corner'>Corner</a> {
|
||||
<a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft_Corner</a>,
|
||||
<a href='#SkRRect_kUpperRight_Corner'>kUpperRight_Corner</a>,
|
||||
<a href='#SkRRect_kLowerRight_Corner'>kLowerRight_Corner</a>,
|
||||
<a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft_Corner</a>,
|
||||
};
|
||||
|
||||
## <a name='Related_Function'>Related_Function</a>
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_rect'>rect</a>() const;
|
||||
<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkRRect_radii'>radii</a>(<a href='#SkRRect_Corner'>Corner</a> corner) const;
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_getBounds'>getBounds</a>() const;
|
||||
friend bool <a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a>;
|
||||
friend bool <a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a>;
|
||||
void <a href='#SkRRect_inset'>inset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='#SkRRect'>SkRRect</a>* dst) const;
|
||||
void <a href='#SkRRect_inset_2'>inset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
|
||||
void <a href='#SkRRect_outset'>outset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='#SkRRect'>SkRRect</a>* dst) const;
|
||||
void <a href='#SkRRect_outset_2'>outset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
|
||||
void <a href='#SkRRect_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
|
||||
<a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_makeOffset'>makeOffset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const;
|
||||
bool <a href='#SkRRect_contains'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const;
|
||||
bool <a href='#SkRRect_isValid'>isValid</a>() const;
|
||||
|
||||
static constexpr size_t <a href='#SkRRect_kSizeInMemory'>kSizeInMemory</a> = 12 * sizeof(SkScalar);
|
||||
|
||||
SkRRect global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Type'>Type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>specialization of <a href='#RRect'>Round Rect</a> geometry</td>
|
||||
</tr>
|
||||
</table>
|
||||
size_t <a href='#SkRRect_writeToMemory'>writeToMemory</a>(void* buffer) const;
|
||||
size_t <a href='#SkRRect_readFromMemory'>readFromMemory</a>(const void* buffer, size_t length);
|
||||
bool <a href='#SkRRect_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix, <a href='#SkRRect'>SkRRect</a>* dst) const;
|
||||
void <a href='#SkRRect_dump'>dump</a>(bool asHex) const;
|
||||
void <a href='#SkRRect_dump_2'>dump</a>() const;
|
||||
void <a href='#SkRRect_dumpHex'>dumpHex</a>() const;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#SkRRect'>SkRRect</a> describes a rounded rectangle with a bounds and a pair of radii for each corner.
|
||||
The bounds and radii can be set so that <a href='#SkRRect'>SkRRect</a> describes: a rectangle with sharp corners;
|
||||
@ -95,241 +87,6 @@ corners.
|
||||
If either axis radii is zero or less: radii are stored as zero; corner is square.
|
||||
If corner curves overlap, radii are proportionally reduced to fit within bounds.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkRRect'>SkRRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkRRect can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeEmpty'>MakeEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with zeroed bounds and corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeOval'>MakeOval</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Oval'>Oval</a> to fit bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeRect'>MakeRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies bounds and zeroes corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeRectXY'>MakeRectXY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates rounded rectangle</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_empty_constructor'>SkRRect()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with zeroed bounds and corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_copy_const_SkRRect'>SkRRect(const SkRRect& rrect)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies bounds and corner radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkRRect operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_copy_operator'>operator=(const SkRRect& rrect)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies bounds and corner radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkRRect member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeEmpty'>MakeEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with zeroed bounds and corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeOval'>MakeOval</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Oval'>Oval</a> to fit bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeRect'>MakeRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies bounds and zeroes corner radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_MakeRectXY'>MakeRectXY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates rounded rectangle</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_contains'>contains</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkRect_Reference#Rect'>Rect</a> is inside</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dump_2'>dump</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dumpHex'>dumpHex</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using hexadecimal to standard output</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getBounds'>getBounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getSimpleRadii'>getSimpleRadii</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns corner radii for simple types</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getType'>getType</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkRRect_Type'>Type</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y-axis</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_inset'>inset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>insets bounds and radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isComplex'>isComplex</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if not empty, <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, simple, or nine-patch</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isNinePatch'>isNinePatch</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if not empty, <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a> or simple; and radii are axis-aligned</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isOval'>isOval</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if not empty, axes radii are equal, radii fill bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isRect'>isRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if not empty, and one radius at each corner is zero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isSimple'>isSimple</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if not empty, <a href='SkRect_Reference#Rect'>Rect</a> or <a href='undocumented#Oval'>Oval</a>; and axes radii are equal</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isValid'>isValid</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#SkRRect_type'>type</a> matches bounds and radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_offset'>offset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_outset'>outset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>outsets bounds and radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_radii'>radii</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns x-axis and y-axis radii for one corner</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_readFromMemory'>readFromMemory</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reads <a href='#RRect'>Round Rect</a> from buffer</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_rect'>rect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setEmpty'>setEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>zeroes width, height, and corner radii</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setNinePatch'>setNinePatch</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces with rounded rectangle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setOval'>setOval</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces with <a href='undocumented#Oval'>Oval</a> to fit bounds</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setRect'>setRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#RRect'>Round Rect</a> bounds with zeroed corners</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setRectRadii'>setRectRadii</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces with rounded rectangle</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setRectXY'>setRectXY</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces with rounded rectangle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_transform'>transform</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and offsets into copy</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_type'>type</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkRRect_Type'>Type</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x-axis</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_writeToMemory'>writeToMemory</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='#RRect'>Round Rect</a> to buffer</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkRRect_empty_constructor'></a>
|
||||
## SkRRect
|
||||
|
||||
@ -420,13 +177,13 @@ copy of <a href='#SkRRect_copy_operator_rrect'>rrect</a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkRRect_Type'>Type</a> {
|
||||
<a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>,
|
||||
<a href='#SkRRect_kRect_Type'>kRect Type</a>,
|
||||
<a href='#SkRRect_kOval_Type'>kOval Type</a>,
|
||||
<a href='#SkRRect_kSimple_Type'>kSimple Type</a>,
|
||||
<a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a>,
|
||||
<a href='#SkRRect_kComplex_Type'>kComplex Type</a>,
|
||||
<a href='#SkRRect_kLastType'>kLastType</a> = <a href='#SkRRect_kComplex_Type'>kComplex Type</a>,
|
||||
<a href='#SkRRect_kEmpty_Type'>kEmpty_Type</a>,
|
||||
<a href='#SkRRect_kRect_Type'>kRect_Type</a>,
|
||||
<a href='#SkRRect_kOval_Type'>kOval_Type</a>,
|
||||
<a href='#SkRRect_kSimple_Type'>kSimple_Type</a>,
|
||||
<a href='#SkRRect_kNinePatch_Type'>kNinePatch_Type</a>,
|
||||
<a href='#SkRRect_kComplex_Type'>kComplex_Type</a>,
|
||||
<a href='#SkRRect_kLastType'>kLastType</a> = <a href='#SkRRect_kComplex_Type'>kComplex_Type</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -527,7 +284,7 @@ Returns <a href='#SkRRect_Type'>Type</a>, one of: <a href='#SkRRect_kEmpty_Type'
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="ace8f4aebf90527d43e4b7291375c9ad"><div>rrect2 is not a <a href='SkRect_Reference#Rect'>Rect</a>; <a href='#SkRRect_inset'>inset</a> has made it empty.
|
||||
<div><fiddle-embed name="ace8f4aebf90527d43e4b7291375c9ad"><div>rrect2 is not a <a href='SkRect_Reference#Rect'>Rect</a>; <a href='#SkRRect_inset'>inset</a>() has made it empty.
|
||||
</div></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
@ -552,7 +309,7 @@ Returns <a href='#SkRRect_Type'>Type</a>, one of: <a href='#SkRRect_kEmpty_Type'
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="1080805c8449406a4e26d694bc56d2dc"><div><a href='#SkRRect_inset'>inset</a> has made rrect2 empty.
|
||||
<div><fiddle-embed name="1080805c8449406a4e26d694bc56d2dc"><div><a href='#SkRRect_inset'>inset</a>() has made rrect2 empty.
|
||||
</div></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
@ -565,15 +322,15 @@ Returns <a href='#SkRRect_Type'>Type</a>, one of: <a href='#SkRRect_kEmpty_Type'
|
||||
## isEmpty
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isEmpty'>isEmpty</a>() const
|
||||
bool <a href='#SkRRect_isEmpty'>isEmpty</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkRRect_rect'>rect</a>.fLeft is equal to <a href='#SkRRect_rect'>rect</a>.fRight, or if <a href='#SkRRect_rect'>rect</a>.fTop is equal
|
||||
to <a href='#SkRRect_rect'>rect</a>.fBottom.
|
||||
Returns true if <a href='#SkRRect_rect'>rect</a>().fLeft is equal to <a href='#SkRRect_rect'>rect</a>().fRight, or if <a href='#SkRRect_rect'>rect</a>().fTop is equal
|
||||
to <a href='#SkRRect_rect'>rect</a>().fBottom.
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href='#SkRRect_width'>width</a> or <a href='#SkRRect_height'>height</a> are zero
|
||||
true if <a href='#SkRRect_width'>width</a>() or <a href='#SkRRect_height'>height</a>() are zero
|
||||
|
||||
### Example
|
||||
|
||||
@ -589,7 +346,7 @@ true if <a href='#SkRRect_width'>width</a> or <a href='#SkRRect_height'>height</
|
||||
## isRect
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isRect'>isRect</a>() const
|
||||
bool <a href='#SkRRect_isRect'>isRect</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if not empty, and if either x-axis or y-axis radius at each corner
|
||||
@ -613,7 +370,7 @@ true if not empty, and one radius at each corner is zero
|
||||
## isOval
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isOval'>isOval</a>() const
|
||||
bool <a href='#SkRRect_isOval'>isOval</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if not empty, if all x-axis radii are equal, if all y-axis radii
|
||||
@ -642,12 +399,12 @@ dimensions; right <a href='#RRect'>Round Rect</a> is an oval.
|
||||
## isSimple
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isSimple'>isSimple</a>() const
|
||||
bool <a href='#SkRRect_isSimple'>isSimple</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if not empty, if all x-axis radii are equal but not zero,
|
||||
if all y-axis radii are equal but not zero; and x-axis radius is less than half
|
||||
<a href='#SkRRect_width'>width</a>, or y-axis radius is less than half <a href='#SkRRect_height'>height</a>.
|
||||
<a href='#SkRRect_width'>width</a>(), or y-axis radius is less than half <a href='#SkRRect_height'>height</a>().
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -667,7 +424,7 @@ true if not empty, <a href='SkRect_Reference#Rect'>Rect</a> or <a href='undocume
|
||||
## isNinePatch
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isNinePatch'>isNinePatch</a>() const
|
||||
bool <a href='#SkRRect_isNinePatch'>isNinePatch</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkRRect_isEmpty'>isEmpty</a>, <a href='#SkRRect_isRect'>isRect</a>, <a href='#SkRRect_isOval'>isOval</a>, and <a href='#SkRRect_isSimple'>isSimple</a> return false; and if
|
||||
@ -692,7 +449,7 @@ true if not empty, <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocument
|
||||
## isComplex
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
inline bool <a href='#SkRRect_isComplex'>isComplex</a>() const
|
||||
bool <a href='#SkRRect_isComplex'>isComplex</a>() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href='#SkRRect_isEmpty'>isEmpty</a>, <a href='#SkRRect_isRect'>isRect</a>, <a href='#SkRRect_isOval'>isOval</a>, <a href='#SkRRect_isSimple'>isSimple</a>, and <a href='#SkRRect_isNinePatch'>isNinePatch</a> return false.
|
||||
@ -731,7 +488,7 @@ bounds().fRight minus bounds().fLeft
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="c675a480b41dee157f84fa2550a2a53c"><div><a href='#SkRRect_MakeRect'>SkRRect::MakeRect</a> sorts its input, so <a href='#SkRRect_width'>width</a> is always zero or larger.
|
||||
<div><fiddle-embed name="c675a480b41dee157f84fa2550a2a53c"><div><a href='#SkRRect_MakeRect'>SkRRect::MakeRect</a> sorts its input, so <a href='#SkRRect_width'>width</a>() is always zero or larger.
|
||||
</div>
|
||||
|
||||
#### Example Output
|
||||
@ -765,7 +522,7 @@ bounds().fBottom minus bounds().fTop
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="5a3eb1755164a7becec33cec6e6eca31"><div><a href='#SkRRect_MakeRect'>SkRRect::MakeRect</a> sorts its input, so <a href='#SkRRect_height'>height</a> is always zero or larger.
|
||||
<div><fiddle-embed name="5a3eb1755164a7becec33cec6e6eca31"><div><a href='#SkRRect_MakeRect'>SkRRect::MakeRect</a> sorts its input, so <a href='#SkRRect_height'>height</a>() is always zero or larger.
|
||||
</div>
|
||||
|
||||
#### Example Output
|
||||
@ -790,9 +547,9 @@ large height: inf
|
||||
<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkRRect_getSimpleRadii'>getSimpleRadii</a>() const
|
||||
</pre>
|
||||
|
||||
Returns top-left corner radii. If <a href='#SkRRect_type'>type</a> returns <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>, <a href='#SkRRect_kRect_Type'>kRect Type</a>,
|
||||
Returns top-left corner radii. If <a href='#SkRRect_type'>type</a>() returns <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>, <a href='#SkRRect_kRect_Type'>kRect Type</a>,
|
||||
<a href='#SkRRect_kOval_Type'>kOval Type</a>, or <a href='#SkRRect_kSimple_Type'>kSimple Type</a>, returns a value representative of all corner radii.
|
||||
If <a href='#SkRRect_type'>type</a> returns <a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a> or <a href='#SkRRect_kComplex_Type'>kComplex Type</a>, at least one of the
|
||||
If <a href='#SkRRect_type'>type</a>() returns <a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a> or <a href='#SkRRect_kComplex_Type'>kComplex Type</a>, at least one of the
|
||||
remaining three corners has a different value.
|
||||
|
||||
### Return Value
|
||||
@ -919,8 +676,8 @@ copy of <a href='#SkRRect_MakeRect_r'>r</a>
|
||||
static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeOval'>MakeOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval)
|
||||
</pre>
|
||||
|
||||
Sets bounds to <a href='#SkRRect_MakeOval_oval'>oval</a>, x-axis radii to half <a href='#SkRRect_MakeOval_oval'>oval</a>.<a href='#SkRRect_width'>width</a>, and all y-axis radii
|
||||
to half <a href='#SkRRect_MakeOval_oval'>oval</a>.<a href='#SkRRect_height'>height</a>. If <a href='#SkRRect_MakeOval_oval'>oval</a> bounds is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Sets bounds to <a href='#SkRRect_MakeOval_oval'>oval</a>, x-axis radii to half <a href='#SkRRect_MakeOval_oval'>oval</a>.<a href='#SkRRect_width'>width</a>(), and all y-axis radii
|
||||
to half <a href='#SkRRect_MakeOval_oval'>oval</a>.<a href='#SkRRect_height'>height</a>(). If <a href='#SkRRect_MakeOval_oval'>oval</a> bounds is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
|
||||
### Parameters
|
||||
@ -954,8 +711,8 @@ static <a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_MakeRectXY'>MakeRectXY</
|
||||
Sets to rounded rectangle with the same radii for all four corners.
|
||||
If rect is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_MakeRectXY_xRad'>xRad</a> and <a href='#SkRRect_MakeRectXY_yRad'>yRad</a> are zero, sets to <a href='#SkRRect_kRect_Type'>kRect Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_MakeRectXY_xRad'>xRad</a> is at least half rect.<a href='#SkRRect_width'>width</a> and <a href='#SkRRect_MakeRectXY_yRad'>yRad</a> is at least half
|
||||
rect.<a href='#SkRRect_height'>height</a>, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_MakeRectXY_xRad'>xRad</a> is at least half rect.<a href='#SkRRect_width'>width</a>() and <a href='#SkRRect_MakeRectXY_yRad'>yRad</a> is at least half
|
||||
rect.<a href='#SkRRect_height'>height</a>(), sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>.
|
||||
|
||||
### Parameters
|
||||
@ -992,8 +749,8 @@ rounded rectangle
|
||||
void <a href='#SkRRect_setOval'>setOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval)
|
||||
</pre>
|
||||
|
||||
Sets bounds to <a href='#SkRRect_setOval_oval'>oval</a>, x-axis radii to half <a href='#SkRRect_setOval_oval'>oval</a>.<a href='#SkRRect_width'>width</a>, and all y-axis radii
|
||||
to half <a href='#SkRRect_setOval_oval'>oval</a>.<a href='#SkRRect_height'>height</a>. If <a href='#SkRRect_setOval_oval'>oval</a> bounds is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Sets bounds to <a href='#SkRRect_setOval_oval'>oval</a>, x-axis radii to half <a href='#SkRRect_setOval_oval'>oval</a>.<a href='#SkRRect_width'>width</a>(), and all y-axis radii
|
||||
to half <a href='#SkRRect_setOval_oval'>oval</a>.<a href='#SkRRect_height'>height</a>(). If <a href='#SkRRect_setOval_oval'>oval</a> bounds is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
|
||||
### Parameters
|
||||
@ -1023,8 +780,8 @@ void <a href='#SkRRect_setRectXY'>setRectXY</a>(const <a href='SkRect_Reference#
|
||||
Sets to rounded rectangle with the same radii for all four corners.
|
||||
If rect is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setRectXY_xRad'>xRad</a> or <a href='#SkRRect_setRectXY_yRad'>yRad</a> is zero, sets to <a href='#SkRRect_kRect_Type'>kRect Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setRectXY_xRad'>xRad</a> is at least half rect.<a href='#SkRRect_width'>width</a> and <a href='#SkRRect_setRectXY_yRad'>yRad</a> is at least half
|
||||
rect.<a href='#SkRRect_height'>height</a>, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setRectXY_xRad'>xRad</a> is at least half rect.<a href='#SkRRect_width'>width</a>() and <a href='#SkRRect_setRectXY_yRad'>yRad</a> is at least half
|
||||
rect.<a href='#SkRRect_height'>height</a>(), sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>.
|
||||
|
||||
### Parameters
|
||||
@ -1064,8 +821,8 @@ Sets bounds to rect. Sets radii to (<a href='#SkRRect_setNinePatch_leftRad'>left
|
||||
If rect is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setNinePatch_leftRad'>leftRad</a> and <a href='#SkRRect_setNinePatch_rightRad'>rightRad</a> are zero, sets to <a href='#SkRRect_kRect_Type'>kRect Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setNinePatch_topRad'>topRad</a> and <a href='#SkRRect_setNinePatch_bottomRad'>bottomRad</a> are zero, sets to <a href='#SkRRect_kRect_Type'>kRect Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setNinePatch_leftRad'>leftRad</a> and <a href='#SkRRect_setNinePatch_rightRad'>rightRad</a> are equal and at least half rect.<a href='#SkRRect_width'>width</a>, and
|
||||
<a href='#SkRRect_setNinePatch_topRad'>topRad</a> and <a href='#SkRRect_setNinePatch_bottomRad'>bottomRad</a> are equal at least half rect.<a href='#SkRRect_height'>height</a>, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setNinePatch_leftRad'>leftRad</a> and <a href='#SkRRect_setNinePatch_rightRad'>rightRad</a> are equal and at least half rect.<a href='#SkRRect_width'>width</a>(), and
|
||||
<a href='#SkRRect_setNinePatch_topRad'>topRad</a> and <a href='#SkRRect_setNinePatch_bottomRad'>bottomRad</a> are equal at least half rect.<a href='#SkRRect_height'>height</a>(), sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if <a href='#SkRRect_setNinePatch_leftRad'>leftRad</a> and <a href='#SkRRect_setNinePatch_rightRad'>rightRad</a> are equal, and <a href='#SkRRect_setNinePatch_topRad'>topRad</a> and <a href='#SkRRect_setNinePatch_bottomRad'>bottomRad</a> are equal,
|
||||
sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>. Otherwise, sets to <a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a>.
|
||||
|
||||
@ -1112,8 +869,8 @@ Sets bounds to rect. Sets radii array for individual control of all for corners.
|
||||
|
||||
If rect is empty, sets to <a href='#SkRRect_kEmpty_Type'>kEmpty Type</a>.
|
||||
Otherwise, if one of each corner radii are zero, sets to <a href='#SkRRect_kRect_Type'>kRect Type</a>.
|
||||
Otherwise, if all x-axis radii are equal and at least half rect.<a href='#SkRRect_width'>width</a>, and
|
||||
all y-axis radii are equal at least half rect.<a href='#SkRRect_height'>height</a>, sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if all x-axis radii are equal and at least half rect.<a href='#SkRRect_width'>width</a>(), and
|
||||
all y-axis radii are equal at least half rect.<a href='#SkRRect_height'>height</a>(), sets to <a href='#SkRRect_kOval_Type'>kOval Type</a>.
|
||||
Otherwise, if all x-axis radii are equal, and all y-axis radii are equal,
|
||||
sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>. Otherwise, sets to <a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a>.
|
||||
|
||||
@ -1141,10 +898,10 @@ sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>. Otherwise, sets to <a
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkRRect_Corner'>Corner</a> {
|
||||
<a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft Corner</a>,
|
||||
<a href='#SkRRect_kUpperRight_Corner'>kUpperRight Corner</a>,
|
||||
<a href='#SkRRect_kLowerRight_Corner'>kLowerRight Corner</a>,
|
||||
<a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft Corner</a>,
|
||||
<a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft_Corner</a>,
|
||||
<a href='#SkRRect_kUpperRight_Corner'>kUpperRight_Corner</a>,
|
||||
<a href='#SkRRect_kLowerRight_Corner'>kLowerRight_Corner</a>,
|
||||
<a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft_Corner</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -1284,7 +1041,7 @@ const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_getBounds'
|
||||
|
||||
Returns bounds. Bounds may have zero width or zero height. Bounds right is
|
||||
greater than or equal to left; bounds bottom is greater than or equal to top.
|
||||
Result is identical to <a href='#SkRRect_rect'>rect</a>.
|
||||
Result is identical to <a href='#SkRRect_rect'>rect</a>().
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -1394,10 +1151,10 @@ If <a href='#SkRRect_inset_dx'>dx</a> or <a href='#SkRRect_inset_dy'>dy</a> caus
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_inset_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>().fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_inset_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>().fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_inset_dst'><code><strong>dst</strong></code></a></td>
|
||||
<td>insets bounds and radii</td>
|
||||
@ -1434,10 +1191,10 @@ If <a href='#SkRRect_inset_2_dx'>dx</a> or <a href='#SkRRect_inset_2_dy'>dy</a>
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_inset_2_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>().fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_inset_2_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>added to <a href='#SkRRect_rect'>rect</a>().fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1472,10 +1229,10 @@ If <a href='#SkRRect_outset_dx'>dx</a> or <a href='#SkRRect_outset_dy'>dy</a> ca
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_outset_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>().fLeft, and added to <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_outset_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>().fTop, and added to <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_outset_dst'><code><strong>dst</strong></code></a></td>
|
||||
<td>outset bounds and radii</td>
|
||||
@ -1512,10 +1269,10 @@ If <a href='#SkRRect_outset_2_dx'>dx</a> or <a href='#SkRRect_outset_2_dy'>dy</a
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_outset_2_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>().fLeft, and added to <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_outset_2_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>subtracted from <a href='#SkRRect_rect'>rect</a>().fTop, and added to <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1541,10 +1298,10 @@ Translates <a href='#RRect'>Round Rect</a> by (<a href='#SkRRect_offset_dx'>dx</
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_offset_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>().fLeft and <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_offset_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>().fTop and <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1562,7 +1319,7 @@ Translates <a href='#RRect'>Round Rect</a> by (<a href='#SkRRect_offset_dx'>dx</
|
||||
## makeOffset
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
<a href='#SkRRect'>SkRRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRRect_makeOffset'>makeOffset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const
|
||||
<a href='#SkRRect'>SkRRect</a> <a href='#SkRRect_makeOffset'>makeOffset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const
|
||||
</pre>
|
||||
|
||||
Returns <a href='#RRect'>Round Rect</a> translated by (<a href='#SkRRect_makeOffset_dx'>dx</a>, <a href='#SkRRect_makeOffset_dy'>dy</a>).
|
||||
@ -1570,10 +1327,10 @@ Returns <a href='#RRect'>Round Rect</a> translated by (<a href='#SkRRect_makeOff
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkRRect_makeOffset_dx'><code><strong>dx</strong></code></a></td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>().fLeft and <a href='#SkRRect_rect'>rect</a>().fRight</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkRRect_makeOffset_dy'><code><strong>dy</strong></code></a></td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td>
|
||||
<td>offset added to <a href='#SkRRect_rect'>rect</a>().fTop and <a href='#SkRRect_rect'>rect</a>().fBottom</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1636,7 +1393,7 @@ be generated by corrupting memory.
|
||||
|
||||
### Return Value
|
||||
|
||||
true if bounds and radii match <a href='#SkRRect_type'>type</a>
|
||||
true if bounds and radii match <a href='#SkRRect_type'>type</a>()
|
||||
|
||||
### Example
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,5 @@
|
||||
SkRegion Reference
|
||||
===
|
||||
|
||||
# <a name='Region'>Region</a>
|
||||
<a href='#Region'>Region</a> is a compressed one bit mask. <a href='#Region'>Region</a> describes an aliased clipping area
|
||||
on integer boundaries. <a href='#Region'>Region</a> can also describe an array of integer rectangles.
|
||||
|
||||
@ -13,349 +11,114 @@ in <a href='SkPath_Reference#Path'>Path</a> become integer rectangle edges. <a h
|
||||
intersection, difference, and so on. <a href='SkCanvas_Reference#Canvas'>Canvas</a> allows only intersection and
|
||||
difference; successive clips can only reduce available <a href='SkCanvas_Reference#Canvas'>Canvas</a> area.
|
||||
|
||||
# <a name='SkRegion'>Class SkRegion</a>
|
||||
<a name='SkRegion'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkRegion'>SkRegion</a> {
|
||||
public:
|
||||
<a href='#SkRegion_empty_constructor'>SkRegion()</a>;
|
||||
<a href='#SkRegion_copy_const_SkRegion'>SkRegion(const SkRegion& region)</a>;
|
||||
explicit <a href='#SkRegion_copy_const_SkIRect'>SkRegion(const SkIRect& rect)</a>;
|
||||
<a href='#SkRegion_destructor'>~SkRegion()</a>;
|
||||
<a href='#SkRegion'>SkRegion</a>& <a href='#SkRegion_copy_operator'>operator=(const SkRegion& region)</a>;
|
||||
bool <a href='#SkRegion_equal1_operator'>operator==(const SkRegion& other)_const</a>;
|
||||
bool <a href='#SkRegion_notequal1_operator'>operator!=(const SkRegion& other)_const</a>;
|
||||
bool <a href='#SkRegion_set'>set</a>(const <a href='#SkRegion'>SkRegion</a>& src);
|
||||
void <a href='#SkRegion_swap'>swap</a>(<a href='#SkRegion'>SkRegion</a>& other);
|
||||
bool <a href='#SkRegion_isEmpty'>isEmpty</a>() const;
|
||||
bool <a href='#SkRegion_isRect'>isRect</a>() const;
|
||||
bool <a href='#SkRegion_isComplex'>isComplex</a>() const;
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_getBounds'>getBounds</a>() const;
|
||||
int <a href='#SkRegion_computeRegionComplexity'>computeRegionComplexity</a>() const;
|
||||
bool <a href='#SkRegion_getBoundaryPath'>getBoundaryPath</a>(<a href='SkPath_Reference#SkPath'>SkPath</a>* path) const;
|
||||
bool <a href='#SkRegion_setEmpty'>setEmpty</a>();
|
||||
bool <a href='#SkRegion_setRect'>setRect</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect);
|
||||
bool <a href='#SkRegion_setRect_2'>setRect</a>(int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
bool <a href='#SkRegion_setRects'>setRects</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a> rects[], int count);
|
||||
bool <a href='#SkRegion_setRegion'>setRegion</a>(const <a href='#SkRegion'>SkRegion</a>& region);
|
||||
bool <a href='#SkRegion_setPath'>setPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, const <a href='#SkRegion'>SkRegion</a>& clip);
|
||||
bool <a href='#SkRegion_intersects'>intersects</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect) const;
|
||||
bool <a href='#SkRegion_intersects_2'>intersects</a>(const <a href='#SkRegion'>SkRegion</a>& other) const;
|
||||
bool <a href='#SkRegion_contains'>contains</a>(int32_t x, int32_t y) const;
|
||||
bool <a href='#SkRegion_contains_2'>contains</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& other) const;
|
||||
bool <a href='#SkRegion_contains_3'>contains</a>(const <a href='#SkRegion'>SkRegion</a>& other) const;
|
||||
bool <a href='#SkRegion_quickContains'>quickContains</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r) const;
|
||||
bool <a href='#SkRegion_quickContains_2'>quickContains</a>(int32_t left, int32_t top, int32_t right,
|
||||
int32_t bottom) const;
|
||||
bool <a href='#SkRegion_quickReject'>quickReject</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect) const;
|
||||
bool <a href='#SkRegion_quickReject_2'>quickReject</a>(const <a href='#SkRegion'>SkRegion</a>& rgn) const;
|
||||
void <a href='#SkRegion_translate'>translate</a>(int dx, int dy);
|
||||
void <a href='#SkRegion_translate_2'>translate</a>(int dx, int dy, <a href='#SkRegion'>SkRegion</a>* dst) const;
|
||||
|
||||
enum <a href='undocumented#Op'>Op</a> {
|
||||
<a href='#SkRegion_kDifference_Op'>kDifference_Op</a>,
|
||||
<a href='#SkRegion_kIntersect_Op'>kIntersect_Op</a>,
|
||||
<a href='#SkRegion_kUnion_Op'>kUnion_Op</a>,
|
||||
<a href='#SkRegion_kXOR_Op'>kXOR_Op</a>,
|
||||
<a href='#SkRegion_kReverseDifference_Op'>kReverseDifference_Op</a>,
|
||||
<a href='#SkRegion_kReplace_Op'>kReplace_Op</a>,
|
||||
<a href='#SkRegion_kLastOp'>kLastOp</a> = <a href='#SkRegion_kReplace_Op'>kReplace_Op</a>,
|
||||
};
|
||||
|
||||
static const int <a href='#SkRegion_kOpCnt'>kOpCnt</a> = <a href='#SkRegion_kLastOp'>kLastOp</a> + 1;
|
||||
bool <a href='#SkRegion_op'>op</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect, <a href='undocumented#Op'>Op</a> op);
|
||||
bool <a href='#SkRegion_op_2'>op</a>(int left, int top, int right, int bottom, <a href='undocumented#Op'>Op</a> op);
|
||||
bool <a href='#SkRegion_op_3'>op</a>(const <a href='#SkRegion'>SkRegion</a>& rgn, <a href='undocumented#Op'>Op</a> op);
|
||||
bool <a href='#SkRegion_op_4'>op</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect, const <a href='#SkRegion'>SkRegion</a>& rgn, <a href='undocumented#Op'>Op</a> op);
|
||||
bool <a href='#SkRegion_op_5'>op</a>(const <a href='#SkRegion'>SkRegion</a>& rgn, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect, <a href='undocumented#Op'>Op</a> op);
|
||||
bool <a href='#SkRegion_op_6'>op</a>(const <a href='#SkRegion'>SkRegion</a>& rgna, const <a href='#SkRegion'>SkRegion</a>& rgnb, <a href='undocumented#Op'>Op</a> op);
|
||||
char* <a href='#SkRegion_toString'>toString</a>();
|
||||
|
||||
class <a href='#SkRegion_Iterator'>Iterator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Iterator_Iterator'>Iterator()</a>;
|
||||
<a href='#SkRegion_Iterator_copy_const_SkRegion'>Iterator(const SkRegion& region)</a>;
|
||||
bool <a href='#SkRegion_Iterator_rewind'>rewind</a>();
|
||||
void <a href='#SkRegion_Iterator_reset'>reset</a>(const <a href='#SkRegion'>SkRegion</a>& region);
|
||||
bool <a href='#SkRegion_Iterator_done'>done</a>() const;
|
||||
void <a href='#SkRegion_Iterator_next'>next</a>();
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Iterator_rect'>rect</a>() const;
|
||||
const <a href='#SkRegion'>SkRegion</a>* <a href='#SkRegion_Iterator_rgn'>rgn</a>() const;
|
||||
};
|
||||
|
||||
class <a href='#SkRegion_Cliperator'>Cliperator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Cliperator_const_SkRegion_const_SkIRect'>Cliperator(const SkRegion& region, const SkIRect& clip)</a>;
|
||||
bool <a href='#SkRegion_Cliperator_done'>done</a>();
|
||||
void <a href='#SkRegion_Cliperator_next'>next</a>();
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Cliperator_rect'>rect</a>() const;
|
||||
};
|
||||
|
||||
class <a href='#SkRegion_Spanerator'>Spanerator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Spanerator_const_SkRegion_int_int_int'>Spanerator(const SkRegion& region, int y, int left, int right)</a>;
|
||||
bool <a href='#SkRegion_Spanerator_next'>next</a>(int* left, int* right);
|
||||
};
|
||||
|
||||
size_t <a href='#SkRegion_writeToMemory'>writeToMemory</a>(void* buffer) const;
|
||||
size_t <a href='#SkRegion_readFromMemory'>readFromMemory</a>(const void* buffer, size_t length);
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#SkRegion'>SkRegion</a> describes the set of pixels used to clip <a href='SkCanvas_Reference#Canvas'>Canvas</a>. <a href='#SkRegion'>SkRegion</a> is compact,
|
||||
efficiently storing a single integer rectangle, or a run length encoded array
|
||||
of rectangles. <a href='#SkRegion'>SkRegion</a> may reduce the current <a href='SkCanvas_Reference#Clip'>Canvas Clip</a>, or may be drawn as
|
||||
one or more integer rectangles. <a href='#SkRegion'>SkRegion</a> iterator returns the scan lines or
|
||||
rectangles contained by it, optionally intersecting a bounding rectangle.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Class'>Class Declarations</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded class members</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkRegion'>SkRegion</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkRegion related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='undocumented#Op'>Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>binary operator combining <a href='#Region'>Regions</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kDifference_Op'>kDifference Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>target minus operand</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kIntersect_Op'>kIntersect Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>target intersected with operand</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kLastOp'>kLastOp</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last operator</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kOpCnt'>kOpCnt</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>number of operators defined</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kReplace_Op'>kReplace Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replace target with operand</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kReverseDifference_Op'>kReverseDifference Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operand minus target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kUnion_Op'>kUnion Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>target unioned with operand</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_kXOR_Op'>kXOR Op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>target exclusive or with operand</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Class'>Class</a>
|
||||
|
||||
|
||||
SkRegion uses C++ classes to declare the public data structures and interfaces.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Cliperator'>Cliperator</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>iterator returning <a href='SkIRect_Reference#IRect'>IRect</a> within clip</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator'>Iterator</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>iterator returning <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Spanerator'>Spanerator</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal line segment iterator</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkRegion can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_empty_constructor'>SkRegion()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_copy_const_SkIRect'>SkRegion(const SkIRect& rect)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> matching <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_copy_const_SkRegion'>SkRegion(const SkRegion& region)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setEmpty'>setEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setPath'>setPath</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> from clipped <a href='SkPath_Reference#Path'>Path</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRect'>setRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> matching <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRect'>setRect(const SkIRect& rect)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRect_2'>setRect(int32 t left, int32 t top, int32 t right, int32 t bottom)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRects'>setRects</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkIRect_Reference#IRect'>IRect</a> array</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRegion'>setRegion</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Region'>Region</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_destructor'>~SkRegion()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>decreases <a href='undocumented#Reference_Count'>Reference Count</a> of owned objects</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Operator'>Operator</a>
|
||||
|
||||
|
||||
SkRegion operators inline class member functions with arithmetic equivalents.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_notequal1_operator'>operator!=(const SkRegion& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Region'>Regions</a> for inequality</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_copy_operator'>operator=(const SkRegion& region)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_equal1_operator'>operator==(const SkRegion& other) const</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Region'>Regions</a> for equality</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_swap'>swap</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Region'>Region</a> pair</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkRegion member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_computeRegionComplexity'>computeRegionComplexity</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns relative complexity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_contains'>contains</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if points are equal or inside</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_getBoundaryPath'>getBoundaryPath</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Region'>Region</a> outline to <a href='SkPath_Reference#Path'>Path</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_getBounds'>getBounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns maximum and minimum of <a href='SkIRect_Reference#IRect'>IRect</a> array</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_intersects'>intersects</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_isComplex'>isComplex</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Region'>Region</a> contains more than one <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_isEmpty'>isEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if bounds has no width or height</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_isRect'>isRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Region'>Region</a> contains one <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_op'>op</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>applies binary operator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_quickContains'>quickContains</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true quickly if points are equal or inside</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_quickReject'>quickReject</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true quickly if points are outside</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_readFromMemory'>readFromMemory</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reads from buffer</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_set'>set</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setEmpty'>setEmpty</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setPath'>setPath</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> from clipped <a href='SkPath_Reference#Path'>Path</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRect'>setRect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> matching <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRects'>setRects</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkIRect_Reference#IRect'>IRect</a> array</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_setRegion'>setRegion</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Region'>Region</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_swap'>swap</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Region'>Region</a> pair</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_toString'>toString</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exists for Android framework only</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_translate'>translate</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='SkIPoint_Reference#IPoint'>IPoints</a> in <a href='#Region'>Region</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_writeToMemory'>writeToMemory</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes to buffer</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# <a name='SkRegion_Iterator'>Class SkRegion::Iterator</a>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkRegion::Iterator can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_copy_const_SkRegion'>Iterator(const SkRegion& region)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> iterator</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member_Function</a>
|
||||
|
||||
|
||||
SkRegion::Iterator member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_Iterator'>Iterator()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_done'>done</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if data parsing is complete</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_next'>next</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>advances to next <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_rect'>rect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns part of <a href='#Region'>Region</a> as <a href='SkIRect_Reference#IRect'>IRect</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_reset'>reset</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Region'>Region</a> to iterate</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_rewind'>rewind</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>points <a href='#SkRegion_Iterator_Iterator'>Iterator</a> to start</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Iterator_rgn'>rgn</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns original <a href='#Region'>Region</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<a name='SkRegion_Iterator'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkRegion_Iterator_Iterator'>Iterator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Iterator_Iterator'>Iterator()</a>;
|
||||
<a href='#SkRegion_Iterator_copy_const_SkRegion'>Iterator(const SkRegion& region)</a>;
|
||||
bool <a href='#SkRegion_Iterator_rewind'>rewind</a>;
|
||||
void <a href='#SkRegion_Iterator_reset'>reset(const SkRegion& region)</a>;
|
||||
bool <a href='#SkRegion_Iterator_done'>done</a> const;
|
||||
void <a href='#SkRegion_Iterator_next'>next</a>;
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Iterator_rect'>rect</a>;
|
||||
const <a href='#SkRegion'>SkRegion</a>* <a href='#SkRegion_Iterator_rgn'>rgn</a>;
|
||||
bool <a href='#SkRegion_Iterator_rewind'>rewind</a>();
|
||||
void <a href='#SkRegion_Iterator_reset'>reset</a>(const <a href='#SkRegion'>SkRegion</a>& region);
|
||||
bool <a href='#SkRegion_Iterator_done'>done</a>() const;
|
||||
void <a href='#SkRegion_Iterator_next'>next</a>();
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Iterator_rect'>rect</a>();
|
||||
const <a href='#SkRegion'>SkRegion</a>* <a href='#SkRegion_Iterator_rgn'>rgn</a>();
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -369,8 +132,8 @@ up <a href='#Region'>Region</a>.
|
||||
<a href='#SkRegion_Iterator_Iterator'>Iterator</a>()
|
||||
</pre>
|
||||
|
||||
Initializes <a href='#SkRegion_Iterator_Iterator'>Iterator</a> with an empty <a href='#Region'>Region</a>. <a href='#SkRegion_Iterator_done'>done</a> on <a href='#SkRegion_Iterator_Iterator'>Iterator</a> returns true.
|
||||
Call <a href='#SkRegion_Iterator_reset'>reset</a> to initialized <a href='#SkRegion_Iterator_Iterator'>Iterator</a> at a later time.
|
||||
Initializes <a href='#SkRegion_Iterator_Iterator'>Iterator</a> with an empty <a href='#Region'>Region</a>. <a href='#SkRegion_Iterator_done'>done</a>() on <a href='#SkRegion_Iterator_Iterator'>Iterator</a> returns true.
|
||||
Call <a href='#SkRegion_Iterator_reset'>reset</a>() to initialized <a href='#SkRegion_Iterator_Iterator'>Iterator</a> at a later time.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -624,49 +387,15 @@ iterated <a href='#Region'>Region</a>
|
||||
|
||||
---
|
||||
|
||||
# <a name='SkRegion_Cliperator'>Class SkRegion::Cliperator</a>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkRegion::Cliperator can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Cliperator_const_SkRegion_const_SkIRect'>Cliperator(const SkRegion& region, const SkIRect& clip)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> iterator with clip</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member_Function</a>
|
||||
|
||||
|
||||
SkRegion::Cliperator member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Cliperator_done'>done</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if data parsing is complete</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Cliperator_next'>next</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>advances to next <a href='SkIRect_Reference#IRect'>IRect</a> within clip</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Cliperator_rect'>rect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns part of <a href='#Region'>Region</a> as <a href='SkIRect_Reference#IRect'>IRect</a> intersected with clip</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a name='SkRegion_Cliperator'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class SK_API <a href='#SkRegion_Cliperator'>Cliperator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Cliperator_const_SkRegion_const_SkIRect'>Cliperator(const SkRegion& region, const SkIRect& clip)</a>;
|
||||
bool <a href='#SkRegion_Cliperator_done'>done</a>;
|
||||
void <a href='#SkRegion_Cliperator_next'>next</a>;
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Cliperator_rect'>rect</a> const;
|
||||
bool <a href='#SkRegion_Cliperator_done'>done</a>();
|
||||
void <a href='#SkRegion_Cliperator_next'>next</a>();
|
||||
const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkRegion_Cliperator_rect'>rect</a>() const;
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -809,39 +538,13 @@ after set rect rect={1,2,3,3}
|
||||
|
||||
---
|
||||
|
||||
# <a name='SkRegion_Spanerator'>Class SkRegion::Spanerator</a>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkRegion::Spanerator can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Spanerator_const_SkRegion_int_int_int'>Spanerator(const SkRegion& region, int y, int left, int right)</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Region'>Region</a> iterator on scan line</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member_Function</a>
|
||||
|
||||
|
||||
SkRegion::Spanerator member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRegion_Spanerator_next'>next</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>advances to next span on horizontal line</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a name='SkRegion_Spanerator'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkRegion_Spanerator'>Spanerator</a> {
|
||||
public:
|
||||
<a href='#SkRegion_Spanerator_const_SkRegion_int_int_int'>Spanerator(const SkRegion& region, int y, int left, int right)</a>;
|
||||
bool <a href='#SkRegion_Spanerator_next'>next(int* left, int* right)</a>;
|
||||
bool <a href='#SkRegion_Spanerator_next'>next</a>(int* left, int* right);
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -1118,7 +821,7 @@ region2 bounds: {1,2,3,4}
|
||||
## operator==
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator==(const SkRegion& other) _const
|
||||
bool operator==(const SkRegion& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Region'>Region</a> and <a href='#SkRegion_equal1_operator_other'>other</a>; returns true if they enclose exactly
|
||||
@ -1159,7 +862,7 @@ set empty one == two
|
||||
## operator!=
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
|
||||
bool operator!=(const SkRegion& other) _const
|
||||
bool operator!=(const SkRegion& other) const
|
||||
</pre>
|
||||
|
||||
Compares <a href='#Region'>Region</a> and <a href='#SkRegion_notequal1_operator_other'>other</a>; returns true if they do not enclose the same area.
|
||||
@ -1248,12 +951,12 @@ region2 bounds: {1,2,3,4}
|
||||
void <a href='#SkRegion_swap'>swap</a>(<a href='#SkRegion'>SkRegion</a>& other)
|
||||
</pre>
|
||||
|
||||
Exchanges <a href='SkIRect_Reference#IRect'>IRect</a> array of <a href='#Region'>Region</a> and <a href='#SkRegion_swap_other'>other</a>. <a href='#SkRegion_swap'>swap</a> internally exchanges pointers,
|
||||
Exchanges <a href='SkIRect_Reference#IRect'>IRect</a> array of <a href='#Region'>Region</a> and <a href='#SkRegion_swap_other'>other</a>. <a href='#SkRegion_swap'>swap</a>() internally exchanges pointers,
|
||||
so it is lightweight and does not allocate memory.
|
||||
|
||||
<a href='#SkRegion_swap'>swap</a> usage has largely been replaced by <a href='#SkRegion_copy_operator'>operator=(const SkRegion& region)</a>.
|
||||
<a href='#SkRegion_swap'>swap</a>() usage has largely been replaced by <a href='#SkRegion_copy_operator'>operator=(const SkRegion& region)</a>.
|
||||
<a href='SkPath_Reference#Path'>Paths</a> do not copy their content on assignment until they are written to,
|
||||
making assignment as efficient as <a href='#SkRegion_swap'>swap</a>.
|
||||
making assignment as efficient as <a href='#SkRegion_swap'>swap</a>().
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -1619,7 +1322,7 @@ bool <a href='#SkRegion_setRects'>setRects</a>(const <a href='SkIRect_Reference#
|
||||
Constructs <a href='#Region'>Region</a> as the union of <a href='SkIRect_Reference#IRect'>IRect</a> in <a href='#SkRegion_setRects_rects'>rects</a> array. If <a href='#SkRegion_setRects_count'>count</a> is
|
||||
zero, constructs empty <a href='#Region'>Region</a>. Returns false if constructed <a href='#Region'>Region</a> is empty.
|
||||
|
||||
May be faster than repeated calls to <a href='#SkRegion_op'>op</a>.
|
||||
May be faster than repeated calls to <a href='#SkRegion_op'>op</a>().
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -2127,13 +1830,13 @@ If <a href='#Region'>Region</a> is empty, sets <a href='#SkRegion_translate_2_ds
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='undocumented#Op'>Op</a> {
|
||||
<a href='#SkRegion_kDifference_Op'>kDifference Op</a>,
|
||||
<a href='#SkRegion_kIntersect_Op'>kIntersect Op</a>,
|
||||
<a href='#SkRegion_kUnion_Op'>kUnion Op</a>,
|
||||
<a href='#SkRegion_kXOR_Op'>kXOR Op</a>,
|
||||
<a href='#SkRegion_kReverseDifference_Op'>kReverseDifference Op</a>,
|
||||
<a href='#SkRegion_kReplace_Op'>kReplace Op</a>,
|
||||
<a href='#SkRegion_kLastOp'>kLastOp</a> = <a href='#SkRegion_kReplace_Op'>kReplace Op</a>,
|
||||
<a href='#SkRegion_kDifference_Op'>kDifference_Op</a>,
|
||||
<a href='#SkRegion_kIntersect_Op'>kIntersect_Op</a>,
|
||||
<a href='#SkRegion_kUnion_Op'>kUnion_Op</a>,
|
||||
<a href='#SkRegion_kXOR_Op'>kXOR_Op</a>,
|
||||
<a href='#SkRegion_kReverseDifference_Op'>kReverseDifference_Op</a>,
|
||||
<a href='#SkRegion_kReplace_Op'>kReplace_Op</a>,
|
||||
<a href='#SkRegion_kLastOp'>kLastOp</a> = <a href='#SkRegion_kReplace_Op'>kReplace_Op</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -2447,6 +2150,8 @@ false if result is empty
|
||||
char* <a href='#SkRegion_toString'>toString</a>()
|
||||
</pre>
|
||||
|
||||
Private: Android framework only.
|
||||
|
||||
### Return Value
|
||||
|
||||
string representation of <a href='#Region'>Region</a>
|
||||
|
@ -1,272 +1,111 @@
|
||||
SkSurface Reference
|
||||
===
|
||||
|
||||
# <a name='Surface'>Surface</a>
|
||||
<a name='SkSurface'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkSurface'>SkSurface</a> : public <a href='undocumented#SkRefCnt'>SkRefCnt</a> {
|
||||
public:
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, void* pixels,
|
||||
size_t rowBytes,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, void* pixels,
|
||||
size_t rowBytes,
|
||||
void (*releaseProc)(void* pixels, void* context),
|
||||
void* context, const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRaster'>MakeRaster</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, size_t rowBytes,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRaster_2'>MakeRaster</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a>(int width, int height,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a>(<a href='undocumented#GrContext'>GrContext</a>* context,
|
||||
const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture,
|
||||
<a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, int sampleCnt,
|
||||
<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType,
|
||||
sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context,
|
||||
const <a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a>& backendRenderTarget,
|
||||
<a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin,
|
||||
<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType,
|
||||
sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context,
|
||||
const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture,
|
||||
<a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin,
|
||||
int sampleCnt,
|
||||
<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType,
|
||||
sk_sp<<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted,
|
||||
const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo,
|
||||
int sampleCount, <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> surfaceOrigin,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps,
|
||||
bool shouldCreateWithMips = false);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget_2'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted,
|
||||
const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, int sampleCount,
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget_3'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted,
|
||||
const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget_4'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context,
|
||||
const <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a>& characterization,
|
||||
<a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeNull'>MakeNull</a>(int width, int height);
|
||||
int <a href='#SkSurface_width'>width</a>() const;
|
||||
int <a href='#SkSurface_height'>height</a>() const;
|
||||
uint32_t <a href='#SkSurface_generationID'>generationID</a>();
|
||||
|
||||
enum <a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> {
|
||||
<a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard_ContentChangeMode</a>,
|
||||
<a href='#SkSurface_kRetain_ContentChangeMode'>kRetain_ContentChangeMode</a>,
|
||||
};
|
||||
|
||||
void <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a>(<a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> mode);
|
||||
|
||||
enum <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> {
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead_BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite_BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite_BackendHandleAccess</a>,
|
||||
};
|
||||
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushRead_TextureHandleAccess'>kFlushRead_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead_BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushWrite_TextureHandleAccess'>kFlushWrite_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite_BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kDiscardWrite_TextureHandleAccess'>kDiscardWrite_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite_BackendHandleAccess</a>;
|
||||
<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> <a href='#SkSurface_getBackendTexture'>getBackendTexture</a>(<a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess);
|
||||
<a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a> <a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a>(<a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess);
|
||||
<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* <a href='#SkSurface_getCanvas'>getCanvas</a>();
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_makeSurface'>makeSurface</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo);
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>> <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a>();
|
||||
void <a href='#SkSurface_draw'>draw</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* canvas, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint);
|
||||
bool <a href='#SkSurface_peekPixels'>peekPixels</a>(<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>* pixmap);
|
||||
bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst, int srcX, int srcY);
|
||||
bool <a href='#SkSurface_readPixels_2'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY);
|
||||
bool <a href='#SkSurface_readPixels_3'>readPixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& dst, int srcX, int srcY);
|
||||
void <a href='#SkSurface_writePixels'>writePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& src, int dstX, int dstY);
|
||||
void <a href='#SkSurface_writePixels_2'>writePixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& src, int dstX, int dstY);
|
||||
const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>& <a href='#SkSurface_props'>props</a>() const;
|
||||
void <a href='#SkSurface_prepareForExternalIO'>prepareForExternalIO</a>();
|
||||
void <a href='#SkSurface_flush'>flush</a>();
|
||||
<a href='undocumented#GrSemaphoresSubmitted'>GrSemaphoresSubmitted</a> <a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a>(int numSemaphores,
|
||||
<a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> signalSemaphores[]);
|
||||
bool <a href='#SkSurface_wait'>wait</a>(int numSemaphores, const <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a>* waitSemaphores);
|
||||
bool <a href='#SkSurface_characterize'>characterize</a>(<a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a>* characterization) const;
|
||||
bool <a href='#SkSurface_draw_2'>draw</a>(<a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>* deferredDisplayList);
|
||||
};
|
||||
</pre>
|
||||
|
||||
# <a name='SkSurface'>Class SkSurface</a>
|
||||
<a href='#SkSurface'>SkSurface</a> is responsible for managing the pixels that a canvas draws into. The pixels can be
|
||||
allocated either in CPU memory (a raster surface) or on the GPU (a <a href='undocumented#GrRenderTarget'>GrRenderTarget</a> surface).
|
||||
<a href='#SkSurface'>SkSurface</a> takes care of allocating a <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a> that will draw into the surface. Call
|
||||
surface-><a href='#SkSurface_getCanvas'>getCanvas</a> to use that canvas (but don't delete it, it is owned by the surface).
|
||||
surface-><a href='#SkSurface_getCanvas'>getCanvas</a>() to use that canvas (but don't delete it, it is owned by the surface).
|
||||
<a href='#SkSurface'>SkSurface</a> always has non-zero dimensions. If there is a request for a new surface, and either
|
||||
of the requested dimensions are zero, then nullptr will be returned.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkSurface'>SkSurface</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constant'>Constant</a>
|
||||
|
||||
|
||||
SkSurface related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options to read and write back-end object</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter options for <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object must be overwritten</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard ContentChangeMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>discards surface on change</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object is readable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object is writable</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preserves surface on change</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Related_Function'>Related Function</a>
|
||||
|
||||
|
||||
SkSurface global, <code>struct</code>, and <code>class</code> related member functions share a topic.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Miscellaneous'>Miscellaneous</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>other functions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions with pixel access</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkSurface member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU render target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU texture</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU back-end render target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeNull'>MakeNull</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> without backing pixels</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRaster'>MakeRaster</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from width, height matching output</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> pointing to new GPU memory buffer</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_characterize'>characterize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Surface_Characterization'>Surface Characterization</a> for threaded GPU processing</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='#Surface'>Surface</a> contents to canvas</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flush'>flush</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O, and signal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_generationID'>generationID</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to render target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendTexture'>getBackendTexture</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to texture</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getCanvas'>getCanvas</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkCanvas_Reference#Canvas'>Canvas</a> that draws into <a href='#Surface'>Surface</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkImage_Reference#Image'>Image</a> capturing <a href='#Surface'>Surface</a> contents</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeSurface'>makeSurface</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates a compatible <a href='#Surface'>Surface</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>notifies that contents will be changed outside of Skia</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_peekPixels'>peekPixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Surface'>Surface</a> parameters to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_props'>props</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Surface_Properties'>Surface Properties</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_wait'>wait</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pauses commands until signaled</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkSurface can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU render target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU texture</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU back-end render target</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeNull'>MakeNull</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> without backing pixels</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRaster'>MakeRaster</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from width, height matching output</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> pointing to new GPU memory buffer</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkImage_Reference#Image'>Image</a> capturing <a href='#Surface'>Surface</a> contents</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeSurface'>makeSurface</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates a compatible <a href='#Surface'>Surface</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkSurface_MakeRasterDirect'></a>
|
||||
## MakeRasterDirect
|
||||
|
||||
@ -286,7 +125,7 @@ info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a h
|
||||
|
||||
<a href='undocumented#Pixel'>Pixel</a> buffer size should be info height times computed <a href='#SkSurface_MakeRasterDirect_rowBytes'>rowBytes</a>.
|
||||
<a href='#Pixels'>Pixels</a> are not initialized.
|
||||
To access <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a> or <a href='#SkSurface_peekPixels'>peekPixels</a>.
|
||||
To access <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a>() or <a href='#SkSurface_peekPixels'>peekPixels</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -352,7 +191,7 @@ info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a h
|
||||
|
||||
<a href='undocumented#Pixel'>Pixel</a> buffer size should be info height times computed <a href='#SkSurface_MakeRasterDirectReleaseProc_rowBytes'>rowBytes</a>.
|
||||
<a href='#Pixels'>Pixels</a> are not initialized.
|
||||
To access <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a> or <a href='#SkSurface_peekPixels'>peekPixels</a>.
|
||||
To access <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a>() or <a href='#SkSurface_peekPixels'>peekPixels</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -412,7 +251,7 @@ static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface<
|
||||
</pre>
|
||||
|
||||
Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into pixels.
|
||||
Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a> times
|
||||
Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a>() times
|
||||
<a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a>, or times <a href='#SkSurface_MakeRaster_imageInfo'>imageInfo</a>.minRowBytes() if <a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a> is zero.
|
||||
<a href='undocumented#Pixel'>Pixel</a> memory is deleted when <a href='#Surface'>Surface</a> is deleted.
|
||||
|
||||
@ -472,7 +311,7 @@ static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface<
|
||||
</pre>
|
||||
|
||||
Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into pixels.
|
||||
Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_2_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a> times
|
||||
Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_2_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a>() times
|
||||
<a href='#SkSurface_MakeRaster_2_imageInfo'>imageInfo</a>.minRowBytes().
|
||||
<a href='undocumented#Pixel'>Pixel</a> memory is deleted when <a href='#Surface'>Surface</a> is deleted.
|
||||
|
||||
@ -996,7 +835,7 @@ static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface<
|
||||
</pre>
|
||||
|
||||
Returns <a href='#Surface'>Surface</a> without backing pixels. Drawing to <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned from <a href='#Surface'>Surface</a>
|
||||
has no effect. Calling <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> on returned <a href='#Surface'>Surface</a> returns nullptr.
|
||||
has no effect. Calling <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a>() on returned <a href='#Surface'>Surface</a> returns nullptr.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -1033,40 +872,6 @@ surf->makeImageSnapshot() == nullptr
|
||||
|
||||
## <a name='Property'>Property</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_generationID'>generationID</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to render target</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendTexture'>getBackendTexture</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to texture</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getCanvas'>getCanvas</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkCanvas_Reference#Canvas'>Canvas</a> that draws into <a href='#Surface'>Surface</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_height'>height</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_props'>props</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Surface_Properties'>Surface Properties</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_width'>width</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkSurface_width'></a>
|
||||
## width
|
||||
|
||||
@ -1094,7 +899,7 @@ surface width=37 canvas width=37
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkSurface_height'>height</a>
|
||||
<a href='#SkSurface_height'>height</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1125,7 +930,7 @@ surface height=1000 canvas height=1000
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkSurface_width'>width</a>
|
||||
<a href='#SkSurface_width'>width</a>()
|
||||
|
||||
---
|
||||
|
||||
@ -1168,8 +973,8 @@ surface generationID: 3
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> {
|
||||
<a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard ContentChangeMode</a>,
|
||||
<a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a>,
|
||||
<a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard_ContentChangeMode</a>,
|
||||
<a href='#SkSurface_kRetain_ContentChangeMode'>kRetain_ContentChangeMode</a>,
|
||||
};
|
||||
</pre>
|
||||
|
||||
@ -1205,16 +1010,6 @@ If a snapshot has been generated, this copies the <a href='#Surface'>Surface</a>
|
||||
|
||||
## <a name='Miscellaneous'>Miscellaneous</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>notifies that contents will be changed outside of Skia</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkSurface_notifyContentWillChange'></a>
|
||||
## notifyContentWillChange
|
||||
|
||||
@ -1227,6 +1022,8 @@ Subsequent calls to <a href='#SkSurface_generationID'>generationID</a> return a
|
||||
|
||||
<a href='#SkSurface_notifyContentWillChange_mode'>mode</a> is normally passed as <a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a>.
|
||||
|
||||
Private: Can we deprecate this?
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name='SkSurface_notifyContentWillChange_mode'><code><strong>mode</strong></code></a></td>
|
||||
@ -1248,17 +1045,17 @@ Subsequent calls to <a href='#SkSurface_generationID'>generationID</a> return a
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
enum <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> {
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead_BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite_BackendHandleAccess</a>,
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite_BackendHandleAccess</a>,
|
||||
};
|
||||
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushRead_TextureHandleAccess'>kFlushRead TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushWrite_TextureHandleAccess'>kFlushWrite TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kDiscardWrite_TextureHandleAccess'>kDiscardWrite TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushRead_TextureHandleAccess'>kFlushRead_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead_BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushWrite_TextureHandleAccess'>kFlushWrite_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite_BackendHandleAccess</a>;
|
||||
static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kDiscardWrite_TextureHandleAccess'>kDiscardWrite_TextureHandleAccess</a> =
|
||||
<a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite_BackendHandleAccess</a>;
|
||||
</pre>
|
||||
|
||||
### Constants
|
||||
@ -1469,56 +1266,6 @@ are not captured. <a href='SkImage_Reference#Image'>Image</a> allocation is acco
|
||||
|
||||
## <a name='Pixels'>Pixels</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='#Surface'>Surface</a> contents to canvas</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw_2'>draw(SkDeferredDisplayList* deferredDisplayList)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_peekPixels'>peekPixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Surface'>Surface</a> parameters to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels(const SkPixmap& dst, int srcX, int srcY)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels_2'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels_3'>readPixels(const SkBitmap& dst, int srcX, int srcY)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels(const SkPixmap& src, int dstX, int dstY)</a></td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels_2'>writePixels(const SkBitmap& src, int dstX, int dstY)</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkSurface_draw'></a>
|
||||
## draw
|
||||
|
||||
@ -1601,8 +1348,8 @@ bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkPixmap_Refe
|
||||
|
||||
Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkSurface_readPixels_dst'>dst</a>.
|
||||
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_srcX'>srcX</a>, <a href='#SkSurface_readPixels_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_height'>height</a>).
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_srcX'>srcX</a>, <a href='#SkSurface_readPixels_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_height'>height</a>()).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_height'>height</a>()).
|
||||
Copies each readable pixel intersecting both rectangles, without scaling,
|
||||
converting to <a href='#SkSurface_readPixels_dst'>dst</a>.colorType() and <a href='#SkSurface_readPixels_dst'>dst</a>.alphaType() if required.
|
||||
|
||||
@ -1662,8 +1409,8 @@ bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkImageInfo_R
|
||||
|
||||
Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='SkCanvas_Reference#Canvas'>Canvas</a> into <a href='#SkSurface_readPixels_2_dstPixels'>dstPixels</a>.
|
||||
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_2_srcX'>srcX</a>, <a href='#SkSurface_readPixels_2_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a>).
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_2_srcX'>srcX</a>, <a href='#SkSurface_readPixels_2_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_height'>height</a>()).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a>()).
|
||||
Copies each readable pixel intersecting both rectangles, without scaling,
|
||||
converting to <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.colorType() and <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.alphaType() if required.
|
||||
|
||||
@ -1694,10 +1441,10 @@ Does not copy, and returns false if:
|
||||
<td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of <a href='#SkSurface_readPixels_2_dstPixels'>dstPixels</a></td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkSurface_readPixels_2_dstPixels'><code><strong>dstPixels</strong></code></a></td>
|
||||
<td>storage for pixels; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a> times <a href='#SkSurface_readPixels_2_dstRowBytes'>dstRowBytes</a>, or larger</td>
|
||||
<td>storage for pixels; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a>() times <a href='#SkSurface_readPixels_2_dstRowBytes'>dstRowBytes</a>, or larger</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkSurface_readPixels_2_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td>
|
||||
<td>size of one destination row; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a> times pixel size, or larger</td>
|
||||
<td>size of one destination row; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a>() times pixel size, or larger</td>
|
||||
</tr>
|
||||
<tr> <td><a name='SkSurface_readPixels_2_srcX'><code><strong>srcX</strong></code></a></td>
|
||||
<td>offset into readable pixels on x-axis; may be negative</td>
|
||||
@ -1732,8 +1479,8 @@ bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkBitmap_Refe
|
||||
|
||||
Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Surface'>Surface</a> into bitmap.
|
||||
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_3_srcX'>srcX</a>, <a href='#SkSurface_readPixels_3_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (bitmap.<a href='#SkSurface_width'>width</a>, bitmap.<a href='#SkSurface_height'>height</a>).
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_3_srcX'>srcX</a>, <a href='#SkSurface_readPixels_3_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_height'>height</a>()).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (bitmap.<a href='#SkSurface_width'>width</a>(), bitmap.<a href='#SkSurface_height'>height</a>()).
|
||||
Copies each readable pixel intersecting both rectangles, without scaling,
|
||||
converting to bitmap.colorType() and bitmap.alphaType() if required.
|
||||
|
||||
@ -1796,8 +1543,8 @@ void <a href='#SkSurface_writePixels'>writePixels</a>(const <a href='SkPixmap_Re
|
||||
|
||||
Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from the <a href='#SkSurface_writePixels_src'>src</a> <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> to the <a href='#Surface'>Surface</a>.
|
||||
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_height'>height</a>).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_dstX'>dstX</a>, <a href='#SkSurface_writePixels_dstY'>dstY</a>) and <code>\(<a href='#SkSurface_writePixels_dstX'>dstX</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_dstY'>dstY</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>\)</code>.
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_height'>height</a>()).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_dstX'>dstX</a>, <a href='#SkSurface_writePixels_dstY'>dstY</a>) and <code>\(<a href='#SkSurface_writePixels_dstX'>dstX</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>(\), <a href='#SkSurface_writePixels_dstY'>dstY</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>(\)\)</code>.
|
||||
|
||||
Copies each readable pixel intersecting both rectangles, without scaling,
|
||||
converting to <a href='#Surface'>Surface</a> colorType() and <a href='#Surface'>Surface</a> alphaType() if required.
|
||||
@ -1833,8 +1580,8 @@ void <a href='#SkSurface_writePixels'>writePixels</a>(const <a href='SkBitmap_Re
|
||||
|
||||
Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from the <a href='#SkSurface_writePixels_2_src'>src</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to the <a href='#Surface'>Surface</a>.
|
||||
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_height'>height</a>).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_2_dstX'>dstX</a>, <a href='#SkSurface_writePixels_2_dstY'>dstY</a>) and <code>\(<a href='#SkSurface_writePixels_2_dstX'>dstX</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_2_dstY'>dstY</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>\)</code>.
|
||||
Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_width'>width</a>(), <a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_height'>height</a>()).
|
||||
Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_2_dstX'>dstX</a>, <a href='#SkSurface_writePixels_2_dstY'>dstY</a>) and <code>\(<a href='#SkSurface_writePixels_2_dstX'>dstX</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>(\), <a href='#SkSurface_writePixels_2_dstY'>dstY</a> \+ <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>(\)\)</code>.
|
||||
|
||||
Copies each readable pixel intersecting both rectangles, without scaling,
|
||||
converting to <a href='#Surface'>Surface</a> colorType() and <a href='#Surface'>Surface</a> alphaType() if required.
|
||||
@ -1906,28 +1653,6 @@ To be deprecated soon.
|
||||
|
||||
## <a name='Utility'>Utility</a>
|
||||
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_characterize'>characterize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Surface_Characterization'>Surface Characterization</a> for threaded GPU processing</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flush'>flush</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O, and signal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_wait'>wait</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pauses commands until signaled</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name='SkSurface_flush'></a>
|
||||
## flush
|
||||
|
||||
@ -2062,7 +1787,7 @@ true if supported
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup> <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>
|
||||
<a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup>() <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>
|
||||
|
||||
---
|
||||
|
||||
@ -2095,7 +1820,7 @@ false if <a href='#SkSurface_draw_2_deferredDisplayList'>deferredDisplayList</a>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href='#SkSurface_characterize'>characterize</a> <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>
|
||||
<a href='#SkSurface_characterize'>characterize</a>() <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,101 +1,34 @@
|
||||
SkTextBlobBuilder Reference
|
||||
===
|
||||
|
||||
# <a name='Text_Blob_Builder'>Text Blob Builder</a>
|
||||
<a name='SkTextBlobBuilder'></a>
|
||||
|
||||
# <a name='SkTextBlobBuilder'>Class SkTextBlobBuilder</a>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkTextBlobBuilder'>SkTextBlobBuilder</a> {
|
||||
public:
|
||||
<a href='#SkTextBlobBuilder_empty_constructor'>SkTextBlobBuilder()</a>;
|
||||
<a href='#SkTextBlobBuilder_destructor'>~SkTextBlobBuilder()</a>;
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='SkTextBlob_Reference#SkTextBlob'>SkTextBlob</a>> <a href='#SkTextBlobBuilder_make'>make</a>();
|
||||
|
||||
## <a name='Struct'>Struct</a>
|
||||
struct <a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a> {
|
||||
<a href='undocumented#SkGlyphID'>SkGlyphID</a>* glyphs;
|
||||
<a href='undocumented#SkScalar'>SkScalar</a>* pos;
|
||||
char* <a href='#SkTextBlobBuilder_RunBuffer_utf8text'>utf8text</a>;
|
||||
uint32_t* clusters;
|
||||
};
|
||||
|
||||
|
||||
SkTextBlobBuilder uses C++ structs to declare the public data structures and interfaces.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>storage for <a href='undocumented#Glyph'>Glyphs</a> and <a href='undocumented#Glyph'>Glyph</a> positions</td>
|
||||
</tr>
|
||||
</table>
|
||||
const <a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a>& <a href='#SkTextBlobBuilder_allocRun'>allocRun</a>(const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& font, int count, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y,
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds = nullptr);
|
||||
const <a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a>& <a href='#SkTextBlobBuilder_allocRunPosH'>allocRunPosH</a>(const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& font, int count, <a href='undocumented#SkScalar'>SkScalar</a> y,
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds = nullptr);
|
||||
const <a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a>& <a href='#SkTextBlobBuilder_allocRunPos'>allocRunPos</a>(const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& font, int count,
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds = nullptr);
|
||||
};
|
||||
</pre>
|
||||
|
||||
Helper class for constructing <a href='SkTextBlob_Reference#SkTextBlob'>SkTextBlob</a>.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkTextBlobBuilder'>SkTextBlobBuilder</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Struct'>Struct Declarations</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded struct members</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Class'>Class</a>
|
||||
|
||||
|
||||
SkTextBlobBuilder uses C++ classes to declare the public data structures and interfaces.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
</table>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkTextBlobBuilder can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_empty_constructor'>SkTextBlobBuilder()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_make'>make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='SkTextBlob_Reference#Text_Blob'>Text Blob</a> from bulider</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_destructor'>~SkTextBlobBuilder()</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>deletes storage</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkTextBlobBuilder member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_allocRun'>allocRun</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable glyph buffer at <a href='SkPoint_Reference#Point'>Point</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_allocRunPos'>allocRunPos</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable glyph and <a href='SkPoint_Reference#Point'>Point</a> buffers</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_allocRunPosH'>allocRunPosH</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable glyph and x-axis position buffers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_make'>make</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='SkTextBlob_Reference#Text_Blob'>Text Blob</a> from bulider</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# <a name='SkTextBlobBuilder_RunBuffer'>Struct SkTextBlobBuilder::RunBuffer</a>
|
||||
<a name='SkTextBlobBuilder_RunBuffer'></a>
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
struct <a href='#SkTextBlobBuilder_RunBuffer'>RunBuffer</a> {
|
||||
@ -113,38 +46,10 @@ Each run may position its <a href='undocumented#Glyph'>Glyphs</a> in one of thre
|
||||
by specifying where the first <a href='undocumented#Glyph'>Glyph</a> is drawn, and allowing <a href='SkPaint_Reference#Font_Metrics'>Paint Font Metrics</a> to
|
||||
determine the advance to subsequent <a href='undocumented#Glyph'>Glyphs</a>; by specifying a baseline, and
|
||||
the position on that baseline for each <a href='undocumented#Glyph'>Glyph</a> in run; or by providing <a href='SkPoint_Reference#Point'>Point</a>
|
||||
array, one per <a href='undocumented#Glyph'>Glyph</a>.
|
||||
array, one per <a href='undocumented#Glyph'>Glyph</a>.<table style='border-collapse: collapse; width: 62.5em'>
|
||||
|
||||
## <a name='Member'>Member</a>
|
||||
|
||||
|
||||
SkTextBlobBuilder::RunBuffer members may be read and written directly without using a member function.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>clusters</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reserved for future use</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyphs</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>storage for <a href='undocumented#Glyph'>Glyphs</a> in run</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pos</td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>storage for positions in run</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlobBuilder_RunBuffer_utf8text'>utf8text</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reserved for future use</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Members
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Member</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkGlyphID*</td>
|
||||
|
@ -1,145 +1,21 @@
|
||||
SkTextBlob Reference
|
||||
===
|
||||
|
||||
# <a name='Text_Blob'>Text Blob</a>
|
||||
<a href='#Text_Blob'>Text Blob</a> holds one or more runs of text. Each run associates a string of <a href='undocumented#Glyph'>Glyphs</a>
|
||||
with a position and <a href='SkPaint_Reference#Paint'>Paint</a>. Each <a href='SkPaint_Reference#Paint'>Paint</a> contains attributes used
|
||||
to define the run text: <a href='undocumented#Typeface'>Typeface</a>, <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>, <a href='SkPaint_Reference#Text_Scale_X'>Paint Text Scale X</a>,
|
||||
<a href='SkPaint_Reference#Text_Skew_X'>Paint Text Skew X</a>, <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a>, <a href='SkPaint_Reference#Hinting'>Paint Hinting</a>, <a href='SkPaint_Reference#Anti_Alias'>Anti Alias</a>, <a href='SkPaint_Reference#Fake_Bold'>Paint Fake Bold</a>,
|
||||
<a href='SkPaint_Reference#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a>, <a href='SkPaint_Reference#Full_Hinting_Spacing'>Full Hinting Spacing</a>, <a href='SkPaint_Reference#LCD_Text'>LCD Text</a>, <a href='SkPaint_Reference#Linear_Text'>Linear Text</a>,
|
||||
and <a href='SkPaint_Reference#Subpixel_Text'>Subpixel Text</a>.
|
||||
<a name='SkTextBlob'></a>
|
||||
|
||||
<a href='#Text_Blob'>Text Blob</a> runs of text use <a href='undocumented#ID'>Glyph ID</a> encoding; each run <a href='SkPaint_Reference#Paint'>Paint</a> must set
|
||||
<a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> to <a href='SkPaint_Reference#SkPaint_kGlyphID_TextEncoding'>SkPaint::kGlyphID TextEncoding</a>.
|
||||
|
||||
<a href='#Text_Blob'>Text Blob</a> is constructed with <a href='#SkTextBlob_MakeFromText'>SkTextBlob::MakeFromText</a> or <a href='SkTextBlobBuilder_Reference#Text_Blob_Builder'>Text Blob Builder</a>.
|
||||
Once created, <a href='#Text_Blob'>Text Blob</a> can not be modified.
|
||||
|
||||
## Overview
|
||||
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkTextBlob'>SkTextBlob</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkTextBlob can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_Deserialize'>Deserialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> from memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromString'>MakeFromString</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromText'>MakeFromText</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member Function</a>
|
||||
|
||||
|
||||
SkTextBlob member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_Deserialize'>Deserialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> from memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromString'>MakeFromString</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromText'>MakeFromText</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_bounds'>bounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns conservative bounding box</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_serialize'>serialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='#Text_Blob'>Text Blob</a> to memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_uniqueID'>uniqueID</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns identifier for <a href='#Text_Blob'>Text Blob</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# <a name='SkTextBlob'>Class SkTextBlob</a>
|
||||
|
||||
## <a name='Constructor'>Constructor</a>
|
||||
|
||||
|
||||
SkTextBlob can be constructed or initialized by these functions, including C++ class constructors.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_Deserialize'>Deserialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> from memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromString'>MakeFromString</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromText'>MakeFromText</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## <a name='Member_Function'>Member_Function</a>
|
||||
|
||||
|
||||
SkTextBlob member functions read and modify the structure properties.
|
||||
<table style='border-collapse: collapse; width: 62.5em'>
|
||||
<tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th>
|
||||
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_Deserialize'>Deserialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> from memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromString'>MakeFromString</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_MakeFromText'>MakeFromText</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Text_Blob'>Text Blob</a> with one run</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_bounds'>bounds</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns conservative bounding box</td>
|
||||
</tr>
|
||||
<tr style='background-color: #f0f0f0; '>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_serialize'>serialize</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='#Text_Blob'>Text Blob</a> to memory</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkTextBlob_uniqueID'>uniqueID</a></td>
|
||||
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns identifier for <a href='#Text_Blob'>Text Blob</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
class <a href='#SkTextBlob'>SkTextBlob</a> final : public SkNVRefCnt<<a href='#SkTextBlob'>SkTextBlob</a>> {
|
||||
public:
|
||||
const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkTextBlob_bounds'>bounds</a>() const;
|
||||
uint32_t <a href='#SkTextBlob_uniqueID'>uniqueID</a>() const;
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkTextBlob'>SkTextBlob</a>> <a href='#SkTextBlob_MakeFromText'>MakeFromText</a>( const void* text, size_t byteLength, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint);
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkTextBlob'>SkTextBlob</a>> <a href='#SkTextBlob_MakeFromString'>MakeFromString</a>(const char* string, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint);
|
||||
size_t <a href='#SkTextBlob_serialize'>serialize</a>(const <a href='undocumented#SkSerialProcs'>SkSerialProcs</a>& procs, void* memory, size_t memory_size) const;
|
||||
<a href='undocumented#sk_sp'>sk_sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkTextBlob_serialize_2'>serialize</a>(const <a href='undocumented#SkSerialProcs'>SkSerialProcs</a>& procs) const;
|
||||
static <a href='undocumented#sk_sp'>sk_sp</a><<a href='#SkTextBlob'>SkTextBlob</a>> <a href='#SkTextBlob_Deserialize'>Deserialize</a>(const void* data, size_t size,
|
||||
const <a href='undocumented#SkDeserialProcs'>SkDeserialProcs</a>& procs);
|
||||
};
|
||||
</pre>
|
||||
|
||||
<a href='#SkTextBlob'>SkTextBlob</a> combines multiple text runs into an immutable container. Each text
|
||||
run consists of <a href='undocumented#Glyph'>Glyphs</a>, <a href='SkPaint_Reference#Paint'>Paint</a>, and position. Only parts of <a href='SkPaint_Reference#Paint'>Paint</a> related to
|
||||
|
@ -573,48 +573,6 @@
|
||||
"file": "SkCanvas_Reference",
|
||||
"name": "SkCanvas::restoreToCount",
|
||||
"stdout": "depth = 1\\ndepth = 3\\ndepth = 1\\n"
|
||||
},
|
||||
"SkColor4f_FromColor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint8_t red = 77, green = 101, blue = 153, alpha = 43;\n SkColor argb = SkColorSetARGB(alpha, red, green, blue);\n SkColor4f color4f = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color4f.fR, color4f.fG, color4f.fB, color4f.fA);\n SkColor fromColor4f = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(fromColor4f),\n SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));\n}",
|
||||
"hash": "33b029064e8d1928e42a587c953d0e4e",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::FromColor",
|
||||
"stdout": "red=0.301961 green=0.396078 blue=0.6 alpha=0.168627\\nred=77 green=101 blue=153 alpha=43\\n"
|
||||
},
|
||||
"SkColor4f_equal1_operator": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f colorRed = { 1, 0, 0, 1 };\n SkColor4f colorNamedRed = SkColor4f::FromColor(SK_ColorRED);\n SkDebugf(\"colorRed %c= colorNamedRed\", colorRed == colorNamedRed ? '=' : '!');\n}",
|
||||
"hash": "e5b34bcb7f80f2ed890cdacaa059db0d",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::operator==(const SkColor4f& other)_const",
|
||||
"stdout": "colorRed == colorNamedRed"
|
||||
},
|
||||
"SkColor4f_notequal1_operator": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f colorGray = { .5, .5, .5, 1 };\n SkColor4f colorNamedGray = SkColor4f::FromColor(SK_ColorGRAY);\n SkDebugf(\"colorGray %c= colorNamedGray \", colorGray != colorNamedGray ? '!' : '=');\n}",
|
||||
"hash": "82f1a9b4c2b27aa547061786d1f33dab",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::operator!=(const SkColor4f& other)_const",
|
||||
"stdout": "colorGray != colorNamedGray"
|
||||
},
|
||||
"SkColor4f_toSkColor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;\n SkColor4f color4f = { red, green, blue, alpha };\n SkColor argb = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(argb),\n SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));\n SkColor4f fromSkColor = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", fromSkColor.fR, fromSkColor.fG,\n fromSkColor.fB, fromSkColor.fA);\n}",
|
||||
"hash": "edc5fd18d961f7607d2bcbf7f7d427e5",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::toSkColor",
|
||||
"stdout": "red=18 green=33 blue=82 alpha=43\\nred=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627\\n"
|
||||
},
|
||||
"SkColor4f_vec": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n const float* array = color.vec();\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}",
|
||||
"hash": "229057023515224358a36acf15508cf6",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::vec()",
|
||||
"stdout": "red=0.266667 green=0.533333 blue=0.8 alpha=0.533333\\n[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=0.533333\\n"
|
||||
},
|
||||
"SkColor4f_vec_2": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n float* array = color.vec();\n array[3] = 1;\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}",
|
||||
"hash": "7420bf0a7cae5c6577c4c4a4613e7e7e",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::vec_2",
|
||||
"stdout": "red=0.266667 green=0.533333 blue=0.8 alpha=0.533333\\n[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=1\\n"
|
||||
},
|
||||
"SkIPoint_Make": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkIPoint pt1 = {45, 66};\n SkIPoint pt2 = SkIPoint::Make(45, 66);\n SkDebugf(\"pt1 %c= pt2\\n\", pt1 == pt2 ? '=' : '!');\n}",
|
||||
@ -2715,6 +2673,48 @@
|
||||
"file": "SkPoint_Reference",
|
||||
"name": "SkPoint::y()",
|
||||
"stdout": "pt1.fY == pt1.y()\\n"
|
||||
},
|
||||
"SkRGBA4f_FromColor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint8_t red = 77, green = 101, blue = 153, alpha = 43;\n SkColor argb = SkColorSetARGB(alpha, red, green, blue);\n SkColor4f color4f = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color4f.fR, color4f.fG, color4f.fB, color4f.fA);\n SkColor fromColor4f = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(fromColor4f),\n SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));\n}",
|
||||
"hash": "33b029064e8d1928e42a587c953d0e4e",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::FromColor",
|
||||
"stdout": "red=0.301961 green=0.396078 blue=0.6 alpha=0.168627\\nred=77 green=101 blue=153 alpha=43\\n"
|
||||
},
|
||||
"SkRGBA4f_equal1_operator": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f colorRed = { 1, 0, 0, 1 };\n SkColor4f colorNamedRed = SkColor4f::FromColor(SK_ColorRED);\n SkDebugf(\"colorRed %c= colorNamedRed\", colorRed == colorNamedRed ? '=' : '!');\n}",
|
||||
"hash": "e5b34bcb7f80f2ed890cdacaa059db0d",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::operator==(const SkRGBA4f& other)_const",
|
||||
"stdout": "colorRed == colorNamedRed"
|
||||
},
|
||||
"SkRGBA4f_notequal1_operator": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f colorGray = { .5, .5, .5, 1 };\n SkColor4f colorNamedGray = SkColor4f::FromColor(SK_ColorGRAY);\n SkDebugf(\"colorGray %c= colorNamedGray \", colorGray != colorNamedGray ? '!' : '=');\n}",
|
||||
"hash": "82f1a9b4c2b27aa547061786d1f33dab",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::operator!=(const SkRGBA4f& other)_const",
|
||||
"stdout": "colorGray != colorNamedGray"
|
||||
},
|
||||
"SkRGBA4f_toSkColor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;\n SkColor4f color4f = { red, green, blue, alpha };\n SkColor argb = color4f.toSkColor();\n SkDebugf(\"red=%d green=%d blue=%d alpha=%d\\n\", SkColorGetR(argb),\n SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));\n SkColor4f fromSkColor = SkColor4f::FromColor(argb);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", fromSkColor.fR, fromSkColor.fG,\n fromSkColor.fB, fromSkColor.fA);\n}",
|
||||
"hash": "edc5fd18d961f7607d2bcbf7f7d427e5",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::toSkColor",
|
||||
"stdout": "red=18 green=33 blue=82 alpha=43\\nred=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627\\n"
|
||||
},
|
||||
"SkRGBA4f_vec": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n const float* array = color.vec();\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}",
|
||||
"hash": "229057023515224358a36acf15508cf6",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::vec()",
|
||||
"stdout": "red=0.266667 green=0.533333 blue=0.8 alpha=0.533333\\n[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=0.533333\\n"
|
||||
},
|
||||
"SkRGBA4f_vec_2": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkColor4f color = SkColor4f::FromColor(0x884488CC);\n SkDebugf(\"red=%g green=%g blue=%g alpha=%g\\n\", color.fR, color.fG, color.fB, color.fA);\n float* array = color.vec();\n array[3] = 1;\n SkDebugf(\"[0]=%g [1]=%g [2]=%g [3]=%g\\n\", array[0], array[1], array[2], array[3]);\n}",
|
||||
"hash": "7420bf0a7cae5c6577c4c4a4613e7e7e",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::vec_2",
|
||||
"stdout": "red=0.266667 green=0.533333 blue=0.8 alpha=0.533333\\n[0]=0.266667 [1]=0.533333 [2]=0.8 [3]=1\\n"
|
||||
},
|
||||
"SkRRect_dump": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n for (bool dumpAsHex : { false, true } ) {\n rrect.dump(dumpAsHex);\n }\n}",
|
||||
@ -3904,45 +3904,45 @@
|
||||
"file": "SkColor_Reference",
|
||||
"name": "Color_Constants_White"
|
||||
},
|
||||
"Illustrations_Blend_Mode_Color_Blends": {
|
||||
"Illustrations_Blend_Mode_Overview_Color_Blends": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor,\n SkBlendMode::kLuminosity } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(90, 0);\n }\n}",
|
||||
"width": 480,
|
||||
"height": 110,
|
||||
"hash": "03710c1770728da885fa4ac24a19d5d1",
|
||||
"file": "illustrations",
|
||||
"name": "Blend_Mode_Color_Blends"
|
||||
"name": "Blend_Mode_Overview_Color_Blends"
|
||||
},
|
||||
"Illustrations_Blend_Mode_Lighten_Darken": {
|
||||
"Illustrations_Blend_Mode_Overview_Lighten_Darken": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kPlus, SkBlendMode::kScreen, SkBlendMode::kOverlay,\n SkBlendMode::kDarken, SkBlendMode::kLighten, SkBlendMode::kColorDodge,\n SkBlendMode::kColorBurn, SkBlendMode::kHardLight, SkBlendMode::kSoftLight,\n SkBlendMode::kDifference, SkBlendMode::kExclusion, SkBlendMode::kMultiply } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(90, 0);\n if (SkBlendMode::kLighten == blend || SkBlendMode::kDifference == blend) {\n canvas->translate(-90 * 5, 100);\n }\n }\n}",
|
||||
"width": 480,
|
||||
"height": 330,
|
||||
"hash": "8e04f89252632da0fffe713f07f2296f",
|
||||
"file": "illustrations",
|
||||
"name": "Blend_Mode_Lighten_Darken"
|
||||
"name": "Blend_Mode_Overview_Lighten_Darken"
|
||||
},
|
||||
"Illustrations_Blend_Mode_Modulate_Blend": {
|
||||
"Illustrations_Blend_Mode_Overview_Modulate_Blend": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n SkBitmap srcBits;\n srcBits.allocN32Pixels(80, 84);\n SkCanvas srcCanvas(srcBits);\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n srcBits.eraseColor(0);\n srcCanvas.drawPath(srcPath, srcPaint);\n canvas->drawColor(0, SkBlendMode::kClear);\n srcPaint.setBlendMode(SkBlendMode::kModulate);\n for (auto step: { 1, 2 } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n if (1 == step) {\n canvas->drawBitmap(srcBits, 0, 0, &srcPaint);\n canvas->drawString(\"Bitmap\", 50, 18, labelPaint);\n } else {\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(\"Geometry\", 50, 18, labelPaint);\n }\n canvas->drawString(SkBlendMode_Name(SkBlendMode::kModulate), 50, 100, labelPaint);\n canvas->translate(120, 0);\n }\n}",
|
||||
"width": 480,
|
||||
"height": 110,
|
||||
"hash": "d8abdd8fb56f9e69342d745d425c4a17",
|
||||
"file": "illustrations",
|
||||
"name": "Blend_Mode_Modulate_Blend"
|
||||
"name": "Blend_Mode_Overview_Modulate_Blend"
|
||||
},
|
||||
"Illustrations_Blend_Mode_Porter_Duff": {
|
||||
"Illustrations_Blend_Mode_Overview_Porter_Duff": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n SkBitmap srcBits;\n srcBits.allocN32Pixels(80, 84);\n SkCanvas srcCanvas(srcBits);\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n srcBits.eraseColor(0);\n srcCanvas.drawPath(srcPath, srcPaint);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kSrc, SkBlendMode::kSrcATop, SkBlendMode::kSrcOver,\n SkBlendMode::kSrcIn, SkBlendMode::kSrcOut,\n SkBlendMode::kDst, SkBlendMode::kDstATop, SkBlendMode::kDstOver,\n SkBlendMode::kDstIn, SkBlendMode::kDstOut,\n SkBlendMode::kClear, SkBlendMode::kXor } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawBitmap(srcBits, 0, 0, &srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(80, 0);\n if (SkBlendMode::kSrcOut == blend || SkBlendMode::kDstOut == blend) {\n canvas->translate(-80 * 5, 100);\n }\n }\n}",
|
||||
"width": 480,
|
||||
"height": 330,
|
||||
"hash": "8c27fb2a58f63505cffa74c1c79e16ba",
|
||||
"file": "illustrations",
|
||||
"name": "Blend_Mode_Porter_Duff"
|
||||
"name": "Blend_Mode_Overview_Porter_Duff"
|
||||
},
|
||||
"Illustrations_Blend_Mode_Porter_Duff_2": {
|
||||
"Illustrations_Blend_Mode_Overview_Porter_Duff_2": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n SkBitmap dstBits;\n dstBits.allocN32Pixels(80, 80);\n SkCanvas dstCanvas(dstBits);\n for (auto blend : { SkBlendMode::kSrc, SkBlendMode::kSrcATop, SkBlendMode::kSrcOver,\n SkBlendMode::kSrcIn, SkBlendMode::kSrcOut,\n SkBlendMode::kDst, SkBlendMode::kDstATop, SkBlendMode::kDstOver,\n SkBlendMode::kDstIn, SkBlendMode::kDstOut,\n SkBlendMode::kClear, SkBlendMode::kXor } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(80, 0);\n if (SkBlendMode::kSrcOut == blend || SkBlendMode::kDstOut == blend) {\n canvas->translate(-80 * 5, 100);\n }\n }\n}",
|
||||
"width": 480,
|
||||
"height": 330,
|
||||
"hash": "50ebbb0162bbf60524a196236d66c915",
|
||||
"file": "illustrations",
|
||||
"name": "Blend_Mode_Porter_Duff_2"
|
||||
"name": "Blend_Mode_Overview_Porter_Duff_2"
|
||||
},
|
||||
"Illustrations_Image_Info_Color_Type_ARGB_4444": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"16-bit word\", 5 + 20 * 8, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 4, 8, 12, 16 };\n const char* labels[] = { \"red\", \"green\", \"blue\", \"alpha\" };\n drawBoxText(&edges[0], &labels[0], 4, 15, 45);\n drawBoxText(&edges[0], &labels[2], 2, 7, 110);\n drawBoxText(&edges[0], &labels[0], 2, 7, 160);\n}\n",
|
||||
@ -4359,14 +4359,6 @@
|
||||
"hash": "8df5800819311b71373d9abb669b49b8",
|
||||
"file": "SkPaint_Reference",
|
||||
"name": "Vertical_Text"
|
||||
},
|
||||
"Path": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkPath path;\n path.moveTo(124, 108);\n path.lineTo(172, 24);\n path.addCircle(50, 50, 30);\n path.moveTo(36, 148);\n path.quadTo(66, 188, 120, 136);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setColor(SK_ColorBLUE);\n paint.setStrokeWidth(3);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "93887af0c1dac49521972698cf04069c",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Path"
|
||||
},
|
||||
"Path_Arc": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkRect oval = {8, 8, 56, 56};\n SkPaint ovalPaint;\n ovalPaint.setAntiAlias(true);\n SkPaint textPaint(ovalPaint);\n ovalPaint.setStyle(SkPaint::kStroke_Style);\n SkPaint arcPaint(ovalPaint);\n arcPaint.setStrokeWidth(5);\n arcPaint.setColor(SK_ColorBLUE);\n canvas->translate(-64, 0);\n for (char arcStyle = '1'; arcStyle <= '6'; ++arcStyle) {\n '4' == arcStyle ? canvas->translate(-96, 55) : canvas->translate(64, 0);\n canvas->drawText(&arcStyle, 1, 30, 36, textPaint);\n canvas->drawOval(oval, ovalPaint);\n SkPath path;\n path.moveTo({56, 32});\n switch (arcStyle) {\n case '1':\n path.arcTo(oval, 0, 90, false);\n break;\n case '2':\n canvas->drawArc(oval, 0, 90, false, arcPaint);\n continue;\n case '3':\n path.addArc(oval, 0, 90);\n break;\n case '4':\n path.arcTo({56, 56}, {32, 56}, 24);\n break;\n case '5':\n path.arcTo({24, 24}, 0, SkPath::kSmall_ArcSize, SkPath::kCW_Direction, {32, 56});\n break;\n case '6':\n path.conicTo({56, 56}, {32, 56}, SK_ScalarRoot2Over2);\n break;\n }\n canvas->drawPath(path, arcPaint);\n }\n}\n",
|
||||
@ -4375,30 +4367,6 @@
|
||||
"hash": "5acc77eba0cb4d00bbf3a8f4db0c0aee",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Arc"
|
||||
},
|
||||
"Path_Contour": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n canvas->drawString(\"1st contour\", 150, 100, paint);\n canvas->drawString(\"2nd contour\", 130, 160, paint);\n canvas->drawString(\"3rd contour\", 40, 30, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n SkPath path;\n path.moveTo(124, 108);\n path.lineTo(172, 24);\n path.moveTo(36, 148);\n path.quadTo(66, 188, 120, 136);\n path.close();\n path.conicTo(70, 20, 110, 40, 0.6f);\n canvas->drawPath(path, paint);\n}",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "0374f2dcd7effeb1dd435205a6c2de6f",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Contour"
|
||||
},
|
||||
"Path_Contour_Zero_Length": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(8);\n paint.setStrokeCap(SkPaint::kRound_Cap);\n SkPath path;\n path.moveTo(36, 48);\n path.lineTo(36, 48);\n canvas->drawPath(path, paint);\n path.reset();\n paint.setStrokeCap(SkPaint::kSquare_Cap);\n path.moveTo(56, 48);\n path.close();\n canvas->drawPath(path, paint);\n}",
|
||||
"width": 256,
|
||||
"height": 64,
|
||||
"hash": "62848df605af6258653d9e16b27d8f7f",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Contour_Zero_Length"
|
||||
},
|
||||
"Path_Contour_a": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(8);\n SkPath path;\n path.moveTo(36, 48);\n path.quadTo(66, 88, 120, 36);\n canvas->drawPath(path, paint);\n path.close();\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"hash": "7a1f39b12d2cd8b7f5b1190879259cb2",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Contour_2"
|
||||
},
|
||||
"Path_Cubic": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkPoint cubicPts[] = {{20, 150}, {90, 10}, {160, 150}, {230, 10}};\n SkColor colors[] = { 0xff88ff00, 0xff0088bb, 0xff6600cc, 0xffbb3377 };\n for (unsigned i = 0; i < SK_ARRAY_COUNT(colors); ++i) {\n paint.setColor(0x7fffffff & colors[i]);\n paint.setStrokeWidth(1);\n for (unsigned j = 0; j < 3; ++j) {\n canvas->drawLine(cubicPts[j], cubicPts[j + 1], paint);\n }\n SkPath path;\n path.moveTo(cubicPts[0]);\n path.cubicTo(cubicPts[1], cubicPts[2], cubicPts[3]);\n paint.setStrokeWidth(3);\n paint.setColor(colors[i]);\n canvas->drawPath(path, paint);\n cubicPts[1].fY += 30;\n cubicPts[2].fX += 30;\n }\n}\n",
|
||||
@ -4407,6 +4375,46 @@
|
||||
"hash": "466445ed991d86de08587066392d654a",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Cubic"
|
||||
},
|
||||
"Path_Overview": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkPath path;\n path.moveTo(124, 108);\n path.lineTo(172, 24);\n path.addCircle(50, 50, 30);\n path.moveTo(36, 148);\n path.quadTo(66, 188, 120, 136);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setColor(SK_ColorBLUE);\n paint.setStrokeWidth(3);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "93887af0c1dac49521972698cf04069c",
|
||||
"file": "SkPath_Overview",
|
||||
"name": "Path_Overview"
|
||||
},
|
||||
"Path_Overview_Contour": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n canvas->drawString(\"1st contour\", 150, 100, paint);\n canvas->drawString(\"2nd contour\", 130, 160, paint);\n canvas->drawString(\"3rd contour\", 40, 30, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n SkPath path;\n path.moveTo(124, 108);\n path.lineTo(172, 24);\n path.moveTo(36, 148);\n path.quadTo(66, 188, 120, 136);\n path.close();\n path.conicTo(70, 20, 110, 40, 0.6f);\n canvas->drawPath(path, paint);\n}",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "0374f2dcd7effeb1dd435205a6c2de6f",
|
||||
"file": "SkPath_Overview",
|
||||
"name": "Contour"
|
||||
},
|
||||
"Path_Overview_Contour_Zero_Length": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(8);\n paint.setStrokeCap(SkPaint::kRound_Cap);\n SkPath path;\n path.moveTo(36, 48);\n path.lineTo(36, 48);\n canvas->drawPath(path, paint);\n path.reset();\n paint.setStrokeCap(SkPaint::kSquare_Cap);\n path.moveTo(56, 48);\n path.close();\n canvas->drawPath(path, paint);\n}",
|
||||
"width": 256,
|
||||
"height": 64,
|
||||
"hash": "62848df605af6258653d9e16b27d8f7f",
|
||||
"file": "SkPath_Overview",
|
||||
"name": "Contour_Zero_Length"
|
||||
},
|
||||
"Path_Overview_Contour_a": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setStrokeWidth(8);\n SkPath path;\n path.moveTo(36, 48);\n path.quadTo(66, 88, 120, 36);\n canvas->drawPath(path, paint);\n path.close();\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 160,
|
||||
"hash": "7a1f39b12d2cd8b7f5b1190879259cb2",
|
||||
"file": "SkPath_Overview",
|
||||
"name": "Contour_2"
|
||||
},
|
||||
"Path_Overview_a": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkPath path;\n path.moveTo(36, 48);\n path.quadTo(66, 88, 120, 36);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setColor(SK_ColorBLUE);\n paint.setStrokeWidth(8);\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStrokeAndFill_Style);\n paint.setColor(SK_ColorRED);\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "36a995442c081ee779ecab2962d36e69",
|
||||
"file": "SkPath_Overview",
|
||||
"name": "Path_Overview_2"
|
||||
},
|
||||
"Path_Quad": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkPoint quadPts[] = {{20, 90}, {120, 10}, {220, 90}};\n canvas->drawLine(quadPts[0], quadPts[1], paint);\n canvas->drawLine(quadPts[1], quadPts[2], paint);\n SkPath path;\n path.moveTo(quadPts[0]);\n path.quadTo(quadPts[1], quadPts[2]);\n paint.setStrokeWidth(3);\n canvas->drawPath(path, paint);\n}\n",
|
||||
@ -4423,14 +4431,6 @@
|
||||
"hash": "4082f66a42df11bb20462b232b156bb6",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Quad_2"
|
||||
},
|
||||
"Path_a": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkPath path;\n path.moveTo(36, 48);\n path.quadTo(66, 88, 120, 36);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setColor(SK_ColorBLUE);\n paint.setStrokeWidth(8);\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n paint.setStyle(SkPaint::kStrokeAndFill_Style);\n paint.setColor(SK_ColorRED);\n canvas->translate(0, 50);\n canvas->drawPath(path, paint);\n}\n",
|
||||
"width": 256,
|
||||
"height": 192,
|
||||
"hash": "36a995442c081ee779ecab2962d36e69",
|
||||
"file": "SkPath_Reference",
|
||||
"name": "Path_2"
|
||||
},
|
||||
"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}",
|
||||
@ -5487,22 +5487,6 @@
|
||||
"hash": "8b128e067881f9251357653692fa28da",
|
||||
"file": "SkCanvas_Reference",
|
||||
"name": "SkCanvas::writePixels_2"
|
||||
},
|
||||
"SkColor4f_Pin": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { SkColor4f::Pin(1.5, 0.45f, 0.0, 1), \n SkColor4f::Pin(1, 0.45f, -0.25, 1),\n {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
|
||||
"width": 256,
|
||||
"height": 40,
|
||||
"hash": "c989cf16c7f8849874eb008cd701af76",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::Pin"
|
||||
},
|
||||
"SkColor4f_pin": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n pixmap.erase(color4f.pin(), &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
|
||||
"width": 256,
|
||||
"height": 40,
|
||||
"hash": "9e349862c5189a44d2acef5da24f2e79",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkColor4f::pin()"
|
||||
},
|
||||
"SkColorGetA": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setColor(SK_ColorRED);\n for (int alpha = 255; alpha >= 0; alpha -= 17) {\n paint.setAlpha(alpha);\n canvas->drawRect({5, 5, 100, 20}, paint);\n SkAlpha alphaInPaint = SkColorGetA(paint.getColor());\n canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);\n canvas->translate(0, 15);\n }\n}",
|
||||
@ -8287,6 +8271,22 @@
|
||||
"hash": "0bcc0f86a2aefc899f3500503dce6968",
|
||||
"file": "SkColor_Reference",
|
||||
"name": "SkPreMultiplyColor"
|
||||
},
|
||||
"SkRGBA4f_Pin": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { SkColor4f::Pin(1.5, 0.45f, 0.0, 1), \n SkColor4f::Pin(1, 0.45f, -0.25, 1),\n {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
|
||||
"width": 256,
|
||||
"height": 40,
|
||||
"hash": "c989cf16c7f8849874eb008cd701af76",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::Pin"
|
||||
},
|
||||
"SkRGBA4f_pin": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n uint32_t storage[8];\n SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorWHITE);\n SkIRect bounds = {0, 0, 1, 1};\n SkColor4f colors[] = { {1.5, 0.45f, 0.0, 1},\n {1, 0.45f, -0.25, 1},\n };\n for (auto color4f : colors) {\n pixmap.erase(color4f, &bounds);\n bounds.offset(2, 0);\n pixmap.erase(color4f.pin(), &bounds);\n bounds.offset(2, 0);\n }\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}",
|
||||
"width": 256,
|
||||
"height": 40,
|
||||
"hash": "9e349862c5189a44d2acef5da24f2e79",
|
||||
"file": "SkColor4f_Reference",
|
||||
"name": "SkRGBA4f::pin()"
|
||||
},
|
||||
"SkRGBToHSV": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n canvas->drawBitmap(source, 0, 0);\n SkPaint bgPaint;\n bgPaint.setColor(0xafffffff);\n canvas->drawRect({20, 30, 110, 90}, bgPaint);\n SkScalar hsv[3];\n SkColor c = source.getColor(226, 128);\n SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);\n canvas->drawString((\"h: \" + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());\n canvas->drawString((\"s: \" + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());\n canvas->drawString((\"v: \" + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());\n canvas->drawLine(110, 90, 226, 128, SkPaint());\n}",
|
||||
|
@ -1,27 +1,8 @@
|
||||
undocumented
|
||||
===
|
||||
|
||||
# <a name='Alias'>Alias</a>
|
||||
|
||||
# <a name='Arc'>Arc</a>
|
||||
|
||||
# <a name='BBH_Factory'>BBH Factory</a>
|
||||
|
||||
# <a name='SkBBHFactory'>Class SkBBHFactory</a>
|
||||
|
||||
# <a name='Backend_Semaphore'>Backend Semaphore</a>
|
||||
|
||||
# <a name='GrBackendSemaphore'>Class GrBackendSemaphore</a>
|
||||
|
||||
# <a name='Bezier_Curve'>Bezier Curve</a>
|
||||
|
||||
# <a name='Big_Endian'>Big Endian</a>
|
||||
|
||||
# <a name='Cartesian_Coordinate'>Cartesian Coordinate</a>
|
||||
|
||||
# <a name='Circle'>Circle</a>
|
||||
|
||||
# <a name='Clip_Op'>Clip Op</a>
|
||||
<a name='SkBBHFactory'></a>
|
||||
<a name='GrBackendSemaphore'></a>
|
||||
|
||||
## <a name='SkClipOp'>Enum SkClipOp</a>
|
||||
|
||||
@ -45,13 +26,8 @@ undocumented
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
# <a name='Color_Filter'>Color Filter</a>
|
||||
|
||||
# <a name='SkColorFilter'>Class SkColorFilter</a>
|
||||
|
||||
# <a name='Color_Space'>Color Space</a>
|
||||
|
||||
# <a name='SkColorSpace'>Class SkColorSpace</a>
|
||||
<a name='SkColorFilter'></a>
|
||||
<a name='SkColorSpace'></a>
|
||||
|
||||
<a name='SkColorSpace_MakeSRGBLinear'></a>
|
||||
## MakeSRGBLinear
|
||||
@ -80,14 +56,6 @@ static bool <a href='#SkColorSpace_Equals'>Equals</a>(const <a href='#SkColorSpa
|
||||
|
||||
---
|
||||
|
||||
# <a name='Coons_Patch'>Coons Patch</a>
|
||||
|
||||
# <a name='Core_Graphics'>Core Graphics</a>
|
||||
|
||||
# <a name='Core_Text'>Core Text</a>
|
||||
|
||||
# <a name='Create_Color_Space_Xform_Canvas'>Create Color Space Xform Canvas</a>
|
||||
|
||||
<a name='SkCreateColorSpaceXformCanvas'></a>
|
||||
## SkCreateColorSpaceXformCanvas
|
||||
|
||||
@ -98,17 +66,8 @@ std::unique_ptr<<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>> SK_API
|
||||
|
||||
---
|
||||
|
||||
# <a name='Curve'>Curve</a>
|
||||
|
||||
# <a name='Data'>Data</a>
|
||||
|
||||
# <a name='SkData'>Class SkData</a>
|
||||
|
||||
# <a name='Debug_Canvas'>Debug Canvas</a>
|
||||
|
||||
# <a name='SkDebugCanvas'>Class SkDebugCanvas</a>
|
||||
|
||||
# <a name='Debugging'>Debugging</a>
|
||||
<a name='SkData'></a>
|
||||
<a name='SkDebugCanvas'></a>
|
||||
|
||||
<a name='SkDebugf'></a>
|
||||
## SkDebugf
|
||||
@ -119,29 +78,14 @@ SK_API void <a href='#SkDebugf'>SkDebugf</a>(const char format[], ...)
|
||||
|
||||
---
|
||||
|
||||
# <a name='Deferred_Display_List'>Deferred Display List</a>
|
||||
|
||||
# <a name='SkDeferredDisplayList'>Class SkDeferredDisplayList</a>
|
||||
<a name='SkDeferredDisplayList'></a>
|
||||
|
||||
## <a name='Recorder'>Recorder</a>
|
||||
|
||||
# <a name='SkDeferredDisplayListRecorder'>Class SkDeferredDisplayListRecorder</a>
|
||||
|
||||
# <a name='Descenders'>Descenders</a>
|
||||
|
||||
# <a name='Deserial_Procs'>Deserial Procs</a>
|
||||
|
||||
# <a name='SkDeserialProcs'>Struct SkDeserialProcs</a>
|
||||
|
||||
# <a name='Destructor'>Destructor</a>
|
||||
|
||||
# <a name='Device'>Device</a>
|
||||
|
||||
# <a name='SkBaseDevice'>Class SkBaseDevice</a>
|
||||
|
||||
# <a name='Document'>Document</a>
|
||||
|
||||
# <a name='SkDocument'>Class SkDocument</a>
|
||||
<a name='SkDeferredDisplayListRecorder'></a>
|
||||
<a name='SkDeserialProcs'></a>
|
||||
<a name='SkBaseDevice'></a>
|
||||
<a name='SkDocument'></a>
|
||||
|
||||
<a name='SkDocument_beginPage'></a>
|
||||
## beginPage
|
||||
@ -154,15 +98,8 @@ SK_API void <a href='#SkDebugf'>SkDebugf</a>(const char format[], ...)
|
||||
|
||||
## <a name='PDF'>PDF</a>
|
||||
|
||||
# <a name='Draw_Layer'>Draw Layer</a>
|
||||
|
||||
# <a name='Draw_Looper'>Draw Looper</a>
|
||||
|
||||
# <a name='SkDrawLooper'>Class SkDrawLooper</a>
|
||||
|
||||
# <a name='Drawable'>Drawable</a>
|
||||
|
||||
# <a name='SkDrawable'>Class SkDrawable</a>
|
||||
<a name='SkDrawLooper'></a>
|
||||
<a name='SkDrawable'></a>
|
||||
|
||||
<a name='SkDrawable_draw'></a>
|
||||
## draw
|
||||
@ -173,12 +110,6 @@ void <a href='#SkDrawable_draw'>draw</a>(<a href='SkCanvas_Reference#SkCanvas'>S
|
||||
|
||||
---
|
||||
|
||||
# <a name='Euclidean_Distance'>Euclidean Distance</a>
|
||||
|
||||
# <a name='Euclidean_Space'>Euclidean Space</a>
|
||||
|
||||
# <a name='Filter_Quality'>Filter Quality</a>
|
||||
|
||||
## <a name='SkFilterQuality'>Enum SkFilterQuality</a>
|
||||
|
||||
### Constants
|
||||
@ -221,17 +152,11 @@ void <a href='#SkDrawable_draw'>draw</a>(<a href='SkCanvas_Reference#SkCanvas'>S
|
||||
|
||||
## <a name='BiCubic'>BiCubic</a>
|
||||
|
||||
# <a name='Font'>Font</a>
|
||||
|
||||
## <a name='Advance'>Advance</a>
|
||||
|
||||
## <a name='Engine'>Engine</a>
|
||||
|
||||
# <a name='Font_Manager'>Font Manager</a>
|
||||
|
||||
# <a name='GPU_Context'>GPU Context</a>
|
||||
|
||||
# <a name='GrContext'>Class GrContext</a>
|
||||
<a name='GrContext'></a>
|
||||
|
||||
<a name='GrContext_flush'></a>
|
||||
## flush
|
||||
@ -242,73 +167,14 @@ void <a href='#GrContext_flush'>flush</a>()
|
||||
|
||||
---
|
||||
|
||||
# <a name='GPU_Share_Group'>GPU Share Group</a>
|
||||
|
||||
# <a name='GPU_Surface'>GPU Surface</a>
|
||||
|
||||
# <a name='GPU_Texture'>GPU Texture</a>
|
||||
|
||||
# <a name='Glyph'>Glyph</a>
|
||||
|
||||
## <a name='ID'>ID</a>
|
||||
|
||||
# <a name='Grayscale'>Grayscale</a>
|
||||
|
||||
# <a name='HTML_Aqua'>HTML Aqua</a>
|
||||
|
||||
# <a name='HTML_Canvas'>HTML Canvas</a>
|
||||
|
||||
## <a name='ArcTo'>ArcTo</a>
|
||||
|
||||
# <a name='HTML_Fuchsia'>HTML Fuchsia</a>
|
||||
|
||||
# <a name='HTML_Gray'>HTML Gray</a>
|
||||
|
||||
# <a name='HTML_Green'>HTML Green</a>
|
||||
|
||||
# <a name='HTML_Lime'>HTML Lime</a>
|
||||
|
||||
# <a name='HTML_Silver'>HTML Silver</a>
|
||||
|
||||
# <a name='ISize'>ISize</a>
|
||||
|
||||
# <a name='SkISize'>Struct SkISize</a>
|
||||
|
||||
# <a name='Image_Filter'>Image Filter</a>
|
||||
|
||||
# <a name='SkImageFilter'>Class SkImageFilter</a>
|
||||
|
||||
# <a name='Image_Scaling'>Image Scaling</a>
|
||||
|
||||
# <a name='Kerning'>Kerning</a>
|
||||
|
||||
# <a name='Left_Side_Bearing'>Left Side Bearing</a>
|
||||
|
||||
# <a name='Line'>Line</a>
|
||||
|
||||
# <a name='Little_Endian'>Little Endian</a>
|
||||
|
||||
# <a name='Mask_Alpha'>Mask Alpha</a>
|
||||
|
||||
# <a name='Mask_Filter'>Mask Filter</a>
|
||||
|
||||
# <a name='SkMaskFilter'>Class SkMaskFilter</a>
|
||||
|
||||
# <a name='Meta_Data'>Meta Data</a>
|
||||
|
||||
# <a name='SkMetaData'>Class SkMetaData</a>
|
||||
|
||||
# <a name='Mip_Map'>Mip Map</a>
|
||||
|
||||
# <a name='Multi_Sample_Anti_Aliasing'>Multi Sample Anti Aliasing</a>
|
||||
|
||||
# <a name='Nine_Patch'>Nine Patch</a>
|
||||
|
||||
# <a name='OS_X'>OS X</a>
|
||||
|
||||
# <a name='Oval'>Oval</a>
|
||||
|
||||
# <a name='Paint_Defaults'>Paint Defaults</a>
|
||||
<a name='SkISize'></a>
|
||||
<a name='SkImageFilter'></a>
|
||||
<a name='SkMaskFilter'></a>
|
||||
<a name='SkMetaData'></a>
|
||||
|
||||
### Constants
|
||||
|
||||
@ -342,10 +208,6 @@ void <a href='#GrContext_flush'>flush</a>()
|
||||
</tr>
|
||||
|
||||
|
||||
# <a name='Patch'>Patch</a>
|
||||
|
||||
# <a name='PathOps'>PathOps</a>
|
||||
|
||||
## <a name='SkPathOp'>Enum SkPathOp</a>
|
||||
|
||||
</table>
|
||||
@ -359,13 +221,8 @@ bool SK_API <a href='#Op'>Op</a>(const <a href='SkPath_Reference#SkPath'>SkPath<
|
||||
|
||||
---
|
||||
|
||||
# <a name='Path_Effect'>Path Effect</a>
|
||||
|
||||
# <a name='SkPathEffect'>Class SkPathEffect</a>
|
||||
|
||||
# <a name='Picture_Recorder'>Picture Recorder</a>
|
||||
|
||||
# <a name='SkPictureRecorder'>Class SkPictureRecorder</a>
|
||||
<a name='SkPathEffect'></a>
|
||||
<a name='SkPictureRecorder'></a>
|
||||
|
||||
<a name='SkPictureRecorder_beginRecording'></a>
|
||||
## beginRecording
|
||||
@ -377,13 +234,9 @@ bool SK_API <a href='#Op'>Op</a>(const <a href='SkPath_Reference#SkPath'>SkPath<
|
||||
|
||||
---
|
||||
|
||||
# <a name='Pixel'>Pixel</a>
|
||||
|
||||
## <a name='Storage'>Storage</a>
|
||||
|
||||
# <a name='Pixel_Ref'>Pixel Ref</a>
|
||||
|
||||
# <a name='SkPixelRef'>Class SkPixelRef</a>
|
||||
<a name='SkPixelRef'></a>
|
||||
|
||||
<a name='SkPixelRef_width'></a>
|
||||
## width
|
||||
@ -421,31 +274,15 @@ void <a href='#SkPixelRef_setImmutable'>setImmutable</a>()
|
||||
|
||||
---
|
||||
|
||||
# <a name='Point3'>Point3</a>
|
||||
|
||||
# <a name='SkPoint3'>Struct SkPoint3</a>
|
||||
|
||||
# <a name='PostScript'>PostScript</a>
|
||||
<a name='SkPoint3'></a>
|
||||
|
||||
## <a name='Arct'>Arct</a>
|
||||
|
||||
# <a name='Premultiply'>Premultiply</a>
|
||||
|
||||
# <a name='RSXform'>RSXform</a>
|
||||
|
||||
# <a name='SkRSXform'>Struct SkRSXform</a>
|
||||
|
||||
# <a name='Raster_Bitmap'>Raster Bitmap</a>
|
||||
|
||||
# <a name='Raster_Engine'>Raster Engine</a>
|
||||
|
||||
# <a name='Raster_Handle_Allocator'>Raster Handle Allocator</a>
|
||||
|
||||
# <a name='SkRasterHandleAllocator'>Class SkRasterHandleAllocator</a>
|
||||
<a name='SkRSXform'></a>
|
||||
<a name='SkRasterHandleAllocator'></a>
|
||||
|
||||
## <a name='SkRasterHandleAllocator_Handle'>Typedef SkRasterHandleAllocator::Handle</a>
|
||||
|
||||
# <a name='SkRasterHandleAllocator_Rec'>Struct SkRasterHandleAllocator::Rec</a>
|
||||
<a name='SkRasterHandleAllocator_Rec'></a>
|
||||
|
||||
<a name='SkRasterHandleAllocator_MakeCanvas'></a>
|
||||
## MakeCanvas
|
||||
@ -457,17 +294,9 @@ static std::unique_ptr<<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>>
|
||||
|
||||
---
|
||||
|
||||
# <a name='Raster_Surface'>Raster Surface</a>
|
||||
|
||||
# <a name='Reference_Count'>Reference Count</a>
|
||||
|
||||
# <a name='SkRefCnt'>Class SkRefCnt</a>
|
||||
|
||||
# <a name='sk_sp'>Class sk_sp</a>
|
||||
|
||||
# <a name='RenderTarget'>RenderTarget</a>
|
||||
|
||||
# <a name='GrBackendRenderTarget'>Class GrBackendRenderTarget</a>
|
||||
<a name='SkRefCnt'></a>
|
||||
<a name='sk_sp'></a>
|
||||
<a name='GrBackendRenderTarget'></a>
|
||||
|
||||
<a name='GrBackendRenderTarget_isValid'></a>
|
||||
## isValid
|
||||
@ -478,33 +307,15 @@ bool <a href='#GrBackendRenderTarget_isValid'>isValid</a>() const
|
||||
|
||||
---
|
||||
|
||||
# <a name='Render_Target'>Render Target</a>
|
||||
|
||||
# <a name='GrRenderTarget'>Class GrRenderTarget</a>
|
||||
|
||||
# <a name='Right_Side_Bearing'>Right Side Bearing</a>
|
||||
|
||||
# <a name='SVG'>SVG</a>
|
||||
<a name='GrRenderTarget'></a>
|
||||
|
||||
## <a name='Canvas'>Canvas</a>
|
||||
|
||||
## <a name='Arc'>Arc</a>
|
||||
|
||||
# <a name='SVG_darkgray'>SVG darkgray</a>
|
||||
|
||||
# <a name='SVG_lightgray'>SVG lightgray</a>
|
||||
|
||||
# <a name='Scalar'>Scalar</a>
|
||||
|
||||
## <a name='SkScalar'>Typedef SkScalar</a>
|
||||
|
||||
# <a name='Serial_Procs'>Serial Procs</a>
|
||||
|
||||
# <a name='SkSerialProcs'>Struct SkSerialProcs</a>
|
||||
|
||||
# <a name='Shader'>Shader</a>
|
||||
|
||||
# <a name='SkShader'>Class SkShader</a>
|
||||
<a name='SkSerialProcs'></a>
|
||||
<a name='SkShader'></a>
|
||||
|
||||
## <a name='SkShader_TileMode'>Enum SkShader::TileMode</a>
|
||||
|
||||
@ -554,31 +365,11 @@ static <a href='#sk_sp'>sk sp</a><<a href='#SkShader'>SkShader</a>> <a hre
|
||||
|
||||
---
|
||||
|
||||
# <a name='Size'>Size</a>
|
||||
|
||||
# <a name='SkSize'>Struct SkSize</a>
|
||||
|
||||
# <a name='Sprite'>Sprite</a>
|
||||
|
||||
# <a name='Stream_Asset'>Stream Asset</a>
|
||||
|
||||
# <a name='SkStreamAsset'>Class SkStreamAsset</a>
|
||||
|
||||
# <a name='String'>String</a>
|
||||
|
||||
# <a name='SkString'>Class SkString</a>
|
||||
|
||||
# <a name='Subclasses'>Subclasses</a>
|
||||
|
||||
# <a name='Supersampling'>Supersampling</a>
|
||||
|
||||
# <a name='Surface_Characterization'>Surface Characterization</a>
|
||||
|
||||
# <a name='SkSurfaceCharacterization'>Class SkSurfaceCharacterization</a>
|
||||
|
||||
# <a name='Surface_Properties'>Surface Properties</a>
|
||||
|
||||
# <a name='SkSurfaceProps'>Class SkSurfaceProps</a>
|
||||
<a name='SkSize'></a>
|
||||
<a name='SkStreamAsset'></a>
|
||||
<a name='SkString'></a>
|
||||
<a name='SkSurfaceCharacterization'></a>
|
||||
<a name='SkSurfaceProps'></a>
|
||||
|
||||
## <a name='Legacy_Font_Host'>Legacy Font Host</a>
|
||||
|
||||
@ -600,12 +391,7 @@ static <a href='#sk_sp'>sk sp</a><<a href='#SkShader'>SkShader</a>> <a hre
|
||||
|
||||
#
|
||||
Topic
|
||||
|
||||
# <a name='Text'>Text</a>
|
||||
|
||||
# <a name='Texture'>Texture</a>
|
||||
|
||||
# <a name='GrBackendTexture'>Class GrBackendTexture</a>
|
||||
<a name='GrBackendTexture'></a>
|
||||
|
||||
<a name='GrBackendTexture_isValid'></a>
|
||||
## isValid
|
||||
@ -616,15 +402,10 @@ bool <a href='#GrBackendTexture_isValid'>isValid</a>() const
|
||||
|
||||
---
|
||||
|
||||
# <a name='Transfer_Mode'>Transfer Mode</a>
|
||||
|
||||
# <a name='Typeface'>Typeface</a>
|
||||
|
||||
## <a name='ID'>ID</a>
|
||||
|
||||
## <a name='SkFontID'>Typedef SkFontID</a>
|
||||
|
||||
# <a name='SkTypeface'>Class SkTypeface</a>
|
||||
<a name='SkTypeface'></a>
|
||||
|
||||
<a name='SkTypeface_uniqueID'></a>
|
||||
## uniqueID
|
||||
@ -635,32 +416,12 @@ bool <a href='#GrBackendTexture_isValid'>isValid</a>() const
|
||||
|
||||
---
|
||||
|
||||
# <a name='UV_Mapping'>UV Mapping</a>
|
||||
|
||||
# <a name='Unhinted'>Unhinted</a>
|
||||
|
||||
# <a name='Unpremultiply'>Unpremultiply</a>
|
||||
|
||||
# <a name='Vertices'>Vertices</a>
|
||||
|
||||
# <a name='SkVertices'>Class SkVertices</a>
|
||||
|
||||
# <a name='SkVertices_Bone'>Class SkVertices::Bone</a>
|
||||
<a name='SkVertices'></a>
|
||||
<a name='SkVertices_Bone'></a>
|
||||
|
||||
## <a name='Colors'>Colors</a>
|
||||
|
||||
## <a name='Texs'>Texs</a>
|
||||
|
||||
# <a name='Xfermode_Image_Filter'>Xfermode Image Filter</a>
|
||||
|
||||
# <a name='SkXfermodeImageFilter'>Class SkXfermodeImageFilter</a>
|
||||
|
||||
# <a name='YUV_Component_U'>YUV Component U</a>
|
||||
|
||||
# <a name='YUV_Component_V'>YUV Component V</a>
|
||||
|
||||
# <a name='YUV_Component_Y'>YUV Component Y</a>
|
||||
|
||||
# <a name='YUV_Planes'>YUV Planes</a>
|
||||
|
||||
# <a name='SkYUVAIndex'>Class SkYUVAIndex</a>
|
||||
<a name='SkXfermodeImageFilter'></a>
|
||||
<a name='SkYUVAIndex'></a>
|
@ -1,7 +1,5 @@
|
||||
usingBookmaker
|
||||
===
|
||||
|
||||
# <a name='Bookmaker'>Bookmaker</a>
|
||||
<a href='#Bookmaker'>Bookmaker</a> generates markdown files to view documentation on skia.org, and generates includes for use in C++.
|
||||
<a href='#Bookmaker'>Bookmaker</a> reads canonical documentation from files suffixed with bmh in the docs directory. These bmh
|
||||
files describe how public interfaces work, and generate Skia fiddle examples to illustrate them.
|
||||
|
@ -43,20 +43,6 @@ add check to require #Const to contain #Code block if defining const or constexp
|
||||
subclasses (e.g. Iter in SkPath) need to check for #Line and generate overview
|
||||
subclass methods should also disallow #In
|
||||
|
||||
There are a number of formatting bugs with ad hoc patches where a substitution doesn't keep
|
||||
the space before or after, or the linefeeds before or after. The rules are not very good either.
|
||||
Linefeeds in the bmh file are intended to be respected, but #Formula tends to start on a new line
|
||||
even if the contents is intended to be inlined. Probably need to require it to be, e.g.:
|
||||
|
||||
array length must be #Formula # (fXCount + 1) * (fYCount + 1) ##.
|
||||
|
||||
where there is always a space between prior words and formula (i.e., between "be" and "(fXCount";
|
||||
and, an absense of a space after ## denotes no space between "+ 1)" and ".". These rules preserve
|
||||
that # commands are always preceded by a whitespace character. Similarly, #PhraseDef/Ref
|
||||
need to be inline or create new paragraphs. #phrase_ref# is sufficiently flexible that it can be
|
||||
treated as a word without trailing whitespace, adapting the whitespace of its context. It also must
|
||||
always have leading whitespace.
|
||||
|
||||
It's awkward that phrase param is a child of the phrase def. Since phrase refs may also be children,
|
||||
there is special case code to skip phrase def when looking for additional substitutions in the
|
||||
phrase def. Could put it in the token list instead I guess, or make a definition subclass used
|
||||
@ -68,6 +54,13 @@ has #Const children. If so, generate a summary table first.
|
||||
Or, only allow #Line and moderate text description in #Const. Put more verbose text, example,
|
||||
seealso, in subsequent #SubTopic. Alpha_Type does this and it looks good.
|
||||
|
||||
IPoint is awkward. SkPoint and SkIPoint are named things; Point is a topic, which
|
||||
refers to float points or integer points. There needn't be an IPoint topic.
|
||||
One way to resolve this would be to combine SkPoint_Reference and SkIPoint_Reference into
|
||||
Point_Reference that then contains both structs (or just move SKIPoint into SkPoint_Reference).
|
||||
Most Point references would be replaced with SkPoint / SkIPoint (if that's what they mean),
|
||||
or remain Point if the text indicates the concept rather one of the C structs.
|
||||
|
||||
see head of selfCheck.cpp for additional todos
|
||||
see head of spellCheck.cpp for additional todos
|
||||
*/
|
||||
@ -140,7 +133,7 @@ BmhParser::MarkProps BmhParser::kMarkProps[] = {
|
||||
, { "List", MarkType::kList, R_Y, E_N, M(Method) | M_CSST | M_E | M_D }
|
||||
, { "Literal", MarkType::kLiteral, R_N, E_N, M(Code) }
|
||||
, { "", MarkType::kMarkChar, R_N, E_N, 0 }
|
||||
, { "Member", MarkType::kMember, R_Y, E_N, M_CSST }
|
||||
, { "Member", MarkType::kMember, R_Y, E_O, M_CSST }
|
||||
, { "Method", MarkType::kMethod, R_Y, E_Y, M_CSST }
|
||||
, { "NoExample", MarkType::kNoExample, R_N, E_N, M_CSST | M_E | M_MD }
|
||||
, { "NoJustify", MarkType::kNoJustify, R_N, E_N, M(Const) | M(Member) }
|
||||
@ -150,7 +143,7 @@ BmhParser::MarkProps BmhParser::kMarkProps[] = {
|
||||
, { "", MarkType::kPhraseParam, R_Y, E_N, 0 }
|
||||
, { "", MarkType::kPhraseRef, R_N, E_N, 0 }
|
||||
, { "Platform", MarkType::kPlatform, R_N, E_N, M(Example) | M(NoExample) }
|
||||
, { "Populate", MarkType::kPopulate, R_N, E_N, M(Subtopic) }
|
||||
, { "Populate", MarkType::kPopulate, R_N, E_N, M_CS | M(Code) }
|
||||
, { "Private", MarkType::kPrivate, R_N, E_N, M_CSST | M_MDCM | M_E }
|
||||
, { "Return", MarkType::kReturn, R_Y, E_N, M(Method) }
|
||||
, { "", MarkType::kRow, R_Y, E_N, M(Table) | M(List) }
|
||||
@ -159,14 +152,15 @@ BmhParser::MarkProps BmhParser::kMarkProps[] = {
|
||||
, { "StdOut", MarkType::kStdOut, R_N, E_N, M(Example) | M(NoExample) }
|
||||
, { "Struct", MarkType::kStruct, R_Y, E_O, M(Class) | M_ST }
|
||||
, { "Substitute", MarkType::kSubstitute, R_N, E_N, M(Alias) | M_ST }
|
||||
, { "Subtopic", MarkType::kSubtopic, R_Y, E_Y, M_CSST }
|
||||
, { "Subtopic", MarkType::kSubtopic, R_Y, E_Y, M_CSST | M_E }
|
||||
, { "Table", MarkType::kTable, R_Y, E_N, M(Method) | M_CSST | M_E }
|
||||
, { "Template", MarkType::kTemplate, R_Y, E_N, M_CSST }
|
||||
, { "", MarkType::kText, R_N, E_N, 0 }
|
||||
, { "ToDo", MarkType::kToDo, R_N, E_N, 0 }
|
||||
, { "Topic", MarkType::kTopic, R_Y, E_Y, 0 }
|
||||
, { "Typedef", MarkType::kTypedef, R_Y, E_N, M_CSST | M_E }
|
||||
, { "Typedef", MarkType::kTypedef, R_Y, E_O, M_CSST | M_E }
|
||||
, { "Union", MarkType::kUnion, R_Y, E_N, M_CSST }
|
||||
, { "Using", MarkType::kUsing, R_Y, E_O, M_CSST }
|
||||
, { "Volatile", MarkType::kVolatile, R_N, E_N, M(StdOut) }
|
||||
, { "Width", MarkType::kWidth, R_N, E_N, M(Example) | M(NoExample) }
|
||||
};
|
||||
@ -234,7 +228,8 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
if (!hasEnd && fRoot->find(name, RootDefinition::AllowParens::kNo)) {
|
||||
return this->reportError<bool>("duplicate symbol");
|
||||
}
|
||||
if (MarkType::kStruct == markType || MarkType::kClass == markType) {
|
||||
if (MarkType::kStruct == markType || MarkType::kClass == markType
|
||||
|| MarkType::kEnumClass == markType) {
|
||||
// if class or struct, build fRoot hierarchy
|
||||
// and change isDefined to search all parents of fRoot
|
||||
SkASSERT(!hasEnd);
|
||||
@ -1029,6 +1024,10 @@ static void add_code(string text, int pos, int end,
|
||||
} while (pos < end);
|
||||
}
|
||||
|
||||
bool BmhParser::IsExemplary(const Definition* def) {
|
||||
return kMarkProps[(int) def->fMarkType].fExemplary != Exemplary::kNo;
|
||||
}
|
||||
|
||||
bool BmhParser::exampleToScript(Definition* def, ExampleOptions exampleOptions,
|
||||
string* result) const {
|
||||
bool hasFiddle = true;
|
||||
@ -2053,10 +2052,14 @@ void TextParser::reportError(const char* errorStr) const {
|
||||
}
|
||||
|
||||
void TextParser::reportWarning(const char* errorStr) const {
|
||||
SkASSERT(fLine < fEnd);
|
||||
TextParser err(fFileName, fLine, fEnd, fLineCount);
|
||||
const char* lineStart = fLine;
|
||||
if (lineStart >= fEnd) {
|
||||
lineStart = fChar;
|
||||
}
|
||||
SkASSERT(lineStart < fEnd);
|
||||
TextParser err(fFileName, lineStart, fEnd, fLineCount);
|
||||
size_t lineLen = this->lineLength();
|
||||
ptrdiff_t spaces = fChar - fLine;
|
||||
ptrdiff_t spaces = fChar - lineStart;
|
||||
while (spaces > 0 && (size_t) spaces > lineLen) {
|
||||
++err.fLineCount;
|
||||
err.fLine += lineLen;
|
||||
@ -2756,15 +2759,19 @@ int main(int argc, char** const argv) {
|
||||
if (!done && !FLAGS_ref.isEmpty() && FLAGS_examples.isEmpty()) {
|
||||
IncludeParser includeParser;
|
||||
includeParser.validate();
|
||||
if (!FLAGS_status.isEmpty() && !includeParser.parseStatus(FLAGS_status[0], ".h",
|
||||
StatusFilter::kCompleted)) {
|
||||
return -1;
|
||||
}
|
||||
if (!FLAGS_include.isEmpty() && !includeParser.parseFile(FLAGS_include[0], ".h",
|
||||
ParserCommon::OneFile::kYes)) {
|
||||
return -1;
|
||||
}
|
||||
MdOut mdOut(bmhParser);
|
||||
includeParser.writeCodeBlock(bmhParser);
|
||||
MdOut mdOut(bmhParser, includeParser);
|
||||
mdOut.fDebugOut = FLAGS_stdout;
|
||||
mdOut.fValidate = FLAGS_validate;
|
||||
if (!FLAGS_bmh.isEmpty() && mdOut.buildReferences(includeParser,
|
||||
FLAGS_bmh[0], FLAGS_ref[0])) {
|
||||
if (!FLAGS_bmh.isEmpty() && mdOut.buildReferences(FLAGS_bmh[0], FLAGS_ref[0])) {
|
||||
bmhParser.fWroteOut = true;
|
||||
}
|
||||
if (!FLAGS_status.isEmpty() && mdOut.buildStatus(FLAGS_status[0], FLAGS_ref[0])) {
|
||||
|
@ -81,6 +81,7 @@ enum class KeyWord {
|
||||
kUintPtr_t,
|
||||
kUnion,
|
||||
kUnsigned,
|
||||
kUsing,
|
||||
kVoid,
|
||||
};
|
||||
|
||||
@ -144,6 +145,7 @@ enum class MarkType {
|
||||
kTopic,
|
||||
kTypedef,
|
||||
kUnion,
|
||||
kUsing,
|
||||
kVolatile,
|
||||
kWidth,
|
||||
};
|
||||
@ -300,8 +302,11 @@ public:
|
||||
}
|
||||
|
||||
bool contains(const char* match, const char* lineEnd, const char** loc) const {
|
||||
*loc = this->strnstr(match, lineEnd);
|
||||
return *loc;
|
||||
const char* result = this->strnstr(match, lineEnd);
|
||||
if (loc) {
|
||||
*loc = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// either /n/n or /n# will stop parsing a typedef
|
||||
@ -406,6 +411,18 @@ public:
|
||||
|
||||
void setForErrorReporting(const Definition* , const char* );
|
||||
|
||||
bool skipToBalancedEndBracket(char startB, char endB) {
|
||||
SkASSERT(fChar < fEnd);
|
||||
SkASSERT(startB == fChar[0]);
|
||||
int startCount = 0;
|
||||
do {
|
||||
char test = this->next();
|
||||
startCount += startB == test;
|
||||
startCount -= endB == test;
|
||||
} while (startCount && fChar < fEnd);
|
||||
return !startCount;
|
||||
}
|
||||
|
||||
bool skipToEndBracket(char endBracket, const char* end = nullptr) {
|
||||
if (nullptr == end) {
|
||||
end = fEnd;
|
||||
@ -446,10 +463,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void skipToAlphaNum() {
|
||||
// returns true if saw close brace
|
||||
bool skipToAlphaNum() {
|
||||
bool sawCloseBrace = false;
|
||||
while (fChar < fEnd && !isalnum(fChar[0])) {
|
||||
fChar++;
|
||||
sawCloseBrace |= '}' == *fChar++;
|
||||
}
|
||||
return sawCloseBrace;
|
||||
}
|
||||
|
||||
bool skipExact(const char* pattern) {
|
||||
@ -473,6 +493,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int skipToLineBalance(char open, char close) {
|
||||
int match = 0;
|
||||
while (!this->eof() && '\n' != fChar[0]) {
|
||||
match += open == this->peek();
|
||||
match -= close == this->next();
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
bool skipToLineStart() {
|
||||
if (!this->skipLine()) {
|
||||
return false;
|
||||
@ -483,6 +512,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void skipToLineStart(int* indent, bool* sawReturn) {
|
||||
SkAssertResult(this->skipLine());
|
||||
this->skipWhiteSpace(indent, sawReturn);
|
||||
}
|
||||
|
||||
void skipLower() {
|
||||
while (fChar < fEnd && (islower(fChar[0]) || '_' == fChar[0])) {
|
||||
fChar++;
|
||||
@ -570,6 +604,18 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void skipWhiteSpace(int* indent, bool* skippedReturn) {
|
||||
while (' ' >= this->peek()) {
|
||||
*indent = *skippedReturn ? *indent + 1 : 1;
|
||||
if ('\n' == this->peek()) {
|
||||
*skippedReturn |= true;
|
||||
*indent = 0;
|
||||
}
|
||||
(void) this->next();
|
||||
SkASSERT(fChar < fEnd);
|
||||
}
|
||||
}
|
||||
|
||||
bool startsWith(const char* str) const {
|
||||
size_t len = strlen(str);
|
||||
ptrdiff_t lineLen = fEnd - fChar;
|
||||
@ -992,6 +1038,7 @@ public:
|
||||
const char* fContentStart; // start past optional markup name
|
||||
string fName;
|
||||
string fFiddle; // if its a constructor or operator, fiddle name goes here
|
||||
string fCode; // suitable for autogeneration of #Code blocks in bmh
|
||||
const char* fContentEnd = nullptr; // the end of the contained text
|
||||
const char* fTerminator = nullptr; // the end of the markup, normally ##\n or \n
|
||||
Definition* fParent = nullptr;
|
||||
@ -1023,17 +1070,17 @@ public:
|
||||
|
||||
class SubtopicKeys {
|
||||
public:
|
||||
static constexpr const char* kClasses = "Class";
|
||||
static constexpr const char* kConstants = "Constant";
|
||||
static constexpr const char* kConstructors = "Constructor";
|
||||
static constexpr const char* kDefines = "Define";
|
||||
static constexpr const char* kMemberFunctions = "Member_Function";
|
||||
static constexpr const char* kMembers = "Member";
|
||||
static constexpr const char* kOperators = "Operator";
|
||||
static constexpr const char* kClasses = "Classes";
|
||||
static constexpr const char* kConstants = "Constants";
|
||||
static constexpr const char* kConstructors = "Constructors";
|
||||
static constexpr const char* kDefines = "Defines";
|
||||
static constexpr const char* kMemberFunctions = "Member_Functions";
|
||||
static constexpr const char* kMembers = "Members";
|
||||
static constexpr const char* kOperators = "Operators";
|
||||
static constexpr const char* kOverview = "Overview";
|
||||
static constexpr const char* kRelatedFunctions = "Related_Function";
|
||||
static constexpr const char* kStructs = "Struct";
|
||||
static constexpr const char* kTypedefs = "Typedef";
|
||||
static constexpr const char* kRelatedFunctions = "Related_Functions";
|
||||
static constexpr const char* kStructs = "Structs";
|
||||
static constexpr const char* kTypedefs = "Typedefs";
|
||||
|
||||
static const char* kGeneratedSubtopics[];
|
||||
};
|
||||
@ -1255,6 +1302,7 @@ public:
|
||||
fPendingSpace = 0;
|
||||
fOutdentNext = false;
|
||||
fWritingIncludes = false;
|
||||
fDebugWriteCodeBlock = false;
|
||||
nl();
|
||||
}
|
||||
|
||||
@ -1270,6 +1318,10 @@ public:
|
||||
fMaxLF = 1;
|
||||
}
|
||||
|
||||
void stringAppend(string& result, char ch) const;
|
||||
void stringAppend(string& result, string str) const;
|
||||
void stringAppend(string& result, const Definition* ) const;
|
||||
|
||||
void writeBlock(int size, const char* data) {
|
||||
SkAssertResult(writeBlockTrim(size, data));
|
||||
}
|
||||
@ -1341,6 +1393,7 @@ public:
|
||||
bool fWroteSomething; // used to detect empty content; an alternative source is preferable
|
||||
bool fReturnOnWrite; // used to detect non-empty content; allowing early return
|
||||
bool fWritingIncludes; // set true when writing includes to check >100 columns
|
||||
mutable bool fDebugWriteCodeBlock;
|
||||
|
||||
private:
|
||||
typedef TextParser INHERITED;
|
||||
@ -1350,6 +1403,7 @@ struct JsonStatus {
|
||||
const Json::Value& fObject;
|
||||
Json::Value::iterator fIter;
|
||||
string fName;
|
||||
StatusFilter fStatusFilter;
|
||||
};
|
||||
|
||||
class JsonCommon : public ParserCommon {
|
||||
@ -1373,7 +1427,7 @@ public:
|
||||
StatusIter(const char* statusFile, const char* suffix, StatusFilter);
|
||||
~StatusIter() override {}
|
||||
string baseDir();
|
||||
bool next(string* file);
|
||||
bool next(string* file, StatusFilter* filter);
|
||||
private:
|
||||
const char* fSuffix;
|
||||
StatusFilter fFilter;
|
||||
@ -1463,6 +1517,7 @@ public:
|
||||
Definition* findExample(string name) const;
|
||||
MarkType getMarkType(MarkLookup lookup) const;
|
||||
bool hasEndToken() const;
|
||||
static bool IsExemplary(const Definition* );
|
||||
string memberName();
|
||||
string methodName();
|
||||
const Definition* parentSpace() const;
|
||||
@ -1568,6 +1623,49 @@ public:
|
||||
kYes,
|
||||
};
|
||||
|
||||
enum class Elided {
|
||||
kNo,
|
||||
kYes,
|
||||
};
|
||||
|
||||
struct CheckCode {
|
||||
enum class State {
|
||||
kNone,
|
||||
kClassDeclaration,
|
||||
kConstructor,
|
||||
kForwardDeclaration,
|
||||
kMethod,
|
||||
};
|
||||
|
||||
void reset() {
|
||||
fInDebugCode = nullptr;
|
||||
fPrivateBrace = 0;
|
||||
fBraceCount = 0;
|
||||
fIndent = 0;
|
||||
fDoubleReturn = 0;
|
||||
fState = State::kNone;
|
||||
fPrivateProtected = false;
|
||||
fTypedefReturn = false;
|
||||
fSkipAPI = false;
|
||||
fSkipInline = false;
|
||||
fSkipWarnUnused = false;
|
||||
fWriteReturn = false;
|
||||
}
|
||||
|
||||
const char* fInDebugCode;
|
||||
int fPrivateBrace;
|
||||
int fBraceCount;
|
||||
int fIndent;
|
||||
int fDoubleReturn;
|
||||
State fState;
|
||||
bool fPrivateProtected;
|
||||
bool fTypedefReturn;
|
||||
bool fSkipAPI;
|
||||
bool fSkipInline;
|
||||
bool fSkipWarnUnused;
|
||||
bool fWriteReturn;
|
||||
};
|
||||
|
||||
IncludeParser() : ParserCommon()
|
||||
, fMaps {
|
||||
{ &fIConstMap, MarkType::kConst }
|
||||
@ -1596,11 +1694,35 @@ public:
|
||||
fIncludeWord = nullptr;
|
||||
}
|
||||
|
||||
bool advanceInclude(TextParser& i);
|
||||
bool inAlignAs() const;
|
||||
void checkForMissingParams(const vector<string>& methodParams,
|
||||
const vector<string>& foundParams);
|
||||
bool checkForWord();
|
||||
string className() const;
|
||||
|
||||
string codeBlock(const Definition& def, bool inProgress) const {
|
||||
return codeBlock(def.fMarkType, def.fName, inProgress);
|
||||
}
|
||||
|
||||
string codeBlock(MarkType markType, string name, bool inProgress) const {
|
||||
if (MarkType::kClass == markType || MarkType::kStruct == markType) {
|
||||
auto map = fIClassMap.find(name);
|
||||
SkASSERT(fIClassMap.end() != map || inProgress);
|
||||
return fIClassMap.end() != map ? map->second.fCode : "";
|
||||
}
|
||||
if (MarkType::kEnum == markType || MarkType::kEnumClass == markType) {
|
||||
auto map = fIEnumMap.find(name);
|
||||
SkASSERT(fIEnumMap.end() != map);
|
||||
return map->second->fCode;
|
||||
}
|
||||
SkASSERT(0);
|
||||
return "";
|
||||
}
|
||||
|
||||
void codeBlockAppend(string& result, char ch) const;
|
||||
void codeBlockSpaces(string& result, int indent) const;
|
||||
|
||||
bool crossCheck(BmhParser& );
|
||||
IClassDefinition* defineClass(const Definition& includeDef, string className);
|
||||
void dumpClassTokens(IClassDefinition& classDef);
|
||||
@ -1616,11 +1738,13 @@ public:
|
||||
bool dumpTokens(string skClassName, string globalFileName, long int* globalTell);
|
||||
void dumpTypedef(const Definition& , string className);
|
||||
|
||||
string elidedCodeBlock(const Definition& );
|
||||
bool findComments(const Definition& includeDef, Definition* markupDef);
|
||||
Definition* findIncludeObject(const Definition& includeDef, MarkType markType,
|
||||
string typeName);
|
||||
static KeyWord FindKey(const char* start, const char* end);
|
||||
Bracket grandParentBracket() const;
|
||||
const Definition* include(string ) const;
|
||||
bool isClone(const Definition& token);
|
||||
bool isConstructor(const Definition& token, string className);
|
||||
bool isInternalName(const Definition& token);
|
||||
@ -1651,6 +1775,7 @@ public:
|
||||
bool parseObjects(Definition* parent, Definition* markupDef);
|
||||
bool parseTemplate(Definition* child, Definition* markupDef);
|
||||
bool parseTypedef(Definition* child, Definition* markupDef);
|
||||
bool parseUsing();
|
||||
bool parseUnion();
|
||||
|
||||
void popBracket() {
|
||||
@ -1724,6 +1849,9 @@ public:
|
||||
}
|
||||
|
||||
void validate() const;
|
||||
void writeCodeBlock(const BmhParser& );
|
||||
string writeCodeBlock(const Definition&, MarkType );
|
||||
string writeCodeBlock(TextParser& i, MarkType , int indent);
|
||||
|
||||
void writeDefinition(const Definition& def) {
|
||||
if (def.length() > 1) {
|
||||
@ -1877,6 +2005,7 @@ protected:
|
||||
unordered_map<string, Definition*> fITemplateMap;
|
||||
unordered_map<string, Definition*> fITypedefMap;
|
||||
unordered_map<string, Definition*> fIUnionMap;
|
||||
CheckCode fCheck;
|
||||
Definition* fRootTopic;
|
||||
Definition* fConstExpr;
|
||||
Definition* fInBrace;
|
||||
@ -1886,6 +2015,7 @@ protected:
|
||||
const Definition* fAttrDeprecated;
|
||||
int fPriorIndex;
|
||||
const char* fIncludeWord;
|
||||
Elided fElided;
|
||||
char fPrev;
|
||||
bool fInChar;
|
||||
bool fInCharCommentString;
|
||||
@ -2251,18 +2381,20 @@ private:
|
||||
class MdOut : public ParserCommon {
|
||||
public:
|
||||
struct SubtopicDescriptions {
|
||||
string fName;
|
||||
string fSingular;
|
||||
string fPlural;
|
||||
string fOneLiner;
|
||||
string fDetails;
|
||||
};
|
||||
|
||||
MdOut(BmhParser& bmh) : ParserCommon()
|
||||
, fBmhParser(bmh) {
|
||||
MdOut(BmhParser& bmh, IncludeParser& inc) : ParserCommon()
|
||||
, fBmhParser(bmh)
|
||||
, fIncludeParser(inc) {
|
||||
this->reset();
|
||||
this->addPopulators();
|
||||
}
|
||||
|
||||
bool buildReferences(const IncludeParser& , const char* docDir, const char* mdOutDirOrFile);
|
||||
bool buildReferences(const char* docDir, const char* mdOutDirOrFile);
|
||||
bool buildStatus(const char* docDir, const char* mdOutDir);
|
||||
void checkAnchors();
|
||||
|
||||
@ -2278,6 +2410,7 @@ private:
|
||||
MarkType fMarkType;
|
||||
};
|
||||
|
||||
void addCodeBlock(const Definition* def, string& str) const;
|
||||
void addPopulators();
|
||||
string addReferences(const char* start, const char* end, BmhParser::Resolvable );
|
||||
string anchorDef(string def, string name);
|
||||
@ -2327,6 +2460,8 @@ private:
|
||||
fResolveAndIndent = false;
|
||||
fLiteralAndIndent = false;
|
||||
fLastDef = nullptr;
|
||||
fParamEnd = nullptr;
|
||||
fInProgress = false;
|
||||
}
|
||||
|
||||
BmhParser::Resolvable resolvable(const Definition* definition) const {
|
||||
@ -2346,10 +2481,14 @@ private:
|
||||
}
|
||||
|
||||
void resolveOut(const char* start, const char* end, BmhParser::Resolvable );
|
||||
void rowOut(string col1, const Definition* col2);
|
||||
void rowOut(const char * name, string description, bool literalName);
|
||||
|
||||
void subtopicOut(string name);
|
||||
void subtopicsOut(Definition* def);
|
||||
void subtopicOut(string key, const vector<Definition*>& data, const Definition* csParent,
|
||||
const Definition* topicParent, bool showClones);
|
||||
bool subtopicRowOut(string keyName, const Definition* entry);
|
||||
void summaryOut(const Definition* def, MarkType , string name);
|
||||
string tableDataCodeDef(const Definition* def);
|
||||
string tableDataCodeDef(string def, string name);
|
||||
@ -2357,14 +2496,16 @@ private:
|
||||
string tableDataCodeLocalRef(string ref, string name);
|
||||
string tableDataCodeRef(const Definition* ref);
|
||||
string tableDataCodeRef(string ref, string name);
|
||||
void writeSubtopicTableHeader(string key);
|
||||
|
||||
vector<const Definition*> fClassStack;
|
||||
unordered_map<string, vector<AnchorDef> > fAllAnchorDefs;
|
||||
unordered_map<string, vector<string> > fAllAnchorRefs;
|
||||
|
||||
BmhParser& fBmhParser;
|
||||
IncludeParser& fIncludeParser;
|
||||
const Definition* fEnumClass;
|
||||
const Definition* fLastDef;
|
||||
const Definition* fLastDef;
|
||||
Definition* fMethod;
|
||||
RootDefinition* fRoot; // used in generating populated tables; always struct or class
|
||||
RootDefinition* fSubtopic; // used in resolving symbols
|
||||
@ -2372,6 +2513,7 @@ private:
|
||||
TableState fTableState;
|
||||
unordered_map<string, SubtopicDescriptions> fPopulators;
|
||||
unordered_map<string, string> fPhraseParams;
|
||||
const char* fParamEnd;
|
||||
bool fAddRefFailed;
|
||||
bool fHasFiddle;
|
||||
bool fInDescription; // FIXME: for now, ignore unfound camelCase in description since it may
|
||||
@ -2381,6 +2523,7 @@ private:
|
||||
bool fResolveAndIndent;
|
||||
bool fOddRow;
|
||||
bool fHasDetails;
|
||||
bool fInProgress;
|
||||
typedef ParserCommon INHERITED;
|
||||
};
|
||||
|
||||
@ -2391,8 +2534,7 @@ public:
|
||||
MethodParser(string className, string fileName,
|
||||
const char* start, const char* end, int lineCount)
|
||||
: TextParser(fileName, start, end, lineCount)
|
||||
, fClassName(className)
|
||||
, fLocalName(className) {
|
||||
, fClassName(className) {
|
||||
size_t doubleColons = className.find_last_of("::");
|
||||
if (string::npos != doubleColons) {
|
||||
fLocalName = className.substr(doubleColons + 1);
|
||||
@ -2402,37 +2544,53 @@ public:
|
||||
|
||||
~MethodParser() override {}
|
||||
|
||||
void skipToMethodStart() {
|
||||
if (!fClassName.length()) {
|
||||
this->skipToAlphaNum();
|
||||
return;
|
||||
string localName() const {
|
||||
return fLocalName;
|
||||
}
|
||||
|
||||
void setLocalName(string name) {
|
||||
if (name == fClassName) {
|
||||
fLocalName = "";
|
||||
} else {
|
||||
fLocalName = name;
|
||||
}
|
||||
}
|
||||
|
||||
// returns true if close brace was skipped
|
||||
int skipToMethodStart() {
|
||||
if (!fClassName.length()) {
|
||||
return this->skipToAlphaNum();
|
||||
}
|
||||
int braceCount = 0;
|
||||
while (!this->eof() && !isalnum(this->peek()) && '~' != this->peek()) {
|
||||
braceCount += '{' == this->peek();
|
||||
braceCount -= '}' == this->peek();
|
||||
this->next();
|
||||
}
|
||||
return braceCount;
|
||||
}
|
||||
|
||||
void skipToMethodEnd(BmhParser::Resolvable resolvable) {
|
||||
if (this->eof()) {
|
||||
return;
|
||||
}
|
||||
if (fLocalName.length()) {
|
||||
if ('~' == this->peek()) {
|
||||
this->next();
|
||||
if (!this->startsWith(fLocalName.c_str())) {
|
||||
--fChar;
|
||||
return;
|
||||
}
|
||||
string name = fLocalName.length() ? fLocalName : fClassName;
|
||||
if ('~' == this->peek()) {
|
||||
this->next();
|
||||
if (!this->startsWith(name.c_str())) {
|
||||
--fChar;
|
||||
return;
|
||||
}
|
||||
if (BmhParser::Resolvable::kSimple != resolvable
|
||||
&& (this->startsWith(fLocalName.c_str()) || this->startsWith("operator"))) {
|
||||
const char* ptr = this->anyOf("\n (");
|
||||
if (ptr && '(' == *ptr && strncmp(ptr, "(...", 4)) {
|
||||
this->skipToEndBracket(')');
|
||||
SkAssertResult(')' == this->next());
|
||||
this->skipExact("_const");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (BmhParser::Resolvable::kSimple != resolvable
|
||||
&& (this->startsWith(name.c_str()) || this->startsWith("operator"))) {
|
||||
const char* ptr = this->anyOf("\n (");
|
||||
if (ptr && '(' == *ptr && strncmp(ptr, "(...", 4)) {
|
||||
this->skipToEndBracket(')');
|
||||
SkAssertResult(')' == this->next());
|
||||
this->skipExact("_const") || (BmhParser::Resolvable::kCode == resolvable
|
||||
&& this->skipExact(" const"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this->startsWith("Sk") && this->wordEndsWith(".h")) { // allow include refs
|
||||
|
@ -51,10 +51,9 @@ bool Catalog::openCatalog(const char* inDir) {
|
||||
|
||||
bool Catalog::openStatus(const char* statusFile) {
|
||||
StatusIter iter(statusFile, ".bmh", StatusFilter::kInProgress);
|
||||
string unused;
|
||||
// FIXME: iterate through only chosen files by setting fDocsDir to iter
|
||||
// read one file to find directory
|
||||
if (!iter.next(&unused)) {
|
||||
if (!iter.next(nullptr, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
return openCatalog(iter.baseDir().c_str());
|
||||
|
@ -39,7 +39,6 @@ enum class OpType : int8_t {
|
||||
kVoid,
|
||||
kBool,
|
||||
kChar,
|
||||
kFloat,
|
||||
kInt,
|
||||
kScalar,
|
||||
kSizeT,
|
||||
@ -117,7 +116,9 @@ const struct OperatorParser {
|
||||
{{ BLANK, OpType::kThis, OpMod::kMove, }}},
|
||||
{ DEFOP::kMultiply, "*", "multiply", BLANK, OpType::kThis, OpMod::kNone, CONST,
|
||||
{{ BLANK, OpType::kScalar, OpMod::kNone, }}},
|
||||
{ DEFOP::kMultiply, "*", "multiply1", BLANK, OpType::kThis, OpMod::kNone, BLANK,
|
||||
{ DEFOP::kMultiply, "*", "multiply1", BLANK, OpType::kThis, OpMod::kNone, CONST,
|
||||
{{ CONST, OpType::kThis, OpMod::kReference, }}},
|
||||
{ DEFOP::kMultiply, "*", "multiply2", BLANK, OpType::kThis, OpMod::kNone, BLANK,
|
||||
{{ CONST, OpType::kThis, OpMod::kReference, },
|
||||
{ CONST, OpType::kThis, OpMod::kReference, }}},
|
||||
{ DEFOP::kMultiplyBy, "*=", "multiplyby", BLANK, OpType::kThis, OpMod::kReference, BLANK,
|
||||
@ -144,7 +145,10 @@ OpType lookup_type(string typeWord, string name) {
|
||||
|| (typeWord == "SkVector" && name == "SkPoint")) {
|
||||
return OpType::kThis;
|
||||
}
|
||||
const char* keyWords[] = { "void", "bool", "char", "float", "int", "SkScalar", "size_t" };
|
||||
if ("float" == typeWord || "double" == typeWord) {
|
||||
return OpType::kScalar;
|
||||
}
|
||||
const char* keyWords[] = { "void", "bool", "char", "int", "SkScalar", "size_t" };
|
||||
for (unsigned i = 0; i < SK_ARRAY_COUNT(keyWords); ++i) {
|
||||
if (typeWord == keyWords[i]) {
|
||||
return (OpType) (i + 1);
|
||||
@ -655,6 +659,9 @@ bool Definition::crossCheckInside(const char* start, const char* end,
|
||||
if (inc.startsWith("SK_API")) {
|
||||
inc.skipWord("SK_API");
|
||||
}
|
||||
if (inc.startsWith("inline")) {
|
||||
inc.skipWord("inline");
|
||||
}
|
||||
if (inc.startsWith("friend")) {
|
||||
inc.skipWord("friend");
|
||||
}
|
||||
@ -700,6 +707,9 @@ bool Definition::crossCheckInside(const char* start, const char* end,
|
||||
char defCh;
|
||||
do {
|
||||
defCh = def.next();
|
||||
if (inc.skipExact("SK_WARN_UNUSED_RESULT")) {
|
||||
inc.skipSpace();
|
||||
}
|
||||
char incCh = inc.next();
|
||||
if (' ' >= defCh && ' ' >= incCh) {
|
||||
break;
|
||||
@ -800,8 +810,12 @@ string Definition::formatFunction(Format format) const {
|
||||
if (lastStart[0] != ' ') {
|
||||
space_pad(&methodStr);
|
||||
}
|
||||
methodStr += string(lastStart, (size_t) (lastEnd - lastStart));
|
||||
written += (size_t) (lastEnd - lastStart);
|
||||
string addon(lastStart, (size_t) (lastEnd - lastStart));
|
||||
if ("_const" == addon) {
|
||||
addon = "const";
|
||||
}
|
||||
methodStr += addon;
|
||||
written += addon.length();
|
||||
}
|
||||
if (delimiter) {
|
||||
if (nextEnd - nextStart >= (ptrdiff_t) (limit - written)) {
|
||||
|
@ -55,6 +55,7 @@ const IncludeKey kKeyWords[] = {
|
||||
{ "uintptr_t", KeyWord::kUintPtr_t, KeyProperty::kNumber },
|
||||
{ "union", KeyWord::kUnion, KeyProperty::kObject },
|
||||
{ "unsigned", KeyWord::kUnsigned, KeyProperty::kNumber },
|
||||
{ "using", KeyWord::kUsing, KeyProperty::kObject },
|
||||
{ "void", KeyWord::kVoid, KeyProperty::kNumber },
|
||||
};
|
||||
|
||||
@ -65,7 +66,8 @@ KeyWord IncludeParser::FindKey(const char* start, const char* end) {
|
||||
for (size_t index = 0; index < kKeyWordCount; ) {
|
||||
if (start[ch] > kKeyWords[index].fName[ch]) {
|
||||
++index;
|
||||
if (ch > 0 && kKeyWords[index - 1].fName[ch - 1] < kKeyWords[index].fName[ch - 1]) {
|
||||
if (ch > 0 && (index == kKeyWordCount ||
|
||||
kKeyWords[index - 1].fName[ch - 1] < kKeyWords[index].fName[ch - 1])) {
|
||||
return KeyWord::kNone;
|
||||
}
|
||||
continue;
|
||||
@ -104,6 +106,394 @@ void IncludeParser::addKeyword(KeyWord keyWord) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool looks_like_method(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fLine, tp.fChar, tp.fLineCount);
|
||||
t.skipSpace();
|
||||
if (!t.skipExact("struct") && !t.skipExact("class") && !t.skipExact("enum class")
|
||||
&& !t.skipExact("enum")) {
|
||||
return true;
|
||||
}
|
||||
t.skipSpace();
|
||||
if (t.skipExact("SK_API")) {
|
||||
t.skipSpace();
|
||||
}
|
||||
if (!isupper(t.peek())) {
|
||||
return true;
|
||||
}
|
||||
return nullptr != t.strnchr('(', t.fEnd);
|
||||
}
|
||||
|
||||
static bool looks_like_forward_declaration(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fChar, tp.lineEnd(), tp.fLineCount);
|
||||
t.skipSpace();
|
||||
if (!t.skipExact("struct") && !t.skipExact("class") && !t.skipExact("enum class")
|
||||
&& !t.skipExact("enum")) {
|
||||
return false;
|
||||
}
|
||||
t.skipSpace();
|
||||
if (t.skipExact("SK_API")) {
|
||||
t.skipSpace();
|
||||
}
|
||||
if (!isupper(t.peek())) {
|
||||
return false;
|
||||
}
|
||||
t.skipToNonAlphaNum();
|
||||
if (t.eof() || ';' != t.next()) {
|
||||
return false;
|
||||
}
|
||||
if (t.eof() || '\n' != t.next()) {
|
||||
return false;
|
||||
}
|
||||
return t.eof();
|
||||
}
|
||||
|
||||
static bool looks_like_constructor(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fLine, tp.lineEnd(), tp.fLineCount);
|
||||
t.skipSpace();
|
||||
if (!isupper(t.peek())) {
|
||||
if (':' == t.next() && ' ' >= t.peek()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
t.skipToNonAlphaNum();
|
||||
if ('(' != t.peek()) {
|
||||
return false;
|
||||
}
|
||||
if (!t.skipToEndBracket(')')) {
|
||||
return false;
|
||||
}
|
||||
SkAssertResult(')' == t.next());
|
||||
t.skipSpace();
|
||||
return tp.fChar == t.fChar;
|
||||
}
|
||||
|
||||
static bool looks_like_class_decl(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fLine, tp.fChar, tp.fLineCount);
|
||||
t.skipSpace();
|
||||
if (!t.skipExact("class")) {
|
||||
return false;
|
||||
}
|
||||
t.skipSpace();
|
||||
if (t.skipExact("SK_API")) {
|
||||
t.skipSpace();
|
||||
}
|
||||
if (!isupper(t.peek())) {
|
||||
return false;
|
||||
}
|
||||
t.skipToNonAlphaNum();
|
||||
return !t.skipToEndBracket('(');
|
||||
}
|
||||
|
||||
static bool looks_like_const(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fChar, tp.lineEnd(), tp.fLineCount);
|
||||
if (!t.startsWith("static constexpr ")) {
|
||||
return false;
|
||||
}
|
||||
if (t.skipToEndBracket(" k")) {
|
||||
SkAssertResult(t.skipExact(" k"));
|
||||
} else if (t.skipToEndBracket(" SK_")) {
|
||||
SkAssertResult(t.skipExact(" SK_"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (!isupper(t.peek())) {
|
||||
return false;
|
||||
}
|
||||
return t.skipToEndBracket(" = ");
|
||||
}
|
||||
|
||||
static bool looks_like_member(const TextParser& tp) {
|
||||
TextParser t(tp.fFileName, tp.fChar, tp.lineEnd(), tp.fLineCount);
|
||||
const char* end = t.anyOf("(;");
|
||||
if (!end || '(' == *end) {
|
||||
return false;
|
||||
}
|
||||
bool foundMember = false;
|
||||
do {
|
||||
const char* next = t.anyOf(" ;");
|
||||
if (';' == *next) {
|
||||
break;
|
||||
}
|
||||
t.skipTo(next);
|
||||
t.skipSpace();
|
||||
foundMember = 'f' == t.fChar[0] && isupper(t.fChar[1]);
|
||||
} while (true);
|
||||
return foundMember;
|
||||
}
|
||||
|
||||
static void skip_constructor_initializers(TextParser& t) {
|
||||
SkAssertResult(':' == t.next());
|
||||
do {
|
||||
t.skipWhiteSpace();
|
||||
t.skipToNonAlphaNum();
|
||||
t.skipWhiteSpace();
|
||||
if ('{' == t.peek()) {
|
||||
t.skipToBalancedEndBracket('{', '}');
|
||||
}
|
||||
do {
|
||||
const char* limiter = t.anyOf("(,{");
|
||||
t.skipTo(limiter);
|
||||
if ('(' != t.peek()) {
|
||||
break;
|
||||
}
|
||||
t.skipToBalancedEndBracket('(', ')');
|
||||
} while (true);
|
||||
if ('{' == t.peek()) {
|
||||
return;
|
||||
}
|
||||
SkAssertResult(',' == t.next());
|
||||
} while (true);
|
||||
}
|
||||
|
||||
static const char kInline[] = "inline ";
|
||||
static const char kSK_API[] = "SK_API ";
|
||||
static const char kSK_WARN_UNUSED_RESULT[] = "SK_WARN_UNUSED_RESULT ";
|
||||
|
||||
bool IncludeParser::advanceInclude(TextParser& i) {
|
||||
i.skipWhiteSpace(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
if (fCheck.fPrivateBrace) {
|
||||
if (i.startsWith("};")) {
|
||||
if (fCheck.fPrivateBrace == fCheck.fBraceCount) {
|
||||
fCheck.fPrivateBrace = 0;
|
||||
fCheck.fDoubleReturn = true;
|
||||
} else {
|
||||
i.skipExact("};");
|
||||
fCheck.fBraceCount -= 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (i.startsWith("public:")) {
|
||||
if (fCheck.fBraceCount <= fCheck.fPrivateBrace) {
|
||||
fCheck.fPrivateBrace = 0;
|
||||
if (fCheck.fPrivateProtected) {
|
||||
i.skipExact("public:");
|
||||
}
|
||||
} else {
|
||||
i.skipExact("public:");
|
||||
}
|
||||
} else {
|
||||
fCheck.fBraceCount += i.skipToLineBalance('{', '}');
|
||||
}
|
||||
return false;
|
||||
} else if (i.startsWith("};")) {
|
||||
fCheck.fDoubleReturn = 2;
|
||||
}
|
||||
if (i.skipExact(kInline)) {
|
||||
fCheck.fSkipInline = true;
|
||||
return false;
|
||||
}
|
||||
if (i.skipExact(kSK_API)) {
|
||||
fCheck.fSkipAPI = true;
|
||||
return false;
|
||||
}
|
||||
if (i.skipExact(kSK_WARN_UNUSED_RESULT)) {
|
||||
fCheck.fSkipWarnUnused = true;
|
||||
return false;
|
||||
}
|
||||
if (i.skipExact("SK_ATTR_DEPRECATED")) {
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
}
|
||||
if (i.skipExact("SkDEBUGCODE")) {
|
||||
i.skipWhiteSpace();
|
||||
if ('(' != i.peek()) {
|
||||
i.reportError("expected open paren");
|
||||
}
|
||||
TextParserSave save(&i);
|
||||
SkAssertResult(i.skipToBalancedEndBracket('(', ')'));
|
||||
fCheck.fInDebugCode = i.fChar - 1;
|
||||
save.restore();
|
||||
SkAssertResult('(' == i.next());
|
||||
}
|
||||
if ('{' == i.peek()) {
|
||||
if (looks_like_method(i)) {
|
||||
fCheck.fState = CheckCode::State::kMethod;
|
||||
if (!i.skipToBalancedEndBracket('{', '}')) {
|
||||
i.reportError("unbalanced open brace");
|
||||
}
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
} else if (looks_like_class_decl(i)) {
|
||||
fCheck.fState = CheckCode::State::kClassDeclaration;
|
||||
fCheck.fPrivateBrace = fCheck.fBraceCount + 1;
|
||||
fCheck.fPrivateProtected = false;
|
||||
}
|
||||
}
|
||||
if (':' == i.peek() && looks_like_constructor(i)) {
|
||||
fCheck.fState = CheckCode::State::kConstructor;
|
||||
skip_constructor_initializers(i);
|
||||
return false;
|
||||
}
|
||||
if ('#' == i.peek()) {
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
}
|
||||
if (i.startsWith("//")) {
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
}
|
||||
if (i.startsWith("/*")) {
|
||||
i.skipToEndBracket("*/");
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
}
|
||||
if (looks_like_forward_declaration(i)) {
|
||||
fCheck.fState = CheckCode::State::kForwardDeclaration;
|
||||
i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
|
||||
return false;
|
||||
}
|
||||
if (i.skipExact("private:") || i.skipExact("protected:")) {
|
||||
if (!fCheck.fBraceCount) {
|
||||
i.reportError("expect private in brace");
|
||||
}
|
||||
fCheck.fPrivateBrace = fCheck.fBraceCount;
|
||||
fCheck.fPrivateProtected = true;
|
||||
return false;
|
||||
}
|
||||
const char* funcEnd = i.anyOf("(\n");
|
||||
if (funcEnd && '(' == funcEnd[0] && '_' == *i.anyOf("_(")
|
||||
&& (i.contains("internal_", funcEnd, nullptr)
|
||||
|| i.contains("private_", funcEnd, nullptr)
|
||||
|| i.contains("legacy_", funcEnd, nullptr)
|
||||
|| i.contains("temporary_", funcEnd, nullptr))) {
|
||||
i.skipTo(funcEnd);
|
||||
if (!i.skipToBalancedEndBracket('(', ')')) {
|
||||
i.reportError("unbalanced open parent");
|
||||
}
|
||||
i.skipSpace();
|
||||
i.skipExact("const ");
|
||||
i.skipSpace();
|
||||
if (';' == i.peek()) {
|
||||
i.next();
|
||||
}
|
||||
fCheck.fState = CheckCode::State::kNone;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void IncludeParser::codeBlockAppend(string& result, char ch) const {
|
||||
if (Elided::kYes == fElided && fCheck.fBraceCount) {
|
||||
return;
|
||||
}
|
||||
this->stringAppend(result, ch);
|
||||
}
|
||||
|
||||
void IncludeParser::codeBlockSpaces(string& result, int indent) const {
|
||||
if (!indent) {
|
||||
return;
|
||||
}
|
||||
if (Elided::kYes == fElided && fCheck.fBraceCount) {
|
||||
return;
|
||||
}
|
||||
SkASSERT(indent > 0);
|
||||
if (fDebugWriteCodeBlock) {
|
||||
SkDebugf("%*c", indent, ' ');
|
||||
}
|
||||
result.append(indent, ' ');
|
||||
}
|
||||
|
||||
string IncludeParser::writeCodeBlock(const Definition& iDef, MarkType markType) {
|
||||
TextParser i(&iDef);
|
||||
fElided = Elided::kNo;
|
||||
const char* before = iDef.fContentStart;
|
||||
while (' ' == *--before)
|
||||
;
|
||||
int startIndent = iDef.fContentStart - before - 1;
|
||||
return writeCodeBlock(i, markType, startIndent);
|
||||
}
|
||||
|
||||
string IncludeParser::writeCodeBlock(TextParser& i, MarkType markType, int startIndent) {
|
||||
string result;
|
||||
char last;
|
||||
int lastIndent = 0;
|
||||
bool lastDoubleMeUp = false;
|
||||
fCheck.reset();
|
||||
this->codeBlockSpaces(result, startIndent);
|
||||
do {
|
||||
if (!this->advanceInclude(i)) {
|
||||
continue;
|
||||
}
|
||||
do {
|
||||
last = i.peek();
|
||||
SkASSERT(' ' < last);
|
||||
if (fCheck.fInDebugCode == i.fChar) {
|
||||
fCheck.fInDebugCode = nullptr;
|
||||
i.next(); // skip close paren
|
||||
break;
|
||||
}
|
||||
if (CheckCode::State::kMethod == fCheck.fState) {
|
||||
this->codeBlockAppend(result, ';');
|
||||
fCheck.fState = CheckCode::State::kNone;
|
||||
}
|
||||
if (fCheck.fWriteReturn) {
|
||||
this->codeBlockAppend(result, '\n');
|
||||
bool doubleMeUp = i.startsWith("typedef ") || looks_like_const(i)
|
||||
|| (!strncmp("struct ", i.fStart, 7) && looks_like_member(i));
|
||||
if ((!--fCheck.fDoubleReturn && !i.startsWith("};")) || i.startsWith("enum ")
|
||||
|| i.startsWith("typedef ") || doubleMeUp || fCheck.fTypedefReturn
|
||||
|| (fCheck.fIndent && (i.startsWith("class ") || i.startsWith("struct ")))) {
|
||||
if (lastIndent > 0 && (!doubleMeUp || !lastDoubleMeUp)) {
|
||||
this->codeBlockAppend(result, '\n');
|
||||
}
|
||||
fCheck.fTypedefReturn = false;
|
||||
lastDoubleMeUp = doubleMeUp;
|
||||
}
|
||||
if (doubleMeUp) {
|
||||
fCheck.fTypedefReturn = true;
|
||||
}
|
||||
lastIndent = fCheck.fIndent;
|
||||
}
|
||||
if (fCheck.fIndent) {
|
||||
size_t indent = fCheck.fIndent;
|
||||
if (fCheck.fSkipInline && indent > sizeof(kInline)) {
|
||||
indent -= sizeof(kInline) - 1;
|
||||
}
|
||||
if (fCheck.fSkipAPI && indent > sizeof(kSK_API)) {
|
||||
indent -= sizeof(kSK_API) - 1;
|
||||
}
|
||||
if (fCheck.fSkipWarnUnused && indent > sizeof(kSK_WARN_UNUSED_RESULT)) {
|
||||
indent -= sizeof(kSK_WARN_UNUSED_RESULT) - 1;
|
||||
}
|
||||
|
||||
this->codeBlockSpaces(result, indent);
|
||||
}
|
||||
this->codeBlockAppend(result, last);
|
||||
fCheck.fWriteReturn = false;
|
||||
fCheck.fIndent = 0;
|
||||
fCheck.fBraceCount += '{' == last;
|
||||
fCheck.fBraceCount -= '}' == last;
|
||||
if (';' == last) {
|
||||
fCheck.fSkipInline = false;
|
||||
fCheck.fSkipAPI = false;
|
||||
fCheck.fSkipWarnUnused = false;
|
||||
}
|
||||
if (fCheck.fBraceCount < 0) {
|
||||
i.reportError("unbalanced close brace");
|
||||
return result;
|
||||
}
|
||||
i.next();
|
||||
} while (!i.eof() && ' ' < i.peek() && !i.startsWith("//"));
|
||||
} while (!i.eof());
|
||||
if (CheckCode::State::kMethod == fCheck.fState) {
|
||||
this->codeBlockAppend(result, ';');
|
||||
}
|
||||
bool elidedTemplate = Elided::kYes == fElided && !strncmp(i.fStart, "template ", 9);
|
||||
bool elidedTClass = elidedTemplate && MarkType::kClass == markType;
|
||||
if (fCheck.fWriteReturn || elidedTClass) {
|
||||
this->codeBlockAppend(result, '\n');
|
||||
}
|
||||
if ((MarkType::kFunction != markType && lastIndent > startIndent) || elidedTClass) {
|
||||
this->codeBlockAppend(result, '}');
|
||||
}
|
||||
this->codeBlockAppend(result, ';');
|
||||
if (MarkType::kFunction != markType || elidedTemplate) {
|
||||
this->codeBlockAppend(result, '\n');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void IncludeParser::checkForMissingParams(const vector<string>& methodParams,
|
||||
const vector<string>& foundParams) {
|
||||
for (auto& methodParam : methodParams) {
|
||||
@ -220,6 +610,22 @@ string IncludeParser::className() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
void IncludeParser::writeCodeBlock(const BmhParser& bmhParser) {
|
||||
for (auto& classMapper : fIClassMap) {
|
||||
string className = classMapper.first;
|
||||
auto finder = bmhParser.fClassMap.find(className);
|
||||
if (bmhParser.fClassMap.end() != finder) {
|
||||
classMapper.second.fCode = this->writeCodeBlock(classMapper.second, MarkType::kClass);
|
||||
continue;
|
||||
}
|
||||
SkASSERT(string::npos != className.find("::"));
|
||||
}
|
||||
for (auto& enumMapper : fIEnumMap) {
|
||||
enumMapper.second->fCode = this->writeCodeBlock(*enumMapper.second,
|
||||
enumMapper.second->fMarkType);
|
||||
}
|
||||
}
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
@ -231,8 +637,6 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) {
|
||||
SkASSERT(string::npos != className.find("::"));
|
||||
continue;
|
||||
}
|
||||
RootDefinition* root = &finder->second;
|
||||
root->clearVisited();
|
||||
}
|
||||
for (auto& classMapper : fIClassMap) {
|
||||
string className = classMapper.first;
|
||||
@ -421,24 +825,34 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) {
|
||||
}
|
||||
}
|
||||
def->fVisited = true;
|
||||
bool hasCode = false;
|
||||
bool hasPopulate = true;
|
||||
for (auto& child : def->fChildren) {
|
||||
if (MarkType::kCode == child->fMarkType) {
|
||||
def = child;
|
||||
hasPopulate = std::any_of(child->fChildren.begin(),
|
||||
child->fChildren.end(), [](auto grandChild){
|
||||
return MarkType::kPopulate == grandChild->fMarkType; });
|
||||
if (!hasPopulate) {
|
||||
def = child;
|
||||
}
|
||||
hasCode = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (MarkType::kCode != def->fMarkType) {
|
||||
if (!hasCode) {
|
||||
if (!root->fDeprecated) {
|
||||
SkDebugf("enum code missing from bmh: %s\n", fullName.c_str());
|
||||
fFailed = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (def->crossCheck(token)) {
|
||||
def->fVisited = true;
|
||||
} else {
|
||||
SkDebugf("enum differs from bmh: %s\n", def->fName.c_str());
|
||||
fFailed = true;
|
||||
if (!hasPopulate) {
|
||||
if (def->crossCheck(token)) {
|
||||
def->fVisited = true;
|
||||
} else {
|
||||
SkDebugf("enum differs from bmh: %s\n", def->fName.c_str());
|
||||
fFailed = true;
|
||||
}
|
||||
}
|
||||
for (auto& child : token.fChildren) {
|
||||
string constName = MarkType::kEnumClass == token.fMarkType ?
|
||||
@ -839,9 +1253,7 @@ void IncludeParser::dumpEnum(const Definition& token, string name) {
|
||||
this->lf(2);
|
||||
this->dumpComment(token);
|
||||
for (auto& child : token.fChildren) {
|
||||
// start here;
|
||||
// get comments before
|
||||
// or after const values
|
||||
// TODO: get comments before or after const values
|
||||
this->writeTag("Const");
|
||||
this->writeSpace();
|
||||
this->writeString(child->fName);
|
||||
@ -1327,6 +1739,23 @@ void IncludeParser::dumpTypedef(const Definition& token, string className) {
|
||||
this->dumpComment(token);
|
||||
}
|
||||
|
||||
string IncludeParser::elidedCodeBlock(const Definition& iDef) {
|
||||
SkASSERT(KeyWord::kStruct == iDef.fKeyWord || KeyWord::kClass == iDef.fKeyWord
|
||||
|| KeyWord::kTemplate == iDef.fKeyWord);
|
||||
TextParser i(&iDef);
|
||||
fElided = Elided::kYes;
|
||||
MarkType markType = MarkType::kClass;
|
||||
if (KeyWord::kTemplate == iDef.fKeyWord) { // may be function
|
||||
for (auto child : iDef.fChildren) {
|
||||
if (MarkType::kMethod == child->fMarkType) {
|
||||
markType = MarkType::kFunction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this->writeCodeBlock(i, markType, 0);
|
||||
}
|
||||
|
||||
bool IncludeParser::findComments(const Definition& includeDef, Definition* markupDef) {
|
||||
// add comment preceding class, if any
|
||||
const Definition* parent = includeDef.fParent;
|
||||
@ -1436,6 +1865,17 @@ bool IncludeParser::inAlignAs() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
const Definition* IncludeParser::include(string match) const {
|
||||
for (auto& entry : fIncludeMap) {
|
||||
if (string::npos == entry.first.find(match)) {
|
||||
continue;
|
||||
}
|
||||
return &entry.second;
|
||||
}
|
||||
SkASSERT(0);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// caller just returns, so report error here
|
||||
bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) {
|
||||
SkASSERT(includeDef->fTokens.size() > 0);
|
||||
@ -1881,8 +2321,10 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
|
||||
IClassDefinition& classDef = fIClassMap[markupDef->fName];
|
||||
SkASSERT(classDef.fStart);
|
||||
string uniqueName = this->uniqueName(classDef.fEnums, nameStr);
|
||||
string fullName = markupChild->fName;
|
||||
markupChild->fName = uniqueName;
|
||||
classDef.fEnums[uniqueName] = markupChild;
|
||||
fIEnumMap[fullName] = markupChild;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -2017,7 +2459,8 @@ bool IncludeParser::parseMethod(Definition* child, Definition* markupDef) {
|
||||
}
|
||||
tokenIter->fName = nameStr; // simple token stream, OK if name is duplicate
|
||||
tokenIter->fMarkType = MarkType::kMethod;
|
||||
tokenIter->fPrivate = string::npos != nameStr.find("::");
|
||||
tokenIter->fPrivate = string::npos != nameStr.find("::")
|
||||
&& KeyWord::kTemplate != child->fParent->fKeyWord;
|
||||
auto testIter = child->fParent->fTokens.begin();
|
||||
SkASSERT(child->fParentIndex > 0);
|
||||
std::advance(testIter, child->fParentIndex - 1);
|
||||
@ -2035,8 +2478,11 @@ bool IncludeParser::parseMethod(Definition* child, Definition* markupDef) {
|
||||
end = testIter->fContentEnd - 1;
|
||||
} else {
|
||||
end = testIter->fContentEnd;
|
||||
while (testIter != child->fParent->fTokens.end()) {
|
||||
testIter = std::next(testIter);
|
||||
do {
|
||||
std::advance(testIter, 1);
|
||||
if (testIter == child->fParent->fTokens.end()) {
|
||||
break;
|
||||
}
|
||||
switch (testIter->fType) {
|
||||
case Definition::Type::kPunctuation:
|
||||
SkASSERT(Punctuation::kSemicolon == testIter->fPunctuation
|
||||
@ -2054,7 +2500,7 @@ bool IncludeParser::parseMethod(Definition* child, Definition* markupDef) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
while (end > start && ' ' >= end[-1]) {
|
||||
--end;
|
||||
@ -2154,6 +2600,11 @@ bool IncludeParser::parseObject(Definition* child, Definition* markupDef) {
|
||||
return child->reportError<bool>("failed to parse union");
|
||||
}
|
||||
break;
|
||||
case KeyWord::kUsing:
|
||||
if (!this->parseUsing()) {
|
||||
return child->reportError<bool>("failed to parse using");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return child->reportError<bool>("unhandled keyword");
|
||||
}
|
||||
@ -2316,7 +2767,12 @@ bool IncludeParser::parseTypedef(Definition* child, Definition* markupDef) {
|
||||
}
|
||||
|
||||
bool IncludeParser::parseUnion() {
|
||||
// incomplete
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IncludeParser::parseUsing() {
|
||||
// incomplete
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2684,6 +3140,7 @@ bool IncludeParser::parseChar() {
|
||||
if (KeyWord::kEnum == fParent->fKeyWord) {
|
||||
fInEnum = false;
|
||||
}
|
||||
parentIsClass |= KeyWord::kStruct == fParent->fKeyWord;
|
||||
this->popObject();
|
||||
if (parentIsClass && fParent && KeyWord::kTemplate == fParent->fKeyWord) {
|
||||
this->popObject();
|
||||
|
@ -450,14 +450,17 @@ void IncludeWriter::enumHeaderOut(RootDefinition* root, const Definition& child)
|
||||
}
|
||||
Definition* codeBlock = nullptr;
|
||||
const char* commentStart = nullptr;
|
||||
bool firstCodeBlocks = true;
|
||||
bool wroteHeader = false;
|
||||
bool lastAnchor = false;
|
||||
SkDEBUGCODE(bool foundConst = false);
|
||||
for (auto test : enumDef->fChildren) {
|
||||
if (MarkType::kCode == test->fMarkType && !codeBlock) {
|
||||
if (MarkType::kCode == test->fMarkType && firstCodeBlocks) {
|
||||
codeBlock = test;
|
||||
commentStart = codeBlock->fTerminator;
|
||||
continue;
|
||||
} else if (codeBlock) {
|
||||
firstCodeBlocks = false;
|
||||
}
|
||||
if (!codeBlock) {
|
||||
continue;
|
||||
@ -515,8 +518,8 @@ void IncludeWriter::enumHeaderOut(RootDefinition* root, const Definition& child)
|
||||
break;
|
||||
}
|
||||
}
|
||||
SkASSERT(codeBlock);
|
||||
SkASSERT(foundConst);
|
||||
// SkASSERT(codeBlock);
|
||||
// SkASSERT(foundConst);
|
||||
if (wroteHeader) {
|
||||
this->indentOut();
|
||||
this->lfcr();
|
||||
@ -1506,6 +1509,11 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
|
||||
fContinuation = nullptr;
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kTemplate == child.fParent->fKeyWord) {
|
||||
// incomplete; no support to template specialization in public includes
|
||||
fContinuation = nullptr;
|
||||
continue;
|
||||
}
|
||||
return child.reportError<bool>("method not found");
|
||||
}
|
||||
if (Bracket::kSlashSlash == child.fBracket || Bracket::kSlashStar == child.fBracket) {
|
||||
@ -1518,6 +1526,10 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
|
||||
if (this->isInternalName(child)) {
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kTemplate == child.fParent->fKeyWord) {
|
||||
// todo: support template specializations
|
||||
continue;
|
||||
}
|
||||
const char* bodyEnd = fDeferComment ? fDeferComment->fContentStart - 1 :
|
||||
fAttrDeprecated ? fAttrDeprecated->fContentStart - 1 :
|
||||
child.fContentStart;
|
||||
@ -1547,7 +1559,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
|
||||
inConstructor = false;
|
||||
method = &mapFind->second;
|
||||
methodName = child.fName;
|
||||
} else {
|
||||
} else if (root) {
|
||||
methodName = root->fName + "::" + child.fName;
|
||||
size_t lastName = root->fName.rfind(':');
|
||||
lastName = string::npos == lastName ? 0 : lastName + 1;
|
||||
@ -1657,7 +1669,22 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
|
||||
if (MarkType::kTopic == parent->fMarkType ||
|
||||
MarkType::kSubtopic == parent->fMarkType) {
|
||||
const char* commentStart = root->fContentStart;
|
||||
unsigned index = 0;
|
||||
const char* commentEnd = root->fChildren[0]->fStart;
|
||||
int line = 1;
|
||||
do {
|
||||
TextParser parser(root->fFileName, commentStart, commentEnd, line);
|
||||
if (!parser.eof()) {
|
||||
parser.skipWhiteSpace();
|
||||
}
|
||||
if (!parser.eof()) {
|
||||
break;
|
||||
}
|
||||
commentStart = root->fChildren[index]->fTerminator;
|
||||
++index;
|
||||
SkASSERT(index < root->fChildren.size());
|
||||
commentEnd = root->fChildren[index]->fStart;
|
||||
} while (true);
|
||||
this->structOut(root, *root, commentStart, commentEnd);
|
||||
} else {
|
||||
SkASSERT(0); // incomplete
|
||||
@ -1784,6 +1811,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
|
||||
case KeyWord::kInline:
|
||||
case KeyWord::kSK_API:
|
||||
case KeyWord::kTemplate:
|
||||
case KeyWord::kUsing:
|
||||
break;
|
||||
case KeyWord::kTypedef:
|
||||
SkASSERT(!memberStart);
|
||||
@ -2255,6 +2283,7 @@ string IncludeWriter::resolveRef(const char* start, const char* end, bool first,
|
||||
} else if (!first) {
|
||||
this->fChar = start;
|
||||
this->fLine = start;
|
||||
this->fEnd = end;
|
||||
this->reportError("reference unfound");
|
||||
return "";
|
||||
}
|
||||
@ -2290,6 +2319,10 @@ string IncludeWriter::resolveRef(const char* start, const char* end, bool first,
|
||||
}
|
||||
if (!substitute.length()) {
|
||||
for (auto child : rootDef->fChildren) {
|
||||
if (MarkType::kSubstitute == child->fMarkType) {
|
||||
substitute = string(child->fContentStart, child->length());
|
||||
break;
|
||||
}
|
||||
// there may be more than one
|
||||
// if so, it's a bug since it's unknown which is the right one
|
||||
if (MarkType::kClass == child->fMarkType ||
|
||||
|
@ -17,8 +17,8 @@
|
||||
fprintf(fOut, __VA_ARGS__)
|
||||
|
||||
const char* SubtopicKeys::kGeneratedSubtopics[] = {
|
||||
kClasses, kConstants, kConstructors, kDefines,
|
||||
kMemberFunctions, kMembers, kOperators, kRelatedFunctions, kStructs, kTypedefs,
|
||||
kConstants, kDefines, kTypedefs, kMembers, kClasses, kStructs, kConstructors,
|
||||
kOperators, kMemberFunctions, kRelatedFunctions
|
||||
};
|
||||
|
||||
const char* kConstTableStyle =
|
||||
@ -46,10 +46,10 @@ const char* kSubConstTableHeader = " <tr>" kTH_Left "Const</th>"
|
||||
kTH_Left "Details</th>" "\n"
|
||||
kTH_Left "Description</th>" "</tr>";
|
||||
const char* kAllMemberTableHeader = " <tr>" kTH_Left "Type</th>" "\n"
|
||||
kTH_Left "Name</th>" "\n"
|
||||
kTH_Left "Member</th>" "\n"
|
||||
kTH_Left "Description</th>" "</tr>";
|
||||
const char* kSubMemberTableHeader = " <tr>" kTH_Left "Type</th>" "\n"
|
||||
kTH_Left "Name</th>" "\n"
|
||||
kTH_Left "Member</th>" "\n"
|
||||
kTH_Left "Details</th>" "\n"
|
||||
kTH_Left "Description</th>" "</tr>";
|
||||
const char* kTopicsTableHeader = " <tr>" kTH_Left "Topic</th>" "\n"
|
||||
@ -162,7 +162,6 @@ static string out_table_data_details(string details) {
|
||||
}
|
||||
|
||||
#undef kConstTDBase
|
||||
#undef kTH_Left
|
||||
#undef kTH_Center
|
||||
|
||||
static void add_ref(string leadingSpaces, string ref, string* result) {
|
||||
@ -204,56 +203,50 @@ void replace_all(string& str, const string& from, const string& to) {
|
||||
|
||||
// detail strings are preceded by an example comment to check readability
|
||||
void MdOut::addPopulators() {
|
||||
fPopulators[SubtopicKeys::kClasses].fName = "Class Declarations";
|
||||
fPopulators[SubtopicKeys::kClasses].fOneLiner = "embedded class members";
|
||||
fPopulators[SubtopicKeys::kClasses].fDetails =
|
||||
/* SkImageInfo */ "uses C++ classes to declare the public data"
|
||||
" structures and interfaces.";
|
||||
fPopulators[SubtopicKeys::kConstants].fName = "Constants";
|
||||
fPopulators[SubtopicKeys::kConstants].fOneLiner = "enum and enum class, and their const values";
|
||||
fPopulators[SubtopicKeys::kConstants].fDetails =
|
||||
/* SkImageInfo */ "related constants are defined by <code>enum</code>,"
|
||||
" <code>enum class</code>, <code>#define</code>, <code>const</code>,"
|
||||
" and <code>constexpr</code>.";
|
||||
fPopulators[SubtopicKeys::kConstructors].fName = "Constructors";
|
||||
fPopulators[SubtopicKeys::kConstructors].fOneLiner = "functions that construct";
|
||||
fPopulators[SubtopicKeys::kConstructors].fDetails =
|
||||
auto populator = [this](string key, string singular, string plural, string oneLiner,
|
||||
string details) -> void {
|
||||
fPopulators[key].fSingular = singular;
|
||||
fPopulators[key].fPlural = plural;
|
||||
fPopulators[key].fOneLiner = oneLiner;
|
||||
fPopulators[key].fDetails = details;
|
||||
};
|
||||
populator(SubtopicKeys::kClasses, "Class", "Class Declarations",
|
||||
"embedded class members",
|
||||
/* SkImageInfo */ "uses <code>class</code> to declare the public data structures"
|
||||
" and interfaces.");
|
||||
populator(SubtopicKeys::kConstants, "Constant", "Constants",
|
||||
"enum and enum class, and their const values",
|
||||
/* SkImageInfo */ "defines related constants are using <code>enum</code>,"
|
||||
" <code>enum class</code>, <code>#define</code>,"
|
||||
" <code>const</code>, and <code>constexpr</code>.");
|
||||
populator(SubtopicKeys::kConstructors, "Constructor", "Constructors",
|
||||
"functions that construct",
|
||||
/* SkImageInfo */ "can be constructed or initialized by these functions,"
|
||||
" including C++ class constructors.";
|
||||
fPopulators[SubtopicKeys::kDefines].fName = "Defines";
|
||||
fPopulators[SubtopicKeys::kDefines].fOneLiner = "preprocessor definitions of functions, values";
|
||||
fPopulators[SubtopicKeys::kDefines].fDetails =
|
||||
" including <code>class</code> constructors.");
|
||||
populator(SubtopicKeys::kDefines, "Define", "Defines",
|
||||
"preprocessor definitions of functions, values",
|
||||
/* SkImageInfo */ "uses preprocessor definitions to inline code and constants,"
|
||||
" and to abstract platform-specific functionality.";
|
||||
fPopulators[SubtopicKeys::kMemberFunctions].fName = "Functions";
|
||||
fPopulators[SubtopicKeys::kMemberFunctions].fOneLiner = "global and class member functions";
|
||||
fPopulators[SubtopicKeys::kMemberFunctions].fDetails =
|
||||
/* SkImageInfo */ "member functions read and modify the structure properties.";
|
||||
fPopulators[SubtopicKeys::kMembers].fName = "Members";
|
||||
fPopulators[SubtopicKeys::kMembers].fOneLiner = "member values";
|
||||
fPopulators[SubtopicKeys::kMembers].fDetails =
|
||||
/* SkImageInfo */ "members may be read and written directly without using"
|
||||
" a member function.";
|
||||
fPopulators[SubtopicKeys::kOperators].fName = "Operators";
|
||||
fPopulators[SubtopicKeys::kOperators].fOneLiner = "operator overloading methods";
|
||||
fPopulators[SubtopicKeys::kOperators].fDetails =
|
||||
/* SkImageInfo */ "operators inline class member functions with arithmetic"
|
||||
" equivalents.";
|
||||
fPopulators[SubtopicKeys::kRelatedFunctions].fName = "Related Functions";
|
||||
fPopulators[SubtopicKeys::kRelatedFunctions].fOneLiner =
|
||||
"similar member functions grouped together";
|
||||
fPopulators[SubtopicKeys::kRelatedFunctions].fDetails =
|
||||
/* SkImageInfo */ "global, <code>struct</code>, and <code>class</code> related member"
|
||||
" functions share a topic.";
|
||||
fPopulators[SubtopicKeys::kStructs].fName = "Struct Declarations";
|
||||
fPopulators[SubtopicKeys::kStructs].fOneLiner = "embedded struct members";
|
||||
fPopulators[SubtopicKeys::kStructs].fDetails =
|
||||
/* SkImageInfo */ "uses C++ structs to declare the public data"
|
||||
" structures and interfaces.";
|
||||
fPopulators[SubtopicKeys::kTypedefs].fName = "Typedef Declarations";
|
||||
fPopulators[SubtopicKeys::kTypedefs].fOneLiner = "types defined by other types";
|
||||
fPopulators[SubtopicKeys::kTypedefs].fDetails =
|
||||
/* SkImageInfo */ " <code>typedef</code> define a data type.";
|
||||
" and to abstract platform-specific functionality.");
|
||||
populator(SubtopicKeys::kMemberFunctions, "Member Function", "Member Functions",
|
||||
"static and local functions",
|
||||
/* SkImageInfo */ "uses member functions to read and modify structure properties.");
|
||||
populator(SubtopicKeys::kMembers, "Member", "Members",
|
||||
"member values",
|
||||
/* SkImageInfo */ "contains members that may be read and written directly without using"
|
||||
" a member function.");
|
||||
populator(SubtopicKeys::kOperators, "Operator", "Operators",
|
||||
"operator overloading functions",
|
||||
/* SkImageInfo */ "defines member functions with arithmetic equivalents.");
|
||||
populator(SubtopicKeys::kRelatedFunctions, "Related Function", "Related Functions",
|
||||
"similar functions grouped together",
|
||||
/* SkImageInfo */ "defines related functions that share a topic.");
|
||||
populator(SubtopicKeys::kStructs, "Struct", "Struct Declarations",
|
||||
"embedded struct members",
|
||||
/* SkImageInfo */ "uses <code>struct</code> to declare the public data"
|
||||
" structures and interfaces.");
|
||||
populator(SubtopicKeys::kTypedefs, "Typedef", "Typedef Declarations",
|
||||
"types defined in terms of other types",
|
||||
/* SkImageInfo */ "uses <code>typedef</code> to define a data type.");
|
||||
}
|
||||
|
||||
Definition* MdOut::checkParentsForMatch(Definition* test, string ref) const {
|
||||
@ -283,15 +276,50 @@ static bool formula_or_code(BmhParser::Resolvable resolvable) {
|
||||
|| BmhParser::Resolvable::kCode == resolvable;
|
||||
}
|
||||
|
||||
static void fixup_const_function_name(string* ref) {
|
||||
const char spaceConst[] = " const";
|
||||
size_t spacePos = ref->rfind(spaceConst);
|
||||
if (string::npos != spacePos && spacePos == ref->length() - sizeof(spaceConst) + 1) {
|
||||
*ref = ref->substr(0, spacePos) + "_const";
|
||||
}
|
||||
}
|
||||
|
||||
struct BraceState {
|
||||
BraceState(RootDefinition* root, string name, const char* ch, KeyWord last, KeyWord keyWord,
|
||||
int count)
|
||||
: fRoot(root)
|
||||
, fName(name)
|
||||
, fChar(ch)
|
||||
, fLastKey(last)
|
||||
, fKeyWord(keyWord)
|
||||
, fBraceCount(count) {
|
||||
}
|
||||
|
||||
RootDefinition* fRoot;
|
||||
string fName;
|
||||
const char* fChar;
|
||||
KeyWord fLastKey;
|
||||
KeyWord fKeyWord;
|
||||
int fBraceCount;
|
||||
};
|
||||
|
||||
// FIXME: preserve inter-line spaces and don't add new ones
|
||||
string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
BmhParser::Resolvable resolvable) {
|
||||
string result;
|
||||
MethodParser t(fRoot ? fRoot->fName : string(), fFileName, refStart, refEnd, fLineCount);
|
||||
bool lineStart = true;
|
||||
// bool structClassSet = false;
|
||||
string ref;
|
||||
string leadingSpaces;
|
||||
int distFromParam = 99;
|
||||
const char* lastLine = nullptr;
|
||||
vector<BraceState> braceStack;
|
||||
KeyWord lastKeyWord = KeyWord::kNone;
|
||||
KeyWord keyWord = KeyWord::kNone;
|
||||
if (BmhParser::Resolvable::kCode == resolvable) {
|
||||
braceStack.push_back({fRoot, fRoot->fName, t.fChar, lastKeyWord, keyWord, 0});
|
||||
}
|
||||
do {
|
||||
++distFromParam;
|
||||
const char* base = t.fChar;
|
||||
@ -303,8 +331,53 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
t.next();
|
||||
continue;
|
||||
}
|
||||
t.skipToMethodStart();
|
||||
if (BmhParser::Resolvable::kCode == resolvable) {
|
||||
int priorBrace = braceStack.back().fBraceCount;
|
||||
int braceCount = priorBrace + t.skipToMethodStart();
|
||||
if (braceCount > priorBrace) {
|
||||
string name;
|
||||
if (KeyWord::kClass == keyWord || KeyWord::kStruct == keyWord) {
|
||||
name = ref;
|
||||
} else if (KeyWord::kClass == lastKeyWord && KeyWord::kPublic == keyWord) {
|
||||
SkASSERT(lastLine);
|
||||
TextParser parser(t.fFileName, lastLine, t.fChar, t.fLineCount);
|
||||
parser.skipSpace();
|
||||
SkAssertResult(parser.skipExact("class "));
|
||||
parser.skipSpace();
|
||||
const char* nameStart = parser.fChar;
|
||||
parser.skipToSpace();
|
||||
name = string(nameStart, parser.fChar - nameStart);
|
||||
}
|
||||
if ("" != name) {
|
||||
const Definition* classDef = this->isDefined(t, name, resolvable);
|
||||
if (!classDef) {
|
||||
string className = fRoot->csParent()->fName;
|
||||
string withRoot = className + "::" + name;
|
||||
classDef = this->isDefined(t, withRoot, resolvable);
|
||||
SkASSERT(classDef);
|
||||
}
|
||||
if (classDef->isRoot()) {
|
||||
fRoot = const_cast<Definition*>(classDef)->asRoot();
|
||||
t.setLocalName(name);
|
||||
}
|
||||
}
|
||||
braceStack.push_back({fRoot, name, t.fChar, lastKeyWord, keyWord, braceCount});
|
||||
} else if (braceCount < priorBrace) {
|
||||
lastKeyWord = braceStack.back().fLastKey;
|
||||
keyWord = braceStack.back().fKeyWord;
|
||||
braceStack.pop_back();
|
||||
if (KeyWord::kClass == keyWord || KeyWord::kStruct == keyWord) {
|
||||
fRoot = braceStack.back().fRoot;
|
||||
t.setLocalName(braceStack.back().fName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
(void) t.skipToMethodStart();
|
||||
}
|
||||
const char* start = t.fChar;
|
||||
if (fParamEnd <= start) {
|
||||
fParamEnd = nullptr;
|
||||
}
|
||||
if (wordStart < start) {
|
||||
if (lineStart) {
|
||||
lineStart = false;
|
||||
@ -356,6 +429,17 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
continue;
|
||||
}
|
||||
ref = string(start, t.fChar - start);
|
||||
if (fParamEnd
|
||||
&& islower(start[0]) && ('k' != start[0] || !isupper(start[1]))) {
|
||||
if (' ' == start[-1] && ' ' != result.back()) {
|
||||
result += ' ';
|
||||
}
|
||||
result += ref;
|
||||
continue;
|
||||
}
|
||||
if (BmhParser::Resolvable::kCode == resolvable) {
|
||||
fixup_const_function_name(&ref);
|
||||
}
|
||||
if (const Definition* def = this->isDefined(t, ref, resolvable)) {
|
||||
if (MarkType::kExternal == def->fMarkType) {
|
||||
(void) this->anchorRef("undocumented#" + ref, ""); // for anchor validate
|
||||
@ -365,15 +449,19 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
SkASSERT(def->fFiddle.length());
|
||||
if (BmhParser::Resolvable::kSimple != resolvable
|
||||
&& !t.eof() && '(' == t.peek() && t.strnchr(')', t.fEnd)) {
|
||||
if (!t.skipToEndBracket(')')) {
|
||||
TextParserSave tSave(&t);
|
||||
if (!t.skipToBalancedEndBracket('(', ')')) {
|
||||
tSave.restore();
|
||||
t.reportError("missing close paren");
|
||||
fAddRefFailed = true;
|
||||
return result;
|
||||
}
|
||||
t.next();
|
||||
// t.next();
|
||||
SkASSERT(')' == t.fChar[-1]);
|
||||
fParamEnd = t.fChar - 1; // don't resolve lower case words til param end
|
||||
string fullRef = string(start, t.fChar - start);
|
||||
// if _2 etc alternates are defined, look for paren match
|
||||
// may ignore () if ref is all lower case
|
||||
// may ignore () if ref is all lower case and resolvable is not code
|
||||
// otherwise flag as error
|
||||
int suffix = '2';
|
||||
bool foundMatch = false;
|
||||
@ -409,6 +497,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
}
|
||||
ref = fullRef;
|
||||
}
|
||||
ref = ref.substr(0, ref.find('('));
|
||||
tSave.restore();
|
||||
} else if (BmhParser::Resolvable::kClone != resolvable &&
|
||||
all_lower(ref) && (t.eof() || '(' != t.peek())) {
|
||||
add_ref(leadingSpaces, ref, &result);
|
||||
@ -420,6 +510,9 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
return result;
|
||||
}
|
||||
result += linkRef(leadingSpaces, def, ref, resolvable);
|
||||
if (!t.eof() && '(' == t.peek()) {
|
||||
result += t.next(); // skip open paren
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!t.eof() && '(' == t.peek()) {
|
||||
@ -492,6 +585,17 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
}
|
||||
}
|
||||
}
|
||||
KeyWord newKeyWord = IncludeParser::FindKey(start, start + ref.length());
|
||||
lastLine = nullptr;
|
||||
if (KeyWord::kPrivate != newKeyWord && KeyWord::kProtected != newKeyWord
|
||||
&& KeyWord::kPublic != newKeyWord) {
|
||||
lastKeyWord = keyWord;
|
||||
keyWord = newKeyWord;
|
||||
} else if (BmhParser::Resolvable::kCode == resolvable && ':' != t.peek()) {
|
||||
lastLine = t.fLine;
|
||||
lastKeyWord = keyWord;
|
||||
keyWord = newKeyWord;
|
||||
}
|
||||
add_ref(leadingSpaces, ref, &result);
|
||||
continue;
|
||||
}
|
||||
@ -536,16 +640,16 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MdOut::buildReferences(const IncludeParser& includeParser, const char* docDir,
|
||||
const char* mdFileOrPath) {
|
||||
bool MdOut::buildReferences(const char* docDir, const char* mdFileOrPath) {
|
||||
if (!sk_isdir(mdFileOrPath)) {
|
||||
SkDebugf("must pass directory %s\n", mdFileOrPath);
|
||||
SkDebugf("pass -i SkXXX.h to build references for a single include\n");
|
||||
return false;
|
||||
}
|
||||
fInProgress = true;
|
||||
SkOSFile::Iter it(docDir, ".bmh");
|
||||
for (SkString file; it.next(&file); ) {
|
||||
if (!includeParser.references(file)) {
|
||||
if (!fIncludeParser.references(file)) {
|
||||
continue;
|
||||
}
|
||||
SkString p = SkOSPath::Join(docDir, file.c_str());
|
||||
@ -559,9 +663,11 @@ bool MdOut::buildReferences(const IncludeParser& includeParser, const char* docD
|
||||
|
||||
bool MdOut::buildStatus(const char* statusFile, const char* outDir) {
|
||||
StatusIter iter(statusFile, ".bmh", StatusFilter::kInProgress);
|
||||
for (string file; iter.next(&file); ) {
|
||||
StatusFilter filter;
|
||||
for (string file; iter.next(&file, &filter); ) {
|
||||
SkString p = SkOSPath::Join(iter.baseDir().c_str(), file.c_str());
|
||||
const char* hunk = p.c_str();
|
||||
fInProgress = StatusFilter::kInProgress == filter;
|
||||
if (!this->buildRefFromFile(hunk, outDir)) {
|
||||
SkDebugf("failed to parse %s\n", hunk);
|
||||
return false;
|
||||
@ -630,9 +736,10 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) {
|
||||
header.replace(underscorePos, 1, " ");
|
||||
}
|
||||
SkASSERT(string::npos == header.find('_'));
|
||||
FPRINTF("%s", header.c_str());
|
||||
this->writeString(header);
|
||||
this->lfAlways(1);
|
||||
this->writeString("===");
|
||||
this->lfAlways(1);
|
||||
FPRINTF("===");
|
||||
}
|
||||
const Definition* prior = nullptr;
|
||||
this->markTypeOut(topicDef, &prior);
|
||||
@ -1190,10 +1297,11 @@ string MdOut::linkRef(string leadingSpaces, const Definition* def,
|
||||
buildup = '#' + parent->fFiddle + '_' + ref;
|
||||
}
|
||||
string refOut(ref);
|
||||
if (!globalEnumMember) {
|
||||
if (!globalEnumMember && BmhParser::Resolvable::kCode != resolvable) {
|
||||
std::replace(refOut.begin(), refOut.end(), '_', ' ');
|
||||
}
|
||||
if (ref.length() > 2 && islower(ref[0]) && "()" == ref.substr(ref.length() - 2)) {
|
||||
if (ref.length() > 2 && islower(ref[0]) && "()" == ref.substr(ref.length() - 2)
|
||||
&& BmhParser::Resolvable::kCode != resolvable) {
|
||||
refOut = refOut.substr(0, refOut.length() - 2);
|
||||
}
|
||||
string result = leadingSpaces + this->anchorRef(buildup, refOut);
|
||||
@ -1228,6 +1336,131 @@ static bool writeTableEnd(MarkType markType, Definition* def, const Definition**
|
||||
return markType != def->fMarkType && *prior && markType == (*prior)->fMarkType;
|
||||
}
|
||||
|
||||
// Recursively build string with declarative code. Skip structs, classes, that
|
||||
// have been built directly.
|
||||
void MdOut::addCodeBlock(const Definition* def, string& result) const {
|
||||
const Definition* last = nullptr;
|
||||
bool wroteFunction = false;
|
||||
for (auto member : def->fChildren) {
|
||||
const Definition* prior = last;
|
||||
const char* priorTerminator = nullptr;
|
||||
if (prior) {
|
||||
priorTerminator = prior->fTerminator ? prior->fTerminator : prior->fContentEnd;
|
||||
}
|
||||
last = member;
|
||||
if (KeyWord::kIfndef == member->fKeyWord) {
|
||||
this->addCodeBlock(member, result);
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kClass == member->fKeyWord || KeyWord::kStruct == member->fKeyWord
|
||||
|| KeyWord::kTemplate == member->fKeyWord) {
|
||||
if (!member->fChildren.size()) {
|
||||
continue;
|
||||
}
|
||||
// todo: Make sure this was written non-elided somewhere else
|
||||
// todo: provide indent value?
|
||||
string block = fIncludeParser.elidedCodeBlock(*member);
|
||||
// add italic link for elided body
|
||||
size_t brace = block.find('{');
|
||||
if (string::npos != brace) {
|
||||
string name = member->fName;
|
||||
if ("" == name) {
|
||||
for (auto child : member->fChildren) {
|
||||
if ("" != (name = child->fName)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
SkASSERT("" != name);
|
||||
string body = "\n // <i>" + name + " interface</i>";
|
||||
block = block.substr(0, brace + 1) + body + block.substr(brace + 1);
|
||||
}
|
||||
this->stringAppend(result, block);
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kEnum == member->fKeyWord) {
|
||||
if (member->fChildren.empty()) {
|
||||
continue;
|
||||
}
|
||||
auto tokenIter = member->fTokens.begin();
|
||||
if (KeyWord::kEnum == member->fKeyWord && KeyWord::kClass == tokenIter->fKeyWord) {
|
||||
tokenIter = tokenIter->fTokens.begin();
|
||||
}
|
||||
while (Definition::Type::kWord != tokenIter->fType) {
|
||||
std::advance(tokenIter, 1);
|
||||
}
|
||||
const auto& token = *tokenIter;
|
||||
string name = string(token.fContentStart, token.length());
|
||||
SkASSERT(name.length() > 0);
|
||||
MarkType markType = KeyWord::kClass == member->fKeyWord
|
||||
|| KeyWord::kStruct == member->fKeyWord ? MarkType::kClass : MarkType::kEnum;
|
||||
// find bmh def or just find name of class / struct / enum ? (what if enum is nameless?)
|
||||
if (wroteFunction) {
|
||||
this->stringAppend(result, '\n');
|
||||
wroteFunction = false;
|
||||
}
|
||||
this->stringAppend(result,
|
||||
fIncludeParser.codeBlock(markType, name, fInProgress));
|
||||
this->stringAppend(result, '\n');
|
||||
continue;
|
||||
}
|
||||
// Global function declarations are not preparsed very well;
|
||||
// make do by using the prior position to find the start
|
||||
if (Bracket::kParen == member->fBracket && prior) {
|
||||
TextParser function(member->fFileName, priorTerminator, member->fTerminator + 1,
|
||||
member->fLineCount);
|
||||
this->stringAppend(result,
|
||||
fIncludeParser.writeCodeBlock(function, MarkType::kFunction, 0));
|
||||
this->stringAppend(result, '\n');
|
||||
wroteFunction = true;
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kTypedef == member->fKeyWord) {
|
||||
this->stringAppend(result, member);
|
||||
this->stringAppend(result, ';');
|
||||
this->stringAppend(result, '\n');
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kDefine == member->fKeyWord) {
|
||||
string body(member->fContentStart, member->length());
|
||||
if (string::npos != body.find('(')) {
|
||||
this->stringAppend(result, body);
|
||||
this->stringAppend(result, '\n');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (KeyWord::kConstExpr == member->fKeyWord) {
|
||||
this->stringAppend(result, member);
|
||||
auto nextMember = def->fTokens.begin();
|
||||
unsigned tokenPos = member->fParentIndex + 1;
|
||||
SkASSERT(tokenPos < def->fTokens.size());
|
||||
std::advance(nextMember, tokenPos);
|
||||
while (member->fContentEnd >= nextMember->fContentStart) {
|
||||
std::advance(nextMember, 1);
|
||||
SkASSERT(++tokenPos < def->fTokens.size());
|
||||
}
|
||||
while (Punctuation::kSemicolon != nextMember->fPunctuation) {
|
||||
std::advance(nextMember, 1);
|
||||
SkASSERT(++tokenPos < def->fTokens.size());
|
||||
}
|
||||
TextParser between(member->fFileName, member->fContentEnd,
|
||||
nextMember->fContentStart, member->fLineCount);
|
||||
between.skipWhiteSpace();
|
||||
if ('=' == between.peek()) {
|
||||
this->stringAppend(result, ' ');
|
||||
string middle(between.fChar, nextMember->fContentStart);
|
||||
this->stringAppend(result, middle);
|
||||
last = nullptr;
|
||||
} else {
|
||||
SkAssertResult(';' == between.peek());
|
||||
}
|
||||
this->stringAppend(result, ';');
|
||||
this->stringAppend(result, '\n');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
string printable = def->printableName();
|
||||
const char* textStart = def->fContentStart;
|
||||
@ -1263,40 +1496,14 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
case MarkType::kClass:
|
||||
case MarkType::kStruct: {
|
||||
fRoot = def->asRoot();
|
||||
this->mdHeaderOut(1);
|
||||
// this->mdHeaderOut(1);
|
||||
this->lfAlways(1);
|
||||
if (MarkType::kStruct == def->fMarkType) {
|
||||
this->htmlOut(anchorDef(def->fFiddle, "Struct " + def->fName));
|
||||
this->htmlOut(anchorDef(def->fFiddle, ""));
|
||||
} else {
|
||||
this->htmlOut(anchorDef(this->linkName(def), "Class " + def->fName));
|
||||
}
|
||||
this->lf(1);
|
||||
if (string::npos != fRoot->fFileName.find("undocumented")) {
|
||||
break;
|
||||
}
|
||||
// if class or struct contains constants, and doesn't contain subtopic kConstant, add it
|
||||
// and add a child populate
|
||||
const Definition* subtopic = def->subtopicParent();
|
||||
const Definition* topic = def->topicParent();
|
||||
for (auto item : SubtopicKeys::kGeneratedSubtopics) {
|
||||
string subname;
|
||||
if (subtopic != topic) {
|
||||
subname = subtopic->fName + '_';
|
||||
}
|
||||
subname += item;
|
||||
if (fRoot->populator(item).fMembers.size()
|
||||
&& !std::any_of(fRoot->fChildren.begin(), fRoot->fChildren.end(),
|
||||
[subname](const Definition* child) {
|
||||
return MarkType::kSubtopic == child->fMarkType
|
||||
&& subname == child->fName;
|
||||
} )) {
|
||||
// generate subtopic
|
||||
this->mdHeaderOut(2);
|
||||
this->htmlOut(anchorDef(subname, item));
|
||||
this->lf(2);
|
||||
// generate populate
|
||||
this->subtopicOut(item);
|
||||
}
|
||||
this->htmlOut(anchorDef(this->linkName(def), ""));
|
||||
}
|
||||
// this->lf(1);
|
||||
} break;
|
||||
case MarkType::kCode:
|
||||
this->lfAlways(2);
|
||||
@ -1325,10 +1532,11 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
if (TableState::kNone == fTableState) {
|
||||
SkASSERT(!*prior || (isConst && MarkType::kConst != (*prior)->fMarkType)
|
||||
|| (!isConst && MarkType::kMember != (*prior)->fMarkType));
|
||||
this->mdHeaderOut(3);
|
||||
FPRINTF("%s", this->fPopulators[isConst ? SubtopicKeys::kConstants :
|
||||
SubtopicKeys::kMembers].fName.c_str());
|
||||
this->lfAlways(2);
|
||||
if (isConst) {
|
||||
this->mdHeaderOut(3);
|
||||
this->writeString(this->fPopulators[SubtopicKeys::kConstants].fPlural);
|
||||
this->lfAlways(2);
|
||||
}
|
||||
FPRINTF("%s", kTableDeclaration);
|
||||
fTableState = TableState::kRow;
|
||||
fOddRow = true;
|
||||
@ -1512,7 +1720,7 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
string method_name = def->methodName();
|
||||
string formattedStr = def->formatFunction(Definition::Format::kIncludeReturn);
|
||||
this->lfAlways(2);
|
||||
this->htmlOut(anchorDef(def->fFiddle, ""));
|
||||
this->htmlOut(this->anchorDef(def->fFiddle, ""));
|
||||
if (!def->isClone()) {
|
||||
this->mdHeaderOutLF(2, 1);
|
||||
FPRINTF("%s", method_name.c_str());
|
||||
@ -1637,16 +1845,88 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
break;
|
||||
case MarkType::kPlatform:
|
||||
break;
|
||||
case MarkType::kPopulate: {
|
||||
SkASSERT(MarkType::kSubtopic == def->fParent->fMarkType);
|
||||
string name = def->fParent->fName;
|
||||
if (string::npos != name.find(SubtopicKeys::kOverview)) {
|
||||
this->subtopicsOut(def->fParent);
|
||||
case MarkType::kPopulate:
|
||||
if (MarkType::kSubtopic == def->fParent->fMarkType) {
|
||||
string name = def->fParent->fName;
|
||||
if (string::npos != name.find(SubtopicKeys::kOverview)) {
|
||||
this->subtopicsOut(def->fParent);
|
||||
} else {
|
||||
this->subtopicOut(name);
|
||||
}
|
||||
} else if (MarkType::kClass == def->fParent->fMarkType
|
||||
|| MarkType::kStruct == def->fParent->fMarkType) {
|
||||
Definition* parent = def->fParent;
|
||||
// SkASSERT(parent->csParent());
|
||||
if (!parent->csParent()) {
|
||||
this->subtopicsOut(def->fParent);
|
||||
}
|
||||
// if class or struct contains constants, and doesn't contain subtopic kConstant,
|
||||
//add it and add a child populate
|
||||
const Definition* subtopic = parent->subtopicParent();
|
||||
const Definition* topic = parent->topicParent();
|
||||
for (auto item : SubtopicKeys::kGeneratedSubtopics) {
|
||||
if (SubtopicKeys::kRelatedFunctions == item) {
|
||||
continue;
|
||||
}
|
||||
if (SubtopicKeys::kMemberFunctions == item) {
|
||||
continue;
|
||||
}
|
||||
string subname;
|
||||
if (subtopic != topic) {
|
||||
subname = subtopic->fName + '_';
|
||||
}
|
||||
subname += item;
|
||||
if (fRoot->populator(item).fMembers.size()
|
||||
&& !std::any_of(fRoot->fChildren.begin(), fRoot->fChildren.end(),
|
||||
[subname](const Definition* child) {
|
||||
return MarkType::kSubtopic == child->fMarkType
|
||||
&& subname == child->fName;
|
||||
} )) {
|
||||
// generate subtopic
|
||||
this->mdHeaderOut(2);
|
||||
string itemStr(item);
|
||||
std::replace(itemStr.begin(), itemStr.end(), '_', ' ');
|
||||
this->htmlOut(anchorDef(subname, itemStr));
|
||||
this->lf(2);
|
||||
// generate populate
|
||||
this->subtopicOut(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->subtopicOut(name);
|
||||
Definition* parent = def->fParent;
|
||||
SkASSERT(parent && MarkType::kCode == parent->fMarkType);
|
||||
// find include matching code parent
|
||||
Definition* grand = parent->fParent;
|
||||
SkASSERT(grand);
|
||||
if (MarkType::kClass == grand->fMarkType
|
||||
|| MarkType::kStruct == grand->fMarkType
|
||||
|| MarkType::kEnum == grand->fMarkType
|
||||
|| MarkType::kEnumClass == grand->fMarkType) {
|
||||
string codeBlock = fIncludeParser.codeBlock(*grand, fInProgress);
|
||||
this->resolveOut(codeBlock.c_str(), codeBlock.c_str() + codeBlock.length(),
|
||||
this->resolvable(parent));
|
||||
} else {
|
||||
SkASSERT(MarkType::kTopic == grand->fMarkType);
|
||||
// use bmh file name to find include file name
|
||||
size_t start = grand->fFileName.rfind("Sk");
|
||||
SkASSERT(start != string::npos && start >= 0);
|
||||
size_t end = grand->fFileName.rfind("_Reference");
|
||||
SkASSERT(end != string::npos && end > start);
|
||||
string incName(grand->fFileName.substr(start, end - start));
|
||||
const Definition* includeDef = fIncludeParser.include(incName + ".h");
|
||||
SkASSERT(includeDef);
|
||||
string codeBlock;
|
||||
this->addCodeBlock(includeDef, codeBlock);
|
||||
this->resolveOut(codeBlock.c_str(), codeBlock.c_str() + codeBlock.length(),
|
||||
this->resolvable(parent));
|
||||
}
|
||||
}
|
||||
} break;
|
||||
break;
|
||||
case MarkType::kPrivate:
|
||||
this->writeString("Private:");
|
||||
this->writeSpace();
|
||||
this->writeBlock(def->length(), def->fContentStart);
|
||||
this->lf(2);
|
||||
break;
|
||||
case MarkType::kReturn:
|
||||
this->mdHeaderOut(3);
|
||||
@ -1701,12 +1981,12 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
// if a subtopic child is const, generate short table of const name, value, line desc
|
||||
if (std::any_of(def->fChildren.begin(), def->fChildren.end(),
|
||||
[](Definition* child){return MarkType::kConst == child->fMarkType;})) {
|
||||
this->summaryOut(def, MarkType::kConst, fPopulators[SubtopicKeys::kConstants].fName);
|
||||
this->summaryOut(def, MarkType::kConst, fPopulators[SubtopicKeys::kConstants].fPlural);
|
||||
}
|
||||
// if a subtopic child is member, generate short table of const name, value, line desc
|
||||
if (std::any_of(def->fChildren.begin(), def->fChildren.end(),
|
||||
[](Definition* child){return MarkType::kMember == child->fMarkType;})) {
|
||||
this->summaryOut(def, MarkType::kMember, fPopulators[SubtopicKeys::kMembers].fName);
|
||||
this->summaryOut(def, MarkType::kMember, fPopulators[SubtopicKeys::kMembers].fPlural);
|
||||
}
|
||||
break;
|
||||
case MarkType::kTable:
|
||||
@ -1738,9 +2018,9 @@ void MdOut::markTypeOut(Definition* def, const Definition** prior) {
|
||||
if (!isUndocumented) {
|
||||
this->populateTables(def, fRoot);
|
||||
}
|
||||
this->mdHeaderOut(1);
|
||||
this->htmlOut(anchorDef(this->linkName(def), printable));
|
||||
this->lf(1);
|
||||
// this->mdHeaderOut(1);
|
||||
// this->htmlOut(anchorDef(this->linkName(def), printable));
|
||||
// this->lf(1);
|
||||
} break;
|
||||
case MarkType::kTypedef:
|
||||
this->mdHeaderOut(2);
|
||||
@ -2097,6 +2377,29 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable
|
||||
}
|
||||
}
|
||||
|
||||
void MdOut::rowOut(string col1, const Definition* col2) {
|
||||
FPRINTF("%s", fOddRow ? kTR_Dark.c_str() : " <tr>");
|
||||
this->lfAlways(1);
|
||||
FPRINTF("%s", kTD_Left.c_str());
|
||||
if ("" != col1) {
|
||||
this->writeString(col1);
|
||||
}
|
||||
FPRINTF("</td>");
|
||||
this->lfAlways(1);
|
||||
FPRINTF("%s", kTD_Left.c_str());
|
||||
TextParser parser(col2->fFileName, col2->fStart, col2->fContentStart, col2->fLineCount);
|
||||
parser.skipExact("#Method");
|
||||
parser.skipSpace();
|
||||
parser.trimEnd();
|
||||
string methodName(parser.fChar, parser.fEnd - parser.fChar);
|
||||
this->htmlOut(this->anchorRef("#" + col2->fFiddle, methodName));
|
||||
this->htmlOut("</td>");
|
||||
this->lfAlways(1);
|
||||
FPRINTF(" </tr>");
|
||||
this->lfAlways(1);
|
||||
fOddRow = !fOddRow;
|
||||
}
|
||||
|
||||
void MdOut::rowOut(const char* name, string description, bool literalName) {
|
||||
FPRINTF("%s", fOddRow ? kTR_Dark.c_str() : " <tr>");
|
||||
this->lfAlways(1);
|
||||
@ -2131,9 +2434,16 @@ void MdOut::subtopicsOut(Definition* def) {
|
||||
this->lfAlways(1);
|
||||
fOddRow = true;
|
||||
for (auto item : SubtopicKeys::kGeneratedSubtopics) {
|
||||
if (SubtopicKeys::kMemberFunctions == item) {
|
||||
continue;
|
||||
}
|
||||
for (auto entry : fRoot->populator(item).fMembers) {
|
||||
if ((csParent && entry->csParent() == csParent)
|
||||
|| entry->subtopicParent() == subtopicParent) {
|
||||
if (SubtopicKeys::kRelatedFunctions == item) {
|
||||
(void) subtopicRowOut(entry->fName, entry); // report all errors
|
||||
continue;
|
||||
}
|
||||
auto popItem = fPopulators.find(item);
|
||||
string description = popItem->second.fOneLiner;
|
||||
if (SubtopicKeys::kConstructors == item) {
|
||||
@ -2143,7 +2453,7 @@ void MdOut::subtopicsOut(Definition* def) {
|
||||
if (subtopicParent != topicParent) {
|
||||
subtopic = subtopicParent->fName + '_';
|
||||
}
|
||||
string link = this->anchorLocalRef(subtopic + item, popItem->second.fName);
|
||||
string link = this->anchorLocalRef(subtopic + item, popItem->second.fPlural);
|
||||
this->rowOut(link.c_str(), description, true);
|
||||
break;
|
||||
}
|
||||
@ -2167,7 +2477,7 @@ void MdOut::subtopicOut(string name) {
|
||||
this->lfAlways(1);
|
||||
if (fPopulators.end() != fPopulators.find(name)) {
|
||||
const SubtopicDescriptions& tableDescriptions = this->populator(name);
|
||||
this->anchorDef(name, tableDescriptions.fName);
|
||||
this->anchorDef(name, tableDescriptions.fPlural);
|
||||
this->lfAlways(1);
|
||||
if (tableDescriptions.fDetails.length()) {
|
||||
string details = csParent->fName;
|
||||
@ -2179,15 +2489,29 @@ void MdOut::subtopicOut(string name) {
|
||||
this->anchorDef(name, name);
|
||||
this->lfAlways(1);
|
||||
}
|
||||
FPRINTF("%s", kTableDeclaration);
|
||||
if (SubtopicKeys::kMembers == name) {
|
||||
return; // members output their own table
|
||||
}
|
||||
const RootDefinition::SubtopicContents& tableContents = fRoot->populator(name.c_str());
|
||||
if (SubtopicKeys::kTypedefs == name && fSubtopic && MarkType::kTopic == fSubtopic->fMarkType) {
|
||||
topicParent = fSubtopic;
|
||||
}
|
||||
this->subtopicOut(name, tableContents.fMembers, csParent, topicParent,
|
||||
tableContents.fShowClones);
|
||||
}
|
||||
|
||||
void MdOut::subtopicOut(string key, const vector<Definition*>& data, const Definition* csParent,
|
||||
const Definition* topicParent, bool showClones) {
|
||||
this->writeString(kTableDeclaration);
|
||||
this->lfAlways(1);
|
||||
FPRINTF("%s", kTopicsTableHeader);
|
||||
this->writeSubtopicTableHeader(key);
|
||||
this->lfAlways(1);
|
||||
fOddRow = true;
|
||||
std::map<string, const Definition*> items;
|
||||
const RootDefinition::SubtopicContents& tableContents = fRoot->populator(name.c_str());
|
||||
auto& data = tableContents.fMembers;
|
||||
for (auto entry : data) {
|
||||
if (!BmhParser::IsExemplary(entry)) {
|
||||
continue;
|
||||
}
|
||||
if (entry->csParent() != csParent && entry->topicParent() != topicParent) {
|
||||
continue;
|
||||
}
|
||||
@ -2198,55 +2522,77 @@ void MdOut::subtopicOut(string name) {
|
||||
start = entry->fName.substr(0, start - 1).rfind("::");
|
||||
}
|
||||
string entryName = entry->fName.substr(string::npos == start ? 0 : start + 1);
|
||||
// fixup_const_function_name(&entry->fName);
|
||||
items[entryName] = entry;
|
||||
}
|
||||
for (auto entry : items) {
|
||||
if (entry.second->fDeprecated) {
|
||||
continue;
|
||||
}
|
||||
const Definition* oneLiner = nullptr;
|
||||
for (auto child : entry.second->fChildren) {
|
||||
if (MarkType::kLine == child->fMarkType) {
|
||||
oneLiner = child;
|
||||
break;
|
||||
}
|
||||
if (!this->subtopicRowOut(entry.first, entry.second)) {
|
||||
return;
|
||||
}
|
||||
if (!oneLiner) {
|
||||
TextParser parser(entry.second->fFileName, entry.second->fStart,
|
||||
entry.second->fContentStart, entry.second->fLineCount);
|
||||
parser.reportError("missing #Line");
|
||||
continue;
|
||||
}
|
||||
string keyName = entry.first;
|
||||
TextParser dummy(entry.second); // for reporting errors, which we won't do
|
||||
if (!this->isDefined(dummy, keyName, BmhParser::Resolvable::kOut)) {
|
||||
keyName = entry.second->fName;
|
||||
size_t doubleColon = keyName.find("::");
|
||||
SkASSERT(string::npos != doubleColon);
|
||||
keyName = keyName.substr(doubleColon + 2);
|
||||
}
|
||||
this->rowOut(keyName.c_str(), string(oneLiner->fContentStart,
|
||||
oneLiner->fContentEnd - oneLiner->fContentStart), false);
|
||||
if (tableContents.fShowClones && entry.second->fCloned) {
|
||||
if (showClones && entry.second->fCloned) {
|
||||
int cloneNo = 2;
|
||||
string builder = entry.second->fName;
|
||||
if ("()" == builder.substr(builder.length() - 2)) {
|
||||
builder = builder.substr(0, builder.length() - 2);
|
||||
}
|
||||
builder += '_';
|
||||
this->rowOut("",
|
||||
preformat(entry.second->formatFunction(Definition::Format::kOmitReturn)), true);
|
||||
this->rowOut("overloads", entry.second);
|
||||
do {
|
||||
string match = builder + to_string(cloneNo);
|
||||
auto child = csParent->findClone(match);
|
||||
if (!child) {
|
||||
break;
|
||||
}
|
||||
this->rowOut("",
|
||||
preformat(child->formatFunction(Definition::Format::kOmitReturn)), true);
|
||||
this->rowOut("", child);
|
||||
} while (++cloneNo);
|
||||
}
|
||||
}
|
||||
FPRINTF("</table>");
|
||||
this->lf(2);
|
||||
}
|
||||
|
||||
bool MdOut::subtopicRowOut(string keyName, const Definition* entry) {
|
||||
const Definition* oneLiner = nullptr;
|
||||
for (auto child : entry->fChildren) {
|
||||
if (MarkType::kLine == child->fMarkType) {
|
||||
oneLiner = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!oneLiner) {
|
||||
TextParser parser(entry->fFileName, entry->fStart,
|
||||
entry->fContentStart, entry->fLineCount);
|
||||
return parser.reportError<bool>("missing #Line");
|
||||
}
|
||||
TextParser dummy(entry); // for reporting errors, which we won't do
|
||||
if (!this->isDefined(dummy, keyName, BmhParser::Resolvable::kOut)) {
|
||||
keyName = entry->fName;
|
||||
size_t doubleColon = keyName.find("::");
|
||||
SkASSERT(string::npos != doubleColon);
|
||||
keyName = keyName.substr(doubleColon + 2);
|
||||
}
|
||||
this->rowOut(keyName.c_str(), string(oneLiner->fContentStart,
|
||||
oneLiner->fContentEnd - oneLiner->fContentStart), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MdOut::writeSubtopicTableHeader(string key) {
|
||||
this->htmlOut("<tr>");
|
||||
this->htmlOut(kTH_Left);
|
||||
if (fPopulators.end() != fPopulators.find(key)) {
|
||||
this->writeString(fPopulators[key].fSingular);
|
||||
} else {
|
||||
this->writeString("Function");
|
||||
}
|
||||
this->htmlOut("</th>");
|
||||
this->lf(1);
|
||||
this->htmlOut(kTH_Left);
|
||||
this->writeString("Description");
|
||||
this->htmlOut("</th>");
|
||||
this->htmlOut("</tr>");
|
||||
}
|
||||
|
||||
#undef kTH_Left
|
||||
|
@ -84,7 +84,7 @@ bool ParserCommon::parseStatus(const char* statusFile, const char* suffix, Statu
|
||||
if (iter.empty()) {
|
||||
return false;
|
||||
}
|
||||
for (string file; iter.next(&file); ) {
|
||||
for (string file; iter.next(&file, nullptr); ) {
|
||||
SkString p = SkOSPath::Join(iter.baseDir().c_str(), file.c_str());
|
||||
const char* hunk = p.c_str();
|
||||
if (!this->parseFromFile(hunk)) {
|
||||
@ -137,6 +137,35 @@ bool ParserCommon::parseSetup(const char* path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ParserCommon::stringAppend(string& result, char ch) const {
|
||||
if (fDebugWriteCodeBlock) {
|
||||
SkDebugf("%c", ch);
|
||||
}
|
||||
result += ch;
|
||||
}
|
||||
|
||||
void ParserCommon::stringAppend(string& result, string str) const {
|
||||
string condense;
|
||||
char last = result.size() ? result.back() : '\n';
|
||||
for (auto c : str) {
|
||||
if (' ' == c && ' ' == last) {
|
||||
continue;
|
||||
}
|
||||
condense += c;
|
||||
if ('\n' != last || ' ' != c) {
|
||||
last = c;
|
||||
}
|
||||
}
|
||||
if (fDebugWriteCodeBlock) {
|
||||
SkDebugf("%s", condense.c_str());
|
||||
}
|
||||
result += condense;
|
||||
}
|
||||
|
||||
void ParserCommon::stringAppend(string& result, const Definition* def) const {
|
||||
this->stringAppend(result, string(def->fContentStart, def->length()));
|
||||
}
|
||||
|
||||
bool ParserCommon::writeBlockIndent(int size, const char* data, bool ignoreIdent) {
|
||||
bool wroteSomething = false;
|
||||
while (size && ' ' >= data[size - 1]) {
|
||||
@ -387,8 +416,10 @@ string StatusIter::baseDir() {
|
||||
|
||||
// FIXME: need to compare fBlockName against fFilter
|
||||
// need to compare fSuffix against next value returned
|
||||
bool StatusIter::next(string* str) {
|
||||
bool StatusIter::next(string* strPtr, StatusFilter *filter) {
|
||||
string str;
|
||||
JsonStatus* status;
|
||||
StatusFilter blockType = StatusFilter::kCompleted;
|
||||
do {
|
||||
do {
|
||||
if (fStack.empty()) {
|
||||
@ -402,7 +433,7 @@ bool StatusIter::next(string* str) {
|
||||
} while (true);
|
||||
if (1 == fStack.size()) {
|
||||
do {
|
||||
StatusFilter blockType = StatusFilter::kUnknown;
|
||||
blockType = StatusFilter::kUnknown;
|
||||
for (unsigned index = 0; index < SK_ARRAY_COUNT(block_names); ++index) {
|
||||
if (status->fIter.key().asString() == block_names[index]) {
|
||||
blockType = (StatusFilter) index;
|
||||
@ -423,7 +454,8 @@ bool StatusIter::next(string* str) {
|
||||
JsonStatus block = {
|
||||
*status->fIter,
|
||||
status->fIter->begin(),
|
||||
status->fIter.key().asString()
|
||||
status->fIter.key().asString(),
|
||||
blockType
|
||||
};
|
||||
fStack.emplace_back(block);
|
||||
status = &(&fStack.back())[-1];
|
||||
@ -431,9 +463,15 @@ bool StatusIter::next(string* str) {
|
||||
status = &fStack.back();
|
||||
continue;
|
||||
}
|
||||
*str = status->fIter->asString();
|
||||
str = status->fIter->asString();
|
||||
if (strPtr) {
|
||||
*strPtr = str;
|
||||
}
|
||||
if (filter) {
|
||||
*filter = status->fStatusFilter;
|
||||
}
|
||||
status->fIter++;
|
||||
if (str->length() - strlen(fSuffix) == str->find(fSuffix)) {
|
||||
if (str.length() - strlen(fSuffix) == str.find(fSuffix)) {
|
||||
return true;
|
||||
}
|
||||
} while (true);
|
||||
@ -452,7 +490,7 @@ bool JsonCommon::parseFromFile(const char* path) {
|
||||
SkDebugf("file %s:\n", path);
|
||||
return this->reportError<bool>("file not parsable");
|
||||
}
|
||||
JsonStatus block = { fRoot, fRoot.begin(), "" };
|
||||
JsonStatus block = { fRoot, fRoot.begin(), "", StatusFilter::kUnknown };
|
||||
fStack.emplace_back(block);
|
||||
return true;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ void BmhParser::spellStatus(const char* statusFile, SkCommandLineFlags::StringAr
|
||||
SpellCheck checker(*this);
|
||||
StatusIter iter(statusFile, ".bmh", StatusFilter::kInProgress);
|
||||
string file;
|
||||
iter.next(&file);
|
||||
iter.next(&file, nullptr);
|
||||
string match = iter.baseDir();
|
||||
checker.check(match.c_str());
|
||||
checker.report(report);
|
||||
|
Loading…
Reference in New Issue
Block a user