L_WriteFileTransforms

#include "l_bitmap.h"

L_LTFIL_API L_INT L_WriteFileTransforms(pszFile, pTransforms, nFlags, pSaveOptions)

L_TCHAR* pszFile;

/* file name */

pFILETRANSFORMS pTransforms;

/* pointer to a transform structure */

L_INT nFlags;

/* flag */

pSAVEFILEOPTION pSaveOptions;

/* pointer to optional extended save options */

Writes transforms to a FlashPix file.

Parameter

Description

pszFile

Character string containing the FlashPix file name.

pTransforms

Pointer to a transform structure.

nFlags

Flag used to determine how the image will be viewed. If nFlags is set, L_WriteFileTransforms will translate and/or scale the image so that the image will fall entirely within the view frame. These transformations will be incorporated into the affine matrix stored with the image. For example, if an image is rotated, as seen below, part of the image now falls outside the view frame. In this case, if nFlag is set, the image will be translated and scaled by L_WriteFileTransforms so that the entire image falls within the view frame.The translation and scaling are incorporated into the matrix stored with the image.

 

If nFlags is not set, the image would be appear as it does on the right, with part of the image "missing":

For an example, click here

pSaveOptions

Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Note:

Page number is specified in the SAVEFILEOPTION structure.

 

Also determines whether the image will be viewed "as is" when rotated, sheared or skewed, or whether the image will be translated and scaled such that the entire image may be viewed in its sheared, skewed or rotated state.

To load a FlashPix file with or without the transforms, see FlashPix Transforms Options.

For more information on transforms in general, refer to FILETRANSFORMS.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_ReadFileTransforms, L_HighPassFilterBitmap

Topics:

Raster Image Functions: Saving Files,

 

Raster Image Functions: Getting and Setting File Information,

 

Raster Image Functions: Doing Geometric Transformations,

 

Raster Image Functions: Modifying Intensity Values,

 

Loading and Saving Images

 

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

 L_INT WriteFileTransformsExample(L_VOID)
{
   L_INT nRet;
   FILETRANSFORMS FileTransforms;

   nRet = L_ReadFileTransforms (TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\IMAGE1.FPX"), &FileTransforms, NULL);
   if(nRet != SUCCESS)
      return nRet;

   //Increase the contrast by 20%
   FileTransforms.fContrastAdjustment = FileTransforms.fContrastAdjustment * 1.2f;
   nRet = L_WriteFileTransforms(TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\IMAGE1.FPX"), &FileTransforms, FALSE, NULL);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}