#include "l_bitmap.h"
L_LTIMGCOR_API L_INT L_ApplyTransformationParameters (pBitmap, nXTranslation, nYTranslation, nAngle, uXScale, uYScale, uFlags)
Corrects the image by removing the translation, rotation, and scaling deformations that have been applied to the image.
Pointer to the bitmap handle referencing the transformed bitmap.
The amount of bitmap translation along the x-axis (Width). This value is internally divided by 100. This value must be equal to the one returned from L_GetTransformationParameters function.
The amount of bitmap translation (in pixels) along the y-axis (Height). This value is internally divided by 100. This value must be equal to the one returned from L_GetTransformationParameters function.
Hundredths of degrees to rotate (+/-). This can be a number from 1 to 36,000. This value is internally divided by 100. A positive value means the image rotated in a clockwise rotation, while a negative value means the image rotated in a counter-clockwise rotation. This value must be equal to the one returned from L_GetTransformationParameters function.
The amount of bitmap x-axis (Width) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from L_GetTransformationParameters function.
The amount of bitmap y-axis (Height) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from L_GetTransformationParameters function.
Flag that specifies the behavior when resizing the bitmap. Select one value. Possible values are:
Value | Meaning |
---|---|
RGS_SIZE_NORMAL | [0x0001] Resize normally. |
RGS_SIZE_RESAMPLE | [0x0002] Use linear interpolation and averaging to produce a higher-quality image. |
RGS_SIZE_BICUBIC | [0x0003] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE. |
RGS_SIZE_FAVORBLACK | [0x0010] Preserve black objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images. |
RGS_SIZE_FAVORWHITE | [0x0020] Preserve white objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORWHITE causes color images to be resampled, but applies the favor-white option to 1-bit, black-and-white images. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
This function corrects the image by removing the translation, rotation, and scaling deformations that have been applied to the image. These transformations make this bitmap match a reference bitmap.
This function is designed to work with L_GetTransformationParameters.
You can get the translation, rotation, and scaling parameters by using L_GetTransformationParameters function; the returned values must be passed as they are to L_ApplyTransformationParameters function.
The shift operation is performed first, followed by the rotation and resize operations.
If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.
To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available in the Document and Medical Imaging toolkits.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Required DLLs and Libraries
Win32, x64, Linux.
For an example, refer to L_GetTransformationParameters.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document