BGRABitmap Geometry types: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: BGRABitmap Geometry types
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Here are all the basic geometry types used in [[BGRABitmap]] library. They are provided by _BGRABitmapTypes_ unit. | |
| 2 | + | ||
| 3 | + | ## Contents | |
| 4 | + | ||
| 5 | + | * 1 Geometry types | |
| 6 | + | * 1.1 2D points | |
| 7 | + | * 1.2 3D points | |
| 8 | + | * 1.3 Rectangles | |
| 9 | + | * 1.4 Paths | |
| 10 | + | * 1.5 Polygon filling | |
| 11 | + | * 1.6 Arrows | |
| 12 | + | * 1.7 Gradients | |
| 13 | + | * 1.8 Bézier curves | |
| 14 | + | ||
| 15 | + | ### Geometry types | |
| 16 | + | ||
| 17 | + | #### 2D points | |
| 18 | + | ||
| 19 | + | _TPoint_ = BGRAClasses.TPoint; | |
| 20 | + | --- | |
| 21 | + | | Represents a point with X and Y integer coordinates | |
| 22 | + | | **const** EmptyPoint : TPoint = (X: -2147483648; Y: -2147483648); | |
| 23 | + | | | A constant representing an empty point (with minimum possible integer values for X and Y) that can be used as a separator in a list of TPoint | |
| 24 | + | | **function** IsEmptyPoint(**const** APoint: TPoint): boolean; | |
| 25 | + | | | Checks if the given point is equivalent to EmptyPoint | |
| 26 | + | **const** EmptySingle = single(-3.402823e38); | |
| 27 | + | | Value indicating that there is nothing in the single-precision floating point value. It is also used as a separator in lists | |
| 28 | + | _PPointF_ = ^BGRAClasses.TPointF; | |
| 29 | + | | Pointer to a TPointF structure | |
| 30 | + | _TPointF_ = BGRAClasses.TPointF; | |
| 31 | + | | Contains a point with single-precision floating point coordinates | |
| 32 | + | | **const** EmptyPointF: TPointF = (x: -3.402823e38; y: -3.402823e38); | |
| 33 | + | | | Value indicating that there is an empty TPointF structure. It is also used as a separator in lists of points | |
| 34 | + | | **function** PointF(x, y: single): TPointF; **overload** ; | |
| 35 | + | | | Creates a new structure with values _x_ and _y_ | |
| 36 | + | | **function** PointF(pt: TPoint): TPointF; **overload** ; | |
| 37 | + | | | Creates a new structure converting integer values to single-precision floating-point coordinates | |
| 38 | + | | **function** isEmptyPointF(**const** pt: TPointF): boolean; | |
| 39 | + | | | Checks if the structure is empty (equal to EmptyPointF) | |
| 40 | + | | **operator** = (**const** pt1, pt2: TPointF): boolean; **inline** ; | |
| 41 | + | | | Checks if both _x_ and _y_ are equal | |
| 42 | + | | **operator** \+ (**const** pt1, pt2: TPointF): TPointF; **inline** ; | |
| 43 | + | | | Adds _x_ and _y_ components separately. It is like adding vectors | |
| 44 | + | | **operator** \- (**const** pt1, pt2: TPointF): TPointF; **inline** ; | |
| 45 | + | | | Subtract _x_ and _y_ components separately. It is like subtracting vectors | |
| 46 | + | | **operator** \- (**const** pt2: TPointF): TPointF; **inline** ; | |
| 47 | + | | | Returns a point with opposite values for _x_ and _y_ components | |
| 48 | + | | **operator** * (**const** pt1, pt2: TPointF): single; **inline** ; | |
| 49 | + | | | Scalar product (deprecated): multiplies _x_ and _y_ components and returns the sum | |
| 50 | + | | **operator** ** (**const** pt1, pt2: TPointF): single; **inline** ; | |
| 51 | + | | | Scalar product: multiplies _x_ and _y_ components and returns the sum | |
| 52 | + | | **operator** * (**const** pt1: TPointF; factor: single): TPointF; **inline** ; | |
| 53 | + | | | Multiplies both _x_ and _y_ by _factor_. It scales the vector represented by (_x_ , _y_) | |
| 54 | + | | **operator** * (factor: single; **const** pt1: TPointF): TPointF; **inline** ; | |
| 55 | + | | | Multiplies both _x_ and _y_ by _factor_. It scales the vector represented by (_x_ , _y_) | |
| 56 | + | | **function** VectLen(**const** dx,dy: single): single; **overload** ; **inline** ; | |
| 57 | + | | | Returns the length of the vector (_dx_ , _dy_) | |
| 58 | + | | **function** VectLen(**const** v: TPointF): single; **overload** ; | |
| 59 | + | | | Returns the length of the vector represented by (_x_ , _y_) | |
| 60 | + | | **function** VectDet(**const** v1,v2: TPointF): double; **inline** ; | |
| 61 | + | | | Computes the determinant of the two vectors (equal to the determinant of the square matrix with those vectors as columns) | |
| 62 | + | _TPointFHelper_ = **record** **helper** **for** TPointF | |
| 63 | + | | Helper for TPointF structure providing additional functionality for point manipulation | |
| 64 | + | | **procedure** Offset(**const** apt: TPointF); **overload** ; | |
| 65 | + | | | Offsets the point by another point (TPointF) | |
| 66 | + | | **procedure** Offset(**const** apt: TPoint); **overload** ; | |
| 67 | + | | | Offsets the point by another point (TPoint) | |
| 68 | + | | **procedure** Offset(dx, dy: longint); **overload** ; | |
| 69 | + | | | Offsets the point by specified distances in the X (_dx_) and Y (_dy_) directions (integer values) | |
| 70 | + | | **procedure** Offset(dx, dy: single); **overload** ; | |
| 71 | + | | | Offsets the point by specified distances in the X (_dx_) and Y (_dy_) directions (single values) | |
| 72 | + | | **procedure** Scale(AScale: single); | |
| 73 | + | | | Scales the point as a vector from the origin) by a specified factor | |
| 74 | + | | **procedure** Normalize; | |
| 75 | + | | | Normalizes the point (modifies it to a unit length) | |
| 76 | + | | **function** Ceiling: TPoint; | |
| 77 | + | | | Rounds the coordinates of the point to the nearest integer towards positive infinity | |
| 78 | + | | **function** Truncate: TPoint; | |
| 79 | + | | | Truncates the coordinates of the point, discarding fractional part | |
| 80 | + | | **function** Floor: TPoint; | |
| 81 | + | | | Rounds the coordinates of the point to the nearest integer towards negative infinity | |
| 82 | + | | **function** Round: TPoint; | |
| 83 | + | | | Rounds the coordinates of the point to the nearest integer | |
| 84 | + | | **function** Length: Single; | |
| 85 | + | | | Calculates the length (magnitude) of the point from the origin | |
| 86 | + | | **function** IsEmpty: boolean; | |
| 87 | + | | | Determines if the point is empty (has special coordinates EmptyPointF) | |
| 88 | + | _ArrayOfTPointF_ = **array** **of** TPointF; | |
| 89 | + | | Contains an array of points with single-precision floating point coordinates | |
| 90 | + | | **function** PointsF(**const** pts: **array** **of** TPointF): ArrayOfTPointF; | |
| 91 | + | | | Creates an array of TPointF | |
| 92 | + | | **function** ConcatPointsF(**const** APolylines: **array** **of** ArrayOfTPointF; AInsertEmptyPointInBetween: boolean = false): ArrayOfTPointF; | |
| 93 | + | | | Concatenates arrays of TPointF | |
| 94 | + | | **function** PolylineLen(**const** pts: **array** **of** TPointF; AClosed: boolean = false): single; | |
| 95 | + | | | Compute the length of the polyline contained in the array. _AClosed_ specifies if the last point is to be joined to the first one | |
| 96 | + | _TAffineMatrix_ = **array**[1..2,1..3] **of** single; | |
| 97 | + | | An affine matrix contains three 2D vectors: the image of x, the image of y and the translation | |
| 98 | + | ||
| 99 | + | #### 3D points | |
| 100 | + | ||
| 101 | + | _PPoint3D_ = ^TPoint3D; | |
| 102 | + | --- | |
| 103 | + | | Pointer to a TPoint3D structure | |
| 104 | + | _TPoint3D_ = **record** | |
| 105 | + | | Point in 3D with single-precision floating point coordinates | |
| 106 | + | | **procedure** Offset(**const** point3D: TPoint3D); | |
| 107 | + | | | Offsets the point by the given 3D vector | |
| 108 | + | | **procedure** Scale(AScale: single); | |
| 109 | + | | | Scale the point (as a vector from the origin) | |
| 110 | + | | **function** Point3D(x,y,z: single): TPoint3D; | |
| 111 | + | | | Creates a new structure with values (_x_ , _y_ , _z_) | |
| 112 | + | | **operator** = (**const** v1,v2: TPoint3D): boolean; **inline** ; | |
| 113 | + | | | Checks if all components _x_ , _y_ and _z_ are equal | |
| 114 | + | | **operator** \+ (**const** v1,v2: TPoint3D): TPoint3D; **inline** ; | |
| 115 | + | | | Adds components separately. It is like adding vectors | |
| 116 | + | | **operator** \- (**const** v1,v2: TPoint3D): TPoint3D; **inline** ; | |
| 117 | + | | | Subtract components separately. It is like subtracting vectors | |
| 118 | + | | **operator** \- (**const** v: TPoint3D): TPoint3D; **inline** ; | |
| 119 | + | | | Returns a point with opposite values for all components | |
| 120 | + | | **operator** * (**const** v1,v2: TPoint3D): single; **inline** ; | |
| 121 | + | | | Scalar product: multiplies components and returns the sum | |
| 122 | + | | **operator** * (**const** v1: TPoint3D; **const** factor: single): TPoint3D; **inline** ; | |
| 123 | + | | | Multiplies components by _factor_. It scales the vector represented by (_x_ , _y_ , _z_) | |
| 124 | + | | **operator** * (**const** factor: single; **const** v1: TPoint3D): TPoint3D; **inline** ; | |
| 125 | + | | | Multiplies components by _factor_. It scales the vector represented by (_x_ , _y_ , _z_) | |
| 126 | + | | **procedure** VectProduct3D(u,v: TPoint3D; **out** w: TPoint3D); | |
| 127 | + | | | Computes the vectorial product _w_. It is perpendicular to both _u_ and _v_ | |
| 128 | + | | **procedure** Normalize3D(**var** v: TPoint3D); **inline** ; | |
| 129 | + | | | Normalize the vector, i.e. scale it so that its length be 1 | |
| 130 | + | | **function** VectLen3D(**const** v: TPoint3D): single; | |
| 131 | + | | | Computes the length of the vector from the origin to the point | |
| 132 | + | _TFaceCulling_ = ( | |
| 133 | + | | Enumerates the modes of face culling in 3D rendering. Face culling is a technique used to determine which faces of a polygon are visible and should be rendered | |
| 134 | + | | _fcNone_ , | |
| 135 | + | | | No face culling is applied. All faces of the polygon are rendered | |
| 136 | + | | _fcKeepCW_ , | |
| 137 | + | | | Keeps only the faces that are clockwise (CW) from the viewer's perspective. Typically used to remove back faces when the convention is that CW is for front faces | |
| 138 | + | | _fcKeepCCW_); | |
| 139 | + | | | Keeps only the faces that are counter-clockwise (CCW) from the viewer's perspective. Typically used to remove back faces when the convention is that CCW is for front faces | |
| 140 | + | ||
| 141 | + | #### Rectangles | |
| 142 | + | ||
| 143 | + | _TRectF_ = BGRAClasses.TRectF; | |
| 144 | + | --- | |
| 145 | + | | Represents a rectangle with single-precision floating point coordinates | |
| 146 | + | | **const** EmptyRectF : TRectF = (left:0; top:0; right:0; bottom: 0); | |
| 147 | + | | | A constant representing an empty rectangle with all coordinates set to 0 | |
| 148 | + | | **function** RectF(Left, Top, Right, Bottom: Single): TRectF; | |
| 149 | + | | | Creates a TRectF structure with specified left, top, right, and bottom coordinates | |
| 150 | + | | **function** RectF(**const** ATopLeft,ABottomRight: TPointF): TRectF; | |
| 151 | + | | | Creates a TRectF structure from two TPointF points representing the top-left and bottom-right corners | |
| 152 | + | | **function** RectF(**const** ARect: TRect): TRectF; | |
| 153 | + | | | Creates a TRectF structure from a TRect structure (integer coordinates converted to single precision) | |
| 154 | + | | **function** RectWithSizeF(left,top,width,height: Single): TRectF; | |
| 155 | + | | | Creates a TRectF structure with a specified position (left, top) and size (width, height) | |
| 156 | + | | **function** IsEmptyRectF(**const** ARect:TRectF): boolean; | |
| 157 | + | | | Checks if the given TRectF structure is empty (of zero size) | |
| 158 | + | | **const** EmptyRect : TRect = (left:0; top:0; right:0; bottom: 0); | |
| 159 | + | | | A value for an empty rectangle with integer coordinates | |
| 160 | + | | **function** PtInRect(**const** pt: TPoint; r: TRect): boolean; **overload** ; | |
| 161 | + | | | Checks if a point is in a rectangle with integer coordinates. This follows usual convention that _r.Right_ and _r.Bottom_ are not considered to be included in the rectangle. | |
| 162 | + | | **function** RectWithSize(left,top,width,height: integer): TRect; | |
| 163 | + | | | Creates a rectangle with integer coordinates with the specified _width_ and _height_ | |
| 164 | + | _TRectHelper_ = **record** **helper** **for** TRect | |
| 165 | + | | Helper for TRect structure providing additional functionality to manipulate rectangles | |
| 166 | + | | **function** GetHeight: integer; | |
| 167 | + | | | Gets the height of the rectangle | |
| 168 | + | | **function** GetIsEmpty: boolean; | |
| 169 | + | | | Determines if the rectangle is empty (of zero size) | |
| 170 | + | | **function** GetWidth: integer; | |
| 171 | + | | | Gets the width of the rectangle | |
| 172 | + | | **procedure** SetHeight(AValue: integer); | |
| 173 | + | | | Sets the height of the rectangle | |
| 174 | + | | **procedure** SetWidth(AValue: integer); | |
| 175 | + | | | Sets the width of the rectangle | |
| 176 | + | | **constructor** Create(Origin: TPoint; AWidth, AHeight: Longint); **overload** ; | |
| 177 | + | | | Creates a rectangle with specified origin, width, and height | |
| 178 | + | | **constructor** Create(ALeft, ATop, ARight, ABottom: Longint); **overload** ; | |
| 179 | + | | | Creates a rectangle with specified left, top, right, and bottom coordinates | |
| 180 | + | | **procedure** Intersect(R: TRect); | |
| 181 | + | | | Modifies the rectangle to be the intersection of itself and another rectangle | |
| 182 | + | | **class** **function** Intersect(R1: TRect; R2: TRect): TRect; static; | |
| 183 | + | | | Returns the intersection of two given rectangles | |
| 184 | + | | **function** IntersectsWith(R: TRect): Boolean; | |
| 185 | + | | | Checks if the rectangle intersects with another rectangle | |
| 186 | + | | **class** **function** Union(R1, R2: TRect): TRect; static; | |
| 187 | + | | | Returns the smallest rectangle that contains both of the given rectangles | |
| 188 | + | | **procedure** Union(R: TRect); | |
| 189 | + | | | Modifies the rectangle to be the union of itself and another rectangle | |
| 190 | + | | **procedure** Offset(DX, DY: Longint); | |
| 191 | + | | | Offsets the rectangle by the given distances in the X and Y directions | |
| 192 | + | | **procedure** Inflate(DX, DY: Longint); | |
| 193 | + | | | Expands or contracts the rectangle by the specified amounts in both directions | |
| 194 | + | | **function** Contains(**const** APoint: TPoint): boolean; **overload** ; | |
| 195 | + | | | Checks if the rectangle contains a specified point | |
| 196 | + | | **function** Contains(**const** ARect: TRect): boolean; **overload** ; | |
| 197 | + | | | Checks if the rectangle completely contains another rectangle | |
| 198 | + | | **property** Width: integer **read** GetWidth **write** SetWidth; | |
| 199 | + | | | Property to get or set the width of the rectangle | |
| 200 | + | | **property** Height: integer **read** GetHeight **write** SetHeight; | |
| 201 | + | | | Property to get or set the height of the rectangle | |
| 202 | + | | **property** IsEmpty: boolean **read** GetIsEmpty; | |
| 203 | + | | | Property to check if the rectangle is empty | |
| 204 | + | _TSize_ = BGRAClasses.TSize; | |
| 205 | + | | Constains a size with integer with and height | |
| 206 | + | _TSizeHelper_ = **record** **helper** **for** TSize | |
| 207 | + | | Helper to access a size | |
| 208 | + | | **function** GetHeight: integer; | |
| 209 | + | | | Gets the height of the size | |
| 210 | + | | **function** GetWidth: integer; | |
| 211 | + | | | Gets the width of the size | |
| 212 | + | | **property** Width: integer **read** GetWidth; | |
| 213 | + | | | Property to get the width | |
| 214 | + | | **property** Height: integer **read** GetHeight; | |
| 215 | + | | | Property to get the height | |
| 216 | + | _PRectF_ = ^TRectF; | |
| 217 | + | | Pointer to a TRectF structure | |
| 218 | + | _TRectFHelper_ = **record** **helper** **for** TRectF | |
| 219 | + | | Helper for TRectF structure providing additional functionality for rectangle manipulation | |
| 220 | + | | **class** **function** Intersect(**const** R1: TRectF; **const** R2: TRectF): TRectF; **overload** ; static; | |
| 221 | + | | | Returns the intersection of two given rectangles | |
| 222 | + | | **class** **function** Union(**const** R1: TRectF; **const** R2: TRectF): TRectF; **overload** ; static; | |
| 223 | + | | | Returns the union of two given rectangles | |
| 224 | + | | **class** **function** Union(**const** R1: TRectF; **const** R2: TRectF; ADiscardEmpty: boolean): TRectF; **overload** ; static; | |
| 225 | + | | | Returns the union of two given rectangles, with an option to ignore empty rectangles | |
| 226 | + | | **function** Union(**const** r: TRectF): TRectF; **overload** ; | |
| 227 | + | | | Returns the union of itself and another rectangle | |
| 228 | + | | **function** Union(**const** r: TRectF; ADiscardEmpty: boolean): TRectF; **overload** ; | |
| 229 | + | | | Returns the union of itself and another rectangle, with an option to ignore empty rectangles | |
| 230 | + | | **procedure** Include(**const** APoint: TPointF); | |
| 231 | + | | | Expands the rectangle to include a specified point (empty points are ignored) | |
| 232 | + | | **function** Contains(**const** APoint: TPointF; AIncludeBottomRight: boolean = false): boolean; | |
| 233 | + | | | Checks if the rectangle contains a specified point, with an option to include or exclude the bottom-right boundary | |
| 234 | + | | **function** IntersectsWith(**const** r: TRectF): boolean; | |
| 235 | + | | | Checks if the rectangle intersects with another rectangle | |
| 236 | + | | **function** IsEmpty: boolean; | |
| 237 | + | | | Determines if the rectangle is empty (of zero size) | |
| 238 | + | _TAffineBox_ = **object** | |
| 239 | + | | Object representing an affine box, defined by three corner points (top-left, top-tight, bottom-left) | |
| 240 | + | | **function** GetAsPolygon: ArrayOfTPointF; | |
| 241 | + | | | Retrieves the affine box as an array of points (polygon representation) | |
| 242 | + | | **function** GetBottomRight: TPointF; | |
| 243 | + | | | Gets the bottom-right corner of the affine box | |
| 244 | + | | **function** GetCenter: TPointF; | |
| 245 | + | | | Calculates the center point of the affine box | |
| 246 | + | | **function** GetHeight: single; | |
| 247 | + | | | Calculates the height of the affine box | |
| 248 | + | | **function** GetIsEmpty: boolean; | |
| 249 | + | | | Determines if the affine box is empty (one of the point being empty, not just of zero size) | |
| 250 | + | | **function** GetRectBounds: TRect; | |
| 251 | + | | | Gets the bounding rectangle of the affine box as TRect | |
| 252 | + | | **function** GetRectBoundsF: TRectF; | |
| 253 | + | | | Gets the bounding rectangle of the affine box as TRectF | |
| 254 | + | | **function** GetSurface: single; | |
| 255 | + | | | Calculates the surface area of the affine box | |
| 256 | + | | **function** GetWidth: single; | |
| 257 | + | | | Calculates the width of the affine box | |
| 258 | + | | _TopLeft_ , | |
| 259 | + | | | Top-left corner of the affine box | |
| 260 | + | | _TopRight_ , | |
| 261 | + | | | Top-right corner of the affine box | |
| 262 | + | | _BottomLeft_ : TPointF; | |
| 263 | + | | | Bottom-left corner of the affine box | |
| 264 | + | | **class** **function** EmptyBox: TAffineBox; static; | |
| 265 | + | | | Creates an empty affine box | |
| 266 | + | | **class** **function** AffineBox(ATopLeft, ATopRight, ABottomLeft: TPointF): TAffineBox; **overload** ; static; | |
| 267 | + | | | Creates an affine box defined by three corner points | |
| 268 | + | | **class** **function** AffineBox(ARectF: TRectF): TAffineBox; **overload** ; static; | |
| 269 | + | | | Creates an affine box from a TRectF structure | |
| 270 | + | | **procedure** Offset(AOfsX, AOfsY: single); **overload** ; | |
| 271 | + | | | Offsets the affine box by specified X and Y amounts | |
| 272 | + | | **procedure** Offset(AOfs: TPointF); **overload** ; | |
| 273 | + | | | Offsets the affine box by a specified point | |
| 274 | + | | **procedure** Inflate(AHoriz, AVert: single); | |
| 275 | + | | | Inflates the affine box along its axes by specified horizontal and vertical amounts | |
| 276 | + | | **function** Contains(APoint: TPointF): boolean; | |
| 277 | + | | | Checks if a point is contained within the affine box | |
| 278 | + | | **property** RectBounds: TRect **read** GetRectBounds; | |
| 279 | + | | | Bounding rectangle as TRect | |
| 280 | + | | **property** RectBoundsF: TRectF **read** GetRectBoundsF; | |
| 281 | + | | | Bounding rectangle as TRectF | |
| 282 | + | | **property** BottomRight: TPointF **read** GetBottomRight; | |
| 283 | + | | | Bottom-right corner of the affine box | |
| 284 | + | | **property** IsEmpty: boolean **read** GetIsEmpty; | |
| 285 | + | | | Check if the affine box is empty (containing empty points, not just of zero size) | |
| 286 | + | | **property** AsPolygon: ArrayOfTPointF **read** GetAsPolygon; | |
| 287 | + | | | Affine box as an array of points (polygon) | |
| 288 | + | | **property** Width: single **read** GetWidth; | |
| 289 | + | | | Width of the affine box along its axes | |
| 290 | + | | **property** Height: single **read** GetHeight; | |
| 291 | + | | | Height of the affine box along its axes | |
| 292 | + | | **property** Surface: single **read** GetSurface; | |
| 293 | + | | | Surface area of the affine box | |
| 294 | + | | **property** Center: TPointF **read** GetCenter; | |
| 295 | + | | | Center point of the affine box | |
| 296 | + | _TRoundRectangleOption_ = ( | |
| 297 | + | | Possible options for a round rectangle | |
| 298 | + | | _rrTopLeftSquare_ ,_rrTopRightSquare_ ,_rrBottomRightSquare_ ,_rrBottomLeftSquare_ , | |
| 299 | + | | | specify that a corner is a square (not rounded) | |
| 300 | + | | _rrTopLeftBevel_ ,_rrTopRightBevel_ ,_rrBottomRightBevel_ ,_rrBottomLeftBevel_ , | |
| 301 | + | | | specify that a corner is a bevel (cut) | |
| 302 | + | | _rrDefault_); | |
| 303 | + | | | default option, does nothing particular | |
| 304 | + | | _TRoundRectangleOptions_ = **set** **of** TRoundRectangleOption; | |
| 305 | + | | | A set of options for a round rectangle | |
| 306 | + | ||
| 307 | + | #### Paths | |
| 308 | + | ||
| 309 | + | _TBGRAPenStyle_ = **array** **of** Single; | |
| 310 | + | --- | |
| 311 | + | | A pen style can be dashed, dotted, etc. It is defined as a list of floating point number. The first number is the length of the first dash, the second number is the length of the first gap, the third number is the length of the second dash... It must have an even number of values. This is used as a complement TPenStyle. | |
| 312 | + | | **function** BGRAPenStyle(dash1, space1: single; dash2: single=0; space2: single = 0; dash3: single=0; space3: single = 0; dash4 : single = 0; space4 : single = 0): TBGRAPenStyle; | |
| 313 | + | | | Creates a pen style with the specified length for the dashes and the spaces | |
| 314 | + | _TSplineStyle_ = ( | |
| 315 | + | | Different types of spline. A spline is a series of points that are used as control points to draw a curve. The first point and last point may or may not be the starting and ending point | |
| 316 | + | | _ssInside_ , | |
| 317 | + | | | The curve is drawn inside the polygonal envelope without reaching the starting and ending points | |
| 318 | + | | _ssInsideWithEnds_ , | |
| 319 | + | | | The curve is drawn inside the polygonal envelope and the starting and ending points are reached | |
| 320 | + | | _ssCrossing_ , | |
| 321 | + | | | The curve crosses the polygonal envelope without reaching the starting and ending points | |
| 322 | + | | _ssCrossingWithEnds_ , | |
| 323 | + | | | The curve crosses the polygonal envelope and the starting and ending points are reached | |
| 324 | + | | _ssOutside_ , | |
| 325 | + | | | The curve is outside the polygonal envelope (starting and ending points are reached) | |
| 326 | + | | _ssRoundOutside_ , | |
| 327 | + | | | The curve expands outside the polygonal envelope (starting and ending points are reached) | |
| 328 | + | | _ssVertexToSide_ , | |
| 329 | + | | | The curve is outside the polygonal envelope and there is a tangeant at vertices (starting and ending points are reached) | |
| 330 | + | | _ssEasyBezier_); | |
| 331 | + | | | The curve is rounded using Bezier curves when the angle is less than or equal to 45° | |
| 332 | + | _PArcDef_ = ^TArcDef; | |
| 333 | + | | Pointer to an arc definition | |
| 334 | + | _TArcDef_ = **record** | |
| 335 | + | | Definition of an arc of an ellipse | |
| 336 | + | | _center_ : TPointF; | |
| 337 | + | | | Center of the ellipse | |
| 338 | + | | _radius_ : TPointF; | |
| 339 | + | | | Horizontal and vertical of the ellipse before rotation | |
| 340 | + | | _xAngleRadCW_ : single; | |
| 341 | + | | | Rotation of the ellipse | |
| 342 | + | | _startAngleRadCW_ , _endAngleRadCW_ : single; | |
| 343 | + | | | Start and end angle, in radian and clockwise. See angle convention in BGRAPath | |
| 344 | + | | _anticlockwise_ : boolean | |
| 345 | + | | | Specifies if the arc goes anticlockwise | |
| 346 | + | | **function** ArcDef(cx, cy, rx,ry, xAngleRadCW, startAngleRadCW, endAngleRadCW: single; anticlockwise: boolean) : TArcDef; | |
| 347 | + | | | Creates a structure for an arc definition | |
| 348 | + | _TArcOption_ = ( | |
| 349 | + | | Possible options for drawing an arc of an ellipse (used in BGRACanvas) | |
| 350 | + | | _aoClosePath_ , | |
| 351 | + | | | Close the path by joining the ending and starting point together | |
| 352 | + | | _aoPie_ , | |
| 353 | + | | | Draw a pie shape by joining the ending and starting point to the center of the ellipse | |
| 354 | + | | _aoFillPath_); | |
| 355 | + | | | Fills the shape | |
| 356 | + | | _TArcOptions_ = **set** **of** TArcOption; | |
| 357 | + | | | Set of options for drawing an arc | |
| 358 | + | _TLineDef_ = **record** | |
| 359 | + | | Defition of a line in the euclidian plane | |
| 360 | + | | _origin_ : TPointF; | |
| 361 | + | | | Some point in the line | |
| 362 | + | | _dir_ : TPointF; | |
| 363 | + | | | Vector indicating the direction | |
| 364 | + | | **function** IntersectLine(line1, line2: TLineDef): TPointF; **overload** ; | |
| 365 | + | | | Computes the intersection of two lines. If they are parallel, returns the middle of the segment between the two origins | |
| 366 | + | | **function** IntersectLine(line1, line2: TLineDef; **out** parallel: boolean): TPointF; **overload** ; | |
| 367 | + | | | Computes the intersection of two lines. If they are parallel, returns the middle of the segment between the two origins. The value _parallel_ is set to indicate if the lines were parallel | |
| 368 | + | | **function** IsConvex(**const** pts: **array** **of** TPointF; IgnoreAlign: boolean = true): boolean; | |
| 369 | + | | | Checks if the polygon formed by the given points is convex. _IgnoreAlign_ specifies that if the points are aligned, it should still be considered as convex | |
| 370 | + | | **function** IsClockwise(**const** pts: **array** **of** TPointF): boolean; | |
| 371 | + | | | Checks if the points follow a clockwise curve | |
| 372 | + | | **function** IsMostlyClockwise(**const** pts: **array** **of** TPointF): boolean; | |
| 373 | + | | | Checks if the curve is clockwise on the whole but accepting some counter-clockwise points | |
| 374 | + | | **function** DoesQuadIntersect(pt1,pt2,pt3,pt4: TPointF): boolean; | |
| 375 | + | | | Checks if the quad formed by the 4 given points intersects itself | |
| 376 | + | | **function** DoesSegmentIntersect(pt1,pt2,pt3,pt4: TPointF): boolean; | |
| 377 | + | | | Checks if two segment intersect | |
| 378 | + | _TBGRAPathDrawProc_ = **procedure**(**const** APoints: **array** **of** TPointF; AClosed: boolean; AData: Pointer) **of** **object** ; | |
| 379 | + | | Callback function when rendering a stroke | |
| 380 | + | _TBGRAPathFillProc_ = **procedure**(**const** APoints: **array** **of** TPointF; AData: pointer) **of** **object** ; | |
| 381 | + | | Callback function when filling a shape | |
| 382 | + | _IBGRAPath_ = **interface** | |
| 383 | + | | A path is the ability to define a contour with _moveTo_ , _lineTo_... Even if it is an interface, it must not implement reference counting. | |
| 384 | + | | **procedure** closePath; | |
| 385 | + | | | Closes the current path with a line to the starting point | |
| 386 | + | | **procedure** moveTo(constref pt: TPointF); | |
| 387 | + | | | Moves to a location, disconnected from previous points | |
| 388 | + | | **procedure** lineTo(constref pt: TPointF); | |
| 389 | + | | | Adds a line from the current point | |
| 390 | + | | **procedure** polylineTo(**const** pts: **array** **of** TPointF); | |
| 391 | + | | | Adds a polyline from the current point | |
| 392 | + | | **procedure** quadraticCurveTo(constref cp,pt: TPointF); | |
| 393 | + | | | Adds a quadratic Bézier curve from the current point | |
| 394 | + | | **procedure** bezierCurveTo(constref cp1,cp2,pt: TPointF); | |
| 395 | + | | | Adds a cubic Bézier curve from the current point | |
| 396 | + | | **procedure** arc(constref arcDef: TArcDef); | |
| 397 | + | | | Adds an arc. If there is a current point, it is connected to the beginning of the arc | |
| 398 | + | | **procedure** openedSpline(**const** pts: **array** **of** TPointF; style: TSplineStyle); | |
| 399 | + | | | Adds an opened spline. If there is a current point, it is connected to the beginning of the spline | |
| 400 | + | | **procedure** closedSpline(**const** pts: **array** **of** TPointF; style: TSplineStyle); | |
| 401 | + | | | Adds an closed spline. If there is a current point, it is connected to the beginning of the spline | |
| 402 | + | | **procedure** copyTo(dest: IBGRAPath); | |
| 403 | + | | | Copy the content of this path to the specified destination | |
| 404 | + | | **function** getPoints: ArrayOfTPointF; **overload** ; | |
| 405 | + | | | Returns the content of the path as an array of points | |
| 406 | + | | **function** getPoints(AMatrix: TAffineMatrix): ArrayOfTPointF; **overload** ; | |
| 407 | + | | | Returns the content of the path as an array of points with the transformation specified by _AMatrix_ | |
| 408 | + | | **procedure** stroke(ADrawProc: TBGRAPathDrawProc; AData: pointer); **overload** ; | |
| 409 | + | | | Calls a given draw procedure for each sub path with computed coordinates for rendering | |
| 410 | + | | **procedure** stroke(ADrawProc: TBGRAPathDrawProc; **const** AMatrix: TAffineMatrix; AData: pointer); **overload** ; | |
| 411 | + | | | Calls a given draw procedure for each sub path with computed coordinates using given _AMatrix_ transformation | |
| 412 | + | | **procedure** fill(AFillProc: TBGRAPathFillProc; AData: pointer); **overload** ; | |
| 413 | + | | | Calls a given fill procedure for each sub path with computed coordinates for rendering | |
| 414 | + | | **procedure** fill(AFillProc: TBGRAPathFillProc; **const** AMatrix: TAffineMatrix; AData: pointer); **overload** ; | |
| 415 | + | | | Calls a given fill procedure for each sub path with computed coordinates using given _AMatrix_ transformation | |
| 416 | + | | **function** getCursor: TBGRACustomPathCursor; | |
| 417 | + | | | Returns a cursor to go through the path. The cursor must be freed by calling _Free_. | |
| 418 | + | _TBGRACustomPath_ = **class**(IBGRAPath) | |
| 419 | + | | Generic class representing a path, providing methods for creation, exploration and rendering | |
| 420 | + | | **constructor** Create; **virtual** ; **abstract** ; | |
| 421 | + | | | Constructor to create a custom path. Must be overridden in subclasses | |
| 422 | + | | **procedure** beginPath; **virtual** ; **abstract** ; | |
| 423 | + | | | Begins a new path | |
| 424 | + | | **procedure** closePath; **virtual** ; **abstract** ; | |
| 425 | + | | | Closes the current path | |
| 426 | + | | **procedure** moveTo(constref pt: TPointF); **virtual** ; **abstract** ; | |
| 427 | + | | | Moves the current point to a specified location, starting a new sub-path | |
| 428 | + | | **procedure** lineTo(constref pt: TPointF); **virtual** ; **abstract** ; | |
| 429 | + | | | Adds a line from the current point to a specified point | |
| 430 | + | | **procedure** polylineTo(**const** pts: **array** **of** TPointF); **virtual** ; **abstract** ; | |
| 431 | + | | | Adds a series of lines to the path based on an array of points | |
| 432 | + | | **procedure** quadraticCurveTo(constref cp, pt: TPointF); **virtual** ; **abstract** ; | |
| 433 | + | | | Adds a quadratic Bézier curve to the path | |
| 434 | + | | **procedure** bezierCurveTo(constref cp1, cp2, pt: TPointF); **virtual** ; **abstract** ; | |
| 435 | + | | | Adds a cubic Bézier curve to the path | |
| 436 | + | | **procedure** arc(constref arcDef: TArcDef); **virtual** ; **abstract** ; | |
| 437 | + | | | Adds an arc to the path based on an arc definition | |
| 438 | + | | **procedure** openedSpline(**const** pts: **array** **of** TPointF; style: TSplineStyle); **virtual** ; **abstract** ; | |
| 439 | + | | | Adds an open spline to the path based on a series of points and a spline style | |
| 440 | + | | **procedure** closedSpline(**const** pts: **array** **of** TPointF; style: TSplineStyle); **virtual** ; **abstract** ; | |
| 441 | + | | | Adds a closed spline to the path based on a series of points and a spline style | |
| 442 | + | | **procedure** copyTo(dest: IBGRAPath); **virtual** ; **abstract** ; | |
| 443 | + | | | Copies the path to another path object | |
| 444 | + | | **function** getPoints: ArrayOfTPointF; **overload** ; **virtual** ; **abstract** ; | |
| 445 | + | | | Retrieves the points of the path | |
| 446 | + | | **function** getPoints(AMatrix: TAffineMatrix): ArrayOfTPointF; **overload** ; **virtual** ; **abstract** ; | |
| 447 | + | | | Retrieves the points of the path, transformed by a specified matrix | |
| 448 | + | | **procedure** stroke(ADrawProc: TBGRAPathDrawProc; AData: pointer); **overload** ; **virtual** ; **abstract** ; | |
| 449 | + | | | Strokes the path with a specified drawing procedure | |
| 450 | + | | **procedure** stroke(ADrawProc: TBGRAPathDrawProc; **const** AMatrix: TAffineMatrix; AData: pointer); **overload** ; **virtual** ; **abstract** ; | |
| 451 | + | | | Strokes the path with a specified drawing procedure and transformation matrix | |
| 452 | + | | **procedure** fill(AFillProc: TBGRAPathFillProc; AData: pointer); **overload** ; **virtual** ; **abstract** ; | |
| 453 | + | | | Fills the path with a specified filling procedure | |
| 454 | + | | **procedure** fill(AFillProc: TBGRAPathFillProc; **const** AMatrix: TAffineMatrix; AData: pointer); **overload** ; **virtual** ; **abstract** ; | |
| 455 | + | | | Fills the path with a specified filling procedure and transformation matrix | |
| 456 | + | | **function** getLength: single; **virtual** ; **abstract** ; | |
| 457 | + | | | Retrieves the length of the path | |
| 458 | + | | **function** getCursor: TBGRACustomPathCursor; **virtual** ; **abstract** ; | |
| 459 | + | | | Retrieves a cursor for navigating the path | |
| 460 | + | _TBGRAPathAny_ = **class** **of** TBGRACustomPath; | |
| 461 | + | | Type for specifying any derived class of TBGRACustomPath | |
| 462 | + | _TBGRACustomPathCursor_ = **class** | |
| 463 | + | | Class that contains a cursor to browse an existing path | |
| 464 | + | | **function** GetArcPos: single; **virtual** ; **abstract** ; | |
| 465 | + | | | Retrieves the current position from the start | |
| 466 | + | | **function** GetCurrentCoord: TPointF; **virtual** ; **abstract** ; | |
| 467 | + | | | Returns the current coordinate in the path | |
| 468 | + | | **function** GetCurrentTangent: TPointF; **virtual** ; **abstract** ; | |
| 469 | + | | | Returns the tangent vector to the current position | |
| 470 | + | | **function** GetLoopClosedShapes: boolean; **virtual** ; **abstract** ; | |
| 471 | + | | | Retrieves if the cursor loops when there is a closed shape | |
| 472 | + | | **function** GetLoopPath: boolean; **virtual** ; **abstract** ; | |
| 473 | + | | | Retrieves if the cursor loops at the end of the whole path | |
| 474 | + | | **function** GetPathLength: single; **virtual** ; **abstract** ; | |
| 475 | + | | | Retreive the full arc length of the path | |
| 476 | + | | **function** GetBounds: TRectF; **virtual** ; **abstract** ; | |
| 477 | + | | | Compute the bounds of the path | |
| 478 | + | | **function** GetStartCoordinate: TPointF; **virtual** ; **abstract** ; | |
| 479 | + | | | Starting coordinate of the path | |
| 480 | + | | **procedure** SetArcPos(AValue: single); **virtual** ; **abstract** ; | |
| 481 | + | | | Sets the current position from the start | |
| 482 | + | | **procedure** SetLoopClosedShapes(AValue: boolean); **virtual** ; **abstract** ; | |
| 483 | + | | | Sets if the cursor loops when there is a closed shape | |
| 484 | + | | **procedure** SetLoopPath(AValue: boolean); **virtual** ; **abstract** ; | |
| 485 | + | | | Sets if the cursor loops at the end of the whole path | |
| 486 | + | | **function** MoveForward(ADistance: single; ACanJump: boolean = true): single; **virtual** ; **abstract** ; | |
| 487 | + | | | Go forward in the path, increasing the value of _Position_. If _ADistance_ is negative, then it goes backward instead. _ACanJump_ specifies if the cursor can jump from one shape to another without a line or an arc. Otherwise, the cursor is stuck, and the return value is less than the value _ADistance_ provided. If all the way has been travelled, the return value is equal to _ADistance_ | |
| 488 | + | | **function** MoveBackward(ADistance: single; ACanJump: boolean = true): single; **virtual** ; **abstract** ; | |
| 489 | + | | | Go backward, decreasing the value of _Position_. If _ADistance_ is negative, then it goes forward instead. _ACanJump_ specifies if the cursor can jump from one shape to another without a line or an arc. Otherwise, the cursor is stuck, and the return value is less than the value _ADistance_ provided. If all the way has been travelled, the return value is equal to _ADistance_ | |
| 490 | + | | **property** CurrentCoordinate: TPointF **read** GetCurrentCoord; | |
| 491 | + | | | Returns the current coordinate in the path | |
| 492 | + | | **property** CurrentTangent: TPointF **read** GetCurrentTangent; | |
| 493 | + | | | Returns the tangent vector. It is a vector of length one that is parallel to the curve at the current point. A normal vector is easily deduced as PointF(y,-x) | |
| 494 | + | | **property** Position: single **read** GetArcPos **write** SetArcPos; | |
| 495 | + | | | Current position in the path, as a distance along the arc from the starting point of the path | |
| 496 | + | | **property** PathLength: single **read** GetPathLength; | |
| 497 | + | | | Full arc length of the path | |
| 498 | + | | **property** StartCoordinate: TPointF **read** GetStartCoordinate; | |
| 499 | + | | | Starting coordinate of the path | |
| 500 | + | | **property** LoopClosedShapes: boolean **read** GetLoopClosedShapes **write** SetLoopClosedShapes; | |
| 501 | + | | | Specifies if the cursor loops when there is a closed shape | |
| 502 | + | | **property** LoopPath: boolean **read** GetLoopPath **write** SetLoopPath; | |
| 503 | + | | | Specifies if the cursor loops at the end of the path. Note that if it needs to jump to go to the beginning, it will be only possible if the parameter _ACanJump_ is set to True when moving along the path | |
| 504 | + | _BGRAPathFactory_ : TBGRAPathAny; | |
| 505 | + | | Factory provided to create a TBGRAPath object | |
| 506 | + | ||
| 507 | + | #### Polygon filling | |
| 508 | + | ||
| 509 | + | _TPolygonOrder_ = ( | |
| 510 | + | --- | |
| 511 | + | | Order of polygons when rendered using TBGRAMultiShapeFiller (in unit BGRAPolygon) | |
| 512 | + | | _poNone_ , | |
| 513 | + | | | No order, colors are mixed together | |
| 514 | + | | _poFirstOnTop_ , | |
| 515 | + | | | First polygon is on top | |
| 516 | + | | _poLastOnTop_); | |
| 517 | + | | | Last polygon is on top | |
| 518 | + | _TIntersectionInfo_ = **class** | |
| 519 | + | | Contains an intersection between an horizontal line and any shape. It is used when filling shapes | |
| 520 | + | | _interX_ : single; | |
| 521 | + | | | Horizontal position of the intersection | |
| 522 | + | | _winding_ : integer; | |
| 523 | + | | | Winding count | |
| 524 | + | | _numSegment_ : integer; | |
| 525 | + | | | Number identifying the current segment where the intersection was found | |
| 526 | + | | **procedure** SetValues(AInterX: Single; AWinding, ANumSegment: integer); | |
| 527 | + | | | Sets the position and other information about the intersection | |
| 528 | + | | _ArrayOfTIntersectionInfo_ = **array** **of** TIntersectionInfo; | |
| 529 | + | | | An array of intersections between an horizontal line and any shape | |
| 530 | + | _TBGRACustomFillInfo_ = **class** | |
| 531 | + | | Abstract class defining any shape that can be filled | |
| 532 | + | | **function** SegmentsCurved: boolean; **virtual** ; **abstract** ; | |
| 533 | + | | | Returns true if one segment number can represent a curve and thus cannot be considered exactly straight | |
| 534 | + | | **function** GetBounds: TRect; **virtual** ; **abstract** ; | |
| 535 | + | | | Returns integer bounds for the shape | |
| 536 | + | | **function** IsPointInside(x,y: single; windingMode: boolean): boolean; **virtual** ; **abstract** ; | |
| 537 | + | | | Check if the point is inside the shape | |
| 538 | + | | **function** CreateIntersectionArray: ArrayOfTIntersectionInfo; **virtual** ; **abstract** ; | |
| 539 | + | | | Create an array that will contain computed intersections. To augment that array, use CreateIntersectionInfo for new items | |
| 540 | + | | **function** CreateIntersectionInfo: TIntersectionInfo; **virtual** ; **abstract** ; | |
| 541 | + | | | Create a structure to define one single intersection | |
| 542 | + | | **procedure** FreeIntersectionArray(**var** inter: ArrayOfTIntersectionInfo); **virtual** ; **abstract** ; | |
| 543 | + | | | Free an array of intersections | |
| 544 | + | | **procedure** ComputeAndSort(cury: single; **var** inter: ArrayOfTIntersectionInfo; **out** nbInter: integer; windingMode: boolean); **virtual** ; **abstract** ; | |
| 545 | + | | | Fill an array _inter_ with actual intersections with the shape at the y coordinate _cury_. _nbInter_ receives the number of computed intersections. _windingMode_ specifies if the winding method must be used to determine what is inside of the shape | |
| 546 | + | | **function** GetSliceIndex: integer; **virtual** ; **abstract** ; | |
| 547 | + | | | Returns the index of the current slice (horizontal stripe) | |
| 548 | + | ||
| 549 | + | #### Arrows | |
| 550 | + | ||
| 551 | + | _TBGRAArrowStyle_ = ( | |
| 552 | + | --- | |
| 553 | + | | Enumerates different styles of arrows that can be used in graphic rendering. Each style represents a unique visual appearance for arrowheads or tails | |
| 554 | + | | _asNone_ , | |
| 555 | + | | | No arrow style. This option indicates that no arrowhead or tail is to be rendered | |
| 556 | + | | _asNormal_ , | |
| 557 | + | | | A normal arrow style, representing a standard arrowhead with an angle | |
| 558 | + | | _asCut_ , | |
| 559 | + | | | A cut arrow style, where the edge of the arrow are cut instead of using the pen end cap | |
| 560 | + | | _asTriangle_ , | |
| 561 | + | | | A triangle arrow style, forming a simple triangular arrowhead | |
| 562 | + | | _asHollowTriangle_ , | |
| 563 | + | | | A hollow triangle arrow style, similar to _asTriangle_ but with an unfilled center | |
| 564 | + | | _asFlipped_ , | |
| 565 | + | | | A flipped arrow style, where the arrowhead points in the opposite direction to the normal style | |
| 566 | + | | _asFlippedCut_ , | |
| 567 | + | | | A flipped cut arrow style, combining the aspects of _asFlipped_ and _asCut_ | |
| 568 | + | | _asTail_ , | |
| 569 | + | | | A small tail, typically used to depict the starting point of an arrow | |
| 570 | + | | _asTailRepeat_); | |
| 571 | + | | | A tail repeat arrow style, depicting a series of repeated patterns typically used for the starting point of an arrow | |
| 572 | + | _TBGRACustomArrow_ = **class** | |
| 573 | + | | Generic class configuring and rendering an arrow | |
| 574 | + | | **function** GetEndOffsetX: single; **virtual** ; **abstract** ; | |
| 575 | + | | | Retrieves the X-offset for the end of the arrow | |
| 576 | + | | **function** GetEndRepeatCount: integer; **virtual** ; **abstract** ; | |
| 577 | + | | | Retrieves the repeat count for the end symbol | |
| 578 | + | | **function** GetEndSizeFactor: TPointF; **virtual** ; **abstract** ; | |
| 579 | + | | | Retrieves the size factor for the end of the arrow | |
| 580 | + | | **function** GetIsEndDefined: boolean; **virtual** ; **abstract** ; | |
| 581 | + | | | Determines if the end of the arrow is defined | |
| 582 | + | | **function** GetIsStartDefined: boolean; **virtual** ; **abstract** ; | |
| 583 | + | | | Determines if the start of the arrow is defined | |
| 584 | + | | **function** GetStartOffsetX: single; **virtual** ; **abstract** ; | |
| 585 | + | | | Retrieves the X-offset for the start of the arrow | |
| 586 | + | | **function** GetStartRepeatCount: integer; **virtual** ; **abstract** ; | |
| 587 | + | | | Retrieves the repeat count for the start symbol | |
| 588 | + | | **function** GetStartSizeFactor: TPointF; **virtual** ; **abstract** ; | |
| 589 | + | | | Retrieves the size factor for the start of the arrow | |
| 590 | + | | **procedure** SetEndOffsetX(AValue: single); **virtual** ; **abstract** ; | |
| 591 | + | | | Sets the X-offset for the end of the arrow | |
| 592 | + | | **procedure** SetEndRepeatCount(AValue: integer); **virtual** ; **abstract** ; | |
| 593 | + | | | Sets the repeat count for the end symbol | |
| 594 | + | | **procedure** SetEndSizeFactor(AValue: TPointF); **virtual** ; **abstract** ; | |
| 595 | + | | | Sets the size factor for the end of the arrow | |
| 596 | + | | **procedure** SetStartOffsetX(AValue: single); **virtual** ; **abstract** ; | |
| 597 | + | | | Sets the X-offset for the start of the arrow | |
| 598 | + | | **procedure** SetStartRepeatCount(AValue: integer); **virtual** ; **abstract** ; | |
| 599 | + | | | Sets the repeat count for the start symbol | |
| 600 | + | | **procedure** SetStartSizeFactor(AValue: TPointF); **virtual** ; **abstract** ; | |
| 601 | + | | | Sets the size factor for the start of the arrow | |
| 602 | + | | **function** GetLineCap: TPenEndCap; **virtual** ; **abstract** ; | |
| 603 | + | | | Retrieves the line cap style for the classic arrow | |
| 604 | + | | **procedure** SetLineCap(AValue: TPenEndCap); **virtual** ; **abstract** ; | |
| 605 | + | | | Sets the line cap style for the classic arrow | |
| 606 | + | | **function** ComputeStartAt(**const** APosition, ADirection: TPointF; **const** AWidth, ACurrentPos: single): ArrayOfTPointF; **virtual** ; **abstract** ; | |
| 607 | + | | | Computes the start of the arrow at a given position and direction | |
| 608 | + | | **function** ComputeEndAt(**const** APosition, ADirection: TPointF; **const** AWidth, ACurrentPos: single): ArrayOfTPointF; **virtual** ; **abstract** ; | |
| 609 | + | | | Computes the end of the arrow at a given position and direction | |
| 610 | + | | **procedure** StartAsNone; **virtual** ; **abstract** ; | |
| 611 | + | | | Sets the start of the arrow to no style | |
| 612 | + | | **procedure** StartAsClassic(AFlipped: boolean = false; ACut: boolean = false; ARelativePenWidth: single = 1); **virtual** ; **abstract** ; | |
| 613 | + | | | Sets the start of the arrow to a classic style | |
| 614 | + | | **procedure** StartAsTriangle(ABackOffset: single = 0; ARounded: boolean = false; AHollow: boolean = false; AHollowPenWidth: single = 0.5); **virtual** ; **abstract** ; | |
| 615 | + | | | Sets the start of the arrow to a triangle style | |
| 616 | + | | **procedure** StartAsTail; **virtual** ; **abstract** ; | |
| 617 | + | | | Sets the start of the arrow to a tail style | |
| 618 | + | | **procedure** EndAsNone; **virtual** ; **abstract** ; | |
| 619 | + | | | Sets the end of the arrow to no style | |
| 620 | + | | **procedure** EndAsClassic(AFlipped: boolean = false; ACut: boolean = false; ARelativePenWidth: single = 1); **virtual** ; **abstract** ; | |
| 621 | + | | | Sets the end of the arrow to a classic style | |
| 622 | + | | **procedure** EndAsTriangle(ABackOffset: single = 0; ARounded: boolean = false; AHollow: boolean = false; AHollowPenWidth: single = 0.5); **virtual** ; **abstract** ; | |
| 623 | + | | | Sets the end of the arrow to a triangle style | |
| 624 | + | | **procedure** EndAsTail; **virtual** ; **abstract** ; | |
| 625 | + | | | Sets the end of the arrow to a tail style | |
| 626 | + | | **property** IsStartDefined: boolean **read** GetIsStartDefined; | |
| 627 | + | | | Check if the start of the arrow is defined | |
| 628 | + | | **property** IsEndDefined: boolean **read** GetIsEndDefined; | |
| 629 | + | | | Check if the end of the arrow is defined | |
| 630 | + | | **property** StartOffsetX: single **read** GetStartOffsetX **write** SetStartOffsetX; | |
| 631 | + | | | X-offset for the start of the arrow | |
| 632 | + | | **property** EndOffsetX: single **read** GetEndOffsetX **write** SetEndOffsetX; | |
| 633 | + | | | X-offset for the end of the arrow | |
| 634 | + | | **property** LineCap: TPenEndCap **read** GetLineCap **write** SetLineCap; | |
| 635 | + | | | Line cap style | |
| 636 | + | | **property** StartSize: TPointF **read** GetStartSizeFactor **write** SetStartSizeFactor; | |
| 637 | + | | | Size factor for the start of the arrow | |
| 638 | + | | **property** EndSize: TPointF **read** GetEndSizeFactor **write** SetEndSizeFactor; | |
| 639 | + | | | Size factor for the end of the arrow | |
| 640 | + | | **property** StartRepeatCount: integer **read** GetStartRepeatCount **write** SetStartRepeatCount; | |
| 641 | + | | | Repeat count for the start symbol | |
| 642 | + | | **property** EndRepeatCount: integer **read** GetEndRepeatCount **write** SetEndRepeatCount; | |
| 643 | + | | | Repeat count for the end symbol | |
| 644 | + | _TBGRACustomPenStroker_ = **class** | |
| 645 | + | | Generic class representing a pen stroker, used for drawing and styling lines with various attributes | |
| 646 | + | | **function** GetArrow: TBGRACustomArrow; **virtual** ; **abstract** ; | |
| 647 | + | | | Retrieves the arrow style used at both ends of strokes | |
| 648 | + | | **function** GetArrowOwned: boolean; **virtual** ; **abstract** ; | |
| 649 | + | | | Determines if the arrow is owned (managed) by the pen stroker | |
| 650 | + | | **function** GetCustomPenStyle: TBGRAPenStyle; **virtual** ; **abstract** ; | |
| 651 | + | | | Gets the custom pen style | |
| 652 | + | | **function** GetJoinStyle: TPenJoinStyle; **virtual** ; **abstract** ; | |
| 653 | + | | | Retrieves the style of line joins (e.g., bevel, miter) | |
| 654 | + | | **function** GetLineCap: TPenEndCap; **virtual** ; **abstract** ; | |
| 655 | + | | | Retrieves the line cap style (e.g., butt, round) | |
| 656 | + | | **function** GetMiterLimit: single; **virtual** ; **abstract** ; | |
| 657 | + | | | Gets the miter limit for line joins | |
| 658 | + | | **function** GetPenStyle: TPenStyle; **virtual** ; **abstract** ; | |
| 659 | + | | | Retrieves the standard pen style | |
| 660 | + | | **function** GetStrokeMatrix: TAffineMatrix; **virtual** ; **abstract** ; | |
| 661 | + | | | Gets the stroke transformation matrix (applied only to stroke and not to path points) | |
| 662 | + | | **procedure** SetArrow(AValue: TBGRACustomArrow); **virtual** ; **abstract** ; | |
| 663 | + | | | Sets the arrow style used at both ends of strokes | |
| 664 | + | | **procedure** SetArrowOwned(AValue: boolean); **virtual** ; **abstract** ; | |
| 665 | + | | | Sets whether the arrow is owned by the pen stroker | |
| 666 | + | | **procedure** SetCustomPenStyle(AValue: TBGRAPenStyle); **virtual** ; **abstract** ; | |
| 667 | + | | | Sets the custom pen style | |
| 668 | + | | **procedure** SetJoinStyle(AValue: TPenJoinStyle); **virtual** ; **abstract** ; | |
| 669 | + | | | Sets the style of line joins | |
| 670 | + | | **procedure** SetLineCap(AValue: TPenEndCap); **virtual** ; **abstract** ; | |
| 671 | + | | | Sets the line cap style | |
| 672 | + | | **procedure** SetMiterLimit(AValue: single); **virtual** ; **abstract** ; | |
| 673 | + | | | Sets the miter limit for line joins | |
| 674 | + | | **procedure** SetPenStyle(AValue: TPenStyle); **virtual** ; **abstract** ; | |
| 675 | + | | | Sets the standard pen style | |
| 676 | + | | **procedure** SetStrokeMatrix(**const** AValue: TAffineMatrix); **virtual** ; **abstract** ; | |
| 677 | + | | | Sets the stroke transformation matrix (applied only to stroke and not to path points) | |
| 678 | + | | **function** ComputePolyline(**const** APoints: **array** **of** TPointF; AWidth: single; AClosedCap: boolean = true): ArrayOfTPointF; **overload** ; **virtual** ; **abstract** ; | |
| 679 | + | | | Computes a polyline with the given points and width, optionally closing the cap | |
| 680 | + | | **function** ComputePolyline(**const** APoints: **array** **of** TPointF; AWidth: single; APenColor: TBGRAPixel; AClosedCap: boolean = true): ArrayOfTPointF; **overload** ; **virtual** ; **abstract** ; | |
| 681 | + | | | Computes a polyline with the given points, width, and pen color, optionally closing the cap | |
| 682 | + | | **function** ComputePolylineAutoCycle(**const** APoints: **array** **of** TPointF; AWidth: single): ArrayOfTPointF; **virtual** ; **abstract** ; | |
| 683 | + | | | Computes a polyline with automatic cycling of points and given width | |
| 684 | + | | **function** ComputePolygon(**const** APoints: **array** **of** TPointF; AWidth: single): ArrayOfTPointF; **virtual** ; **abstract** ; | |
| 685 | + | | | Computes a polygon with the given points and width | |
| 686 | + | | **property** Style: TPenStyle **read** GetPenStyle **write** SetPenStyle; | |
| 687 | + | | | Standard pen style | |
| 688 | + | | **property** CustomPenStyle: TBGRAPenStyle **read** GetCustomPenStyle **write** SetCustomPenStyle; | |
| 689 | + | | | Custom pen style (with given dash and gap lengths) | |
| 690 | + | | **property** Arrow: TBGRACustomArrow **read** GetArrow **write** SetArrow; | |
| 691 | + | | | Arrow style at both ends of strokes | |
| 692 | + | | **property** ArrowOwned: boolean **read** GetArrowOwned **write** SetArrowOwned; | |
| 693 | + | | | Is the arrow is owned by the pen stroker | |
| 694 | + | | **property** StrokeMatrix: TAffineMatrix **read** GetStrokeMatrix **write** SetStrokeMatrix; | |
| 695 | + | | | Stroke transformation matrix (applied only to stroke and not to path points) | |
| 696 | + | | **property** LineCap: TPenEndCap **read** GetLineCap **write** SetLineCap; | |
| 697 | + | | | Line cap style | |
| 698 | + | | **property** JoinStyle: TPenJoinStyle **read** GetJoinStyle **write** SetJoinStyle; | |
| 699 | + | | | Join style of lines | |
| 700 | + | | **property** MiterLimit: single **read** GetMiterLimit **write** SetMiterLimit; | |
| 701 | + | | | Miter limit for line joins | |
| 702 | + | ||
| 703 | + | #### Gradients | |
| 704 | + | ||
| 705 | + | _TGradientType_ = ( | |
| 706 | + | --- | |
| 707 | + | | Shape of a gradient | |
| 708 | + | | _gtLinear_ , | |
| 709 | + | | | The color changes along a certain vector and does not change along its perpendicular direction | |
| 710 | + | | _gtReflected_ , | |
| 711 | + | | | The color changes like in _gtLinear_ however it is symmetrical to a specified direction | |
| 712 | + | | _gtDiamond_ , | |
| 713 | + | | | The color changes along a diamond shape | |
| 714 | + | | _gtRadial_ , | |
| 715 | + | | | The color changes in a radial way from a given center | |
| 716 | + | | _gtAngular_); | |
| 717 | + | | | The color changes according to the angle relative to a given center | |
| 718 | + | | **const** GradientTypeStr : **array**[TGradientType] **of** **string** | |
| 719 | + | | | List of string to represent gradient types | |
| 720 | + | | **function** StrToGradientType(str: **string**): TGradientType; | |
| 721 | + | | | Returns the gradient type represented by the given string | |
| 722 | + | _TBGRAGradientGetColorAtFunc_ = **function**(position: integer): TBGRAPixel **of** **object** ; | |
| 723 | + | | Function type to get the the color at a given integer position | |
| 724 | + | _TBGRAGradientGetColorAtFloatFunc_ = **function**(position: single): TBGRAPixel **of** **object** ; | |
| 725 | + | | Function type to get the the color at a given single-precision floating type position | |
| 726 | + | _TBGRAGradientGetExpandedColorAtFunc_ = **function**(position: integer): TExpandedPixel **of** **object** ; | |
| 727 | + | | Function type to get the the expanded color at a given integer position | |
| 728 | + | _TBGRAGradientGetExpandedColorAtFloatFunc_ = **function**(position: single): TExpandedPixel **of** **object** ; | |
| 729 | + | | Function type to get the the expanded color at a given single-precision floating type position | |
| 730 | + | _TBGRACustomGradient_ = **class** | |
| 731 | + | | Defines a gradient of color, not specifying its shape but only the series of colors | |
| 732 | + | | **function** GetColorAt(position: integer): TBGRAPixel; **virtual** ; **abstract** ; | |
| 733 | + | | | Returns the color at a given _position_. The reference range is from 0 to 65535, however values beyond are possible as well | |
| 734 | + | | **function** GetExpandedColorAt(position: integer): TExpandedPixel; **virtual** ; | |
| 735 | + | | | Returns the expanded color at a given _position_. The reference range is from 0 to 65535, however values beyond are possible as well | |
| 736 | + | | **function** GetColorAtF(position: single): TBGRAPixel; **virtual** ; | |
| 737 | + | | | Returns the color at a given _position_. The reference range is from 0 to 1, however values beyond are possible as well | |
| 738 | + | | **function** GetExpandedColorAtF(position: single): TExpandedPixel; **virtual** ; | |
| 739 | + | | | Returns the expanded color at a given _position_. The reference range is from 0 to 1, however values beyond are possible as well | |
| 740 | + | | **function** GetAverageColor: TBGRAPixel; **virtual** ; **abstract** ; | |
| 741 | + | | | Returns the average color of the gradient | |
| 742 | + | | **function** GetAverageExpandedColor: TExpandedPixel; **virtual** ; | |
| 743 | + | | | Returns the average expanded color of the gradient | |
| 744 | + | | **function** GetMonochrome: boolean; **virtual** ; **abstract** ; | |
| 745 | + | | | Returns whether the gradient has only one color | |
| 746 | + | | **property** Monochrome: boolean **read** GetMonochrome; | |
| 747 | + | | | If the gradient contains only one color and thus is not really a gradient | |
| 748 | + | ||
| 749 | + | #### Bézier curves | |
| 750 | + | ||
| 751 | + | _TCubicBezierCurve_ = **object** | |
| 752 | + | --- | |
| 753 | + | | Definition of a Bézier curve of order 3. It has two control points _c1_ and _c2_. Those are not reached by the curve in general. | |
| 754 | + | | **function** SimpleComputePoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; | |
| 755 | + | | | Compute the points using the simple approach of computing for each time value | |
| 756 | + | | _p1_ : TPointF; | |
| 757 | + | | | Starting point (reached) | |
| 758 | + | | _c1_ : TPointF; | |
| 759 | + | | | First control point (not reached by the curve) | |
| 760 | + | | _c2_ : TPointF; | |
| 761 | + | | | Second control point (not reached by the curve) | |
| 762 | + | | _p2_ : TPointF; | |
| 763 | + | | | Ending point (reached) | |
| 764 | + | | **function** ComputePointAt(t: single): TPointF; | |
| 765 | + | | | Computes the point at time _t_ , varying from 0 to 1 | |
| 766 | + | | **procedure** Split(**out** ALeft, ARight: TCubicBezierCurve); | |
| 767 | + | | | Split the curve in two such that _ALeft.p2_ = _ARight.p1_ | |
| 768 | + | | **function** ComputeLength(AAcceptedDeviation: single = 0.1): single; | |
| 769 | + | | | Compute an approximation of the length of the curve. _AAcceptedDeviation_ indicates the maximum orthogonal distance that is ignored and approximated by a straight line. | |
| 770 | + | | **function** ToPoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; | |
| 771 | + | | | Computes a polygonal approximation of the curve. _AAcceptedDeviation_ indicates the maximum orthogonal distance that is ignored and approximated by a straight line. _AIncludeFirstPoint_ indicates if the first point must be included in the array | |
| 772 | + | | **procedure** CopyToPath(ADest: IBGRAPath); | |
| 773 | + | | | Copy the curve to the given path | |
| 774 | + | | **function** GetBounds: TRectF; | |
| 775 | + | | | Computes the rectangular bounds | |
| 776 | + | | **function** BezierCurve(origin, control1, control2, destination: TPointF) : TCubicBezierCurve; **overload** ; | |
| 777 | + | | | Creates a structure for a cubic Bézier curve | |
| 778 | + | _TQuadraticBezierCurve_ = **object** | |
| 779 | + | | Definition of a Bézier curve of order 2. It has one control point | |
| 780 | + | | **function** SimpleComputePoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; | |
| 781 | + | | | Compute the points using the simple approach of computing for each time value | |
| 782 | + | | **function** ComputeExtremumPositionOutsideSegment: single; | |
| 783 | + | | | Computes the position where the curve has its extremum | |
| 784 | + | | _p1_ : TPointF; | |
| 785 | + | | | Starting point (reached) | |
| 786 | + | | _c_ : TPointF; | |
| 787 | + | | | Control point (not reached by the curve) | |
| 788 | + | | _p2_ : TPointF; | |
| 789 | + | | | Ending point (reached) | |
| 790 | + | | **function** ComputePointAt(t: single): TPointF; | |
| 791 | + | | | Computes the point at time _t_ , varying from 0 to 1 | |
| 792 | + | | **procedure** Split(**out** ALeft, ARight: TQuadraticBezierCurve); | |
| 793 | + | | | Split the curve in two such that _ALeft.p2_ = _ARight.p1_ | |
| 794 | + | | **function** ComputeLength: single; | |
| 795 | + | | | Compute the **exact** length of the curve | |
| 796 | + | | **function** ToPoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; | |
| 797 | + | | | Computes a polygonal approximation of the curve. _AAcceptedDeviation_ indicates the maximum orthogonal distance that is ignored and approximated by a straight line. _AIncludeFirstPoint_ indicates if the first point must be included in the array | |
| 798 | + | | **procedure** CopyToPath(ADest: IBGRAPath); | |
| 799 | + | | | Copy the curve to the given path | |
| 800 | + | | **function** GetBounds: TRectF; | |
| 801 | + | | | Computes the rectangular bounds | |
| 802 | + | | **function** BezierCurve(origin, control, destination: TPointF) : TQuadraticBezierCurve; **overload** ; | |
| 803 | + | | | Creates a structure for a quadratic Bézier curve | |
| 804 | + | | **function** BezierCurve(origin, destination: TPointF) : TQuadraticBezierCurve; **overload** ; | |
| 805 | + | | | Creates a structure for a quadratic Bézier curve without curvature | |
| 806 | + | | _ArrayOfSingle_ = **array** **of** single; | |
| 807 | + | | | Array of single-precision floating point values | |
| 808 | + | _TRationalQuadraticBezierCurve_ = **object** | |
| 809 | + | | Quasi-standard rational quadratic Bezier curve, defined by three points and a number: | |
| 810 | + | ||
| 811 | + | * _p1_ : starting point | |
| 812 | + | * _c_ : control point | |
| 813 | + | * _p2_ : ending point | |
| 814 | + | * _weight_ : weight for the control point | |
| 815 | + | ||
| 816 | + | The curve is defined with the function (t in [0; 1]): | |
| 817 | + | ||
| 818 | + | * f: t → ((1-t)2 * _p1_ \+ 2 * t * (1-t) * _weight_ * _c_ \+ t2*_p2_) / (1-t)2 \+ 2 * t * (1-t) * _weight_ \+ t2) | |
| 819 | + | ||
| 820 | + | The curve is an arc of: | |
| 821 | + | ||
| 822 | + | * ellipse when _weight_ in ]-1; 1[ | |
| 823 | + | * parabola when _weight_ = 1 (classical quadratic Bezier curve) | |
| 824 | + | * hyperbola when _weight_ > 1 | |
| 825 | + | ||
| 826 | + | A negative weight give the complementary curve for its positive counterpart. So when _weight_ ≤ -1 the curve is discontinuous: | |
| 827 | + | ||
| 828 | + | * infinite branches of parabola when _weight_ = -1 | |
| 829 | + | * infinite branches of hyperbola and symetric hyperbola when _weight_ < -1 | |
| 830 | + | ||
| 831 | + | To transform a rational quadratic Bezier curve with an affin transformation, you only have to transform the three points and leave the weight as it is. | |
| 832 | + | | _p1_ , _c_ , _p2_ : TPointF; | |
| 833 | + | | | Starting, control and ending points | |
| 834 | + | | _weight_ : single; | |
| 835 | + | | | Weight of control point | |
| 836 | + | | **function** GetIsInfinite: boolean; | |
| 837 | + | | | Checks whether the curve is infinitely long | |
| 838 | + | | **function** InternalComputePoints(AInfiniteBounds: TRectF; AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; | |
| 839 | + | | | Compute points in the general case | |
| 840 | + | | **function** GetBoundingPositions(AIncludeFirstAndLast: boolean; ASorted: boolean): ArrayOfSingle; | |
| 841 | + | | | Computes the points relevant to compute bounds | |
| 842 | + | | **function** ComputePointAt(t: single): TPointF; | |
| 843 | + | | | Compute a point at the specified time | |
| 844 | + | | **function** ComputeLength(AAcceptedDeviation: single = 0.1): single; | |
| 845 | + | | | Compute the length | |
| 846 | + | | **function** ToPoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; **overload** ; | |
| 847 | + | | | Computes the points of the curve | |
| 848 | + | | **function** ToPoints(AInfiniteBounds: TRectF; AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF; **overload** ; | |
| 849 | + | | | Computes the points of the curve by providing where the infinite curve can stop | |
| 850 | + | | **function** GetBounds: TRectF; | |
| 851 | + | | | Compute the rectangular bounds | |
| 852 | + | | **procedure** Split(**out** ALeft, ARight: TRationalQuadraticBezierCurve); | |
| 853 | + | | | Split into two curves | |
| 854 | + | | **property** IsInfinite: boolean **read** GetIsInfinite; | |
| 855 | + | | | Is the curve infinitely long | |
| 856 | + | | **function** BezierCurve(origin, control, destination: TPointF; Aweight:single) : TRationalQuadraticBezierCurve; **overload** ; | |
| 857 | + | | | Creates a rational Bézier curve | |
| 858 | + | _TEasyBezierCurveMode_ = ( | |
| 859 | + | | Enumerates modes for handling curves in a Bezier curve sequence | |
| 860 | + | | _cmAuto_ , | |
| 861 | + | | | Automatically determines whether to curve or form an angle based on the points' positions | |
| 862 | + | | _cmCurve_ , | |
| 863 | + | | | Forces a curve at the point | |
| 864 | + | | _cmAngle_ | |
| 865 | + | | | Forces an angle at the point, meaning the point is reached and forms an angle instead of a curve | |
| 866 | + | _TEasyBezierPointTransformFunc_ = **function**(APoint: PPointF; AData: Pointer): TPointF **of** **object** ; | |
| 867 | + | | Function type for transforming Bezier curve points | |
| 868 | + | _TEasyBezierCurve_ = **object** | |
| 869 | + | | Object representing an easy-to-use Bezier curve, with configurable curve modes and transformation functions | |
| 870 | + | | **function** GetCurveMode(AIndex: integer): TEasyBezierCurveMode; | |
| 871 | + | | | Retrieves the curve mode for a specified point index | |
| 872 | + | | **function** GetCurveStartPoint: TPointF; | |
| 873 | + | | | Gets the starting point of the curve | |
| 874 | + | | **function** GetPoint(AIndex: integer): TPointF; | |
| 875 | + | | | Retrieves the point at a specified index | |
| 876 | + | | **function** GetPointCount: integer; | |
| 877 | + | | | Gets the total number of points in the curve | |
| 878 | + | | **procedure** SetClosed(AValue: boolean); | |
| 879 | + | | | Sets whether the curve is closed | |
| 880 | + | | **procedure** SetCurveMode(AIndex: integer; AValue: TEasyBezierCurveMode); | |
| 881 | + | | | Sets the curve mode for a specified point index | |
| 882 | + | | **procedure** SetMinimumDotProduct(AValue: single); | |
| 883 | + | | | Sets the minimum dot product to form a curve instead of an angle | |
| 884 | + | | **procedure** SetPoint(AIndex: integer; AValue: TPointF); | |
| 885 | + | | | Sets the point at a specified index | |
| 886 | + | | _FCurves_ : **array** **of** **record** | |
| 887 | + | | | Computed Bézier control points | |
| 888 | + | | _FInvalidated_ : boolean; | |
| 889 | + | | | Whether the curve need to be recomputed | |
| 890 | + | | _FPoints_ : **array** **of** **record** | |
| 891 | + | | | Definition of the curve by the user | |
| 892 | + | | _FMinimumDotProduct_ : single; | |
| 893 | + | | | Minimum dot product to form a curve instead of an angle | |
| 894 | + | | _FClosed_ : boolean; | |
| 895 | + | | | Is the curve is closed | |
| 896 | + | | **function** MaybeCurve(start1, end1, start2, end2: integer): boolean; | |
| 897 | + | | | Checks whether two vectors have the minimum dot product to suggest a curve. _start1_ and _end1_ are the indices for the first vector. _start2_ and _end2_ for the second vector. | |
| 898 | + | | **procedure** ComputeQuadraticCurves; | |
| 899 | + | | | Computes the control points for the classical quadratic curve | |
| 900 | + | | **function** PointTransformNone(APoint: PPointF; AData: Pointer): TPointF; | |
| 901 | + | | | Fonction to apply no transformation | |
| 902 | + | | **function** PointTransformOffset(APoint: PPointF; AData: Pointer): TPointF; | |
| 903 | + | | | Fonction to apply an offset | |
| 904 | + | | **procedure** Init; | |
| 905 | + | | | Initializes the Bezier curve object | |
| 906 | + | | **procedure** Clear; | |
| 907 | + | | | Clears all points and resets the curve | |
| 908 | + | | **procedure** SetPoints(APoints: **array** **of** TPointF; ACurveMode: TEasyBezierCurveMode); **overload** ; | |
| 909 | + | | | Sets the points and curve mode for the entire curve | |
| 910 | + | | **procedure** SetPoints(APoints: **array** **of** TPointF; ACurveMode: **array** **of** TEasyBezierCurveMode); **overload** ; | |
| 911 | + | | | Sets the points and individual curve modes for each point | |
| 912 | + | | **procedure** SetPoints(APoints: **array** **of** TPointF; ACurveMode: TEasyBezierCurveMode; AStart, ACount: integer); **overload** ; | |
| 913 | + | | | Sets a subset of points and a single curve mode for these points | |
| 914 | + | | **procedure** SetPoints(APoints: **array** **of** TPointF; ACurveMode: **array** **of** TEasyBezierCurveMode; AStart, ACount: integer); **overload** ; | |
| 915 | + | | | Sets a subset of points and individual curve modes for each of these points | |
| 916 | + | | **procedure** CopyToPath(ADest: IBGRAPath); **overload** ; | |
| 917 | + | | | Copies the Bezier curve to a path object | |
| 918 | + | | **procedure** CopyToPath(ADest: IBGRAPath; AOffset: TPointF; AReverse: boolean = false); **overload** ; | |
| 919 | + | | | Copies the Bezier curve to a path object with an offset and optional reversal | |
| 920 | + | | **procedure** CopyToPath(ADest: IBGRAPath; ATransformFunc: TEasyBezierPointTransformFunc; ATransformData: Pointer; AReverse: boolean = false); **overload** ; | |
| 921 | + | | | Copies the Bezier curve to a path object with a custom transformation | |
| 922 | + | | **property** Point[AIndex: integer]: TPointF **read** GetPoint **write** SetPoint; | |
| 923 | + | | | Coordinates of the points | |
| 924 | + | | **property** CurveMode[AIndex: integer]: TEasyBezierCurveMode **read** GetCurveMode **write** SetCurveMode; | |
| 925 | + | | | Mode to use for each point | |
| 926 | + | | **property** PointCount: integer **read** GetPointCount; | |
| 927 | + | | | Number of points | |
| 928 | + | | **property** MinimumDotProduct: single **read** FMinimumDotProduct **write** SetMinimumDotProduct; | |
| 929 | + | | | Minimum dot product to form a curve rather than an angle when using _cmAuto_ mode | |
| 930 | + | | **property** Closed: boolean **read** FClosed **write** SetClosed; | |
| 931 | + | | | Gets or sets whether to close the curve | |
| 932 | + | | **property** CurveStartPoint: TPointF **read** GetCurveStartPoint; | |
| 933 | + | | | Coordinates of the starting point | |
| 934 | + | | **function** ToPoints: ArrayOfTPointF; | |
| 935 | + | | | Converts the Bezier curve into an array of points | |
| 936 | + | | **function** ComputeLength: single; | |
| 937 | + | | | Computes the total length of the Bezier curve | |
| 938 | + | | **const** EasyBezierDefaultMinimumDotProduct = 0.707; | |
| 939 | + | | | Minimum dot product, corresponding to approximately 45 degrees, to form a curve instead of an angle | |
| 940 | + | **function** EasyBezierCurve(APoints: **array** **of** TPointF; AClosed: boolean; ACurveMode: TEasyBezierCurveMode; | |
| 941 | + | | Create a TEasyBezierCurve object with only one curve mode | |
| 942 | + | **function** EasyBezierCurve(APoints: **array** **of** TPointF; AClosed: boolean; ACurveMode: **array** **of** TEasyBezierCurveMode; | |
| 943 | + | | Create a TEasyBezierCurve object with a curve mode for each point | |
| 944 | + | **function** EasyBezierCurve(APoints: **array** **of** TPointF; AStart, ACount: integer; AClosed: boolean; ACurveMode: TEasyBezierCurveMode; | |
| 945 | + | | Create a TEasyBezierCurve object with a subsection of the array of points, with only one curve mode | |
| 946 | + | **function** EasyBezierCurve(APoints: **array** **of** TPointF; AStart, ACount: integer; AClosed: boolean; ACurveMode: **array** **of** TEasyBezierCurveMode; | |
| 947 | + | | Create a TEasyBezierCurve object with a subsection of the array of points, with a curve mode for each point | |
| 948 | + | ||
| 949 | + | --- | |
| 950 | + | *From the Free Pascal wiki, page "BGRABitmap Geometry types", as the Internet Archive kept it on 2025-01-23. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
