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_Image::open


Use this function to associate the J2K_Image object with a file, memory buffer or custom data source.

int open(char *filename);
int open(unsigned char *src_buffer, int src_size);
int open(int resource_no);
int open(void *data_source, J2K_Callbacks *cbs);


Parameters

filename
Name of a JPEG 2000 image file.

src_buffer
Pointer to a memory buffer, containing a JPEG 2000 image file.

src_size
Size of data in the memory buffer (in bytes).

resource_no
The resource ID. See "Samples\C++\h_Resources" for the example of using resources.

data_source
Pointer to a data source identifier to be passed to callback routines unchanged. See "Custom Data Sources" section for more information.

cbs
Pointer to a special structure with callbacks. See "Custom Data Sources" section for more information.

Return value

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

Example

J2K_Image image;

int j2k_err = image.open("test.j2k");

if(j2k_err != J2KERR_SUCCESS){ printf("\n J2K-Codec error: %s.\n", image.errStr); return -1; }

...

image.close();

See also

J2K_Image::close()

J2K_Image class
2004-2008 © Alex Saveliev