LFileSettings::SetJ2KOptions

Summary

Sets the file options used by LEADTOOLS when saving J2K or JP2 files.

Syntax

#include "ltwrappr.h"

static L_INT LFileSettings::SetJ2KOptions(pOptions)

Parameters

const pFILEJ2KOPTIONS pOptions

Pointer to a structure that contains the options to use when saving J2K or JP2 files.

Returns

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

Comments

The nSize member of the FILEJ2KOPTIONS structure must be set before calling this function.

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example will make it so the next time you save a JPEG2000 or enhanced CMP file, it will be saved with a 100:1 compression ratio.

L_INT LFileSettings__SetJ2KOptionsExample()  
{ 
   L_INT nRet; 
   FILEJ2KOPTIONS J2KOptions; 
 
   // Get the current values. Change the  
   // compression ratio 
   nRet = LFileSettings::GetJ2KOptions( &J2KOptions, sizeof(FILEJ2KOPTIONS)); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // set the compression control to make sure we will be 
   // using the compression control 
   J2KOptions.uCompressionControl = J2K_COMPRESSION_RATIO; 
 
   // set the compression ratio to 100 
   J2KOptions.fCompressionRatio = 100.0f; 
 
   // set the compression options. The next time I save a  
   // JPEG2000 file, it will be saved with 100:1 compression ratio 
   nRet = LFileSettings::SetJ2KOptions(&J2KOptions); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 

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

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