LBitmap::ApplyTransformationParameters

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyTransformationParameters (nXTranslation, nYTranslation, nAngle, uXScale, uYScale, uFlags)

Corrects the image by removing the translation, rotation, and scaling deformations that have been applied on the image.

Parameters

L_INT nXTranslation

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 LBitmap::GetTransformationParameters function.

L_INT nYTranslation

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 LBitmap::GetTransformationParameters function.

L_INT nAngle

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 is rotated in a counter-clockwise rotation. This value must be equal to the one returned from LBitmap::GetTransformationParameters function.

L_UINT uXScale

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 LBitmap::GetTransformationParameters function.

L_UINT uYScale

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 LBitmap::GetTransformationParameters function.

L_UINT uFlags

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] (Document/Medical only) 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] (Document/Medical only) 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.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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 LBitmap::GetTransformationParameters.

You can get the translation, rotation, and scaling parameters by using LBitmap::GetTransformationParameters function; the returned values must be passed as they are to [LBitmap: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 LBitmap::Deskew function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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 only in the Document/Medical toolkits.

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.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For an example, refer to LBitmap::GetTransformationParameters.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.