Class TAsphyreCanvas
Description | Hierarchy | Fields | Methods | Properties |
Unit
Declaration
type TAsphyreCanvas = class(TObject)
Description
2D canvas specification for rendering points, lines, filled shapes and images using gradient color fills, different blending effects, and alpha transparency.
Hierarchy
- TObject
- TAsphyreCanvas
Overview
Methods
procedure Circle(const Pos: TPoint2; Radius: Single; Steps: Integer; Color: Cardinal); |
|
procedure DrawIndexedTriangles(Vertices: PPoint2; Colors: PLongWord; Indices: PLongInt; NoVertices, NoTriangles: Integer; Effect: TBlendingEffect = beNormal); virtual; abstract; |
|
procedure Ellipse(const Pos, Radius: TPoint2; Steps: Integer; Color: Cardinal); |
|
procedure FillArc(x, y, Radius, InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillArc(const Pos, Radius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillCircle(x, y, Radius: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
procedure FillEllipse(const Pos, Radius: TPoint2; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
procedure FillHexagon(const Mtx: TMatrix3; c1, c2, c3, c4, c5, c6: Cardinal; Effect: TBlendingEffect = beNormal); |
|
procedure FillQuad(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
procedure FillRect(Left, Top, Width, Height: Integer; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillRect(const Rect: TRect; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillRect(const Rect: TRect; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillRibbon(const Pos, InRadius, OutRadius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillRibbon(const Pos, InRadius, OutRadius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; InColor1, InColor2, InColor3, OutColor1, OutColor2, OutColor3: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FillTri(const p1, p2, p3: TPoint2; c1, c2, c3: Cardinal; Effect: TBlendingEffect = beNormal); |
|
procedure Flush(); virtual; abstract; |
|
procedure FrameHexagon(const Mtx: TMatrix3; Color: Cardinal); |
|
procedure FrameRect(const Rect: TRect; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure FrameRect(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
procedure HorizLine(Left, Top, Width: Single; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure HorizLine(Left, Top, Width: Single; Color1, Color2: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure Line(const Src, Dest: TPoint2; Color: Cardinal); overload; |
|
procedure Line(x1, y1, x2, y2: Single; Color: Cardinal); overload; |
|
procedure Line(const Src, Dest: TPoint2; Color1, Color2: Cardinal); overload; virtual; abstract; |
|
procedure LineArray(Points: PPoint2; Color: Cardinal; NoPoints: Integer); virtual; |
|
procedure PutPixel(const Point: TPoint2; Color: Cardinal); overload; virtual; abstract; |
|
procedure PutPixel(x, y: Single; Color: Cardinal); overload; |
|
procedure QuadHole(const Pos, Size, Center, Radius: TPoint2; OutColor, InColor: Cardinal; Steps: Integer; Effect: TBlendingEffect = beNormal); overload; |
|
procedure ResetStates(); virtual; |
|
procedure TexMap(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); virtual; abstract; |
|
procedure UseImage(Image: TAsphyreImage; const Mapping: TPoint4; TextureNo: Integer = 0); |
|
procedure UseImagePt(Image: TAsphyreImage; Pattern: Integer = 0); overload; |
|
procedure UseImagePt(Image: TAsphyreImage; Pattern: Integer; const SrcRect: TRect; Mirror: Boolean = False; Flip: Boolean = False); overload; |
|
procedure UseImagePx(Image: TAsphyreImage; const Mapping: TPoint4; TextureNo: Integer = 0); |
|
procedure UseTexture(Texture: TAsphyreCustomTexture; const Mapping: TPoint4); virtual; abstract; |
|
procedure UseTexturePx(Texture: TAsphyreCustomTexture; const Mapping: TPoint4); |
|
procedure VertLine(Left, Top, Height: Single; Color1, Color2: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure VertLine(Left, Top, Height: Single; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
procedure WireQuad(const Points: TPoint4; const Colors: TColor4); |
|
procedure WuLine(Src, Dest: TPoint2; Color1, Color2: Cardinal); |
Properties
property Antialias: Boolean read GetAntialias write SetAntialias; |
|
property CacheStall: Integer read FCacheStall; |
|
property ClipRect: TRect read GetClipRect write SetClipRect; |
|
property MipMapping: Boolean read GetMipMapping write SetMipMapping; |
Description
Methods
procedure Circle(const Pos: TPoint2; Radius: Single; Steps: Integer; Color: Cardinal); |
|
Draws circle at the given position, radius and color. This routine uses Line routine. |
procedure DrawIndexedTriangles(Vertices: PPoint2; Colors: PLongWord; Indices: PLongInt; NoVertices, NoTriangles: Integer; Effect: TBlendingEffect = beNormal); virtual; abstract; |
|
Draws multiple filled triangles using the specified vertices, vertex colors and index buffers. This is a low-level routine and can be used for drawing complex shapes quickly and efficiently. |
procedure Ellipse(const Pos, Radius: TPoint2; Steps: Integer; Color: Cardinal); |
|
Draws ellipse at the given position, radius and color. This routine uses Line routine. |
procedure FillArc(x, y, Radius, InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws filled arc at the given coordinates and radius. The arc begins at |
procedure FillArc(const Pos, Radius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws filled arc at the given position and radius. The arc begins at |
procedure FillCircle(x, y, Radius: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
Draws filled circle at the given position and radius. The circle is subdivided into a number of triangles specified in |
procedure FillEllipse(const Pos, Radius: TPoint2; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
Draws filled ellipse at the given position and radius. The ellipse is subdivided into a number of triangles specified in |
procedure FillHexagon(const Mtx: TMatrix3; c1, c2, c3, c4, c5, c6: Cardinal; Effect: TBlendingEffect = beNormal); |
|
Draws hexagon where vertices are spaced 0.5 pixels apart from its center (so diameter is 1) in all directions, multiplied by the given matrix and filled with gradient of six colors at the corresponding vertices. The size, position and rotation of hexagon can be given using one or a combination of several 3x3 matrices multiplied together. |
procedure FillQuad(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); |
|
Draws filled quad between the specified vertices and vertex colors. |
procedure FillRect(Left, Top, Width, Height: Integer; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws rectangle at the given coordinates filled with solid color. |
procedure FillRect(const Rect: TRect; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws rectangle filled with the specified 4-color gradient. |
procedure FillRect(const Rect: TRect; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws rectangle filled with solid color. |
procedure FillRibbon(const Pos, InRadius, OutRadius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws filled ribbon at the given position between inner and outer radiuses. The ribbon begins at |
procedure FillRibbon(const Pos, InRadius, OutRadius: TPoint2; InitPhi, EndPhi: Single; Steps: Integer; InColor1, InColor2, InColor3, OutColor1, OutColor2, OutColor3: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws filled ribbon at the given position between inner and outer radiuses. The ribbon begins at |
procedure FillTri(const p1, p2, p3: TPoint2; c1, c2, c3: Cardinal; Effect: TBlendingEffect = beNormal); |
|
Draws filled triangle between the specified vertices and vertex colors. |
procedure FrameHexagon(const Mtx: TMatrix3; Color: Cardinal); |
|
Draws lines between each vertex in hexagon. The vertices are spaced 0.5 pixels apart from its center (so diameter is 1) in all directions, multiplied by the given matrix and filled with gradient of six colors at the corresponding vertices. The size, position and rotation of hexagon can be given using one or a combination of several 3x3 matrices multiplied together. |
procedure FrameRect(const Rect: TRect; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws lines that form the specified rectangle using colors from the given 4-color gradient. This primitive uses filled shapes and not actual lines for pixel-perfect mapping. |
procedure FrameRect(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); overload; |
|
Draws lines between four corners of the given rectangle where the lines are filled using 4-color gradient. This method uses filled shapes instead of line primitives for pixel-perfect mapping but assumes that the four vertex points are aligned to form rectangle. |
procedure HorizLine(Left, Top, Width: Single; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws horizontal line using the specified coordinates and filled with solid color. This primitive uses a filled shape and not line primitive for pixel-perfect mapping. |
procedure HorizLine(Left, Top, Width: Single; Color1, Color2: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws horizontal line using the specified coordinates and filled with two color gradient. This primitive uses a filled shape and not line primitive for pixel-perfect mapping. |
procedure Line(const Src, Dest: TPoint2; Color: Cardinal); overload; |
|
Draws line between the two specified 2D floating-point vectors using solid color. |
procedure Line(x1, y1, x2, y2: Single; Color: Cardinal); overload; |
|
Draws line between the specified coordinates using solid color. |
procedure Line(const Src, Dest: TPoint2; Color1, Color2: Cardinal); overload; virtual; abstract; |
|
Draws line between the two specified 2D floating-point vectors using gradient of two colors. |
procedure LineArray(Points: PPoint2; Color: Cardinal; NoPoints: Integer); virtual; |
|
Draws series of lines between specified vertices using solid color. |
procedure PutPixel(const Point: TPoint2; Color: Cardinal); overload; virtual; abstract; |
|
Draws a single pixel on the screen or render target using the specified 2D floating-point vector. |
procedure PutPixel(x, y: Single; Color: Cardinal); overload; |
|
Draws a single pixel on the screen or render target using the specified coordinates. |
procedure QuadHole(const Pos, Size, Center, Radius: TPoint2; OutColor, InColor: Cardinal; Steps: Integer; Effect: TBlendingEffect = beNormal); overload; |
|
Draws a filled rectangle at the given position and size with a hole (in form of ellipse) inside at the given center and radius. The quality of the hole is defined by the value of |
procedure TexMap(const Points: TPoint4; const Colors: TColor4; Effect: TBlendingEffect = beNormal); virtual; abstract; |
|
Draws textured rectangle at the given vertices and multiplied by the specified 4-color gradient. The texture must be set prior to this call by one of |
procedure UseImage(Image: TAsphyreImage; const Mapping: TPoint4; TextureNo: Integer = 0); |
|
Defines the specified image with one of its textures to be used in next call to TexMap. The coordinates inside the texture are defined in logical units in range of [0..1]. |
procedure UseImagePt(Image: TAsphyreImage; Pattern: Integer = 0); overload; |
|
Defines the specified image with one of its patterns to be used in next call to TexMap. If the image has none or just one pattern, the value of |
procedure UseImagePt(Image: TAsphyreImage; Pattern: Integer; const SrcRect: TRect; Mirror: Boolean = False; Flip: Boolean = False); overload; |
|
Defines the specified image with one of its patterns to be used in next call to TexMap. Only part of pattern is used for rendering defined by the given coordinates; these coordinates can also be mirrored horizontally and/or flipped vertically, if needed. If the image has no or just one pattern, the value of |
procedure UseImagePx(Image: TAsphyreImage; const Mapping: TPoint4; TextureNo: Integer = 0); |
|
Defines the specified image with one of its textures to be used in next call to TexMap. The coordinates inside the texture are defined in pixels using floating-point coordinates. |
procedure UseTexture(Texture: TAsphyreCustomTexture; const Mapping: TPoint4); virtual; abstract; |
|
Defines the specified texture to be used in next call to TexMap. The coordinates inside the texture are defined in logical units in range of [0..1]. |
procedure UseTexturePx(Texture: TAsphyreCustomTexture; const Mapping: TPoint4); |
|
Defines the specified texture to be used in next call to TexMap. The coordinates inside the texture are defined in pixels using floating-point coordinates. |
procedure VertLine(Left, Top, Height: Single; Color1, Color2: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws vertical line using the specified coordinates and filled with two color gradient. This primitive uses a filled shape and not line primitive for pixel-perfect mapping. |
procedure VertLine(Left, Top, Height: Single; Color: Cardinal; Effect: TBlendingEffect = beNormal); overload; |
|
Draws vertical line using the specified coordinates and filled with solid color. This primitive uses a filled shape and not line primitive for pixel-perfect mapping. |
procedure WireQuad(const Points: TPoint4; const Colors: TColor4); |
|
Draws lines between the specified vertices (making it a wireframe quad) and vertex colors. |
procedure WuLine(Src, Dest: TPoint2; Color1, Color2: Cardinal); |
|
Draws antialiased "wu-line" using PutPixel primitive between the specified 2D floating-point vectors using two color gradient. |
Properties
property ClipRect: TRect read GetClipRect write SetClipRect; |
|
The clipping rectangle in which the rendering will be made. This can be useful for restricting the rendering to a certain part of screen. |
Generated by PasDoc 0.12.1 on 2012-09-14 11:55:49