JCL Help:Transform

From Project JEDI Wiki
Jump to navigationJump to search


Summary

The summary for this help topic does not exist, edit this page

Pascal

 procedure Transform(Dst: TJclBitmap32; Src: TJclBitmap32; SrcRect: TRect; Transformation: TJclTransformation);


Description

Transform is responsible for arbitrary geometrical transformations of bitmaps or their fragments. The current version supports only linear transformations.
The Transformation parameter is a reference to a descendant of an abstract TTransformation class. It specifies all necessary transformation Parameters:.
When Src.StretchFilter is different from sfNearest, Transform uses bilinear interpolation for magnification (along any axis) as for minification, it is not as accurate as StretchTransfer function. If you need better quality when minimizing the bitmaps, transform them into the temporary buffer so that there is no minification involved, then StretchTransfer to a final bitmap.
The function does not support spline interpolation, if Src.StretchFilter is sfSpline, Transform operates as if it were sfLinear.
There is an issue with antialiasing and edges. How to make them antialiased and still keep the performance? The solution implemented in JclGraphics is similar to the one used in OpenGL. You just have to provide the source bitmap (or its region) with transparent edges. In the original image, you’ll have to force the alpha channel on its edges to zeroes, for example, using the SetBorderTransparent method.
Remember, that color is interpolated as well, it means that for nice fadeout the color on the border should match the color of pixels lying next to the border.
In case the bitmap is transformed in dmOpaque mode, it might be better to keep the color on the edge close to the color of the background.


See Also

SetBorderTransparent TJclBitmap32.StretchFilter StretchTransfer TJclLinearTransformation


About

Unit

JclGraphics


Donator

Alex Denissov


Platforms

VCL


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page