1- unit Image32_Draw ;
1+ unit Img32.Draw ;
22
33(* ******************************************************************************
44* Author : Angus Johnson *
5- * Version : 2.25 *
6- * Date : 30 June 2021 *
5+ * Version : 3.1 *
6+ * Date : 15 August 2021 *
77* Website : http://www.angusj.com *
88* Copyright : Angus Johnson 2019-2021 *
99* *
1616
1717interface
1818
19- { $I Image32 .inc}
19+ { $I Img32 .inc}
2020
2121{ .$DEFINE MemCheck} // for debugging only (adds a minimal cost to performance)
2222
2323uses
24- SysUtils, Classes, Types, Math, Image32, Image32_Vector ,
25- Image32_Transform ; // experimental;
24+ SysUtils, Classes, Types, Math, Img32, Img32.Vector ,
25+ Img32.Transform ; // experimental;
2626
2727type
28- TFillRule = Image32_Vector .TFillRule;
28+ TFillRule = Img32.Vector .TFillRule;
2929
3030 // TGradientColor: used internally by both
3131 // TLinearGradientRenderer and TRadialGradientRenderer
@@ -280,9 +280,9 @@ TBarycentricRenderer = class(TCustomRenderer)
280280
281281 // Both DrawBoolMask and DrawAlphaMask require
282282 // 'mask' length to equal 'img' width * height
283- procedure DrawBoolMask (img: TIMage32 ;
283+ procedure DrawBoolMask (img: TImage32 ;
284284 const mask: TArrayOfByte; color: TColor32 = clBlack32);
285- procedure DrawAlphaMask (img: TIMage32 ;
285+ procedure DrawAlphaMask (img: TImage32 ;
286286 const mask: TArrayOfByte; color: TColor32 = clBlack32);
287287
288288 procedure Rasterize (const paths: TPathsD;
@@ -292,7 +292,7 @@ implementation
292292
293293{ $IFDEF MemCheck}
294294resourcestring
295- sMemCheckError = ' Image32_Draw : Memory allocation error' ;
295+ sMemCheckError = ' Img32.Draw : Memory allocation error' ;
296296{ $ENDIF}
297297
298298type
@@ -341,7 +341,7 @@ procedure ApplyClearType(img: TImage32;
341341begin
342342 // Precondition: the background to text drawn onto 'img' must be transparent
343343
344- // multiplication tables (see Image32 .pas)
344+ // multiplication tables (see Img32 .pas)
345345 // 85 + (2 * 57) + (2 * 28) == 255
346346 primeTbl := PByteArray(@MulTable[85 + centerWeighting *2 ]);
347347 nearTbl := PByteArray(@MulTable[57 ]);
@@ -961,7 +961,7 @@ procedure Rasterize(const paths: TPathsD; const clipRec: TRect;
961961begin
962962 // See also https://nothings.org/gamedev/rasterize/
963963 if not assigned(renderer) then Exit;
964- clipRec2 := Image32_Vector .IntersectRect(clipRec, GetBounds(paths));
964+ Types .IntersectRect(clipRec2, clipRec, GetBounds(paths));
965965 if IsEmptyRect(clipRec2) then Exit;
966966
967967 paths2 := OffsetPath(paths, -clipRec2.Left, -clipRec2.Top);
@@ -1732,6 +1732,7 @@ procedure DrawLine(img: TImage32; const lines: TPathsD;
17321732 if not assigned(lines) then exit;
17331733 if (lineWidth < MinStrokeWidth) then lineWidth := MinStrokeWidth;
17341734 lines2 := Outline(lines, lineWidth, joinStyle, endStyle, miterLimit);
1735+
17351736 cr := TColorRenderer.Create(color);
17361737 try
17371738 if cr.Initialize(img) then
@@ -2026,7 +2027,7 @@ procedure ErasePolygon(img: TImage32; const polygons: TPathsD;
20262027end ;
20272028// ------------------------------------------------------------------------------
20282029
2029- procedure DrawBoolMask (img: TIMage32 ; const mask: TArrayOfByte; color: TColor32);
2030+ procedure DrawBoolMask (img: TImage32 ; const mask: TArrayOfByte; color: TColor32);
20302031var
20312032 i, len: integer;
20322033 pc: PColor32;
@@ -2050,7 +2051,7 @@ procedure DrawBoolMask(img: TIMage32; const mask: TArrayOfByte; color: TColor32)
20502051end ;
20512052// ------------------------------------------------------------------------------
20522053
2053- procedure DrawAlphaMask (img: TIMage32 ; const mask: TArrayOfByte; color: TColor32);
2054+ procedure DrawAlphaMask (img: TImage32 ; const mask: TArrayOfByte; color: TColor32);
20542055var
20552056 i, len: integer;
20562057 pc: PColor32;
0 commit comments