1 // SPDX-License-Identifier: LGPL-3.0-linking-exception
2 {
3 /**************************************************************************\
4 bgrabitmap.pas
5 --------------
6 Free easy-to-use memory bitmap 32-bit,
7 8-bit for each channel, transparency.
8 Channels can be in the following orders:
9 - B G R A (recommended for Windows, required for fpGUI)
10 - R G B A (recommended for Gtk and MacOS)
11
12 - Drawing primitives
13 - Resample
14 - Reference counter
15 - Drawing on LCL canvas
16 - Loading and saving images
17
18 Note : line order can change, so if you access
19 directly to bitmap data, check LineOrder value
20 or use Scanline to compute position.
21
22
23 --> Include BGRABitmap and BGRABitmapTypes in the 'uses' clause.
24 }
25
26 unit BGRABitmap;
27
28 {$mode objfpc}{$H+}
29 {$i bgrabitmap.inc}
30
31 interface
32
33 { Compiler directives are used to include the best version according
34 to the platform }
35
36 uses
37 BGRAClasses, BGRABitmapTypes, FPImage, SysUtils,
38 {$IFDEF BGRABITMAP_USE_FPGUI}
39 BGRAfpGUIBitmap,
40 {$ELSE}
41 {$IFDEF BGRABITMAP_USE_LCL}
42 {$IFDEF LCLwin32}
43 BGRAWinBitmap,
44 {$ELSE}
45 {$IFDEF LCLgtk}
46 BGRAGtkBitmap,
47 {$ELSE}
48 {$IFDEF LCLgtk2}
49 BGRAGtkBitmap,
50 {$ELSE}
51 {$IF defined(LCLqt) or defined(LCLqt5)}
52 BGRAQtBitmap,
53 {$ELSE}
54 {$IFDEF DARWIN}
55 BGRAMacBitmap,
56 {$ELSE}
57 BGRALCLBitmap,
58 {$ENDIF}
59 {$ENDIF}
60 {$ENDIF}
61 {$ENDIF}
62 {$ENDIF}
63 {$ELSE}
64 {$IFDEF BGRABITMAP_USE_MSEGUI}
65 BGRAMSEguiBitmap,
66 {$ELSE}
67 BGRANoGuiBitmap,
68 {$ENDIF}
69 {$ENDIF}
70 {$ENDIF}
71 BGRAGraphics;
72
73 type
74 {$IFDEF BGRABITMAP_USE_FPGUI}
75 TBGRABitmap = class(TBGRAfpGUIBitmap)
76 {$ELSE}
77 {$IFDEF BGRABITMAP_USE_LCL}
78 {$IFDEF LCLwin32}
79 TBGRABitmap = class(TBGRAWinBitmap)
80 {$ELSE}
81 {$IFDEF LCLgtk}
82 TBGRABitmap = class(TBGRAGtkBitmap)
83 {$ELSE}
84 {$IFDEF LCLgtk2}
85
86 { TBGRABitmap }
87
88 TBGRABitmap = class(TBGRAGtkBitmap)
89 {$ELSE}
90 {$IF defined(LCLqt) or defined(LCLqt5)}
91 TBGRABitmap = class(TBGRAQtBitmap)
92 {$ELSE}
93 {$IFDEF DARWIN}
94 TBGRABitmap = class(TBGRAMacBitmap)
95 {$ELSE}
96 TBGRABitmap = class(TBGRALCLBitmap)
97 {$ENDIF}
98 {$ENDIF}
99 {$ENDIF}
100 {$ENDIF}
101 {$ENDIF}
102 {$ELSE}
103 {$IFDEF BGRABITMAP_USE_MSEGUI}
104 TBGRABitmap = class(TBGRAMSEguiBitmap)
105 {$ELSE}
106 TBGRABitmap = class(TBGRANoGUIBitmap)
107 {$ENDIF}
108 {$ENDIF}
109 {$ENDIF}
110 public
NewBitmapnull111 function NewBitmap: TBGRABitmap; overload; override;
NewBitmapnull112 function NewBitmap(AWidth, AHeight: integer): TBGRABitmap; overload; override;
NewBitmapnull113 function NewBitmap(AWidth, AHeight: integer; const Color: TBGRAPixel): TBGRABitmap; overload; override;
NewBitmapnull114 function NewBitmap(AWidth, AHeight: integer; AColor: Pointer): TBGRABitmap; overload; override;
NewBitmapnull115 function NewBitmap(Filename: string): TBGRABitmap; overload; override;
NewBitmapnull116 function NewBitmap(Filename: string; AIsUtf8: boolean): TBGRABitmap; overload; override;
NewBitmapnull117 function NewBitmap(Filename: string; AIsUtf8: boolean; AOptions: TBGRALoadingOptions): TBGRABitmap; overload; override;
NewBitmapnull118 function NewBitmap(AFPImage: TFPCustomImage): TBGRABitmap; overload; override;
NewReferencenull119 function NewReference: TBGRABitmap; override;
GetUniquenull120 function GetUnique: TBGRABitmap; override;
Duplicatenull121 function Duplicate(DuplicateProperties: Boolean = False): TBGRABitmap; overload; override;
Duplicatenull122 function Duplicate(DuplicateProperties, DuplicateXorMask: Boolean) : TBGRABitmap; overload; override;
GetPartnull123 function GetPart(const ARect: TRect): TBGRABitmap; override;
CreateBrushTexturenull124 function CreateBrushTexture(ABrushStyle: TBrushStyle; APatternColor, ABackgroundColor: TBGRAPixel;
125 AWidth: integer = 8; AHeight: integer = 8; APenWidth: single = 1): TBGRABitmap; override;
Resamplenull126 function Resample(newWidth, newHeight: integer;
127 mode: TResampleMode = rmFineResample): TBGRABitmap; override;
RotateCWnull128 function RotateCW: TBGRABitmap; override;
RotateCCWnull129 function RotateCCW: TBGRABitmap; override;
RotateUDnull130 function RotateUD: TBGRABitmap; override;
FilterSmartZoom3null131 function FilterSmartZoom3(Option: TMedianOption): TBGRABitmap; override;
FilterMediannull132 function FilterMedian(Option: TMedianOption): TBGRABitmap; override;
FilterSmoothnull133 function FilterSmooth: TBGRABitmap; override;
FilterSharpennull134 function FilterSharpen(Amount: single = 1): TBGRABitmap; overload; override;
FilterSharpennull135 function FilterSharpen(ABounds: TRect; Amount: single = 1): TBGRABitmap; overload; override;
FilterContournull136 function FilterContour(AGammaCorrection: boolean = false): TBGRABitmap; override;
FilterPixelatenull137 function FilterPixelate(pixelSize: integer; useResample: boolean; filter: TResampleFilter = rfLinear): TBGRABitmap; override;
FilterBlurRadialnull138 function FilterBlurRadial(radius: single; blurType: TRadialBlurType): TBGRABitmap; overload; override;
FilterBlurRadialnull139 function FilterBlurRadial(const ABounds: TRect; radius: single; blurType: TRadialBlurType): TBGRABitmap; overload; override;
FilterBlurRadialnull140 function FilterBlurRadial(radiusX, radiusY: single; blurType: TRadialBlurType): TBGRABitmap; overload; override;
FilterBlurRadialnull141 function FilterBlurRadial(const ABounds: TRect; radiusX, radiusY: single; blurType: TRadialBlurType): TBGRABitmap; overload; override;
FilterBlurMotionnull142 function FilterBlurMotion(distance: single; angle: single; oriented: boolean): TBGRABitmap; overload; override;
FilterBlurMotionnull143 function FilterBlurMotion(const ABounds: TRect; distance: single; angle: single; oriented: boolean): TBGRABitmap; overload; override;
FilterCustomBlurnull144 function FilterCustomBlur(mask: TCustomUniversalBitmap): TBGRABitmap; overload; override;
FilterCustomBlurnull145 function FilterCustomBlur(const ABounds: TRect; mask: TCustomUniversalBitmap): TBGRABitmap; overload; override;
FilterEmbossnull146 function FilterEmboss(angle: single; AStrength: integer= 64; AOptions: TEmbossOptions = []): TBGRABitmap; overload; override;
FilterEmbossnull147 function FilterEmboss(angle: single; ABounds: TRect; AStrength: integer= 64; AOptions: TEmbossOptions = []): TBGRABitmap; overload; override;
FilterEmbossHighlightnull148 function FilterEmbossHighlight(FillSelection: boolean): TBGRABitmap; overload; override;
FilterEmbossHighlightnull149 function FilterEmbossHighlight(FillSelection: boolean; BorderColor: TBGRAPixel): TBGRABitmap; overload; override;
FilterEmbossHighlightnull150 function FilterEmbossHighlight(FillSelection: boolean; BorderColor: TBGRAPixel; var Offset: TPoint): TBGRABitmap; overload; override;
FilterGrayscalenull151 function FilterGrayscale: TBGRABitmap; overload; override;
FilterGrayscalenull152 function FilterGrayscale(ABounds: TRect): TBGRABitmap; overload; override;
FilterNormalizenull153 function FilterNormalize(eachChannel: boolean = True): TBGRABitmap; overload; override;
FilterNormalizenull154 function FilterNormalize(ABounds: TRect; eachChannel: boolean = True): TBGRABitmap; overload; override;
FilterRotatenull155 function FilterRotate(origin: TPointF; angle: single; correctBlur: boolean = false): TBGRABitmap; override;
FilterAffinenull156 function FilterAffine(AMatrix: TAffineMatrix; correctBlur: boolean = false): TBGRABitmap; override;
FilterSpherenull157 function FilterSphere: TBGRABitmap; override;
FilterTwirlnull158 function FilterTwirl(ACenter: TPoint; ARadius: Single; ATurn: Single=1; AExponent: Single=3): TBGRABitmap; overload; override;
FilterTwirlnull159 function FilterTwirl(ABounds: TRect; ACenter: TPoint; ARadius: Single; ATurn: Single=1; AExponent: Single=3): TBGRABitmap; overload; override;
FilterCylindernull160 function FilterCylinder: TBGRABitmap; override;
FilterPlanenull161 function FilterPlane: TBGRABitmap; override;
162 end;
163
164 // draw a bitmap from pure data
165 procedure BGRABitmapDraw(ACanvas: TCanvas; Rect: TRect; AData: Pointer;
166 VerticalFlip: boolean; AWidth, AHeight: integer; Opaque: boolean);
167
168 { Replace the content of the variable Destination with the variable
169 Temp and frees previous object contained in Destination.
170
171 This function is useful as a shortcut for :
172
173 var
174 temp: TBGRABitmap;
175 begin
176 ...
177 temp := someBmp.Filter... as TBGRABitmap;
178 someBmp.Free;
179 someBmp := temp;
180 end;
181
182 which becomes :
183
184 begin
185 ...
186 BGRAReplace(someBmp, someBmp.Filter... );
187 end;
188 }
189 procedure BGRAReplace(var Destination: TBGRABitmap; Temp: TObject);
190
191 implementation
192
193 uses BGRAReadBMP, BGRAReadBmpMioMap, BGRAReadGif,
194 BGRAReadIco, BGRAReadJpeg, BGRAReadLzp, BGRAReadPCX,
195 BGRAReadPng, BGRAWritePNG, BGRAReadPSD, BGRAReadTGA, BGRAReadXPM,
196 BGRAWriteLzp, BGRAReadWebP, BGRAWriteWebP;
197
198 var
199 tempBmp: TBGRABitmap;
200
201 procedure BGRABitmapDraw(ACanvas: TCanvas; Rect: TRect; AData: Pointer;
202 VerticalFlip: boolean; AWidth, AHeight: integer; Opaque: boolean);
203 var
204 LineOrder: TRawImageLineOrder;
205 begin
206 if tempBmp = nil then
207 tempBmp := TBGRABitmap.Create;
208 if VerticalFlip then
209 LineOrder := riloBottomToTop
210 else
211 LineOrder := riloTopToBottom;
212 if Opaque then
213 tempBmp.DataDrawOpaque(ACanvas, Rect, AData, LineOrder, AWidth, AHeight)
214 else
215 tempBmp.DataDrawTransparent(ACanvas, Rect, AData, LineOrder, AWidth, AHeight);
216 end;
217
218 procedure BGRAReplace(var Destination: TBGRABitmap; Temp: TObject);
219 begin
220 Destination.Free;
221 Destination := Temp as TBGRABitmap;
222 end;
223
224 { TBGRABitmap }
225
TBGRABitmap.NewBitmapnull226 function TBGRABitmap.NewBitmap: TBGRABitmap;
227 begin
228 Result:=inherited NewBitmap as TBGRABitmap;
229 end;
230
TBGRABitmap.NewBitmapnull231 function TBGRABitmap.NewBitmap(AWidth, AHeight: integer): TBGRABitmap;
232 begin
233 Result:=inherited NewBitmap(AWidth, AHeight) as TBGRABitmap;
234 end;
235
TBGRABitmap.NewBitmapnull236 function TBGRABitmap.NewBitmap(AWidth, AHeight: integer; const Color: TBGRAPixel
237 ): TBGRABitmap;
238 begin
239 Result:=inherited NewBitmap(AWidth, AHeight, Color) as TBGRABitmap;
240 end;
241
TBGRABitmap.NewBitmapnull242 function TBGRABitmap.NewBitmap(AWidth, AHeight: integer; AColor: Pointer
243 ): TBGRABitmap;
244 begin
245 Result:=inherited NewBitmap(AWidth, AHeight, AColor) as TBGRABitmap;
246 end;
247
TBGRABitmap.NewBitmapnull248 function TBGRABitmap.NewBitmap(Filename: string): TBGRABitmap;
249 begin
250 Result:=inherited NewBitmap(Filename) as TBGRABitmap;
251 end;
252
TBGRABitmap.NewBitmapnull253 function TBGRABitmap.NewBitmap(Filename: string; AIsUtf8: boolean): TBGRABitmap;
254 begin
255 Result:=inherited NewBitmap(Filename, AIsUtf8) as TBGRABitmap;
256 end;
257
TBGRABitmap.NewBitmapnull258 function TBGRABitmap.NewBitmap(Filename: string; AIsUtf8: boolean;
259 AOptions: TBGRALoadingOptions): TBGRABitmap;
260 begin
261 Result:=inherited NewBitmap(Filename, AIsUtf8, AOptions) as TBGRABitmap;
262 end;
263
TBGRABitmap.NewBitmapnull264 function TBGRABitmap.NewBitmap(AFPImage: TFPCustomImage): TBGRABitmap;
265 begin
266 Result:=inherited NewBitmap(AFPImage) as TBGRABitmap;
267 end;
268
NewReferencenull269 function TBGRABitmap.NewReference: TBGRABitmap;
270 begin
271 Result:=inherited NewReference as TBGRABitmap;
272 end;
273
GetUniquenull274 function TBGRABitmap.GetUnique: TBGRABitmap;
275 begin
276 Result:=inherited GetUnique as TBGRABitmap;
277 end;
278
TBGRABitmap.Duplicatenull279 function TBGRABitmap.Duplicate(DuplicateProperties: Boolean): TBGRABitmap;
280 begin
281 Result:=inherited Duplicate(DuplicateProperties) as TBGRABitmap;
282 end;
283
TBGRABitmap.Duplicatenull284 function TBGRABitmap.Duplicate(DuplicateProperties, DuplicateXorMask: Boolean
285 ): TBGRABitmap;
286 begin
287 Result:=inherited Duplicate(DuplicateProperties, DuplicateXorMask) as TBGRABitmap;
288 end;
289
TBGRABitmap.GetPartnull290 function TBGRABitmap.GetPart(const ARect: TRect): TBGRABitmap;
291 begin
292 Result:=inherited GetPart(ARect) as TBGRABitmap;
293 end;
294
CreateBrushTexturenull295 function TBGRABitmap.CreateBrushTexture(ABrushStyle: TBrushStyle;
296 APatternColor, ABackgroundColor: TBGRAPixel; AWidth: integer;
297 AHeight: integer; APenWidth: single): TBGRABitmap;
298 begin
299 Result:=inherited CreateBrushTexture(ABrushStyle, APatternColor,
300 ABackgroundColor, AWidth, AHeight, APenWidth) as TBGRABitmap;
301 end;
302
Resamplenull303 function TBGRABitmap.Resample(newWidth, newHeight: integer; mode: TResampleMode
304 ): TBGRABitmap;
305 begin
306 Result:=inherited Resample(newWidth, newHeight, mode) as TBGRABitmap;
307 end;
308
TBGRABitmap.RotateCWnull309 function TBGRABitmap.RotateCW: TBGRABitmap;
310 begin
311 Result:=inherited RotateCW as TBGRABitmap;
312 end;
313
RotateCCWnull314 function TBGRABitmap.RotateCCW: TBGRABitmap;
315 begin
316 Result:=inherited RotateCCW as TBGRABitmap;
317 end;
318
TBGRABitmap.RotateUDnull319 function TBGRABitmap.RotateUD: TBGRABitmap;
320 begin
321 Result:=inherited RotateUD as TBGRABitmap;
322 end;
323
FilterSmartZoom3null324 function TBGRABitmap.FilterSmartZoom3(Option: TMedianOption): TBGRABitmap;
325 begin
326 Result:=inherited FilterSmartZoom3(Option) as TBGRABitmap;
327 end;
328
TBGRABitmap.FilterMediannull329 function TBGRABitmap.FilterMedian(Option: TMedianOption): TBGRABitmap;
330 begin
331 Result:=inherited FilterMedian(Option) as TBGRABitmap;
332 end;
333
FilterSmoothnull334 function TBGRABitmap.FilterSmooth: TBGRABitmap;
335 begin
336 Result:=inherited FilterSmooth as TBGRABitmap;
337 end;
338
TBGRABitmap.FilterSharpennull339 function TBGRABitmap.FilterSharpen(Amount: single): TBGRABitmap;
340 begin
341 Result:=inherited FilterSharpen(Amount) as TBGRABitmap;
342 end;
343
TBGRABitmap.FilterSharpennull344 function TBGRABitmap.FilterSharpen(ABounds: TRect; Amount: single): TBGRABitmap;
345 begin
346 Result:=inherited FilterSharpen(ABounds, Amount) as TBGRABitmap;
347 end;
348
TBGRABitmap.FilterContournull349 function TBGRABitmap.FilterContour(AGammaCorrection: boolean = false): TBGRABitmap;
350 begin
351 Result:=inherited FilterContour(AGammaCorrection) as TBGRABitmap;
352 end;
353
FilterPixelatenull354 function TBGRABitmap.FilterPixelate(pixelSize: integer; useResample: boolean;
355 filter: TResampleFilter): TBGRABitmap;
356 begin
357 Result:=inherited FilterPixelate(pixelSize, useResample, filter) as TBGRABitmap;
358 end;
359
TBGRABitmap.FilterBlurRadialnull360 function TBGRABitmap.FilterBlurRadial(radius: single; blurType: TRadialBlurType
361 ): TBGRABitmap;
362 begin
363 Result:=inherited FilterBlurRadial(radius, blurType) as TBGRABitmap;
364 end;
365
TBGRABitmap.FilterBlurRadialnull366 function TBGRABitmap.FilterBlurRadial(const ABounds: TRect; radius: single;
367 blurType: TRadialBlurType): TBGRABitmap;
368 begin
369 Result:=inherited FilterBlurRadial(ABounds, radius, blurType) as TBGRABitmap;
370 end;
371
TBGRABitmap.FilterBlurRadialnull372 function TBGRABitmap.FilterBlurRadial(radiusX, radiusY: single;
373 blurType: TRadialBlurType): TBGRABitmap;
374 begin
375 Result:=inherited FilterBlurRadial(radiusX, radiusY, blurType) as TBGRABitmap;
376 end;
377
TBGRABitmap.FilterBlurRadialnull378 function TBGRABitmap.FilterBlurRadial(const ABounds: TRect; radiusX, radiusY: single;
379 blurType: TRadialBlurType): TBGRABitmap;
380 begin
381 Result:=inherited FilterBlurRadial(ABounds, radiusX, radiusY, blurType) as TBGRABitmap;
382 end;
383
FilterBlurMotionnull384 function TBGRABitmap.FilterBlurMotion(distance: single; angle: single;
385 oriented: boolean): TBGRABitmap;
386 begin
387 Result:=inherited FilterBlurMotion(distance, angle, oriented) as TBGRABitmap;
388 end;
389
FilterBlurMotionnull390 function TBGRABitmap.FilterBlurMotion(const ABounds: TRect; distance: single;
391 angle: single; oriented: boolean): TBGRABitmap;
392 begin
393 Result:=inherited FilterBlurMotion(ABounds, distance, angle, oriented) as TBGRABitmap;
394 end;
395
FilterCustomBlurnull396 function TBGRABitmap.FilterCustomBlur(mask: TCustomUniversalBitmap
397 ): TBGRABitmap;
398 begin
399 Result:=inherited FilterCustomBlur(mask) as TBGRABitmap;
400 end;
401
FilterCustomBlurnull402 function TBGRABitmap.FilterCustomBlur(const ABounds: TRect;
403 mask: TCustomUniversalBitmap): TBGRABitmap;
404 begin
405 Result:=inherited FilterCustomBlur(ABounds, mask) as TBGRABitmap;
406 end;
407
FilterEmbossnull408 function TBGRABitmap.FilterEmboss(angle: single; AStrength: integer;
409 AOptions: TEmbossOptions): TBGRABitmap;
410 begin
411 Result:=inherited FilterEmboss(angle, AStrength, AOptions) as TBGRABitmap;
412 end;
413
FilterEmbossnull414 function TBGRABitmap.FilterEmboss(angle: single; ABounds: TRect;
415 AStrength: integer; AOptions: TEmbossOptions): TBGRABitmap;
416 begin
417 Result:=inherited FilterEmboss(angle, ABounds, AStrength, AOptions) as TBGRABitmap;
418 end;
419
FilterEmbossHighlightnull420 function TBGRABitmap.FilterEmbossHighlight(FillSelection: boolean): TBGRABitmap;
421 begin
422 Result:=inherited FilterEmbossHighlight(FillSelection) as TBGRABitmap;
423 end;
424
FilterEmbossHighlightnull425 function TBGRABitmap.FilterEmbossHighlight(FillSelection: boolean;
426 BorderColor: TBGRAPixel): TBGRABitmap;
427 begin
428 Result:=inherited FilterEmbossHighlight(FillSelection, BorderColor) as TBGRABitmap;
429 end;
430
FilterEmbossHighlightnull431 function TBGRABitmap.FilterEmbossHighlight(FillSelection: boolean;
432 BorderColor: TBGRAPixel; var Offset: TPoint): TBGRABitmap;
433 begin
434 Result:=inherited FilterEmbossHighlight(FillSelection, BorderColor, Offset) as TBGRABitmap;
435 end;
436
TBGRABitmap.FilterGrayscalenull437 function TBGRABitmap.FilterGrayscale: TBGRABitmap;
438 begin
439 Result:=inherited FilterGrayscale as TBGRABitmap;
440 end;
441
TBGRABitmap.FilterGrayscalenull442 function TBGRABitmap.FilterGrayscale(ABounds: TRect): TBGRABitmap;
443 begin
444 Result:=inherited FilterGrayscale(ABounds) as TBGRABitmap;
445 end;
446
FilterNormalizenull447 function TBGRABitmap.FilterNormalize(eachChannel: boolean): TBGRABitmap;
448 begin
449 Result:=inherited FilterNormalize(eachChannel) as TBGRABitmap;
450 end;
451
FilterNormalizenull452 function TBGRABitmap.FilterNormalize(ABounds: TRect; eachChannel: boolean
453 ): TBGRABitmap;
454 begin
455 Result:=inherited FilterNormalize(ABounds, eachChannel) as TBGRABitmap;
456 end;
457
FilterRotatenull458 function TBGRABitmap.FilterRotate(origin: TPointF; angle: single;
459 correctBlur: boolean): TBGRABitmap;
460 begin
461 Result:=inherited FilterRotate(origin, angle, correctBlur) as TBGRABitmap;
462 end;
463
FilterAffinenull464 function TBGRABitmap.FilterAffine(AMatrix: TAffineMatrix; correctBlur: boolean
465 ): TBGRABitmap;
466 begin
467 Result:=inherited FilterAffine(AMatrix, correctBlur) as TBGRABitmap;
468 end;
469
TBGRABitmap.FilterSpherenull470 function TBGRABitmap.FilterSphere: TBGRABitmap;
471 begin
472 Result:=inherited FilterSphere as TBGRABitmap;
473 end;
474
FilterTwirlnull475 function TBGRABitmap.FilterTwirl(ACenter: TPoint; ARadius: Single;
476 ATurn: Single; AExponent: Single): TBGRABitmap;
477 begin
478 Result:=inherited FilterTwirl(ACenter, ARadius, ATurn, AExponent) as TBGRABitmap;
479 end;
480
FilterTwirlnull481 function TBGRABitmap.FilterTwirl(ABounds: TRect; ACenter: TPoint;
482 ARadius: Single; ATurn: Single; AExponent: Single): TBGRABitmap;
483 begin
484 Result:=inherited FilterTwirl(ABounds, ACenter, ARadius, ATurn, AExponent) as TBGRABitmap;
485 end;
486
FilterCylindernull487 function TBGRABitmap.FilterCylinder: TBGRABitmap;
488 begin
489 Result:=inherited FilterCylinder as TBGRABitmap;
490 end;
491
FilterPlanenull492 function TBGRABitmap.FilterPlane: TBGRABitmap;
493 begin
494 Result:=inherited FilterPlane as TBGRABitmap;
495 end;
496
497 initialization
498
499 //this variable is assigned to access appropriate functions
500 //depending on the platform
501 BGRABitmapFactory := TBGRABitmap;
502
503 finalization
504
505 tempBmp.Free;
506
507 end.
508
509