Support
SiteLinks |
GR32AddonsThis set of unit containt differents addons to GR32 more orless usefull, tested with GR32 version 1.8beta. The contents of theses files are subject to the Mozilla Public License Version 1.1
GR32_MathAddons.pasThis unit define some procedures and functions specially axed on Single float arithmetic. This include some trigonometric functions (such as GR32_TransformsEx.pas and GR32_TransformsWarp.pasTheses unit define some new transformations, most of then are taken from the Paul Bourke article : Image warping / distortion. See his web page for details, C implementation and screenshoot. Every distortions are based on a generic transformation GR32_TransformsEx.pas define a spacial transformation, PerfsTransforms.zip is an modified version of the GR32 sample application TransformEx with this Transformations illustrated. (here is the Exe only archive). GR32_RasterizerEx.pasThis unit define a really simple rasterizer class. It draw the bitmap in a "boxed" way, instead of define a color for each pixel of the image, a color value is caculated for a square of pixel (a property of the Rasterizer). The result is a weird image really pixelixed, but the resulting bitmap can be calculated more quickly than the whole image. This can be usefull, if each pixel is the result of a complex transformation, to preview the final image. This rasterizer has been used in the above Transforms demo to accelerate the rendering during mouse dragging operations on the spherical projection. GR32_Convolution.pasThis unit is a fused version of the Antti Lukats MMX implementation of kernel 3x3 convolution and the so called PixelPtr implementation of Patrick Quinn. It use 3 PixelPtr (one per line) and MMX operations when available, if there is not MMX or when the use of MMX operation is not profitable it use the PixelPtr implementation. i.e. MMX does not propose a divide operator, so when the kernel has a factor (i.e. the matrix is not normalized) and when this factor is not a power of 2, it doas NOT use MMX operations at all, because switching from MMX to integer arithmetic, apply 4 div and switch back to MMX, is slower than doing the whole stuff with standart operations. By the way, kernels normalmized or with a power of 2 normalisation factor represent most of the kernels... If you are using user's defined kernels you should (if you can) adjust the normalisation factor to be executed with an MMX version of the function. The following application is a benchmark between the diferents implementation. Applied to an image 1600x1200, with a Pentium 4 :
You can test yourself the differents convolution with the Morpheus Convolution Benchmark (exe) ;-) (source files). Some kernels have been to the list of Patrick (4 Emboss style matrixes). Moreover 5x5 and 7x7 convolutions have been implemented (the 7x7 version does not use MMX yet) plus two specially optimized convolutions : Gaussian Blur and Sharpen. Theses last one are 20% and 30% faster then the fastest generic 3x3 implementations. |