-
Notifications
You must be signed in to change notification settings - Fork 14
/
AsciiImage.RenderContext.Types.pas
73 lines (59 loc) · 1.33 KB
/
AsciiImage.RenderContext.Types.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
unit AsciiImage.RenderContext.Types;
interface
uses
Graphics,
{$if CompilerVersion > 22}
System.Types,
System.UITypes;
{$Else}
Types;
{$IfEnd}
{$If declared(TGraphic)}
const Framework = 'VCL';
{$Else}
const Framework = 'FM';
const clNone = TAlphaColorRec.Null;
const clBlack = TAlphaColorRec.Black;
{$IfEnd}
type
{$If Framework = 'VCL'}
TColorValue = TColor;
{$Else}
TColorValue = TAlphaColor;
{$IfEnd}
{$if (CompilerVersion > 22) and declared(System.Types.TPointF)}
TPointF = System.Types.TPointF;
{$Else}
TPointF = record
X: Single;
Y: Single;
end;
{$IfEnd}
{$if (CompilerVersion > 22) and declared(System.Types.TRectF)}
TRectF = System.Types.TRectF;
{$Else}
TRectF = record
Left, Top, Right, Bottom: Single;
end;
{$IfEnd}
{$if CompilerVersion > 22}
TRect = System.Types.TRect;
{$Else}
TRect = Types.TRect;
{$IfEnd}
function PointF(AX, AY: Single): TPointF; inline;
function RectF(ALeft, ATop, ARight, ABottom: Single): TRectF; inline;
implementation
function PointF(AX, AY: Single): TPointF;
begin
Result.X := AX;
Result.Y := AY;
end;
function RectF(ALeft, ATop, ARight, ABottom: Single): TRectF;
begin
Result.Left := ALeft;
Result.Top := ATop;
Result.Right := ARight;
Result.Bottom := ABottom;
end;
end.