Difference between revisions of "TBGRACustomBitmap and IBGRAScanner"

From Lazarus wiki
Jump to navigationJump to search
(created)
 
(not wiki)
Line 1: Line 1:
 
Back to [[BGRABitmap]].
 
Back to [[BGRABitmap]].
  
This class and this interface are included in [[BGRABitmapTypes]].
+
This class and this interface are included in ''BGRABitmapTypes''.
  
 
=== TBGRACustomBitmap and IBGRAScanner ===
 
=== TBGRACustomBitmap and IBGRAScanner ===

Revision as of 17:09, 30 April 2015

Back to BGRABitmap.

This class and this interface are included in BGRABitmapTypes.

TBGRACustomBitmap and IBGRAScanner

IBGRAScanner

IBGRAScanner = interface
Interface for a scanner. A scanner is like an image, but its content has no limit and it can be calculated on the fly. It is like a infinite readonly image.

Note: it must not implement reference counting even if it is an interface

TBGRACustomBitmap implements this interface and the content is repeated horizontally and vertically. There are also various classes in BGRAGradientScanner unit that generate gradients on the fly and in BGRATransform unit that provide geometrical transformations of images
procedure ScanMoveTo(X,Y: Integer);
Move to the position (X,Y) for the next call to ScanNextPixel
function ScanNextPixel: TBGRAPixel;
Scan the pixel at the current location and increments X
function ScanAt(X,Y: Single): TBGRAPixel;
Scan at any location using floating point coordinates
function ScanAtInteger(X,Y: integer): TBGRAPixel;
Scan at any location using integer coordinates
procedure ScanPutPixels(pdest: PBGRAPixel; count: integer; mode: TDrawMode);
Copy a row of pixels from X to X+count-1 to a specified destination pdest. mode indicates how to combine with existing data
function IsScanPutPixelsDefined: boolean;
Returns True if the function ScanPutPixels is available. Otherwise you need to call ScanNextPixel and combine pixels for example with SetPixel
TScanAtFunction = function (X,Y: Single): TBGRAPixel of object;
A type of function of a scanner that returns the content at floating point coordinates
TScanAtIntegerFunction = function (X,Y: Integer): TBGRAPixel of object;
A type of function of a scanner that returns the content at integer coordinates
TScanNextPixelFunction = function: TBGRAPixel of object;
A type of function of a scanner that returns the next pixel
TBGRACustomScanner = class(IBGRAScanner)
Base class for implementing IBGRAScanner interface

TBGRACustomBitmap

TBGRACustomBitmap = class(TFPCustomImage,IBGRAScanner)
This is the base class for TBGRABitmap. It is the direct parent of TBGRADefaultBitmap class, which is the parent of the diverse implementations. A bitmap can be used as a scanner using the interface IBGRAScanner
Caption: string;
User defined caption. It does not appear on the image
FontName: string;
Specifies the font to use. Unless the font renderer accept otherwise, the name is in human readable form, like 'Arial', 'Times New Roman', ...
FontStyle: TFontStyles;
Specifies the set of styles to be applied to the font. These can be fsBold, fsItalic, fsStrikeOut, fsUnderline. So the value [fsBold,fsItalic] means that the font must be bold and italic. See miscellaneous types
FontQuality : TBGRAFontQuality;
Specifies the quality of rendering. Default value is fqSystem. See miscellaneous types
FontOrientation: integer;
Specifies the rotation of the text, for functions that support text rotation. It is expressed in tenth of degrees, positive values going counter-clockwise.
FontVerticalAnchor: TFontVerticalAnchor;
Specifies how the font is vertically aligned relative to the start coordinate. See miscellaneous types
JoinStyle: TPenJoinStyle;
How to join segments. See BGRAGraphics
JoinMiterLimit: single;
Limit for the extension of the segments when joining them with pjsMiter join style, expressed in multiples of the width of the pen
FillMode: TFillMode;
Method to use when filling polygons (winding or alternate). See BGRAGraphics
LinearAntialiasing: boolean;
Specifies if linear antialiasing must be used when drawing antialiased shapes
ResampleFilter : TResampleFilter;
Resample filter is used when resizing the bitmap
ScanInterpolationFilter: TResampleFilter;
Scan interpolation filter is used when the bitmap is used as a scanner (interface IBGRAScanner)
ScanOffset: TPoint;
Offset to apply when the image is scanned using IBGRAScanner interface