Skip to content

Naming conventions

General

Graphics32 follows standard Delphi/FPC identifier naming practices:

CategoryPrefixExample
ClassesTTBitmap32, TImage32, TCustomSampler
InterfacesIIBackend, INotify
Types / RecordsTTColor32, TFloatPoint, TRect
Color ConstantsclclWhite32, clRed32
Global FunctionsPascalCaseColor32, RedComponent, Intensity

Line and Pixel methods

The TBitmap32 class provides a large number of methods for single pixel access and single pixel width line drawing. While the prefix of these methods indicate what they do (draw a line, access a pixel, etc.), the postfix denotes how they behave. The methods can include one or more of the following postfixes:

PostfixNameDescriptionSample (magnified x4)Examples
(none)Methods without modifiers offer maximum performance.
Lines and pixels are rendered without anti-aliasing and without color blending.
No clipping is performed so coordinates are expected to be within bitmap boundaries. Out of bounds coordinates can cause access violations and memory overwrites.
Line
HorzLine
Pixel
FillRect
SSafeClipping is performed when coordinates extend beyond bitmap boundaries.
This modifier can be combined with any one of the anti-aliasing or transparent modifiers below (T, A, X or F) and also with the stippling (P) modifier.
LineS
LineToS
PixelS
TTransparentSemi-transparent pixels are merged onto the background image (though still without anti-aliasing).LineTS
LineToTS
FillRectTS
AAnti-aliasedUses a modified version of Bresenham’s algorithm known as Wu’s antialiasing.LineA
LineAS
XFixedCoordinates are in fixed point (TFixed) format.
These methods also employ a more sophisticated anti-aliasing algorithm than that used in the ‘A’ methods above.
LineX
LineXS
PixelXS
FFloatCoordinates are in floating point (TFloat) format.
These methods employ the same anti-aliasing algorithm used in the ‘X’ methods.
LineFS
PixelFS
PStipplingLines are drawn using a stippling pattern.
This modifier must be combined with either the ‘X’ or ‘F’ modifiers above.
LineFSP
LineXSP
WWrappedCoordinate-wrapped pixel access modulo bitmap dimensions (Width and Height)PixelW
PixelFW
RResampledResampled pixel access at floating-point coordinates evaluated using the active resampler.PixelFR
PixelXR

Note

For lines, all the methods listed above draw line segments that are a single pixel wide. To draw thicker (or thinner) lines, see the Polyline and PolyPolyline functions in the GR32_Polygons unit. Those functions also produce better anti-aliased blending over fully transparent backgrounds (when compared with X & F modifier methods above).

Blend functions

Most blend functions are named using a scheme that clearly identify how they operate:

PostfixExampleMeaning
RegBlendRegThe result foreground color is returned as the function Result.
MemBlendMemThe result foreground color is returned in the F parameter.
ExMergeRegExThe foreground alpha is scaled with a master alpha value.
MemsBlendMemsApply a single foreground color onto an array of background colors.
LineMergeLineApply an array of foreground colors onto an array of background colors.
RGBBlendMemRGBOperate independently on each color channel using separate alpha values.
Line1MergeLine1Deprecated. Same as Mems.