aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-01-26 12:56:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 18:22:10 +0000
commit2dc84ad3ef88320f612a9459d53f67b63082aebc (patch)
tree7a68c05581c94b658f7e8ac8bb3e66136b5b55fb /docs
parent33bf56d6b48180ca48c85de0f4f0747b61c1d315 (diff)
working on global enum and image info
Added global enum support. That exposed one big hole in bookmaker: The topic overview should not be in the class or struct if the topic includes multiple objects, which is the case for SkImageInfo and enums like SkColorType. This straightens that out, and then used that knowledge to strengthen the topics in SkRect as a test. Now SkRect has more groups of methods, and can expose and link to sets of methods with the same name. This work also is getting ready for tightening SeeAlso data, to be checked as part of the bots' tasks soon. Also, remove links from markup for lowercase method names unless the reference has trailing parentheses. TBR=caryclark@google.com Docs-Preview: https://skia.org/?cl=98782 Bug: skia:6898 Change-Id: I35419c9789da17e272047bf7b9c95b1cf44bb7fe Reviewed-on: https://skia-review.googlesource.com/98782 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkCanvas_Reference.bmh39
-rw-r--r--docs/SkIRect_Reference.bmh272
-rw-r--r--docs/SkImageInfo_Reference.bmh891
-rw-r--r--docs/SkPaint_Reference.bmh2
-rw-r--r--docs/SkRect_Reference.bmh668
-rw-r--r--docs/SkSurface_Reference.bmh56
-rw-r--r--docs/status.json4
-rw-r--r--docs/undocumented.bmh83
8 files changed, 1532 insertions, 483 deletions
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 4463ea6b3a..9387450922 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -35,7 +35,6 @@ This approach may be deprecated in the future.
# Constants # enum and enum class, const values ##
# Constructors # functions that construct SkPath ##
# Member_Functions # static functions and member methods ##
-# Operators # operator overloading methods ##
#Table ##
#Subtopic ##
@@ -183,19 +182,19 @@ Allocates raster Canvas that will draw directly into pixels.
Canvas is returned if all parameters are valid.
Valid parameters include:
info dimensions are zero or positive;
-info contains Image_Color_Type and Image_Alpha_Type supported by Raster_Surface;
+info contains Color_Type and Alpha_Type supported by Raster_Surface;
pixels is not nullptr;
-rowBytes is zero or large enough to contain info width pixels of Image_Color_Type.
+rowBytes is zero or large enough to contain info width pixels of Color_Type.
Pass zero for rowBytes to compute rowBytes from info width and size of pixel.
If rowBytes is greater than zero, it must be equal to or greater than
-info width times bytes required for Image_Color_Type.
+info width times bytes required for Color_Type.
Pixel buffer size should be info height times computed rowBytes.
Pixels are not initialized.
To access pixels after drawing, call flush() or peekPixels.
-#Param info width, height, Image_Color_Type, Image_Alpha_Type, Color_Space, of Raster_Surface;
+#Param info width, height, Color_Type, Alpha_Type, Color_Space, of Raster_Surface;
width, or height, or both, may be zero
##
#Param pixels pointer to destination pixels buffer
@@ -253,8 +252,8 @@ void draw(SkCanvas* ) {
Allocates raster Canvas specified by inline image specification. Subsequent Canvas
calls draw into pixels.
-Image_Color_Type is set to kN32_SkColorType.
-Image_Alpha_Type is set to kPremul_SkAlphaType.
+Color_Type is set to kN32_SkColorType.
+Alpha_Type is set to kPremul_SkAlphaType.
To access pixels after drawing, call flush() or peekPixels.
Canvas is returned if all parameters are valid.
@@ -265,7 +264,7 @@ rowBytes is zero or large enough to contain width pixels of kN32_SkColorType.
Pass zero for rowBytes to compute rowBytes from width and size of pixel.
If rowBytes is greater than zero, it must be equal to or greater than
-width times bytes required for Image_Color_Type.
+width times bytes required for Color_Type.
Pixel buffer size should be height times rowBytes.
@@ -445,7 +444,7 @@ May be deprecated in the future.
#ToDo Should be deprecated? ##
-#Param bitmap width, height, Image_Color_Type, Image_Alpha_Type, and pixel
+#Param bitmap width, height, Color_Type, Alpha_Type, and pixel
storage of Raster_Surface
##
@@ -534,7 +533,7 @@ Use props to match the device characteristics, like LCD striping.
bitmap is copied so that subsequently editing bitmap will not affect
constructed Canvas.
-#Param bitmap width, height, Image_Color_Type, Image_Alpha_Type,
+#Param bitmap width, height, Color_Type, Alpha_Type,
and pixel storage of Raster_Surface
##
#Param props order and orientation of RGB striping; and whether to use
@@ -656,9 +655,9 @@ The storage is freed when Canvas is deleted.
#Method SkImageInfo imageInfo() const
Returns Image_Info for Canvas. If Canvas is not associated with Raster_Surface or
-GPU_Surface, returned Image_Color_Type is set to kUnknown_SkColorType.
+GPU_Surface, returned Color_Type is set to kUnknown_SkColorType.
-#Return dimensions and Image_Color_Type of Canvas ##
+#Return dimensions and Color_Type of Canvas ##
#Example
SkCanvas emptyCanvas;
@@ -788,7 +787,7 @@ Returns nullptr if no match found.
If props is nullptr, matches Surface_Properties in Canvas. If props is nullptr and Canvas
does not have Surface_Properties, creates Surface with default Surface_Properties.
-#Param info width, height, Image_Color_Type, Image_Alpha_Type, and Color_Space ##
+#Param info width, height, Color_Type, Alpha_Type, and Color_Space ##
#Param props Surface_Properties to match; may be nullptr to match Canvas ##
#Return Surface matching info and props, or nullptr if no match is available ##
@@ -1028,7 +1027,7 @@ class like SkDumpCanvas.
The destination pixel storage must be allocated by the caller.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. dstPixels contents outside Rect intersection are unchanged.
@@ -1043,7 +1042,7 @@ Does not copy, and returns false if:
# dstRowBytes is too small to contain one row of pixels. ##
##
-#Param dstInfo width, height, Image_Color_Type, and Image_Alpha_Type of dstPixels ##
+#Param dstInfo width, height, Color_Type, and Alpha_Type of dstPixels ##
#Param dstPixels storage for pixels; dstInfo.height() times dstRowBytes, or larger ##
#Param dstRowBytes size of one destination row; dstInfo.width() times pixel size, or larger ##
#Param srcX offset into readable pixels in x; may be negative ##
@@ -1120,7 +1119,7 @@ class like SkDumpCanvas.
Caller must allocate pixel storage in pixmap if needed.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination Rects
are copied. pixmap pixels contents outside Rect intersection are unchanged.
@@ -1183,7 +1182,7 @@ class like SkDumpCanvas.
Caller must allocate pixel storage in bitmap if needed.
-Bitmap values are converted only if Image_Color_Type and Image_Alpha_Type
+Bitmap values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. Bitmap pixels outside Rect intersection are unchanged.
@@ -1244,7 +1243,7 @@ Pixels are not writable when SkCanvas is returned by SkDocument::beginPage,
returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility
class like SkDumpCanvas.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. Canvas pixels outside Rect intersection are unchanged.
@@ -1261,7 +1260,7 @@ Does not copy, and returns false if:
# rowBytes is too small to contain one row of pixels. ##
##
-#Param info width, height, Image_Color_Type, and Image_Alpha_Type of pixels ##
+#Param info width, height, Color_Type, and Alpha_Type of pixels ##
#Param pixels pixels to copy, of size info.height() times rowBytes, or larger ##
#Param rowBytes size of one row of pixels; info.width() times pixel size, or larger ##
#Param x offset into Canvas writable pixels in x; may be negative ##
@@ -1302,7 +1301,7 @@ Pixels are not writable when SkCanvas is returned by SkDocument::beginPage,
returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility
class like SkDumpCanvas.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. Canvas pixels outside Rect intersection are unchanged.
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index eb0a3c06b0..62afc71406 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -1,52 +1,44 @@
#Topic IRect
+#Alias IRects
#Alias IRect_Reference
-#Struct SkIRect
-
-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.
-
#Topic Overview
#Subtopic Subtopics
#Table
#Legend
-# name # description ##
+# name # description ##
#Legend ##
-# Constructors # list of functions that construct SkPath ##
-# Member_Functions # list of static functions and member methods ##
-# Operators # operator overloading methods ##
+# Constructors # functions that construct SkIRect ##
+# Member_Functions # static functions and member methods ##
+# Members # member values ##
+# Operators # operator overloading methods ##
+# Related_Functions # similar methods grouped together ##
#Table ##
##
-#Subtopic Constructors
-#Table
-#Legend
-# name # description ##
-#Legend ##
-# MakeEmpty # returns bounds of (0, 0, 0, 0) ##
-# MakeLTRB # constructs from int left, top, right, bottom ##
-# MakeLargest # deprecated ##
-# MakeSize # constructs from ISize returning (0, 0, width, height) ##
-# MakeWH # constructs from int input returning (0, 0, width, height) ##
-# MakeXYWH # constructs from int input returning (x, y, width, height) ##
-# makeInset # constructs from sides moved symmetrically about the center ##
-# makeOffset # constructs from translated sides ##
-# makeOutset # constructs from sides moved symmetrically about the center ##
-# makeSorted # constructs, ordering sides from smaller to larger ##
-#Table ##
-#Subtopic ##
+#Topic Overview ##
-#Subtopic Operators
+#Struct SkIRect
+
+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 Related_Functions
#Table
#Legend
-# name # description ##
+# name # description ##
#Legend ##
-# bool operator!=(const SkIRect& a, const SkIRect& b) # returns true if members are unequal ##
-# bool operator==(const SkIRect& a, const SkIRect& b) # returns true if members are equal ##
+# Inset_Outset_Offset # moves sides ##
+# Intersection # set to shared bounds ##
+# Join # set to union of bounds ##
+# Properties # side values, center, validity ##
+# Rounding # adjust to integer bounds ##
+# Set # replaces all values ##
+# Sorting # orders sides ##
#Table ##
#Subtopic ##
@@ -72,7 +64,7 @@ its top, it is considered empty.
# height() # returns span in y ##
# height64 # returns span in y as int64_t ##
# inset() # moves the sides symmetrically about the center ##
-# intersect # sets to shared area; returns true if not empty ##
+# intersect() # sets to shared area; returns true if not empty ##
# intersectNoEmptyCheck # sets to shared area; returns true if not empty skips empty check ##
# is16Bit # returns true if members fit in 16-bit word ##
# isEmpty # returns true if width or height are zero or negative or they exceed int32_t ##
@@ -102,7 +94,7 @@ its top, it is considered empty.
#Table ##
#Subtopic ##
-#Topic ##
+#Subtopic Members
#Member int32_t fLeft
May contain any value. The smaller of the horizontal values when sorted.
@@ -124,6 +116,25 @@ May contain any value. The larger of the vertical values when sorted.
When equal to or less than fTop, IRect is empty.
##
+#Subtopic Members ##
+
+#Subtopic Constructors
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# MakeEmpty # returns bounds of (0, 0, 0, 0) ##
+# MakeLTRB # constructs from int left, top, right, bottom ##
+# MakeLargest # deprecated ##
+# MakeSize # constructs from ISize returning (0, 0, width, height) ##
+# MakeWH # constructs from int input returning (0, 0, width, height) ##
+# MakeXYWH # constructs from int input returning (x, y, width, height) ##
+# makeInset # constructs from sides moved symmetrically about the center ##
+# makeOffset # constructs from translated sides ##
+# makeOutset # constructs from sides moved symmetrically about the center ##
+# makeSorted # constructs, ordering sides from smaller to larger ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
@@ -163,8 +174,8 @@ outset rect isEmpty: false
Returns constructed IRect set to (0, 0, w, h). Does not validate input; w or h
may be negative.
-#Param w width of constructed Rect ##
-#Param h height of constructed Rect ##
+#Param w width of constructed IRect ##
+#Param h height of constructed IRect ##
#Return bounds (0, 0, w, h) ##
@@ -191,7 +202,7 @@ all equal
Returns constructed IRect set to (0, 0, size.width(), size.height()).
Does not validate input; size.width() or size.height() may be negative.
-#Param size values for Rect width and height ##
+#Param size values for IRect width and height ##
#Return bounds (0, 0, size.width(), size.height()) ##
@@ -215,7 +226,7 @@ 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)
-Returns constructed IRect set to (l, t, r, b). Does not sort input; Rect may
+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.
#Param l integer stored in fLeft ##
@@ -277,6 +288,9 @@ rect: -10, 35, 5, 60 isEmpty: false
##
+#Subtopic Constructors ##
+
+
# ------------------------------------------------------------------------------
#Method int32_t left() const
@@ -554,8 +568,8 @@ original rect: 20, 30, 40, 50 size: 20, 20
#Method int32_t centerX() const
-Returns average of left edge and right edge. Result does not change if Rect
-is sorted. Result may be incorrect if Rect is far from the origin.
+Returns average of left edge and right edge. Result does not change if IRect
+is sorted. Result may be incorrect if IRect is far from the origin.
Result is rounded down.
@@ -585,8 +599,8 @@ left: -10 right: 11 centerX: 0 div2: 0
#Method int32_t centerY() const
-Returns average of top edge and bottom edge. Result does not change if Rect
-is sorted. Result may be incorrect if Rect is far from the origin.
+Returns average of top edge and bottom edge. Result does not change if IRect
+is sorted. Result may be incorrect if IRect is far from the origin.
Result is rounded down.
@@ -668,6 +682,15 @@ sorted: {20, 40, 20, 50} is empty
##
+#Subtopic Operators
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# bool operator!=(const SkIRect& a, const SkIRect& b) # returns true if members are unequal ##
+# bool operator==(const SkIRect& a, const SkIRect& b) # returns true if members are equal ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method bool operator==(const SkIRect& a, const SkIRect& b)
@@ -718,6 +741,8 @@ test != sorted
##
+#Subtopic ##
+
# ------------------------------------------------------------------------------
#Method bool is16Bit() const
@@ -862,6 +887,23 @@ rect: -10, 35, 5, 60 isEmpty: false
##
+#Subtopic Inset_Outset_Offset
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# inset() # moves the sides symmetrically about the center ##
+# makeInset # constructs from sides moved symmetrically about the center ##
+# makeOffset # constructs from translated sides ##
+# makeOutset # constructs from sides moved symmetrically about the center ##
+# offset() # translates sides without changing width and height ##
+# # void offset(int32_t dx, int32_t dy) ##
+# # void offset(const SkIPoint& delta) ##
+# offsetTo # translates to (x, y) without changing width and height ##
+# outset() # moves the sides symmetrically about the center ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method SkIRect makeOffset(int32_t dx, int32_t dy) const
@@ -876,7 +918,7 @@ If dy is positive, IRect returned is moved downward.
#Param dx offset added to fLeft and fRight ##
#Param dy offset added to fTop and fBottom ##
-#Return Rect offset in x or y, with original width and height ##
+#Return IRect offset in x or y, with original width and height ##
#Example
SkIRect rect = { 10, 50, 20, 60 };
@@ -909,7 +951,7 @@ If dy is positive, IRect returned is shorter.
#Param dx offset added to fLeft and subtracted from fRight ##
#Param dy offset added to fTop and subtracted from fBottom ##
-#Return Rect inset symmetrically left and right, top and bottom ##
+#Return IRect inset symmetrically left and right, top and bottom ##
#Example
SkIRect rect = { 10, 50, 20, 60 };
@@ -942,7 +984,7 @@ If dy is positive, IRect returned is taller.
#Param dx offset subtracted to fLeft and added from fRight ##
#Param dy offset subtracted to fTop and added from fBottom ##
-#Return Rect outset symmetrically left and right, top and bottom ##
+#Return IRect outset symmetrically left and right, top and bottom ##
#Example
SkIRect rect = { 10, 50, 20, 60 };
@@ -1071,10 +1113,10 @@ rect: 15, 27, 45, 60
Outsets IRect by (dx, dy).
-If dx is positive, makes Rect wider.
-If dx is negative, makes Rect narrower.
-If dy is positive, makes Rect taller.
-If dy is negative, makes Rect shorter.
+If dx is positive, makes IRect wider.
+If dx is negative, makes IRect narrower.
+If dy is positive, makes IRect taller.
+If dy is negative, makes IRect shorter.
#Param dx subtracted to fLeft and added from fRight ##
#Param dy subtracted to fTop and added from fBottom ##
@@ -1092,6 +1134,42 @@ rect: 5, 1, 55, 86
##
+#Subtopic Inset_Outset_Offset ##
+
+#Subtopic Intersection
+
+IRects intersect when they enclose a common area. To intersect, each of the pair
+must describe area; fLeft is less than fRight, and fTop is less than fBottom;
+empty() returns false. The intersection of IRect pair can be described by:
+
+#Formula
+(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop),
+ min(a.fRight, b.fRight), min(a.fBottom, b.fBottom))
+##
+.
+
+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.
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Intersects # returns true if areas overlap ##
+# IntersectsNoEmptyCheck # returns true if areas overlap skips empty check ##
+# contains() # returns true if points are equal or inside ##
+# # bool contains(int32_t x, int32_t y) const ##
+# # bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const ##
+# # bool contains(const SkIRect& r) const ##
+# intersect() # sets to shared area; returns true if not empty ##
+# # bool intersect(const SkIRect& r) ##
+# # bool intersect(const SkIRect& a, const SkIRect& b) ##
+# # bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom) ##
+# intersectNoEmptyCheck # sets to shared area; returns true if not empty skips empty check ##
+# quickReject # returns true if rectangles do not intersect ##
+#Table ##
+
+
# ------------------------------------------------------------------------------
#Method bool quickReject(int l, int t, int r, int b) const
@@ -1102,10 +1180,10 @@ intersect IRect. Does not check to see if construction or IRect is empty.
Is implemented with short circuit logic so that true can be returned after
a single compare.
-#Param l x minimum of constructed Rect ##
-#Param t y minimum of constructed Rect ##
-#Param r x maximum of constructed Rect ##
-#Param b y maximum of constructed Rect ##
+#Param l x minimum of constructed IRect ##
+#Param t y minimum of constructed IRect ##
+#Param r x maximum of constructed IRect ##
+#Param b y maximum of constructed IRect ##
#Return true if construction and IRect have no area in common ##
@@ -1143,7 +1221,7 @@ Returns true if:
fLeft <= x < fRight && fTop <= y < fBottom
##
.
-Returns false if Rect is empty.
+Returns false if IRect is empty.
Considers input to describe constructed IRect:
#Formula
@@ -1180,16 +1258,16 @@ rect: (30, 50, 40, 60) does not contain (30, 60)
#Method bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const
-Constructs Rect to intersect from (left, top, right, bottom). Does not sort
+Constructs IRect to intersect from (left, top, right, bottom). Does not sort
construction.
-Returns true if Rect contains construction.
-Returns false if Rect is empty or construction is empty.
+Returns true if IRect contains construction.
+Returns false if IRect is empty or construction is empty.
-#Param left x minimum of constructed Rect ##
-#Param top y minimum of constructed Rect ##
-#Param right x maximum of constructed Rect ##
-#Param bottom y maximum of constructed Rect ##
+#Param left x minimum of constructed IRect ##
+#Param top y minimum of constructed IRect ##
+#Param right x maximum of constructed IRect ##
+#Param bottom y maximum of constructed IRect ##
#Return true if all sides of IRect are outside construction ##
@@ -1219,10 +1297,10 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
#Method bool contains(const SkIRect& r) const
-Returns true if Rect contains r.
-Returns false if Rect is empty or r is empty.
+Returns true if IRect contains r.
+Returns false if IRect is empty or r is empty.
-Rect contains r when Rect area completely includes r area.
+IRect contains r when IRect area completely includes r area.
#Param r IRect contained ##
@@ -1252,10 +1330,10 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
#Method bool contains(const SkRect& r) const
-Returns true if Rect contains r.
-Returns false if Rect is empty or r is empty.
+Returns true if IRect contains r.
+Returns false if IRect is empty or r is empty.
-Rect contains r when Rect area completely includes r area.
+IRect contains r when IRect area completely includes r area.
#Param r Rect contained ##
@@ -1289,15 +1367,15 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
Constructs IRect from (left, top, right, bottom). Does not sort
construction.
-Returns true if Rect contains construction.
+Returns true if IRect contains construction.
Asserts if IRect is empty or construction is empty, and if SK_DEBUG is defined.
-Return is undefined if Rect is empty or construction is empty.
+Return is undefined if IRect is empty or construction is empty.
-#Param left x minimum of constructed Rect ##
-#Param top y minimum of constructed Rect ##
-#Param right x maximum of constructed Rect ##
-#Param bottom y maximum of constructed Rect ##
+#Param left x minimum of constructed IRect ##
+#Param top y minimum of constructed IRect ##
+#Param right x maximum of constructed IRect ##
+#Param bottom y maximum of constructed IRect ##
#Return true if all sides of IRect are outside construction ##
@@ -1327,12 +1405,12 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
#Method bool containsNoEmptyCheck(const SkIRect& r) const
-Returns true if Rect contains construction.
+Returns true if IRect contains construction.
Asserts if IRect is empty or construction is empty, and if SK_DEBUG is defined.
-Return is undefined if Rect is empty or construction is empty.
+Return is undefined if IRect is empty or construction is empty.
-#Param r Rect contained ##
+#Param r IRect contained ##
#Return true if all sides of IRect are outside r ##
@@ -1356,18 +1434,6 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
##
-#Topic Intersection
-
-IRects intersect when they enclose a common area. To intersect, each of the pair
-must describe area; fLeft is less than fRight, and fTop is less than fBottom;
-empty() returns false. The intersection of IRect pair can be described by:
-#Formula
-(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop),
- min(a.fRight, b.fRight), min(a.fBottom, b.fBottom))
-##
-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.
-
# ------------------------------------------------------------------------------
#Method bool intersect(const SkIRect& r)
@@ -1379,7 +1445,7 @@ Returns false if either r or IRect is empty, leaving IRect unchanged.
#Param r limit of result ##
-#Return true if r and Rect have area in common ##
+#Return true if r and IRect have area in common ##
#Example
#Description
@@ -1542,24 +1608,24 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
##
-#Topic Intersection ##
+#Subtopic Intersection ##
# ------------------------------------------------------------------------------
#Method void join(int32_t left, int32_t top, int32_t right, int32_t bottom)
-Constructs Rect to intersect from (left, top, right, bottom). Does not sort
+Constructs IRect to intersect from (left, top, right, bottom). Does not sort
construction.
-Sets Rect to the union of itself and the construction.
+Sets IRect to the union of itself and the construction.
-Has no effect if construction is empty. Otherwise, if Rect is empty, sets
-Rect to construction.
+Has no effect if construction is empty. Otherwise, if IRect is empty, sets
+IRect to construction.
-#Param left x minimum of constructed Rect ##
-#Param top y minimum of constructed Rect ##
-#Param right x maximum of constructed Rect ##
-#Param bottom y maximum of constructed Rect ##
+#Param left x minimum of constructed IRect ##
+#Param top y minimum of constructed IRect ##
+#Param right x maximum of constructed IRect ##
+#Param bottom y maximum of constructed IRect ##
#Example
SkIRect rect = { 10, 20, 15, 25};
@@ -1578,11 +1644,11 @@ Rect to construction.
#Method void join(const SkIRect& r)
-Sets Rect to the union of itself and r.
+Sets IRect to the union of itself and r.
-Has no effect if r is empty. Otherwise, if Rect is empty, sets Rect to r.
+Has no effect if r is empty. Otherwise, if IRect is empty, sets IRect to r.
-#Param r expansion Rect ##
+#Param r expansion IRect ##
#Example
SkIRect rect = { 10, 20, 15, 25};
@@ -1624,7 +1690,7 @@ sorted: 20, 10, 30, 50
#Method SkIRect makeSorted() const
-Returns Rect with fLeft and fRight swapped if fLeft is greater than fRight; and
+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;
and width() and height() will be zero or positive.
diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh
new file mode 100644
index 0000000000..8787af0623
--- /dev/null
+++ b/docs/SkImageInfo_Reference.bmh
@@ -0,0 +1,891 @@
+#Topic Image_Info
+#Alias Image_Info_Reference
+
+#Topic Overview
+
+#Subtopic Subtopics
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Constants # enum and enum class, const values ##
+# Constructors # functions that construct ImageInfo ##
+# Member_Functions # static functions and member methods ##
+# Operators # operator overloading methods ##
+#Table ##
+##
+
+#Subtopic Constants
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Alpha_Type # encoding for pixel transparency ##
+# Color_Type # encoding for pixel color components ##
+# SkDestinationSurfaceColorMode # ##
+# SkYUVColorSpace # ##
+#Table ##
+#Subtopic ##
+
+#Topic ##
+
+# ------------------------------------------------------------------------------
+#Topic Alpha_Type
+#Alias Alpha_Type
+#Alias Alpha_Types
+#Enum SkAlphaType
+
+#Code
+ enum SkAlphaType {
+ kUnknown_SkAlphaType,
+ kOpaque_SkAlphaType,
+ kPremul_SkAlphaType,
+ kUnpremul_SkAlphaType,
+ kLastEnum_SkAlphaType = kUnpremul_SkAlphaType,
+ };
+##
+
+Describes how to interpret the alpha component of a pixel.
+
+#Const kUnknown_SkAlphaType 0
+##
+#Const kOpaque_SkAlphaType 1
+All pixels are stored as opaque.
+##
+#Const kPremul_SkAlphaType 2
+All pixels have their alpha premultiplied in their color components.
+This is the natural format for the rendering target pixels.
+##
+#Const kUnpremul_SkAlphaType 3
+All pixels have their color components stored without any regard to the
+alpha. e.g. this is the default configuration for PNG images.
+kUnpremul_SkAlphaType is supported only for input images. Rendering cannot
+generate this on output.
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Enum SkAlphaType ##
+#Topic ##
+
+# ------------------------------------------------------------------------------
+#Topic Color_Type
+#Subtopic Native_Color_Type
+#Alias Native_Color_Type
+#Substitute native SkColorType
+##
+#Alias Color_Type
+#Alias Color_Types
+#Enum SkColorType
+
+#Code
+ enum SkColorType {
+ kUnknown_SkColorType,
+ kAlpha_8_SkColorType,
+ kRGB_565_SkColorType,
+ kARGB_4444_SkColorType,
+ kRGBA_8888_SkColorType,
+ kBGRA_8888_SkColorType,
+ kGray_8_SkColorType,
+ kRGBA_F16_SkColorType,
+ kLastEnum_SkColorType = kRGBA_F16_SkColorType,
+ kN32_SkColorType = kBGRA_8888_SkColorType,
+ kN32_SkColorType = kRGBA_8888_SkColorType,
+ };
+##
+
+Describes how to interpret the components of a pixel.
+kN32_SkColorType is an alias for whichever 32 bit Color_ARGB format is the "native"
+form for skia's blitters. Use this if you don't have a swizzle preference
+for 32 bit pixels.
+
+#Const kUnknown_SkColorType 0
+##
+#Const kAlpha_8_SkColorType 1
+##
+#Const kRGB_565_SkColorType 2
+##
+#Const kARGB_4444_SkColorType 3
+##
+#Const kRGBA_8888_SkColorType 4
+##
+#Const kBGRA_8888_SkColorType 5
+##
+#Const kGray_8_SkColorType 6
+##
+#Const kRGBA_F16_SkColorType 7
+##
+#Const kN32_SkColorType 4
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Enum SkColorType ##
+#Topic ##
+
+# ------------------------------------------------------------------------------
+#Enum SkYUVColorSpace
+
+#Code
+ enum SkYUVColorSpace {
+ kJPEG_SkYUVColorSpace,
+ kRec601_SkYUVColorSpace,
+ kRec709_SkYUVColorSpace,
+ kLastEnum_SkYUVColorSpace = kRec709_SkYUVColorSpace,
+ };
+##
+
+Describes the color space a YUV pixel.
+
+#Const kJPEG_SkYUVColorSpace 0
+Standard JPEG color space.
+##
+#Const kRec601_SkYUVColorSpace 1
+SDTV standard Rec. 601 color space. Uses "studio swing" [16, 235] color
+range. See http://en.wikipedia.org/wiki/Rec._601 for details.
+##
+#Const kRec709_SkYUVColorSpace 2
+HDTV standard Rec. 709 color space. Uses "studio swing" [16, 235] color
+range. See http://en.wikipedia.org/wiki/Rec._709 for details.
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Enum SkYUVColorSpace ##
+
+# ------------------------------------------------------------------------------
+#EnumClass SkDestinationSurfaceColorMode
+
+#Code
+ enum class SkDestinationSurfaceColorMode {
+ kLegacy,
+ kGammaAndColorSpaceAware,
+ };
+##
+
+#Const kLegacy 0
+##
+#Const kGammaAndColorSpaceAware 1
+##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#EnumClass SkDestinationSurfaceColorMode ##
+
+# ------------------------------------------------------------------------------
+
+#Struct SkImageInfo
+
+Describe an image's dimensions and pixel type.
+Used for both src images and render-targets (surfaces).
+
+#Subtopic Operators
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# bool operator!=(const SkImageInfo& other)_const # ##
+# bool operator==(const SkImageInfo& other)_const # ##
+#Table ##
+#Subtopic ##
+
+#Subtopic Member_Functions
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# ByteSizeOverflowed # ##
+# Make # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ##
+# MakeA8 # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ##
+# MakeN32 # creates Image_Info with Native_Color_Type ##
+# MakeN32Premul # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ##
+# MakeS32 # creates Image_Info with Native_Color_Type, sRGB Color_Space ##
+# MakeUnknown # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ##
+# alphaType # ##
+# bounds() # ##
+# bytesPerPixel # ##
+# colorSpace # ##
+# colorType # ##
+# computeByteSize # ##
+# computeMinByteSize # ##
+# computeOffset # ##
+# dimensions() # ##
+# flatten() # ##
+# gammaCloseToSRGB # ##
+# height() # ##
+# isEmpty # ##
+# isOpaque # ##
+# makeAlphaType # creates Image_Info with changed Alpha_Type ##
+# makeColorSpace # creates Image_Info with changed Color_Space ##
+# makeColorType # creates Image_Info with changed Color_Type ##
+# makeWH # creates Image_Info with changed dimensions ##
+# minRowBytes # ##
+# minRowBytes64 # ##
+# refColorSpace # ##
+# reset() # ##
+# shiftPerPixel # ##
+# unflatten() # ##
+# validRowBytes # ##
+# validate() # ##
+# width() # ##
+#Table ##
+#Subtopic ##
+
+#Subtopic Constructors
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Make # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ##
+# MakeA8 # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ##
+# MakeN32 # creates Image_Info with Native_Color_Type ##
+# MakeN32Premul # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ##
+# MakeS32 # creates Image_Info with Native_Color_Type, sRGB Color_Space ##
+# MakeUnknown # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ##
+# SkImageInfo() # creates with zero dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ##
+# makeAlphaType # creates Image_Info with changed Alpha_Type ##
+# makeColorSpace # creates Image_Info with changed Color_Space ##
+# makeColorType # creates Image_Info with changed Color_Type ##
+# makeWH # creates Image_Info with changed dimensions ##
+
+#Table ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkImageInfo()
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
+ sk_sp<SkColorSpace> cs = nullptr)
+
+#Param width incomplete ##
+#Param height incomplete ##
+#Param ct incomplete ##
+#Param at incomplete ##
+#Param cs incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeN32(int width, int height, SkAlphaType at,
+ sk_sp<SkColorSpace> cs = nullptr)
+
+Sets colortype to kN32_SkColorType.
+
+#Param width incomplete ##
+#Param height incomplete ##
+#Param at incomplete ##
+#Param cs incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
+
+Creates Image_Info marked as sRGB with kN32_SkColorType swizzle.
+
+#Param width incomplete ##
+#Param height incomplete ##
+#Param at incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr)
+
+Sets colortype to kN32_SkColorType, and the alphatype to premul.
+
+#Param width incomplete ##
+#Param height incomplete ##
+#Param cs incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeN32Premul(const SkISize& size)
+
+#Param size incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeA8(int width, int height)
+
+#Param width incomplete ##
+#Param height incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeUnknown(int width, int height)
+
+#Param width incomplete ##
+#Param height incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static SkImageInfo MakeUnknown()
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Subtopic Constructors ##
+
+
+# ------------------------------------------------------------------------------
+
+#Method int width() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method int height() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkColorType colorType() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkAlphaType alphaType() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkColorSpace* colorSpace() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method sk_sp<SkColorSpace> refColorSpace() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isEmpty() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool isOpaque() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkISize dimensions() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkIRect bounds() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool gammaCloseToSRGB() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkImageInfo makeWH(int newWidth, int newHeight) const
+
+Creates Image_Info with the same colortype and alphatype as this info,
+but with the specified width and height.
+
+#Param newWidth incomplete ##
+#Param newHeight incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
+
+#Param newAlphaType incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkImageInfo makeColorType(SkColorType newColorType) const
+
+#Param newColorType incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
+
+#Param cs incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method int bytesPerPixel() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method int shiftPerPixel() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method uint64_t minRowBytes64() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t minRowBytes() const
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t computeOffset(int x, int y, size_t rowBytes) const
+
+#Param x incomplete ##
+#Param y incomplete ##
+#Param rowBytes incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool operator==(const SkImageInfo& other)_const
+
+#Param other incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool operator!=(const SkImageInfo& other)_const
+
+#Param other incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void unflatten(SkReadBuffer& buffer)
+
+#Param buffer incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void flatten(SkWriteBuffer& buffer) const
+
+#Param buffer incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t computeByteSize(size_t rowBytes) const
+
+Returns the size (in bytes) of the image buffer that this info needs, given the specified
+rowBytes. The rowBytes must be >= this->minRowBytes().
+if (height == 0) {
+return 0;
+} else {
+return (height - 1) * rowBytes + width * bytes_per_pixel.
+
+If the calculation overflows this returns SK_MaxSizeT.
+
+#Param rowBytes incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t computeMinByteSize() const
+
+Returns the minimum size (in bytes) of the image buffer that this info needs.
+If the calculation overflows, or if the height is 0, this returns 0.
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method static bool ByteSizeOverflowed(size_t byteSize)
+
+Returns true if the result of computeByteSize (or computeMinByteSize) overflowed
+
+#Param byteSize incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool validRowBytes(size_t rowBytes) const
+
+#Param rowBytes incomplete ##
+
+#Return incomplete ##
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void reset()
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+# ------------------------------------------------------------------------------
+
+#Method void validate() const
+
+#Example
+// incomplete
+##
+
+#SeeAlso incomplete
+
+#Method ##
+
+#Struct SkImageInfo ##
+
+#Topic ImageInfo ##
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index 801df43109..c08bc297fd 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -5112,7 +5112,7 @@ Paint may draw to.
#Topic Fast_Bounds ##
# ------------------------------------------------------------------------------
-#Method void toString(SkString* str) const;
+#Method void toString(SkString* str) const
#DefinedBy SK_TO_STRING_NONVIRT() ##
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index 0df650b668..fd223d1f01 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -2,6 +2,23 @@
#Alias Rects
#Alias Rect_Reference
+#Topic Overview
+
+#Subtopic Subtopics
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Constructors # functions that construct SkRect ##
+# Member_Functions # static functions and member methods ##
+# Members # member values ##
+# Operators # operator overloading methods ##
+# Related_Functions # similar methods grouped together ##
+#Table ##
+##
+
+#Topic Overview ##
+
#Struct SkRect
SkRect holds four SkScalar coordinates describing the upper and
@@ -14,48 +31,20 @@ 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.
-#Topic Overview
-
-#Subtopic Subtopics
-#ToDo manually add subtopics ##
-#Table
-#Legend
-# topics # description ##
-#Legend ##
-# Constructors # functions that construct SkPath ##
-# Member_Functions # static functions and member methods ##
-# Operators # operator overloading methods ##
-#Table ##
-##
-
-#Subtopic Constructors
+#Subtopic Related_Functions
#Table
#Legend
-# name # description ##
+# name # description ##
#Legend ##
-# Make # constructs from ISize returning (0, 0, width, height) ##
-# MakeEmpty # constructs from bounds of (0, 0, 0, 0) ##
-# MakeFromIRect # deprecated ##
-# MakeIWH # constructs from int input returning (0, 0, width, height) ##
-# MakeLTRB # constructs from SkScalar left, top, right, bottom ##
-# MakeLargest # deprecated ##
-# MakeSize # constructs from Size returning (0, 0, width, height) ##
-# MakeWH # constructs from SkScalar input returning (0, 0, width, height) ##
-# MakeXYWH # constructs from SkScalar input returning (x, y, width, height) ##
-# makeInset # constructs from sides moved symmetrically about the center ##
-# makeOffset # constructs from translated sides ##
-# makeOutset # constructs from sides moved symmetrically about the center ##
-# makeSorted # constructs, ordering sides from smaller to larger ##
-#Table ##
-#Subtopic ##
-
-#Subtopic Operators
-#Table
-#Legend
-# description # function ##
-#Legend ##
-# bool operator!=(const SkRect& a, const SkRect& b) # returns true if members are unequal ##
-# bool operator==(const SkRect& a, const SkRect& b) # returns true if members are equal ##
+# As_Points # conversion to and from Points ##
+# From_Integers # set Scalar values from integer input ##
+# Inset_Outset_Offset # moves sides ##
+# Intersection # set to shared bounds ##
+# Join # set to union of bounds ##
+# Properties # side values, center, validity ##
+# Rounding # adjust to integer bounds ##
+# Set # replaces all values ##
+# Sorting # orders sides ##
#Table ##
#Subtopic ##
@@ -121,7 +110,7 @@ integer input cannot convert to SkScalar without loss of precision.
#Table ##
#Subtopic ##
-#Topic ##
+#Subtopic Members
#Member SkScalar fLeft
May contain any value, including infinities and NaN. The smaller of the
@@ -143,6 +132,28 @@ 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 Members ##
+
+#Subtopic Constructors
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Make # constructs from ISize returning (0, 0, width, height) ##
+# MakeEmpty # constructs from bounds of (0, 0, 0, 0) ##
+# MakeFromIRect # deprecated ##
+# MakeIWH # constructs from int input returning (0, 0, width, height) ##
+# MakeLTRB # constructs from SkScalar left, top, right, bottom ##
+# MakeLargest # deprecated ##
+# MakeSize # constructs from Size returning (0, 0, width, height) ##
+# MakeWH # constructs from SkScalar input returning (0, 0, width, height) ##
+# MakeXYWH # constructs from SkScalar input returning (x, y, width, height) ##
+# makeInset # constructs from sides moved symmetrically about the center ##
+# makeOffset # constructs from translated sides ##
+# makeOutset # constructs from sides moved symmetrically about the center ##
+# makeSorted # constructs, ordering sides from smaller to larger ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
@@ -402,6 +413,29 @@ than fBottom.
##
+#Subtopic Constructors ##
+
+#Subtopic Properties
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# bottom() # returns larger bounds in y, if sorted ##
+# centerX # returns midpoint in x ##
+# centerY # returns midpoint in y ##
+# height() # returns span in y ##
+# isEmpty # returns true if width or height are zero or negative ##
+# isFinite # returns true if no member is infinite or NaN ##
+# isSorted # returns true if width or height are zero or positive ##
+# left() # returns smaller bounds in x, if sorted ##
+# right() # returns larger bounds in x, if sorted ##
+# top() # returns smaller bounds in y, if sorted ##
+# width() # returns span in x ##
+# x() # returns bounds left ##
+# y() # returns bounds top ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method bool isEmpty() const
@@ -738,6 +772,18 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38
##
+#Subtopic Properties ##
+
+#Subtopic Operators
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# bool operator!=(const SkRect& a, const SkRect& b) # returns true if members are unequal ##
+# bool operator==(const SkRect& a, const SkRect& b) # returns true if members are equal ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method bool operator==(const SkRect& a, const SkRect& b)
@@ -808,6 +854,19 @@ test with NaN is not equal to itself
##
+#Subtopic Operators ##
+
+#Subtopic As_Points
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# setBounds # sets to upper and lower limits of Point array ##
+# setBoundsCheck # sets to upper and lower limits of Point array ##
+# toQuad # returns four corners as Point ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method void toQuad(SkPoint quad[4]) const
@@ -843,6 +902,108 @@ corners: {1, 2} {3, 2} {3, 4} {1, 4}
# ------------------------------------------------------------------------------
+#Method void setBounds(const SkPoint pts[], int count)
+
+Sets to bounds of Point array with count entries. If count is zero or smaller,
+or if Point array contains an infinity or NaN, sets to (0, 0, 0, 0).
+
+Result is either empty or sorted: fLeft is less than or equal to fRight, and
+fTop is less than or equal to fBottom.
+
+#Param pts Point array ##
+#Param count entries in array ##
+
+#Example
+ SkPoint points[] = {{3, 4}, {1, 2}, {5, 6}, {SK_ScalarNaN, 8}};
+ for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) {
+ SkRect rect;
+ rect.setBounds(points, count);
+ if (count > 0) {
+ SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY);
+ } else {
+ SkDebugf("%14s", " ");
+ }
+ SkDebugf("count: %d rect: %g, %g, %g, %g\n", count,
+ rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
+ }
+#StdOut
+ count: 0 rect: 0, 0, 0, 0
+added: 3, 4 count: 1 rect: 3, 4, 3, 4
+added: 1, 2 count: 2 rect: 1, 2, 3, 4
+added: 5, 6 count: 3 rect: 1, 2, 5, 6
+added: nan, 8 count: 4 rect: 0, 0, 0, 0
+##
+##
+
+#SeeAlso set setBoundsCheck SkPath::addPoly
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool setBoundsCheck(const SkPoint pts[], int count)
+
+Sets to bounds of Point array with count entries. Returns false if count is
+zero or smaller, or if Point array contains an infinity or NaN; in these cases
+sets Rect to (0, 0, 0, 0).
+
+Result is either empty or sorted: fLeft is less than or equal to fRight, and
+fTop is less than or equal to fBottom.
+
+#Param pts Point array ##
+#Param count entries in array ##
+
+#Return true if all Point values are finite ##
+
+#Example
+ SkPoint points[] = {{3, 4}, {1, 2}, {5, 6}, {SK_ScalarNaN, 8}};
+ for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) {
+ SkRect rect;
+ bool success = rect.setBoundsCheck(points, count);
+ if (count > 0) {
+ SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY);
+ } else {
+ SkDebugf("%14s", " ");
+ }
+ SkDebugf("count: %d rect: %g, %g, %g, %g success: %s\n", count,
+ rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, success ? "true" : "false");
+ }
+#StdOut
+ count: 0 rect: 0, 0, 0, 0 success: true
+added: 3, 4 count: 1 rect: 3, 4, 3, 4 success: true
+added: 1, 2 count: 2 rect: 1, 2, 3, 4 success: true
+added: 5, 6 count: 3 rect: 1, 2, 5, 6 success: true
+added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
+##
+##
+
+#SeeAlso set setBounds SkPath::addPoly
+
+##
+
+#Subtopic As_Points ##
+
+#Subtopic Set
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# iset() # sets to int input (left, top, right, bottom) ##
+# isetWH # sets to int input (0, 0, width, height) ##
+# set() # sets to SkScalar input (left, top, right, bottom) and others ##
+# # void set(const SkIRect& src) ##
+# # void set(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) ##
+# # void set(const SkPoint pts[], int count) ##
+# # void set(const SkPoint& p0, const SkPoint& p1) ##
+# setEmpty # sets to (0, 0, 0, 0) ##
+# setLTRB # sets to SkScalar input (left, top, right, bottom) ##
+# setWH # sets to SkScalar input (0, 0, width, height) ##
+# setXYWH # sets to SkScalar input (x, y, width, height) ##
+#Table ##
+
+# ------------------------------------------------------------------------------
+
#Method void setEmpty()
Sets Rect to (0, 0, 0, 0).
@@ -953,63 +1114,6 @@ rect2: {3, 4, 1, 2}
# ------------------------------------------------------------------------------
-#Method void iset(int left, int top, int right, int bottom)
-
-Sets Rect to (left, top, right, bottom).
-All parameters are promoted from integer to Scalar.
-left and right are not sorted; left is not necessarily less than right.
-top and bottom are not sorted; top is not necessarily less than bottom.
-
-#Param left promoted to SkScalar and stored in fLeft ##
-#Param top promoted to SkScalar and stored in fTop ##
-#Param right promoted to SkScalar and stored in fRight ##
-#Param bottom promoted to SkScalar and stored in fBottom ##
-
-#Example
- SkRect rect1 = {3, 4, 1, 2};
- SkDebugf("rect1: {%g, %g, %g, %g}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
- SkRect rect2;
- rect2.iset(3, 4, 1, 2);
- SkDebugf("rect2: {%g, %g, %g, %g}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
-#StdOut
-rect1: {3, 4, 1, 2}
-rect2: {3, 4, 1, 2}
-##
-##
-
-#SeeAlso set setLTRB SkIRect::set SkIntToScalar
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method void isetWH(int width, int height)
-
-Sets Rect to (0, 0, width, height).
-width and height may be zero or negative. width and height are promoted from
-integer to SkScalar, large values may lose precision.
-
-#Param width promoted to SkScalar and stored in fRight ##
-#Param height promoted to SkScalar and stored in fBottom ##
-
-#Example
- SkRect rect1 = {0, 0, 1, 2};
- SkDebugf("rect1: {%g, %g, %g, %g}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
- SkRect rect2;
- rect2.isetWH(1, 2);
- SkDebugf("rect2: {%g, %g, %g, %g}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
-#StdOut
-rect1: {0, 0, 1, 2}
-rect2: {0, 0, 1, 2}
-##
-##
-
-#SeeAlso MakeWH MakeXYWH iset() SkIRect:MakeWH
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method void set(const SkPoint pts[], int count)
Sets to bounds of Point array with count entries. If count is zero or smaller,
@@ -1049,87 +1153,6 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0
# ------------------------------------------------------------------------------
-#Method void setBounds(const SkPoint pts[], int count)
-
-Sets to bounds of Point array with count entries. If count is zero or smaller,
-or if Point array contains an infinity or NaN, sets to (0, 0, 0, 0).
-
-Result is either empty or sorted: fLeft is less than or equal to fRight, and
-fTop is less than or equal to fBottom.
-
-#Param pts Point array ##
-#Param count entries in array ##
-
-#Example
- SkPoint points[] = {{3, 4}, {1, 2}, {5, 6}, {SK_ScalarNaN, 8}};
- for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) {
- SkRect rect;
- rect.setBounds(points, count);
- if (count > 0) {
- SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY);
- } else {
- SkDebugf("%14s", " ");
- }
- SkDebugf("count: %d rect: %g, %g, %g, %g\n", count,
- rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
- }
-#StdOut
- count: 0 rect: 0, 0, 0, 0
-added: 3, 4 count: 1 rect: 3, 4, 3, 4
-added: 1, 2 count: 2 rect: 1, 2, 3, 4
-added: 5, 6 count: 3 rect: 1, 2, 5, 6
-added: nan, 8 count: 4 rect: 0, 0, 0, 0
-##
-##
-
-#SeeAlso set setBoundsCheck SkPath::addPoly
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method bool setBoundsCheck(const SkPoint pts[], int count)
-
-Sets to bounds of Point array with count entries. Returns false if count is
-zero or smaller, or if Point array contains an infinity or NaN; in these cases
-sets Rect to (0, 0, 0, 0).
-
-Result is either empty or sorted: fLeft is less than or equal to fRight, and
-fTop is less than or equal to fBottom.
-
-#Param pts Point array ##
-#Param count entries in array ##
-
-#Return true if all Point values are finite ##
-
-#Example
- SkPoint points[] = {{3, 4}, {1, 2}, {5, 6}, {SK_ScalarNaN, 8}};
- for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) {
- SkRect rect;
- bool success = rect.setBoundsCheck(points, count);
- if (count > 0) {
- SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY);
- } else {
- SkDebugf("%14s", " ");
- }
- SkDebugf("count: %d rect: %g, %g, %g, %g success: %s\n", count,
- rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, success ? "true" : "false");
- }
-#StdOut
- count: 0 rect: 0, 0, 0, 0 success: true
-added: 3, 4 count: 1 rect: 3, 4, 3, 4 success: true
-added: 1, 2 count: 2 rect: 1, 2, 3, 4 success: true
-added: 5, 6 count: 3 rect: 1, 2, 5, 6 success: true
-added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
-##
-##
-
-#SeeAlso set setBounds SkPath::addPoly
-
-##
-
-# ------------------------------------------------------------------------------
-
#Method void set(const SkPoint& p0, const SkPoint& p1)
Sets bounds to the smallest Rect enclosing Points p0 and p1. The result is
@@ -1217,6 +1240,94 @@ rect: -15, 0, 0, 25 isEmpty: false
##
+#Subtopic Set ##
+
+#Subtopic From_Integers
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# iset() # sets to int input (left, top, right, bottom) ##
+# isetWH # sets to int input (0, 0, width, height) ##
+#Table ##
+
+# ------------------------------------------------------------------------------
+
+#Method void iset(int left, int top, int right, int bottom)
+
+Sets Rect to (left, top, right, bottom).
+All parameters are promoted from integer to Scalar.
+left and right are not sorted; left is not necessarily less than right.
+top and bottom are not sorted; top is not necessarily less than bottom.
+
+#Param left promoted to SkScalar and stored in fLeft ##
+#Param top promoted to SkScalar and stored in fTop ##
+#Param right promoted to SkScalar and stored in fRight ##
+#Param bottom promoted to SkScalar and stored in fBottom ##
+
+#Example
+ SkRect rect1 = {3, 4, 1, 2};
+ SkDebugf("rect1: {%g, %g, %g, %g}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
+ SkRect rect2;
+ rect2.iset(3, 4, 1, 2);
+ SkDebugf("rect2: {%g, %g, %g, %g}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
+#StdOut
+rect1: {3, 4, 1, 2}
+rect2: {3, 4, 1, 2}
+##
+##
+
+#SeeAlso set setLTRB SkIRect::set SkIntToScalar
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method void isetWH(int width, int height)
+
+Sets Rect to (0, 0, width, height).
+width and height may be zero or negative. width and height are promoted from
+integer to SkScalar, large values may lose precision.
+
+#Param width promoted to SkScalar and stored in fRight ##
+#Param height promoted to SkScalar and stored in fBottom ##
+
+#Example
+ SkRect rect1 = {0, 0, 1, 2};
+ SkDebugf("rect1: {%g, %g, %g, %g}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
+ SkRect rect2;
+ rect2.isetWH(1, 2);
+ SkDebugf("rect2: {%g, %g, %g, %g}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
+#StdOut
+rect1: {0, 0, 1, 2}
+rect2: {0, 0, 1, 2}
+##
+##
+
+#SeeAlso MakeWH MakeXYWH iset() SkIRect:MakeWH
+
+##
+
+#Subtopic From_Integers ##
+
+#Subtopic Inset_Outset_Offset
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# inset() # moves the sides symmetrically about the center ##
+# makeInset # constructs from sides moved symmetrically about the center ##
+# makeOffset # constructs from translated sides ##
+# makeOutset # constructs from sides moved symmetrically about the center ##
+# offset() # translates sides without changing width and height ##
+# # void offset(SkScalar dx, SkScalar dy) ##
+# # void offset(const SkPoint& delta) ##
+# offsetTo # translates to (x, y) without changing width and height ##
+# outset() # moves the sides symmetrically about the center ##
+#Table ##
+
# ------------------------------------------------------------------------------
#Method SkRect makeOffset(SkScalar dx, SkScalar dy) const
@@ -1447,7 +1558,9 @@ rect: 5, 1, 55, 86
##
-#Topic Intersection
+#Subtopic Inset_Outset_Offset ##
+
+#Subtopic Intersection
Rects intersect when they enclose a common area. To intersect, each of the pair
must describe area; fLeft is less than fRight, and fTop is less than fBottom;
@@ -1462,6 +1575,89 @@ 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.
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# Intersects # returns true if areas overlap ##
+# contains() # returns true if points are equal or inside ##
+# # bool contains(const SkRect& r) const ##
+# # bool contains(const SkIRect& r) const ##
+# intersect() # sets to shared area; returns true if not empty ##
+# # bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) ##
+# # bool intersect(const SkRect& r) ##
+# # bool intersect(const SkRect& a, const SkRect& b) ##
+# intersects() # returns true if areas overlap ##
+# # bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) const ##
+# # bool intersects(const SkRect& r) const ##
+#Table ##
+
+# ------------------------------------------------------------------------------
+
+#Method bool contains(const SkRect& r) const
+
+Returns true if Rect contains r.
+Returns false if Rect is empty or r is empty.
+
+Rect contains r when Rect area completely includes r area.
+
+#Param r Rect contained ##
+
+#Return true if all sides of Rect are outside r ##
+
+#Example
+ SkRect rect = { 30, 50, 40, 60 };
+ SkRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
+ for (auto contained : tests) {
+ SkDebugf("rect: (%g, %g, %g, %g) %s (%g, %g, %g, %g)\n",
+ rect.left(), rect.top(), rect.right(), rect.bottom(),
+ rect.contains(contained) ? "contains" : "does not contain",
+ contained.left(), contained.top(), contained.right(), contained.bottom());
+ }
+#StdOut
+rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
+rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
+rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
+##
+##
+
+#SeeAlso SkIRect::contains
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool contains(const SkIRect& r) const
+
+Returns true if Rect contains r.
+Returns false if Rect is empty or r is empty.
+
+Rect contains r when Rect area completely includes r area.
+
+#Param r IRect contained ##
+
+#Return true if all sides of Rect are outside r ##
+
+#Example
+ SkRect rect = { 30, 50, 40, 60 };
+ SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
+ for (auto contained : tests) {
+ SkDebugf("rect: (%g, %g, %g, %g) %s (%d, %d, %d, %d)\n",
+ rect.left(), rect.top(), rect.right(), rect.bottom(),
+ rect.contains(contained) ? "contains" : "does not contain",
+ contained.left(), contained.top(), contained.right(), contained.bottom());
+ }
+#StdOut
+rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
+rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
+rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
+##
+##
+
+#SeeAlso SkIRect::contains
+
+##
+
# ------------------------------------------------------------------------------
#Method bool intersect(const SkRect& r)
@@ -1636,8 +1832,20 @@ Returns false if either a or b is empty, or do not intersect.
##
-#Topic Intersection ##
+#Subtopic Intersection ##
+#Subtopic Join
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# join() # sets to union of bounds ##
+# # void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) ##
+# # void join(const SkRect& r) ##
+# joinNonEmptyArg # sets to union of bounds, asserting that argument is not empty ##
+# joinPossiblyEmptyRect # sets to union of bounds. Skips empty check for both ##
+#Table ##
# ------------------------------------------------------------------------------
@@ -1758,75 +1966,23 @@ sorted: 10, 0, 55, 100
##
-# ------------------------------------------------------------------------------
-
-#Method bool contains(const SkRect& r) const
-
-Returns true if Rect contains r.
-Returns false if Rect is empty or r is empty.
-
-Rect contains r when Rect area completely includes r area.
-
-#Param r Rect contained ##
-
-#Return true if all sides of Rect are outside r ##
-
-#Example
- SkRect rect = { 30, 50, 40, 60 };
- SkRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
- for (auto contained : tests) {
- SkDebugf("rect: (%g, %g, %g, %g) %s (%g, %g, %g, %g)\n",
- rect.left(), rect.top(), rect.right(), rect.bottom(),
- rect.contains(contained) ? "contains" : "does not contain",
- contained.left(), contained.top(), contained.right(), contained.bottom());
- }
-#StdOut
-rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
-rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
-rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
-##
-##
-
-#SeeAlso SkIRect::contains
-
-##
-
-# ------------------------------------------------------------------------------
-
-#Method bool contains(const SkIRect& r) const
-
-Returns true if Rect contains r.
-Returns false if Rect is empty or r is empty.
-
-Rect contains r when Rect area completely includes r area.
-
-#Param r IRect contained ##
-
-#Return true if all sides of Rect are outside r ##
-
-#Example
- SkRect rect = { 30, 50, 40, 60 };
- SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
- for (auto contained : tests) {
- SkDebugf("rect: (%g, %g, %g, %g) %s (%d, %d, %d, %d)\n",
- rect.left(), rect.top(), rect.right(), rect.bottom(),
- rect.contains(contained) ? "contains" : "does not contain",
- contained.left(), contained.top(), contained.right(), contained.bottom());
- }
-#StdOut
-rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
-rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
-rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
-##
-##
-
-#SeeAlso SkIRect::contains
-
-##
+#Subtopic Join ##
-#Topic Round
+#Subtopic Rounding
-# ------------------------------------------------------------------------------
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# round() # sets members to nearest integer value ##
+# # void round(SkIRect* dst) const ##
+# # SkIRect round() const ##
+# roundIn # sets members to nearest integer value towards opposite ##
+# roundOut # sets members to nearest integer value away from opposite ##
+# # void roundOut(SkIRect* dst) const ##
+# # void roundOut(SkRect* dst) const ##
+# # SkIRect roundOut() const ##
+#Table ##
#Method void round(SkIRect* dst) const
@@ -1993,7 +2149,17 @@ round: 30, 50, 41, 61
##
-#Topic Round ##
+#Subtopic Rounding ##
+
+#Subtopic Sorting
+
+#Table
+#Legend
+# name # description ##
+#Legend ##
+# makeSorted # constructs, ordering sides from smaller to larger ##
+# sort() # orders sides from smaller to larger ##
+#Table ##
# ------------------------------------------------------------------------------
@@ -2014,7 +2180,7 @@ sorted: 20.5, 10.5, 30.5, 50.5
##
##
-#SeeAlso makeSorted SkIRect::sort
+#SeeAlso makeSorted SkIRect::sort isSorted
##
@@ -2039,10 +2205,12 @@ sorted: 20.5, 10.5, 30.5, 50.5
##
##
-#SeeAlso sort SkIRect::makeSorted
+#SeeAlso sort SkIRect::makeSorted isSorted
##
+#Subtopic Sorting ##
+
# ------------------------------------------------------------------------------
#Method const SkScalar* asScalars() const
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh
index 164570d422..396d3c240d 100644
--- a/docs/SkSurface_Reference.bmh
+++ b/docs/SkSurface_Reference.bmh
@@ -90,15 +90,15 @@ Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
Surface is returned if all parameters are valid.
Valid parameters include:
info dimensions are greater than zero;
-info contains Image_Color_Type and Image_Alpha_Type supported by Raster_Surface;
+info contains Color_Type and Alpha_Type supported by Raster_Surface;
pixels is not nullptr;
-rowBytes is large enough to contain info width pixels of Image_Color_Type.
+rowBytes is large enough to contain info width pixels of Color_Type.
Pixel buffer size should be info height times computed rowBytes.
Pixels are not initialized.
To access pixels after drawing, call flush() or peekPixels.
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width and height must be greater than zero
##
#Param pixels pointer to destination pixels buffer ##
@@ -153,15 +153,15 @@ releaseProc is called with pixels and context when Surface is deleted.
Surface is returned if all parameters are valid.
Valid parameters include:
info dimensions are greater than zero;
-info contains Image_Color_Type and Image_Alpha_Type supported by Raster_Surface;
+info contains Color_Type and Alpha_Type supported by Raster_Surface;
pixels is not nullptr;
-rowBytes is large enough to contain info width pixels of Image_Color_Type.
+rowBytes is large enough to contain info width pixels of Color_Type.
Pixel buffer size should be info height times computed rowBytes.
Pixels are not initialized.
To access pixels after drawing, call flush() or peekPixels.
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width and height must be greater than zero
##
#Param pixels pointer to destination pixels buffer ##
@@ -229,13 +229,13 @@ Pixel memory is deleted when Surface is deleted.
Surface is returned if all parameters are valid.
Valid parameters include:
info dimensions are greater than zero;
-info contains Image_Color_Type and Image_Alpha_Type supported by Raster_Surface;
-rowBytes is large enough to contain info width pixels of Image_Color_Type, or is zero.
+info contains Color_Type and Alpha_Type supported by Raster_Surface;
+rowBytes is large enough to contain info width pixels of Color_Type, or is zero.
If rowBytes is not zero, subsequent images returned by makeImageSnapshot
have the same rowBytes.
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width and height must be greater than zero
##
#Param rowBytes interval from one Surface row to the next; may be zero ##
@@ -292,9 +292,9 @@ Pixel memory is deleted when Surface is deleted.
Surface is returned if all parameters are valid.
Valid parameters include:
info dimensions are greater than zero;
-info contains Image_Color_Type and Image_Alpha_Type supported by Raster_Surface.
+info contains Color_Type and Alpha_Type supported by Raster_Surface.
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width and height must be greater than zero
##
#Param props LCD striping orientation and setting for device independent fonts;
@@ -735,10 +735,10 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
bool shouldCreateWithMips = false)
Returns offscreen Surface on GPU indicated by context. Allocates memory for
-pixels, based on the width, height, and Image_Color_Type in ImageInfo. budgeted
+pixels, based on the width, height, and Color_Type in ImageInfo. budgeted
selects whether allocation for offscreen pixels is tracked by context. imageInfo
-describes the pixel format in Image_Color_Type, and transparency in
-Image_Alpha_Type, and color matching in Color_Space.
+describes the pixel format in Color_Type, and transparency in
+Alpha_Type, and color matching in Color_Space.
sampleCount requests the number of samples per pixel.
Pass zero to disable Multi_Sample_Anti_Aliasing. The request is rounded
@@ -753,7 +753,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
#Param context GPU_Context ##
#Param budgeted one of: SkBudgeted::kNo, SkBudgeted::kYes ##
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space;
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space;
width, or height, or both, may be zero
##
#Param sampleCount samples per pixel, or 0 to disable full scene anti-aliasing ##
@@ -800,10 +800,10 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
const SkSurfaceProps* props)
Returns offscreen Surface on GPU indicated by context. Allocates memory for
-pixels, based on the width, height, and Image_Color_Type in ImageInfo. budgeted
+pixels, based on the width, height, and Color_Type in ImageInfo. budgeted
selects whether allocation for offscreen pixels is tracked by context. imageInfo
-describes the pixel format in Image_Color_Type, and transparency in
-Image_Alpha_Type, and color matching in Color_Space.
+describes the pixel format in Color_Type, and transparency in
+Alpha_Type, and color matching in Color_Space.
sampleCount requests the number of samples per pixel.
Pass zero to disable Multi_Sample_Anti_Aliasing. The request is rounded
@@ -814,7 +814,7 @@ Surface bottom-left corner is pinned to the origin.
#Param context GPU_Context ##
#Param budgeted one of: SkBudgeted::kNo, SkBudgeted::kYes ##
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width, or height, or both, may be zero
##
#Param sampleCount samples per pixel, or 0 to disable Multi_Sample_Anti_Aliasing ##
@@ -872,16 +872,16 @@ void draw(SkCanvas* canvas) {
const SkImageInfo& imageInfo)
Returns offscreen Surface on GPU indicated by context. Allocates memory for
-pixels, based on the width, height, and Image_Color_Type in ImageInfo. budgeted
+pixels, based on the width, height, and Color_Type in ImageInfo. budgeted
selects whether allocation for offscreen pixels is tracked by context. imageInfo
-describes the pixel format in Image_Color_Type, and transparency in
-Image_Alpha_Type, and color matching in Color_Space.
+describes the pixel format in Color_Type, and transparency in
+Alpha_Type, and color matching in Color_Space.
Surface bottom-left corner is pinned to the origin.
#Param context GPU_Context ##
#Param budgeted one of: SkBudgeted::kNo, SkBudgeted::kYes ##
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Raster_Surface; width, or height, or both, may be zero
##
@@ -1282,7 +1282,7 @@ does not share the same pixels.
Returns nullptr if imageInfo width or height are zero, or if imageInfo
is incompatible with Surface.
-#Param imageInfo width, height, Image_Color_Type, Image_Alpha_Type, Color_Space,
+#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Surface; width and height must be greater than zero
##
@@ -1422,7 +1422,7 @@ Pixels are readable when Surface is raster, or backed by a GPU.
The destination pixel storage must be allocated by the caller.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. dst contents outside Rect intersection are unchanged.
@@ -1481,7 +1481,7 @@ Pixels are readable when Surface is raster, or backed by a GPU.
The destination pixel storage must be allocated by the caller.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. dstPixels contents outside Rect intersection are unchanged.
@@ -1495,7 +1495,7 @@ Does not copy, and returns false if:
# dstRowBytes is too small to contain one row of pixels. ##
##
-#Param dstInfo width, height, Image_Color_Type, and Image_Alpha_Type of dstPixels ##
+#Param dstInfo width, height, Color_Type, and Alpha_Type of dstPixels ##
#Param dstPixels storage for pixels; dstInfo.height() times dstRowBytes, or larger ##
#Param dstRowBytes size of one destination row; dstInfo.width() times pixel size, or larger ##
#Param srcX offset into readable pixels in x; may be negative ##
@@ -1546,7 +1546,7 @@ Pixels are readable when Surface is raster, or backed by a GPU.
The destination pixel storage must be allocated by the caller.
-Pixel values are converted only if Image_Color_Type and Image_Alpha_Type
+Pixel values are converted only if Color_Type and Alpha_Type
do not match. Only pixels within both source and destination rectangles
are copied. dst contents outside Rect intersection are unchanged.
diff --git a/docs/status.json b/docs/status.json
index 3aeea76992..09a0b80955 100644
--- a/docs/status.json
+++ b/docs/status.json
@@ -33,11 +33,13 @@
"InProgress": {
"include": {
"core": [
- "SkImage.h"
+ "SkImage.h",
+ "SkImageInfo.h"
]
},
"docs": [
"SkImage_Reference.bmh",
+ "SkImageInfo_Reference.bmh",
"overview.bmh",
"usingBookmaker.bmh"
]
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index 235a9e7ff6..150e2bcd47 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -344,86 +344,6 @@ FT_Load_Glyph
##
##
-#Topic Image_Alpha_Type
-#Alias Alpha_Type
-#Alias Alpha_Types
- #Enum SkAlphaType
- #Const kUnknown_SkAlphaType 0
- ##
- #Const kOpaque_SkAlphaType 1
- ##
- #Const kPremul_SkAlphaType 2
- ##
- #Const kUnpremul_SkAlphaType 3
- ##
- ##
-#Topic ##
-#Topic Image_Color_Type
-#Subtopic Native_Color_Type
-#Alias Native_Color_Type
-#Substitute native SkColorType
-##
-#Alias Color_Type
-#Alias Color_Types
- #Enum SkColorType
- #Const kUnknown_SkColorType 0
- ##
- #Const kAlpha_8_SkColorType 1
- ##
- #Const kRGB_565_SkColorType 2
- ##
- #Const kARGB_4444_SkColorType 3
- ##
- #Const kRGBA_8888_SkColorType 4
- ##
- #Const kBGRA_8888_SkColorType 5
- ##
- #Const kIndex_8_SkColorType 6
- ##
- #Const kGray_8_SkColorType 7
- ##
- #Const kRGBA_F16_SkColorType 8
- ##
- #ToDo this is a lie; need to not require values for consts ##
- #Const kN32_SkColorType 4
- ##
- #Enum ##
-#Topic ##
-#Topic Image_Info
- #Struct SkImageInfo
- #Method SkImageInfo()
- ##
- #Method static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr)
- ##
- #Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
- ##
- #Method size_t minRowBytes() const
- ##
- #Method bool isOpaque() const
- ##
- #Method int bytesPerPixel() const
- ##
- #Method int height() const
- ##
- #Method int width() const
- ##
- #Method SkColorType colorType() const
- ##
- #Method SkAlphaType alphaType() const
- ##
- #Method SkColorSpace* colorSpace() const
- ##
- #Method bool isOpaque() const
- ##
- #Method size_t minRowBytes() const
- ##
- #Method size_t computeByteSize(size_t rowBytes) const
- ##
- #Method void validate() const
- ##
- ##
-#Topic ##
-
#Topic Image_Filter
#Subtopic Scaling
#Subtopic ##
@@ -556,6 +476,9 @@ FT_Load_Glyph
#Const SK_MaxS32
to be written
##
+ #Const SK_MaxSizeT
+ to be written
+ ##
#Typedef int32_t SkUnichar
#Typedef ##
#Typedef unsigned U8CPU