J2K-Codec ™

News
Overview
Download
Order
F.A.Q.
More info
Support
Links

Welcome
QuickStart

ActiveX Control

C++ Wrapper
J2K_Image
open
easyDecode
selectTiles
getMetaData
decode
close
J2K_Frames
open
getFrames
getFrame
operators
close

API Reference
General
getVersion
getLastError
getErrorStr
getLastErrorStr
Unlock
Open / Close
Open
Close
Info
GetInfo
GetInfoEx
GetResolutions
GetResDimensions
GetMetaData
Decoding
EasyDecode
SelectTiles
Decode
Cancel
Debug
StartLogging
StopLogging


J2K_GetResolutions


Use this function to get the number of available resolution levels in the J2K image.

int J2K_GetResolutions(void *image, int *resolutions);


Parameters

image
A pointer, obtained from J2K_Open().

resolutions
Pointer to a variable, where the number of resolutions will be placed.

Return value

Returns J2KERR_SUCCESS or an error code if the function has failed. See the list of error codes here.

Example

int resolutions=0, rWidth, rHeight;

int j2k_err = J2K_GetResolutions(image, &resolutions;);
if(j2k_err != J2KERR_SUCCESS) printf("\n J2K-Codec error: %s.", J2K_getErrorStr(j2k_err));

printf("\n %u resolution(s) available.\n", resolutions);

for(int i=0; i<resolutions; i++)
{
   J2K_GetResolutionDimensions(image, i, &rWidth;, &rHeight;);
   printf(" - Resolution %u: %ux%u\n", i, rWidth, rHeight);
}

See also

J2K_GetResolutionDimensions()
2004-2008 © Alex Saveliev