1
- unit Image32_Draw ;
1
+ unit Img32.Draw ;
2
2
3
3
(* ******************************************************************************
4
4
* Author : Angus Johnson *
5
- * Version : 2.25 *
6
- * Date : 30 June 2021 *
5
+ * Version : 3.1 *
6
+ * Date : 15 August 2021 *
7
7
* Website : http://www.angusj.com *
8
8
* Copyright : Angus Johnson 2019-2021 *
9
9
* *
16
16
17
17
interface
18
18
19
- { $I Image32 .inc}
19
+ { $I Img32 .inc}
20
20
21
21
{ .$DEFINE MemCheck} // for debugging only (adds a minimal cost to performance)
22
22
23
23
uses
24
- SysUtils, Classes, Types, Math, Image32, Image32_Vector ,
25
- Image32_Transform ; // experimental;
24
+ SysUtils, Classes, Types, Math, Img32, Img32.Vector ,
25
+ Img32.Transform ; // experimental;
26
26
27
27
type
28
- TFillRule = Image32_Vector .TFillRule;
28
+ TFillRule = Img32.Vector .TFillRule;
29
29
30
30
// TGradientColor: used internally by both
31
31
// TLinearGradientRenderer and TRadialGradientRenderer
@@ -280,9 +280,9 @@ TBarycentricRenderer = class(TCustomRenderer)
280
280
281
281
// Both DrawBoolMask and DrawAlphaMask require
282
282
// 'mask' length to equal 'img' width * height
283
- procedure DrawBoolMask (img: TIMage32 ;
283
+ procedure DrawBoolMask (img: TImage32 ;
284
284
const mask: TArrayOfByte; color: TColor32 = clBlack32);
285
- procedure DrawAlphaMask (img: TIMage32 ;
285
+ procedure DrawAlphaMask (img: TImage32 ;
286
286
const mask: TArrayOfByte; color: TColor32 = clBlack32);
287
287
288
288
procedure Rasterize (const paths: TPathsD;
@@ -292,7 +292,7 @@ implementation
292
292
293
293
{ $IFDEF MemCheck}
294
294
resourcestring
295
- sMemCheckError = ' Image32_Draw : Memory allocation error' ;
295
+ sMemCheckError = ' Img32.Draw : Memory allocation error' ;
296
296
{ $ENDIF}
297
297
298
298
type
@@ -341,7 +341,7 @@ procedure ApplyClearType(img: TImage32;
341
341
begin
342
342
// Precondition: the background to text drawn onto 'img' must be transparent
343
343
344
- // multiplication tables (see Image32 .pas)
344
+ // multiplication tables (see Img32 .pas)
345
345
// 85 + (2 * 57) + (2 * 28) == 255
346
346
primeTbl := PByteArray(@MulTable[85 + centerWeighting *2 ]);
347
347
nearTbl := PByteArray(@MulTable[57 ]);
@@ -961,7 +961,7 @@ procedure Rasterize(const paths: TPathsD; const clipRec: TRect;
961
961
begin
962
962
// See also https://nothings.org/gamedev/rasterize/
963
963
if not assigned(renderer) then Exit;
964
- clipRec2 := Image32_Vector .IntersectRect(clipRec, GetBounds(paths));
964
+ Types .IntersectRect(clipRec2, clipRec, GetBounds(paths));
965
965
if IsEmptyRect(clipRec2) then Exit;
966
966
967
967
paths2 := OffsetPath(paths, -clipRec2.Left, -clipRec2.Top);
@@ -1732,6 +1732,7 @@ procedure DrawLine(img: TImage32; const lines: TPathsD;
1732
1732
if not assigned(lines) then exit;
1733
1733
if (lineWidth < MinStrokeWidth) then lineWidth := MinStrokeWidth;
1734
1734
lines2 := Outline(lines, lineWidth, joinStyle, endStyle, miterLimit);
1735
+
1735
1736
cr := TColorRenderer.Create(color);
1736
1737
try
1737
1738
if cr.Initialize(img) then
@@ -2026,7 +2027,7 @@ procedure ErasePolygon(img: TImage32; const polygons: TPathsD;
2026
2027
end ;
2027
2028
// ------------------------------------------------------------------------------
2028
2029
2029
- procedure DrawBoolMask (img: TIMage32 ; const mask: TArrayOfByte; color: TColor32);
2030
+ procedure DrawBoolMask (img: TImage32 ; const mask: TArrayOfByte; color: TColor32);
2030
2031
var
2031
2032
i, len: integer;
2032
2033
pc: PColor32;
@@ -2050,7 +2051,7 @@ procedure DrawBoolMask(img: TIMage32; const mask: TArrayOfByte; color: TColor32)
2050
2051
end ;
2051
2052
// ------------------------------------------------------------------------------
2052
2053
2053
- procedure DrawAlphaMask (img: TIMage32 ; const mask: TArrayOfByte; color: TColor32);
2054
+ procedure DrawAlphaMask (img: TImage32 ; const mask: TArrayOfByte; color: TColor32);
2054
2055
var
2055
2056
i, len: integer;
2056
2057
pc: PColor32;
0 commit comments