L_SetJ2KOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetJ2KOptions(pOptions)

pFILEJ2KOPTIONS pOptions;

/* pointer to a structure */

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

Parameter

Description

pOptions

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

Returns

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

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 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_GetJ2KOptions

Topics:

Raster Image Functions: Saving Files

 

Implementing JPEG 2000 Plug in Features

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

FILEJ2KOPTIONS J2KOptions;

// get the current values. I only want to change the 
//   compression ratio
L_GetJ2KOptions
( &J2KOptions, sizeof(FILEJ2KOPTIONS));

// 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
L_SetJ2KOptions
(&J2KOptions);