OpenJPEG  2.1.2
Data Structures | Macros | Typedefs | Enumerations | Functions
openjpeg.h File Reference
#include "opj_stdint.h"
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  opj_poc
 Progression order changes. More...
 
struct  opj_cparameters
 Compression parameters. More...
 
struct  opj_dparameters
 Decompression parameters. More...
 
struct  opj_image_comp
 Defines a single image component. More...
 
struct  opj_image
 Defines image data and characteristics. More...
 
struct  opj_image_comptparm
 Component parameters structure used by the opj_image_create function. More...
 
struct  opj_packet_info
 Index structure : Information concerning a packet inside tile. More...
 
struct  opj_marker_info
 Marker structure. More...
 
struct  opj_tp_info
 Index structure : Information concerning tile-parts. More...
 
struct  opj_tile_info
 Index structure : information regarding tiles. More...
 
struct  opj_codestream_info
 Index structure of the codestream. More...
 
struct  opj_tccp_info
 Tile-component coding parameters information. More...
 
struct  opj_tile_v2_info
 Tile coding parameters information. More...
 
struct  opj_codestream_info_v2
 Information structure about the codestream (FIXME should be expand and enhance) More...
 
struct  opj_tp_index
 Index structure about a tile part. More...
 
struct  opj_tile_index
 Index structure about a tile. More...
 
struct  opj_codestream_index
 Index structure of the codestream (FIXME should be expand and enhance) More...
 
struct  opj_jp2_metadata
 Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT. More...
 
struct  opj_jp2_index
 Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT. More...
 

Macros

#define INLINE
 
#define OPJ_DEPRECATED(func)   func
 
#define OPJ_API
 
#define OPJ_LOCAL
 
#define OPJ_CALLCONV
 
#define OPJ_TRUE   1
 
#define OPJ_FALSE   0
 
#define OPJ_ARG_NOT_USED(x)   (void)(x)
 
#define OPJ_PATH_LEN   4096
 Maximum allowed size for filenames. More...
 
#define OPJ_J2K_MAXRLVLS   33
 Number of maximum resolution level authorized. More...
 
#define OPJ_J2K_MAXBANDS   (3*OPJ_J2K_MAXRLVLS-2)
 Number of maximum sub-band linked to number of resolution level. More...
 
#define OPJ_J2K_DEFAULT_NB_SEGS   10
 
#define OPJ_J2K_STREAM_CHUNK_SIZE   0x100000 /** 1 mega by default */
 
#define OPJ_J2K_DEFAULT_HEADER_SIZE   1000
 
#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS   10
 
#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS   10
 
#define JPWL_MAX_NO_TILESPECS   16
 Maximum number of tile parts expected by JPWL: increase at your will. More...
 
#define JPWL_MAX_NO_PACKSPECS   16
 Maximum number of packet parts expected by JPWL: increase at your will. More...
 
#define JPWL_MAX_NO_MARKERS   512
 Maximum number of JPWL markers: increase at your will. More...
 
#define JPWL_PRIVATEINDEX_NAME   "jpwl_index_privatefilename"
 index file name used when JPWL is on More...
 
#define JPWL_EXPECTED_COMPONENTS   3
 Expect this number of components, so you'll find better the first EPB. More...
 
#define JPWL_MAXIMUM_TILES   8192
 Expect this maximum number of tiles, to avoid some crashes. More...
 
#define JPWL_MAXIMUM_HAMMING   2
 Expect this maximum number of bit errors in marker id's. More...
 
#define JPWL_MAXIMUM_EPB_ROOM   65450
 Expect this maximum number of bytes for composition of EPBs. More...
 
#define OPJ_IMG_INFO   1
 EXPERIMENTAL FOR THE MOMENT Supported options about file information used only in j2k_dump. More...
 
#define OPJ_J2K_MH_INFO   2
 Codestream information based only on the main header. More...
 
#define OPJ_J2K_TH_INFO   4
 Tile information based on the current tile header. More...
 
#define OPJ_J2K_TCH_INFO   8
 Tile/Component information of all tiles. More...
 
#define OPJ_J2K_MH_IND   16
 Codestream index based only on the main header. More...
 
#define OPJ_J2K_TH_IND   32
 Tile index based on the current tile. More...
 
#define OPJ_JP2_INFO   128
 < More...
 
#define OPJ_JP2_IND   256
 JP2 file index. More...
 
#define OPJ_PROFILE_NONE   0x0000 /** no profile, conform to 15444-1 */
 JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMD) These values help chosing the RSIZ value for the J2K codestream. More...
 
#define OPJ_PROFILE_0   0x0001 /** Profile 0 as described in 15444-1,Table A.45 */
 
#define OPJ_PROFILE_1   0x0002 /** Profile 1 as described in 15444-1,Table A.45 */
 
#define OPJ_PROFILE_PART2   0x8000 /** At least 1 extension defined in 15444-2 (Part-2) */
 
#define OPJ_PROFILE_CINEMA_2K   0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */
 
#define OPJ_PROFILE_CINEMA_4K   0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */
 
#define OPJ_PROFILE_CINEMA_S2K   0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */
 
#define OPJ_PROFILE_CINEMA_S4K   0x0006 /** Scalable 4K cinema profile defined in 15444-1 AMD2 */
 
#define OPJ_PROFILE_CINEMA_LTS   0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */
 
#define OPJ_PROFILE_BC_SINGLE   0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */
 
#define OPJ_PROFILE_BC_MULTI   0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */
 
#define OPJ_PROFILE_BC_MULTI_R   0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */
 
#define OPJ_PROFILE_IMF_2K   0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_PROFILE_IMF_4K   0x0401 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_PROFILE_IMF_8K   0x0402 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_PROFILE_IMF_2K_R   0x0403 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_PROFILE_IMF_4K_R   0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_PROFILE_IMF_8K_R   0x0801 /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
 
#define OPJ_EXTENSION_NONE   0x0000 /** No Part-2 extension */
 JPEG 2000 Part-2 extensions. More...
 
#define OPJ_EXTENSION_MCT   0x0100 /** Custom MCT support */
 
#define OPJ_IS_CINEMA(v)    (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
 JPEG 2000 profile macros. More...
 
#define OPJ_IS_STORAGE(v)    ((v) == OPJ_PROFILE_CINEMA_LTS)
 
#define OPJ_IS_BROADCAST(v)   (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))
 
#define OPJ_IS_IMF(v)    (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))
 
#define OPJ_IS_PART2(v)    ((v) & OPJ_PROFILE_PART2)
 
#define OPJ_CINEMA_24_CS   1302083 /** Maximum codestream length for 24fps */
 JPEG 2000 codestream and component size limits in cinema profiles. More...
 
#define OPJ_CINEMA_48_CS   651041 /** Maximum codestream length for 48fps */
 
#define OPJ_CINEMA_24_COMP   1041666 /** Maximum size per color component for 2K & 4K @ 24fps */
 
#define OPJ_CINEMA_48_COMP   520833 /** Maximum size per color component for 2K @ 48fps */
 
#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG   0x0001
 
#define OPJ_STREAM_READ   OPJ_TRUE
 Stream open flags. More...
 
#define OPJ_STREAM_WRITE   OPJ_FALSE
 The stream was opened for writing. More...
 

Typedefs

typedef int OPJ_BOOL
 
typedef char OPJ_CHAR
 
typedef float OPJ_FLOAT32
 
typedef double OPJ_FLOAT64
 
typedef unsigned char OPJ_BYTE
 
typedef int8_t OPJ_INT8
 
typedef uint8_t OPJ_UINT8
 
typedef int16_t OPJ_INT16
 
typedef uint16_t OPJ_UINT16
 
typedef int32_t OPJ_INT32
 
typedef uint32_t OPJ_UINT32
 
typedef int64_t OPJ_INT64
 
typedef uint64_t OPJ_UINT64
 
typedef int64_t OPJ_OFF_T
 
typedef size_t OPJ_SIZE_T
 
typedef enum RSIZ_CAPABILITIES OPJ_RSIZ_CAPABILITIES
 DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Rsiz Capabilities. More...
 
typedef enum CINEMA_MODE OPJ_CINEMA_MODE
 DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Digital cinema operation mode. More...
 
typedef enum PROG_ORDER OPJ_PROG_ORDER
 Progression order. More...
 
typedef enum COLOR_SPACE OPJ_COLOR_SPACE
 Supported image color spaces. More...
 
typedef enum CODEC_FORMAT OPJ_CODEC_FORMAT
 Supported codec. More...
 
typedef void(* opj_msg_callback) (const char *msg, void *client_data)
 Callback function prototype for events. More...
 
typedef struct opj_poc opj_poc_t
 Progression order changes. More...
 
typedef struct opj_cparameters opj_cparameters_t
 Compression parameters. More...
 
typedef struct opj_dparameters opj_dparameters_t
 Decompression parameters. More...
 
typedef void * opj_codec_t
 JPEG2000 codec V2. More...
 
typedef OPJ_SIZE_T(* opj_stream_read_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
 
typedef OPJ_SIZE_T(* opj_stream_write_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
 
typedef OPJ_OFF_T(* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)
 
typedef OPJ_BOOL(* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)
 
typedef void(* opj_stream_free_user_data_fn) (void *p_user_data)
 
typedef void * opj_stream_t
 
typedef struct opj_image_comp opj_image_comp_t
 Defines a single image component. More...
 
typedef struct opj_image opj_image_t
 Defines image data and characteristics. More...
 
typedef struct opj_image_comptparm opj_image_cmptparm_t
 Component parameters structure used by the opj_image_create function. More...
 
typedef struct opj_packet_info opj_packet_info_t
 Index structure : Information concerning a packet inside tile. More...
 
typedef struct opj_marker_info opj_marker_info_t
 Marker structure. More...
 
typedef struct opj_tp_info opj_tp_info_t
 Index structure : Information concerning tile-parts. More...
 
typedef struct opj_tile_info opj_tile_info_t
 Index structure : information regarding tiles. More...
 
typedef struct opj_codestream_info opj_codestream_info_t
 Index structure of the codestream. More...
 
typedef struct opj_tccp_info opj_tccp_info_t
 Tile-component coding parameters information. More...
 
typedef struct opj_tile_v2_info opj_tile_info_v2_t
 Tile coding parameters information. More...
 
typedef struct opj_codestream_info_v2 opj_codestream_info_v2_t
 Information structure about the codestream (FIXME should be expand and enhance) More...
 
typedef struct opj_tp_index opj_tp_index_t
 Index structure about a tile part. More...
 
typedef struct opj_tile_index opj_tile_index_t
 Index structure about a tile. More...
 
typedef struct opj_codestream_index opj_codestream_index_t
 Index structure of the codestream (FIXME should be expand and enhance) More...
 
typedef struct opj_jp2_metadata opj_jp2_metadata_t
 Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT. More...
 
typedef struct opj_jp2_index opj_jp2_index_t
 Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT. More...
 

Enumerations

enum  RSIZ_CAPABILITIES { OPJ_STD_RSIZ = 0, OPJ_CINEMA2K = 3, OPJ_CINEMA4K = 4, OPJ_MCT = 0x8100 }
 DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Rsiz Capabilities. More...
 
enum  CINEMA_MODE { OPJ_OFF = 0, OPJ_CINEMA2K_24 = 1, OPJ_CINEMA2K_48 = 2, OPJ_CINEMA4K_24 = 3 }
 DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Digital cinema operation mode. More...
 
enum  PROG_ORDER {
  OPJ_PROG_UNKNOWN = -1, OPJ_LRCP = 0, OPJ_RLCP = 1, OPJ_RPCL = 2,
  OPJ_PCRL = 3, OPJ_CPRL = 4
}
 Progression order. More...
 
enum  COLOR_SPACE {
  OPJ_CLRSPC_UNKNOWN = -1, OPJ_CLRSPC_UNSPECIFIED = 0, OPJ_CLRSPC_SRGB = 1, OPJ_CLRSPC_GRAY = 2,
  OPJ_CLRSPC_SYCC = 3, OPJ_CLRSPC_EYCC = 4, OPJ_CLRSPC_CMYK = 5
}
 Supported image color spaces. More...
 
enum  CODEC_FORMAT {
  OPJ_CODEC_UNKNOWN = -1, OPJ_CODEC_J2K = 0, OPJ_CODEC_JPT = 1, OPJ_CODEC_JP2 = 2,
  OPJ_CODEC_JPP = 3, OPJ_CODEC_JPX = 4
}
 Supported codec. More...
 

Functions

OPJ_API const char *OPJ_CALLCONV opj_version (void)
 
OPJ_API opj_image_t *OPJ_CALLCONV opj_image_create (OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc)
 Create an image. More...
 
OPJ_API void OPJ_CALLCONV opj_image_destroy (opj_image_t *image)
 Deallocate any resources associated with an image. More...
 
OPJ_API opj_image_t *OPJ_CALLCONV opj_image_tile_create (OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc)
 Creates an image without allocating memory for the image (used in the new version of the library). More...
 
OPJ_API opj_stream_t *OPJ_CALLCONV opj_stream_default_create (OPJ_BOOL p_is_input)
 Creates an abstract stream. More...
 
OPJ_API opj_stream_t *OPJ_CALLCONV opj_stream_create (OPJ_SIZE_T p_buffer_size, OPJ_BOOL p_is_input)
 Creates an abstract stream. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_destroy (opj_stream_t *p_stream)
 Destroys a stream created by opj_create_stream. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_read_function (opj_stream_t *p_stream, opj_stream_read_fn p_function)
 Sets the given function to be used as a read function. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_write_function (opj_stream_t *p_stream, opj_stream_write_fn p_function)
 Sets the given function to be used as a write function. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function (opj_stream_t *p_stream, opj_stream_skip_fn p_function)
 Sets the given function to be used as a skip function. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function (opj_stream_t *p_stream, opj_stream_seek_fn p_function)
 Sets the given function to be used as a seek function, the stream is then seekable. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t *p_stream, void *p_data, opj_stream_free_user_data_fn p_function)
 Sets the given data to be used as a user data for the stream. More...
 
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length (opj_stream_t *p_stream, OPJ_UINT64 data_length)
 Sets the length of the user data for the stream. More...
 
OPJ_API opj_stream_t *OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream)
 Create a stream from a file identified with its filename with default parameters (helper function) More...
 
OPJ_API opj_stream_t *OPJ_CALLCONV opj_stream_create_file_stream (const char *fname, OPJ_SIZE_T p_buffer_size, OPJ_BOOL p_is_read_stream)
 Create a stream from a file identified with its filename with a specific buffer size. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_info_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the info handler use by openjpeg. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the warning handler use by openjpeg. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the error handler use by openjpeg. More...
 
OPJ_API opj_codec_t *OPJ_CALLCONV opj_create_decompress (OPJ_CODEC_FORMAT format)
 Creates a J2K/JP2 decompression structure. More...
 
OPJ_API void OPJ_CALLCONV opj_destroy_codec (opj_codec_t *p_codec)
 Destroy a decompressor handle. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress (opj_codec_t *p_codec, opj_stream_t *p_stream)
 Read after the codestream if necessary. More...
 
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters (opj_dparameters_t *parameters)
 Set decoding parameters to default values. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder (opj_codec_t *p_codec, opj_dparameters_t *parameters)
 Setup the decoder with decompression parameters provided by the user and with the message handler provided by the user. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header (opj_stream_t *p_stream, opj_codec_t *p_codec, opj_image_t **p_image)
 Decodes an image header. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area (opj_codec_t *p_codec, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y)
 Sets the given area to be decoded. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode (opj_codec_t *p_decompressor, opj_stream_t *p_stream, opj_image_t *p_image)
 Decode an image from a JPEG-2000 codestream. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile (opj_codec_t *p_codec, opj_stream_t *p_stream, opj_image_t *p_image, OPJ_UINT32 tile_index)
 Get the decoded tile from the codec. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor (opj_codec_t *p_codec, OPJ_UINT32 res_factor)
 Set the resolution factor of the decoded image. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile (opj_codec_t *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_t *p_stream)
 Writes a tile with the given data. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header (opj_codec_t *p_codec, opj_stream_t *p_stream, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_should_go_on)
 Reads a tile header. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data (opj_codec_t *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_t *p_stream)
 Reads a tile data. More...
 
OPJ_API opj_codec_t *OPJ_CALLCONV opj_create_compress (OPJ_CODEC_FORMAT format)
 Creates a J2K/JP2 compression structure. More...
 
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters (opj_cparameters_t *parameters)
 Set encoding parameters to default values, that means : More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_encoder (opj_codec_t *p_codec, opj_cparameters_t *parameters, opj_image_t *image)
 Setup the encoder parameters using the current image and using user parameters. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress (opj_codec_t *p_codec, opj_image_t *p_image, opj_stream_t *p_stream)
 Start to compress the current image. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec, opj_stream_t *p_stream)
 End to compress the current image. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode (opj_codec_t *p_codec, opj_stream_t *p_stream)
 Encode an image into a JPEG-2000 codestream. More...
 
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info (opj_codestream_info_v2_t **cstr_info)
 Destroy Codestream information after compression or decompression. More...
 
OPJ_API void OPJ_CALLCONV opj_dump_codec (opj_codec_t *p_codec, OPJ_INT32 info_flag, FILE *output_stream)
 Dump the codec information into the output stream. More...
 
OPJ_API opj_codestream_info_v2_t *OPJ_CALLCONV opj_get_cstr_info (opj_codec_t *p_codec)
 Get the codestream information from the codec. More...
 
OPJ_API opj_codestream_index_t *OPJ_CALLCONV opj_get_cstr_index (opj_codec_t *p_codec)
 Get the codestream index from the codec. More...
 
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index (opj_codestream_index_t **p_cstr_index)
 
OPJ_API opj_jp2_metadata_t *OPJ_CALLCONV opj_get_jp2_metadata (opj_codec_t *p_codec)
 Get the JP2 file information from the codec FIXME. More...
 
OPJ_API opj_jp2_index_t *OPJ_CALLCONV opj_get_jp2_index (opj_codec_t *p_codec)
 Get the JP2 file index from the codec FIXME. More...
 
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT (opj_cparameters_t *parameters, OPJ_FLOAT32 *pEncodingMatrix, OPJ_INT32 *p_dc_shift, OPJ_UINT32 pNbComp)
 Sets the MCT matrix to use. More...
 

Macro Definition Documentation

#define INLINE
#define JPWL_EXPECTED_COMPONENTS   3

Expect this number of components, so you'll find better the first EPB.

Referenced by opj_set_default_decoder_parameters().

#define JPWL_MAX_NO_MARKERS   512

Maximum number of JPWL markers: increase at your will.

#define JPWL_MAX_NO_PACKSPECS   16

Maximum number of packet parts expected by JPWL: increase at your will.

Referenced by opj_j2k_setup_encoder(), and opj_set_default_encoder_parameters().

#define JPWL_MAX_NO_TILESPECS   16

Maximum number of tile parts expected by JPWL: increase at your will.

Referenced by opj_j2k_setup_encoder(), and opj_set_default_encoder_parameters().

#define JPWL_MAXIMUM_EPB_ROOM   65450

Expect this maximum number of bytes for composition of EPBs.

#define JPWL_MAXIMUM_HAMMING   2

Expect this maximum number of bit errors in marker id's.

#define JPWL_MAXIMUM_TILES   8192

Expect this maximum number of tiles, to avoid some crashes.

Referenced by opj_set_default_decoder_parameters().

#define JPWL_PRIVATEINDEX_NAME   "jpwl_index_privatefilename"

index file name used when JPWL is on

#define OPJ_API
#define OPJ_ARG_NOT_USED (   x)    (void)(x)
#define OPJ_CALLCONV
#define OPJ_CINEMA_24_COMP   1041666 /** Maximum size per color component for 2K & 4K @ 24fps */
#define OPJ_CINEMA_24_CS   1302083 /** Maximum codestream length for 24fps */

JPEG 2000 codestream and component size limits in cinema profiles.

Referenced by opj_j2k_set_cinema_parameters(), and opj_j2k_setup_encoder().

#define OPJ_CINEMA_48_COMP   520833 /** Maximum size per color component for 2K @ 48fps */

Referenced by opj_j2k_setup_encoder().

#define OPJ_CINEMA_48_CS   651041 /** Maximum codestream length for 48fps */

Referenced by opj_j2k_setup_encoder().

#define OPJ_DEPRECATED (   func)    func
#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG   0x0001

Referenced by opj_jp2_setup_decoder().

#define OPJ_EXTENSION_MCT   0x0100 /** Custom MCT support */
#define OPJ_EXTENSION_NONE   0x0000 /** No Part-2 extension */

JPEG 2000 Part-2 extensions.

Referenced by opj_j2k_setup_encoder().

#define OPJ_FALSE   0

Referenced by associate_channel(), check_JP2boxidx(), close_channel(), delete_session(), enqueue_metabins(), fread_jpip(), fwrite_jp2k(), gene_cachemodel(), gene_JPIPstream(), gene_metamsg(), get_initquery(), get_mainheader_from_j2kstream(), handle_clientreq(), identify_cid(), identify_target(), is_allsent(), isJPPstream(), isJPTfeasible(), modify_COCmkrstream(), modify_mainheader(), modify_SIZmkrstream(), modify_tileheader(), open_channel(), opj_alloc_tile_component_data(), opj_bio_bytein(), opj_bio_byteout(), opj_bio_flush(), opj_bio_inalign(), opj_check_EPHuse(), opj_create_compress(), opj_decode(), opj_decode_tile_data(), opj_dwt_decode_real(), opj_dwt_decode_tile(), opj_dwt_encode_procedure(), opj_encode(), opj_end_compress(), opj_end_decompress(), opj_event_msg(), opj_get_decoded_tile(), opj_j2k_add_mct(), opj_j2k_add_mhmarker(), opj_j2k_add_tlmarker(), opj_j2k_allocate_tile_element_cstr_index(), opj_j2k_check_poc_val(), opj_j2k_compare_coc(), opj_j2k_compare_SPCod_SPCoc(), opj_j2k_compare_SQcd_SQcc(), opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_tcd(), opj_j2k_decode(), opj_j2k_decode_one_tile(), opj_j2k_decode_tile(), opj_j2k_decode_tiles(), opj_j2k_encode(), opj_j2k_encoding_validation(), opj_j2k_end_compress(), opj_j2k_get_sot_values(), opj_j2k_get_tile(), opj_j2k_is_cinema_compliant(), opj_j2k_merge_ppm(), opj_j2k_merge_ppt(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_post_write_tile(), opj_j2k_pre_write_tile(), opj_j2k_read_cbd(), opj_j2k_read_coc(), opj_j2k_read_cod(), opj_j2k_read_crg(), opj_j2k_read_header(), opj_j2k_read_header_procedure(), opj_j2k_read_mcc(), opj_j2k_read_mco(), opj_j2k_read_mct(), opj_j2k_read_plm(), opj_j2k_read_plt(), opj_j2k_read_poc(), opj_j2k_read_ppm(), opj_j2k_read_ppt(), opj_j2k_read_qcc(), opj_j2k_read_qcd(), opj_j2k_read_rgn(), opj_j2k_read_siz(), opj_j2k_read_soc(), opj_j2k_read_sod(), opj_j2k_read_sot(), opj_j2k_read_SPCod_SPCoc(), opj_j2k_read_SQcd_SQcc(), opj_j2k_read_tile_header(), opj_j2k_read_tlm(), opj_j2k_read_unk(), opj_j2k_set_cinema_parameters(), opj_j2k_set_decode_area(), opj_j2k_set_decoded_resolution_factor(), opj_j2k_setup_decoding(), opj_j2k_setup_decoding_tile(), opj_j2k_setup_decoding_validation(), opj_j2k_setup_encoder(), opj_j2k_setup_encoding_validation(), opj_j2k_setup_end_compress(), opj_j2k_setup_header_reading(), opj_j2k_setup_header_writing(), opj_j2k_setup_mct_encoding(), opj_j2k_start_compress(), opj_j2k_update_image_data(), opj_j2k_update_rates(), opj_j2k_write_all_coc(), opj_j2k_write_all_qcc(), opj_j2k_write_all_tile_parts(), opj_j2k_write_cbd(), opj_j2k_write_coc(), opj_j2k_write_cod(), opj_j2k_write_com(), opj_j2k_write_eoc(), opj_j2k_write_first_tile_part(), opj_j2k_write_mcc_record(), opj_j2k_write_mco(), opj_j2k_write_mct_data_group(), opj_j2k_write_mct_record(), opj_j2k_write_poc(), opj_j2k_write_qcc(), opj_j2k_write_qcd(), opj_j2k_write_regions(), opj_j2k_write_rgn(), opj_j2k_write_siz(), opj_j2k_write_soc(), opj_j2k_write_sod(), opj_j2k_write_SPCod_SPCoc(), opj_j2k_write_SQcd_SQcc(), opj_j2k_write_tile(), opj_j2k_write_tlm(), opj_j2k_write_updated_tlm(), opj_jp2_check_color(), opj_jp2_decode(), opj_jp2_end_compress(), opj_jp2_end_decompress(), opj_jp2_get_tile(), opj_jp2_read_boxhdr(), opj_jp2_read_boxhdr_char(), opj_jp2_read_bpcc(), opj_jp2_read_cdef(), opj_jp2_read_cmap(), opj_jp2_read_colr(), opj_jp2_read_ftyp(), opj_jp2_read_header(), opj_jp2_read_header_procedure(), opj_jp2_read_ihdr(), opj_jp2_read_jp(), opj_jp2_read_jp2h(), opj_jp2_read_pclr(), opj_jp2_setup_encoder(), opj_jp2_setup_encoding_validation(), opj_jp2_setup_end_header_reading(), opj_jp2_setup_end_header_writing(), opj_jp2_setup_header_reading(), opj_jp2_setup_header_writing(), opj_jp2_skip_jp2c(), opj_jp2_start_compress(), opj_jp2_write_ftyp(), opj_jp2_write_jp(), opj_jp2_write_jp2c(), opj_jp2_write_jp2h(), opj_jpip_skip_iptr(), opj_lupDecompose(), opj_matrix_inversion_f(), opj_mct_decode_custom(), opj_mct_encode_custom(), opj_mqc_init_dec(), opj_pi_check_next_level(), opj_pi_next(), opj_pi_next_cprl(), opj_pi_next_lrcp(), opj_pi_next_pcrl(), opj_pi_next_rlcp(), opj_pi_next_rpcl(), opj_procedure_list_add_procedure(), opj_read_header(), opj_read_tile_header(), opj_seek_from_file(), opj_set_decode_area(), opj_set_decoded_resolution_factor(), opj_set_default_decoder_parameters(), opj_set_default_encoder_parameters(), opj_set_error_handler(), opj_set_info_handler(), opj_set_MCT(), opj_set_warning_handler(), opj_setup_decoder(), opj_setup_encoder(), opj_start_compress(), opj_stream_default_seek(), opj_stream_flush(), opj_stream_read_seek(), opj_stream_write_seek(), opj_t1_allocate_buffers(), opj_t1_decode_cblk(), opj_t1_decode_cblks(), opj_t1_encode_cblks(), opj_t2_decode_packet(), opj_t2_decode_packets(), opj_t2_encode_packet(), opj_t2_encode_packets(), opj_t2_init_seg(), opj_t2_read_packet_data(), opj_t2_read_packet_header(), opj_t2_skip_packet(), opj_t2_skip_packet_data(), opj_tcd_code_block_dec_allocate(), opj_tcd_code_block_enc_allocate(), opj_tcd_code_block_enc_allocate_data(), opj_tcd_copy_tile_data(), opj_tcd_decode_tile(), opj_tcd_dwt_decode(), opj_tcd_dwt_encode(), opj_tcd_encode_tile(), opj_tcd_init(), opj_tcd_init_decode_tile(), opj_tcd_init_tile(), opj_tcd_mct_decode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_rateallocate(), opj_tcd_t1_decode(), opj_tcd_t1_encode(), opj_tcd_t2_decode(), opj_tcd_t2_encode(), opj_tcd_update_tile_data(), opj_write_tile(), parse_JPIPstream(), recons_codestream_from_JPPstream(), recons_codestream_from_JPTstream(), recons_packet(), recons_precinct(), recv_ack(), search_session_and_channel(), set_cidxdata(), set_CODmkrdata(), set_cptrdata(), set_mainmhixdata(), set_ppixdata(), set_SIZmkrdata(), set_thixdata(), and set_tpixdata().

#define OPJ_IMG_INFO   1

EXPERIMENTAL FOR THE MOMENT Supported options about file information used only in j2k_dump.

Basic image information provided to the user

Referenced by j2k_dump().

#define OPJ_IS_BROADCAST (   v)    (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))

Referenced by opj_j2k_setup_encoder().

#define OPJ_IS_CINEMA (   v)    (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
#define OPJ_IS_IMF (   v)    (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))

Referenced by opj_j2k_setup_encoder().

#define OPJ_IS_PART2 (   v)    ((v) & OPJ_PROFILE_PART2)
#define OPJ_IS_STORAGE (   v)    ((v) == OPJ_PROFILE_CINEMA_LTS)

Referenced by opj_j2k_setup_encoder().

#define OPJ_J2K_DEFAULT_HEADER_SIZE   1000
#define OPJ_J2K_DEFAULT_NB_SEGS   10
#define OPJ_J2K_MAXBANDS   (3*OPJ_J2K_MAXRLVLS-2)

Number of maximum sub-band linked to number of resolution level.

Referenced by j2k_get_cstr_info(), opj_j2k_copy_tile_quantization_parameters(), and opj_j2k_read_SQcd_SQcc().

#define OPJ_J2K_MAXRLVLS   33
#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS   10
#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS   10
#define OPJ_J2K_MH_IND   16

Codestream index based only on the main header.

Referenced by j2k_dump().

#define OPJ_J2K_MH_INFO   2

Codestream information based only on the main header.

Referenced by j2k_dump().

#define OPJ_J2K_STREAM_CHUNK_SIZE   0x100000 /** 1 mega by default */
#define OPJ_J2K_TCH_INFO   8

Tile/Component information of all tiles.

Referenced by j2k_dump().

#define OPJ_J2K_TH_IND   32

Tile index based on the current tile.

Referenced by j2k_dump().

#define OPJ_J2K_TH_INFO   4

Tile information based on the current tile header.

Referenced by j2k_dump().

#define OPJ_JP2_IND   256

JP2 file index.

Referenced by j2k_dump().

#define OPJ_JP2_INFO   128

<

JP2 file information

Referenced by j2k_dump().

#define OPJ_LOCAL
#define OPJ_PATH_LEN   4096

Maximum allowed size for filenames.

#define OPJ_PROFILE_0   0x0001 /** Profile 0 as described in 15444-1,Table A.45 */
#define OPJ_PROFILE_1   0x0002 /** Profile 1 as described in 15444-1,Table A.45 */
#define OPJ_PROFILE_BC_MULTI   0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_BC_MULTI_R   0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_BC_SINGLE   0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_CINEMA_2K   0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */
#define OPJ_PROFILE_CINEMA_4K   0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */
#define OPJ_PROFILE_CINEMA_LTS   0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */
#define OPJ_PROFILE_CINEMA_S2K   0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */

Referenced by opj_j2k_setup_encoder().

#define OPJ_PROFILE_CINEMA_S4K   0x0006 /** Scalable 4K cinema profile defined in 15444-1 AMD2 */

Referenced by opj_j2k_setup_encoder().

#define OPJ_PROFILE_IMF_2K   0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_2K_R   0x0403 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_4K   0x0401 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_4K_R   0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_8K   0x0402 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_8K_R   0x0801 /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_NONE   0x0000 /** no profile, conform to 15444-1 */

JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMD) These values help chosing the RSIZ value for the J2K codestream.

The RSIZ value triggers various encoding options, as detailed in Table A.10. If OPJ_PROFILE_PART2 is chosen, it has to be combined with one or more extensions described hereunder. Example: rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT; For broadcast profiles, the OPJ_PROFILE value has to be combined with the targeted mainlevel (3-0 LSB, value between 0 and 11): Example: rsiz = OPJ_PROFILE_BC_MULTI | 0x0005; (here mainlevel 5) For IMF profiles, the OPJ_PROFILE value has to be combined with the targeted mainlevel (3-0 LSB, value between 0 and 11) and sublevel (7-4 LSB, value between 0 and 9): Example: rsiz = OPJ_PROFILE_IMF_2K | 0x0040 | 0x0005; (here main 5 and sublevel 4)

Referenced by opj_j2k_setup_encoder(), and opj_set_default_encoder_parameters().

#define OPJ_PROFILE_PART2   0x8000 /** At least 1 extension defined in 15444-2 (Part-2) */
#define OPJ_STREAM_READ   OPJ_TRUE

Stream open flags.

The stream was opened for reading.

#define OPJ_STREAM_WRITE   OPJ_FALSE

The stream was opened for writing.

#define OPJ_TRUE   1

Referenced by associate_channel(), check_JP2boxidx(), close_channel(), delete_session(), enqueue_mainheader(), enqueue_metabins(), enqueue_metadata(), enqueue_precinct(), enqueue_tile(), enqueue_tileheader(), fread_jpip(), fwrite_jp2k(), gene_cachemodel(), gene_JPIPstream(), gene_target(), get_mainheader_from_j2kstream(), handle_clientreq(), handle_dstCIDreqMSG(), handle_JPIPstreamMSG(), identify_cid(), identify_target(), init_dec_server(), init_jpipdecoder(), is_allsent(), isJPPstream(), isJPTfeasible(), j2k_to_pnm(), modify_COCmkrstream(), modify_mainheader(), modify_SIZmkrstream(), modify_tileheader(), open_channel(), opj_alloc_tile_component_data(), opj_bio_bytein(), opj_bio_byteout(), opj_bio_flush(), opj_bio_inalign(), opj_check_EPHuse(), opj_create_decompress(), opj_dwt_decode_real(), opj_dwt_decode_tile(), opj_dwt_encode_procedure(), opj_event_msg(), opj_j2k_add_mct(), opj_j2k_add_mhmarker(), opj_j2k_add_tlmarker(), opj_j2k_allocate_tile_element_cstr_index(), opj_j2k_build_decoder(), opj_j2k_build_encoder(), opj_j2k_calculate_tp(), opj_j2k_check_poc_val(), opj_j2k_compare_SPCod_SPCoc(), opj_j2k_compare_SQcd_SQcc(), opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_tcd(), opj_j2k_decode(), opj_j2k_decode_one_tile(), opj_j2k_decode_tile(), opj_j2k_decode_tiles(), opj_j2k_decoding_validation(), opj_j2k_destroy_header_memory(), opj_j2k_encode(), opj_j2k_encoding_validation(), opj_j2k_end_compress(), opj_j2k_end_decompress(), opj_j2k_end_encoding(), opj_j2k_exec(), opj_j2k_get_end_header(), opj_j2k_get_sot_values(), opj_j2k_get_tile(), opj_j2k_is_cinema_compliant(), opj_j2k_mct_validation(), opj_j2k_merge_ppm(), opj_j2k_merge_ppt(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_post_write_tile(), opj_j2k_pre_write_tile(), opj_j2k_read_cbd(), opj_j2k_read_coc(), opj_j2k_read_cod(), opj_j2k_read_com(), opj_j2k_read_crg(), opj_j2k_read_header(), opj_j2k_read_header_procedure(), opj_j2k_read_mcc(), opj_j2k_read_mco(), opj_j2k_read_mct(), opj_j2k_read_plm(), opj_j2k_read_plt(), opj_j2k_read_poc(), opj_j2k_read_ppm(), opj_j2k_read_ppt(), opj_j2k_read_qcc(), opj_j2k_read_qcd(), opj_j2k_read_rgn(), opj_j2k_read_siz(), opj_j2k_read_soc(), opj_j2k_read_sod(), opj_j2k_read_sot(), opj_j2k_read_SPCod_SPCoc(), opj_j2k_read_SQcd_SQcc(), opj_j2k_read_tile_header(), opj_j2k_read_tlm(), opj_j2k_read_unk(), opj_j2k_set_decode_area(), opj_j2k_set_decoded_resolution_factor(), opj_j2k_setup_decoding(), opj_j2k_setup_decoding_tile(), opj_j2k_setup_decoding_validation(), opj_j2k_setup_encoder(), opj_j2k_setup_encoding_validation(), opj_j2k_setup_end_compress(), opj_j2k_setup_header_reading(), opj_j2k_setup_header_writing(), opj_j2k_setup_mct_encoding(), opj_j2k_start_compress(), opj_j2k_update_image_data(), opj_j2k_update_rates(), opj_j2k_write_all_coc(), opj_j2k_write_all_qcc(), opj_j2k_write_all_tile_parts(), opj_j2k_write_cbd(), opj_j2k_write_coc(), opj_j2k_write_cod(), opj_j2k_write_com(), opj_j2k_write_eoc(), opj_j2k_write_epc(), opj_j2k_write_first_tile_part(), opj_j2k_write_mcc_record(), opj_j2k_write_mco(), opj_j2k_write_mct_data_group(), opj_j2k_write_mct_record(), opj_j2k_write_poc(), opj_j2k_write_qcc(), opj_j2k_write_qcd(), opj_j2k_write_regions(), opj_j2k_write_rgn(), opj_j2k_write_siz(), opj_j2k_write_soc(), opj_j2k_write_sod(), opj_j2k_write_sot(), opj_j2k_write_SPCod_SPCoc(), opj_j2k_write_SQcd_SQcc(), opj_j2k_write_tile(), opj_j2k_write_tlm(), opj_j2k_write_updated_tlm(), opj_jp2_check_color(), opj_jp2_decode(), opj_jp2_default_validation(), opj_jp2_exec(), opj_jp2_get_tile(), opj_jp2_read_boxhdr(), opj_jp2_read_boxhdr_char(), opj_jp2_read_bpcc(), opj_jp2_read_cdef(), opj_jp2_read_cmap(), opj_jp2_read_colr(), opj_jp2_read_ftyp(), opj_jp2_read_header_procedure(), opj_jp2_read_ihdr(), opj_jp2_read_jp(), opj_jp2_read_jp2h(), opj_jp2_read_pclr(), opj_jp2_setup_decoding_validation(), opj_jp2_setup_encoder(), opj_jp2_setup_encoding_validation(), opj_jp2_setup_end_header_reading(), opj_jp2_setup_end_header_writing(), opj_jp2_setup_header_reading(), opj_jp2_setup_header_writing(), opj_jp2_skip_jp2c(), opj_jp2_write_jp(), opj_jp2_write_jp2c(), opj_jp2_write_jp2h(), opj_jpip_skip_iptr(), opj_lupDecompose(), opj_matrix_inversion_f(), opj_mct_decode_custom(), opj_mct_encode_custom(), opj_mqc_init_dec(), opj_pi_check_next_level(), opj_pi_next_cprl(), opj_pi_next_lrcp(), opj_pi_next_pcrl(), opj_pi_next_rlcp(), opj_pi_next_rpcl(), opj_procedure_list_add_procedure(), opj_seek_from_file(), opj_set_error_handler(), opj_set_info_handler(), opj_set_MCT(), opj_set_warning_handler(), opj_setup_decoder(), opj_stream_flush(), opj_stream_read_seek(), opj_stream_write_seek(), opj_t1_allocate_buffers(), opj_t1_decode_cblk(), opj_t1_decode_cblks(), opj_t1_encode_cblks(), opj_t2_decode_packet(), opj_t2_decode_packets(), opj_t2_encode_packet(), opj_t2_encode_packets(), opj_t2_init_seg(), opj_t2_read_packet_data(), opj_t2_read_packet_header(), opj_t2_skip_packet(), opj_t2_skip_packet_data(), opj_tcd_code_block_dec_allocate(), opj_tcd_code_block_enc_allocate(), opj_tcd_code_block_enc_allocate_data(), opj_tcd_copy_tile_data(), opj_tcd_dc_level_shift_decode(), opj_tcd_dc_level_shift_encode(), opj_tcd_decode_tile(), opj_tcd_dwt_decode(), opj_tcd_dwt_encode(), opj_tcd_encode_tile(), opj_tcd_init(), opj_tcd_init_encode_tile(), opj_tcd_init_tile(), opj_tcd_mct_decode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_rateallocate(), opj_tcd_t1_decode(), opj_tcd_t1_encode(), opj_tcd_t2_decode(), opj_tcd_t2_encode(), opj_tcd_update_tile_data(), parse_comps(), parse_JPIPstream(), parse_metareq(), parse_req_box_prop(), recons_codestream_from_JPPstream(), recons_codestream_from_JPTstream(), recons_packet(), recons_precinct(), recv_ack(), search_session_and_channel(), set_cidxdata(), set_CODmkrdata(), set_cptrdata(), set_mainmhixdata(), set_ppixdata(), set_SIZmkrdata(), set_thixdata(), and set_tpixdata().

Typedef Documentation

typedef int OPJ_BOOL
typedef unsigned char OPJ_BYTE
typedef char OPJ_CHAR

DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Digital cinema operation mode.

Supported codec.

typedef void* opj_codec_t

JPEG2000 codec V2.

Index structure of the codestream (FIXME should be expand and enhance)

Index structure of the codestream.

Information structure about the codestream (FIXME should be expand and enhance)

Supported image color spaces.

Compression parameters.

Decompression parameters.

typedef float OPJ_FLOAT32
typedef double OPJ_FLOAT64

Component parameters structure used by the opj_image_create function.

Defines a single image component.

typedef struct opj_image opj_image_t

Defines image data and characteristics.

typedef int16_t OPJ_INT16
typedef int32_t OPJ_INT32
typedef int64_t OPJ_INT64
typedef int8_t OPJ_INT8

Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

Marker structure.

typedef void(* opj_msg_callback) (const char *msg, void *client_data)

Callback function prototype for events.

Parameters
msgEvent message
client_dataClient object where will be return the event message
typedef int64_t OPJ_OFF_T

Index structure : Information concerning a packet inside tile.

typedef struct opj_poc opj_poc_t

Progression order changes.

typedef enum PROG_ORDER OPJ_PROG_ORDER

Progression order.

DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Rsiz Capabilities.

typedef size_t OPJ_SIZE_T
typedef void(* opj_stream_free_user_data_fn) (void *p_user_data)
typedef OPJ_SIZE_T(* opj_stream_read_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
typedef OPJ_BOOL(* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)
typedef OPJ_OFF_T(* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)
typedef void* opj_stream_t
typedef OPJ_SIZE_T(* opj_stream_write_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)

Tile-component coding parameters information.

Index structure about a tile.

Index structure : information regarding tiles.

Tile coding parameters information.

typedef struct opj_tp_index opj_tp_index_t

Index structure about a tile part.

typedef struct opj_tp_info opj_tp_info_t

Index structure : Information concerning tile-parts.

typedef uint16_t OPJ_UINT16
typedef uint32_t OPJ_UINT32
typedef uint64_t OPJ_UINT64
typedef uint8_t OPJ_UINT8

Enumeration Type Documentation

DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Digital cinema operation mode.

Enumerator
OPJ_OFF 
OPJ_CINEMA2K_24 

Not Digital Cinema.

OPJ_CINEMA2K_48 

2K Digital Cinema at 24 fps

OPJ_CINEMA4K_24 

2K Digital Cinema at 48 fps

Supported codec.

Enumerator
OPJ_CODEC_UNKNOWN 

place-holder

OPJ_CODEC_J2K 

JPEG-2000 codestream : read/write.

OPJ_CODEC_JPT 

JPT-stream (JPEG 2000, JPIP) : read only.

OPJ_CODEC_JP2 

JP2 file format : read/write.

OPJ_CODEC_JPP 

JPP-stream (JPEG 2000, JPIP) : to be coded.

OPJ_CODEC_JPX 

JPX file format (JPEG 2000 Part-2) : to be coded.

Supported image color spaces.

Enumerator
OPJ_CLRSPC_UNKNOWN 

not supported by the library

OPJ_CLRSPC_UNSPECIFIED 

not specified in the codestream

OPJ_CLRSPC_SRGB 

sRGB

OPJ_CLRSPC_GRAY 

grayscale

OPJ_CLRSPC_SYCC 

YUV.

OPJ_CLRSPC_EYCC 

e-YCC

OPJ_CLRSPC_CMYK 

CMYK.

enum PROG_ORDER

Progression order.

Enumerator
OPJ_PROG_UNKNOWN 

place-holder

OPJ_LRCP 

layer-resolution-component-precinct order

OPJ_RLCP 

resolution-layer-component-precinct order

OPJ_RPCL 

resolution-precinct-component-layer order

OPJ_PCRL 

precinct-component-resolution-layer order

OPJ_CPRL 

component-precinct-resolution-layer order

DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Rsiz Capabilities.

Enumerator
OPJ_STD_RSIZ 
OPJ_CINEMA2K 

Standard JPEG2000 profile.

OPJ_CINEMA4K 

Profile name for a 2K image.

OPJ_MCT 

Profile name for a 4K image.

Function Documentation

OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress ( OPJ_CODEC_FORMAT  format)
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress ( OPJ_CODEC_FORMAT  format)
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode ( opj_codec_t p_decompressor,
opj_stream_t p_stream,
opj_image_t p_image 
)

Decode an image from a JPEG-2000 codestream.

Parameters
p_decompressordecompressor handle
p_streamInput buffer stream
p_imagethe decoded image
Returns
true if success, otherwise false

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data ( opj_codec_t p_codec,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_t p_stream 
)

Reads a tile data.

This function is compulsory and allows one to decode tile data. opj_read_tile_header should be called before. The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.

Parameters
p_codecthe jpeg2000 codec.
p_tile_indexthe index of the tile being decoded, this should be the value set by opj_read_tile_header.
p_datapointer to a memory block that will hold the decoded data.
p_data_sizesize of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.
p_streamthe stream to decode.
Returns
true if the data could be decoded.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API void OPJ_CALLCONV opj_destroy_codec ( opj_codec_t p_codec)

Destroy a decompressor handle.

Parameters
p_codecdecompressor handle to destroy

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_decompression, and opj_free().

Referenced by j2k_to_pnm().

OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index ( opj_codestream_index_t **  p_cstr_index)
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info ( opj_codestream_info_v2_t **  cstr_info)

Destroy Codestream information after compression or decompression.

Parameters
cstr_infoCodestream information structure

References opj_free().

Referenced by j2k_get_cstr_info().

OPJ_API void OPJ_CALLCONV opj_dump_codec ( opj_codec_t p_codec,
OPJ_INT32  info_flag,
FILE *  output_stream 
)

Dump the codec information into the output stream.

Parameters
p_codecthe jpeg2000 codec.
info_flagtype of information dump.
output_streamoutput stream where dump the informations get from the codec.

References opj_codec_private::m_codec, and opj_codec_private::opj_dump_codec.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Encode an image into a JPEG-2000 codestream.

Parameters
p_codeccompressor handle
p_streamOutput buffer stream
Returns
Returns true if successful, returns false otherwise

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

End to compress the current image.

Parameters
p_codecCompressor handle
p_streamInput stgream

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Read after the codestream if necessary.

Parameters
p_codecthe JPEG2000 codec to read.
p_streamthe JPEG2000 stream.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_API opj_codestream_index_t* OPJ_CALLCONV opj_get_cstr_index ( opj_codec_t p_codec)

Get the codestream index from the codec.

Parameters
p_codecthe jpeg2000 codec.
Returns
a pointer to a codestream index structure.

References opj_codec_private::m_codec, and opj_codec_private::opj_get_codec_index.

OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info ( opj_codec_t p_codec)

Get the codestream information from the codec.

Parameters
p_codecthe jpeg2000 codec.
Returns
a pointer to a codestream information structure.

References opj_codec_private::m_codec, and opj_codec_private::opj_get_codec_info.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile ( opj_codec_t p_codec,
opj_stream_t p_stream,
opj_image_t p_image,
OPJ_UINT32  tile_index 
)

Get the decoded tile from the codec.

Parameters
p_codecthe jpeg2000 codec.
p_streaminput streamm
p_imageoutput image
tile_indexindex of the tile which will be decode
Returns
true if success, otherwise false

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index ( opj_codec_t p_codec)

Get the JP2 file index from the codec FIXME.

Parameters
p_codecthe jpeg2000 codec.
Returns
a pointer to a JP2 index structure.
OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata ( opj_codec_t p_codec)

Get the JP2 file information from the codec FIXME.

Parameters
p_codecthe jpeg2000 codec.
Returns
a pointer to a JP2 metadata structure.
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create ( OPJ_UINT32  numcmpts,
opj_image_cmptparm_t cmptparms,
OPJ_COLOR_SPACE  clrspc 
)
OPJ_API void OPJ_CALLCONV opj_image_destroy ( opj_image_t image)

Deallocate any resources associated with an image.

Parameters
imageimage to be destroyed

References opj_image::comps, opj_image_comp::data, opj_image::icc_profile_buf, opj_image::numcomps, and opj_free().

Referenced by j2k_to_pnm(), opj_image_create(), opj_image_tile_create(), opj_j2k_decode(), opj_j2k_destroy(), opj_j2k_get_tile(), and opj_j2k_read_header().

OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create ( OPJ_UINT32  numcmpts,
opj_image_cmptparm_t cmptparms,
OPJ_COLOR_SPACE  clrspc 
)

Creates an image without allocating memory for the image (used in the new version of the library).

Parameters
numcmptsthe number of components
cmptparmsthe components parameters
clrspcthe image color space
Returns
a new image structure if successful, NULL otherwise.

References opj_image::color_space, opj_image::comps, opj_image_comp::data, opj_image_comp::dx, opj_image_comptparm::dx, opj_image_comp::dy, opj_image_comptparm::dy, opj_image_comp::h, opj_image_comptparm::h, opj_image::numcomps, opj_calloc(), opj_image_destroy(), opj_image_comp::prec, opj_image_comptparm::prec, opj_image_comp::sgnd, opj_image_comptparm::sgnd, opj_image_comp::w, opj_image_comptparm::w, opj_image_comp::x0, opj_image_comptparm::x0, opj_image_comp::y0, and opj_image_comptparm::y0.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header ( opj_stream_t p_stream,
opj_codec_t p_codec,
opj_image_t **  p_image 
)

Decodes an image header.

Parameters
p_streamthe jpeg2000 stream.
p_codecthe jpeg2000 codec to read.
p_imagethe image structure initialized with the characteristics of encoded image.
Returns
true if the main header of the codestream and the JP2 header is correctly read.

References EVT_ERROR, opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, opj_event_msg(), and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header ( opj_codec_t p_codec,
opj_stream_t p_stream,
OPJ_UINT32 p_tile_index,
OPJ_UINT32 p_data_size,
OPJ_INT32 p_tile_x0,
OPJ_INT32 p_tile_y0,
OPJ_INT32 p_tile_x1,
OPJ_INT32 p_tile_y1,
OPJ_UINT32 p_nb_comps,
OPJ_BOOL p_should_go_on 
)

Reads a tile header.

This function is compulsory and allows one to know the size of the tile that will be decoded. The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.

Parameters
p_codecthe jpeg2000 codec.
p_tile_indexpointer to a value that will hold the index of the tile being decoded, in case of success.
p_data_sizepointer to a value that will hold the maximum size of the decoded data, in case of success. In case of truncated codestreams, the actual number of bytes decoded may be lower. The computation of the size is the same as depicted in opj_write_tile.
p_tile_x0pointer to a value that will hold the x0 pos of the tile (in the image).
p_tile_y0pointer to a value that will hold the y0 pos of the tile (in the image).
p_tile_x1pointer to a value that will hold the x1 pos of the tile (in the image).
p_tile_y1pointer to a value that will hold the y1 pos of the tile (in the image).
p_nb_compspointer to a value that will hold the number of components in the tile.
p_should_go_onpointer to a boolean that will hold the fact that the decoding should go on. In case the codestream is over at the time of the call, the value will be set to false. The user should then stop the decoding.
p_streamthe stream to decode.
Returns
true if the tile header could be decoded. In case the decoding should end, the returned value is still true. returning false may be the result of a shortage of memory or an internal error.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area ( opj_codec_t p_codec,
opj_image_t p_image,
OPJ_INT32  p_start_x,
OPJ_INT32  p_start_y,
OPJ_INT32  p_end_x,
OPJ_INT32  p_end_y 
)

Sets the given area to be decoded.

This function should be called right after opj_read_header and before any tile header reading.

Parameters
p_codecthe jpeg2000 codec.
p_imagethe decoded image previously setted by opj_read_header
p_start_xthe left position of the rectangle to decode (in image coordinates).
p_end_xthe right position of the rectangle to decode (in image coordinates).
p_start_ythe up position of the rectangle to decode (in image coordinates).
p_end_ythe bottom position of the rectangle to decode (in image coordinates).
Returns
true if the area could be set.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor ( opj_codec_t p_codec,
OPJ_UINT32  res_factor 
)

Set the resolution factor of the decoded image.

Parameters
p_codecthe jpeg2000 codec.
res_factorresolution factor to set
Returns
true if success, otherwise false

References opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters ( opj_dparameters_t parameters)
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters ( opj_cparameters_t parameters)

Set encoding parameters to default values, that means :

  • Lossless
  • 1 tile
  • Size of precinct : 2^15 x 2^15 (means 1 precinct)
  • Size of code-block : 64 x 64
  • Number of resolutions: 6
  • No SOP marker in the codestream
  • No EPH marker in the codestream
  • No sub-sampling in x or y direction
  • No mode switch activated
  • Progression order: LRCP
  • No index file
  • No ROI upshifted
  • No offset of the origin of the image
  • No offset of the origin of the tiles
  • Reversible DWT 5-3
Parameters
parametersCompression parameters

References opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cparameters::cod_format, opj_cparameters::cp_cinema, opj_cparameters::cp_disto_alloc, opj_cparameters::cp_fixed_alloc, opj_cparameters::cp_fixed_quality, opj_cparameters::cp_rsiz, opj_cparameters::decod_format, opj_cparameters::jpip_on, opj_cparameters::jpwl_epc_on, opj_cparameters::jpwl_hprot_MH, opj_cparameters::jpwl_hprot_TPH, opj_cparameters::jpwl_hprot_TPH_tileno, JPWL_MAX_NO_PACKSPECS, JPWL_MAX_NO_TILESPECS, opj_cparameters::jpwl_pprot, opj_cparameters::jpwl_pprot_packno, opj_cparameters::jpwl_pprot_tileno, opj_cparameters::jpwl_sens_addr, opj_cparameters::jpwl_sens_MH, opj_cparameters::jpwl_sens_range, opj_cparameters::jpwl_sens_size, opj_cparameters::jpwl_sens_TPH, opj_cparameters::jpwl_sens_TPH_tileno, opj_cparameters::max_comp_size, opj_cparameters::numresolution, OPJ_FALSE, OPJ_LRCP, OPJ_OFF, OPJ_PROFILE_NONE, OPJ_STD_RSIZ, opj_cparameters::prog_order, opj_cparameters::roi_compno, opj_cparameters::rsiz, opj_cparameters::subsampling_dx, opj_cparameters::subsampling_dy, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, and opj_cparameters::tp_on.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the error handler use by openjpeg.

Parameters
p_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

References opj_event_mgr::error_handler, opj_event_mgr::m_error_data, opj_codec_private::m_event_mgr, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_info_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the info handler use by openjpeg.

Parameters
p_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

References opj_event_mgr::info_handler, opj_codec_private::m_event_mgr, opj_event_mgr::m_info_data, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT ( opj_cparameters_t parameters,
OPJ_FLOAT32 pEncodingMatrix,
OPJ_INT32 p_dc_shift,
OPJ_UINT32  pNbComp 
)

Sets the MCT matrix to use.

Parameters
parametersthe parameters to change.
pEncodingMatrixthe encoding matrix.
p_dc_shiftthe dc shift coefficients to use.
pNbCompthe number of components of the image.
Returns
true if the parameters could be set.

References opj_cparameters::irreversible, opj_cparameters::mct_data, OPJ_EXTENSION_MCT, OPJ_FALSE, OPJ_IS_PART2, opj_malloc(), OPJ_PROFILE_PART2, OPJ_TRUE, opj_cparameters::rsiz, and opj_cparameters::tcp_mct.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the warning handler use by openjpeg.

Parameters
p_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

References opj_codec_private::m_event_mgr, opj_event_mgr::m_warning_data, OPJ_FALSE, OPJ_TRUE, and opj_event_mgr::warning_handler.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder ( opj_codec_t p_codec,
opj_dparameters_t parameters 
)

Setup the decoder with decompression parameters provided by the user and with the message handler provided by the user.

Parameters
p_codecdecompressor handler
parametersdecompression parameters
Returns
true if the decoder is correctly set

References EVT_ERROR, opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, opj_event_msg(), OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_encoder ( opj_codec_t p_codec,
opj_cparameters_t parameters,
opj_image_t image 
)

Setup the encoder parameters using the current image and using user parameters.

Parameters
p_codecCompressor handle
parametersCompression parameters
imageInput filled image

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t p_codec,
opj_image_t p_image,
opj_stream_t p_stream 
)

Start to compress the current image.

Parameters
p_codecCompressor handle
imageInput filled image
p_streamInput stgream

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create ( OPJ_SIZE_T  p_buffer_size,
OPJ_BOOL  p_is_input 
)
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream ( const char *  fname,
OPJ_BOOL  p_is_read_stream 
)

Create a stream from a file identified with its filename with default parameters (helper function)

Parameters
fnamethe filename of the file to stream
p_is_read_streamwhether the stream is a read stream (true) or not (false)

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create_file_stream().

Referenced by j2k_to_pnm().

OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream ( const char *  fname,
OPJ_SIZE_T  p_buffer_size,
OPJ_BOOL  p_is_read_stream 
)

Create a stream from a file identified with its filename with a specific buffer size.

Parameters
fnamethe filename of the file to stream
p_buffer_sizesize of the chunk used to stream
p_is_read_streamwhether the stream is a read stream (true) or not (false)

References opj_get_data_length_from_file(), opj_read_from_file(), opj_seek_from_file(), opj_skip_from_file(), opj_stream_create(), opj_stream_set_read_function(), opj_stream_set_seek_function(), opj_stream_set_skip_function(), opj_stream_set_user_data(), opj_stream_set_user_data_length(), opj_stream_set_write_function(), and opj_write_from_file().

Referenced by opj_stream_create_default_file_stream().

OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create ( OPJ_BOOL  p_is_input)

Creates an abstract stream.

This function does nothing except allocating memory and initializing the abstract stream.

Parameters
p_is_inputif set to true then the stream will be an input stream, an output stream else.
Returns
a stream object.

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create().

OPJ_API void OPJ_CALLCONV opj_stream_destroy ( opj_stream_t p_stream)

Destroys a stream created by opj_create_stream.

This function does NOT close the abstract stream. If needed the user must close its own implementation of the stream.

Parameters
p_streamthe stream to destroy.

References opj_stream_private::m_free_user_data_fn, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, and opj_free().

Referenced by j2k_to_pnm().

OPJ_API void OPJ_CALLCONV opj_stream_set_read_function ( opj_stream_t p_stream,
opj_stream_read_fn  p_function 
)

Sets the given function to be used as a read function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a read function.

References opj_stream_private::m_read_fn, opj_stream_private::m_status, and OPJ_STREAM_STATUS_INPUT.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function ( opj_stream_t p_stream,
opj_stream_seek_fn  p_function 
)

Sets the given function to be used as a seek function, the stream is then seekable.

Parameters
p_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_seek_fn.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function ( opj_stream_t p_stream,
opj_stream_skip_fn  p_function 
)

Sets the given function to be used as a skip function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_skip_fn.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_user_data ( opj_stream_t p_stream,
void *  p_data,
opj_stream_free_user_data_fn  p_function 
)

Sets the given data to be used as a user data for the stream.

Parameters
p_streamthe stream to modify
p_datathe data to set.
p_functionthe function to free p_data when opj_stream_destroy() is called.

References opj_stream_private::m_free_user_data_fn, and opj_stream_private::m_user_data.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length ( opj_stream_t p_stream,
OPJ_UINT64  data_length 
)

Sets the length of the user data for the stream.

Parameters
p_streamthe stream to modify
data_lengthlength of the user_data.

References opj_stream_private::m_user_data_length.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_write_function ( opj_stream_t p_stream,
opj_stream_write_fn  p_function 
)

Sets the given function to be used as a write function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a write function.

References opj_stream_private::m_status, opj_stream_private::m_write_fn, and OPJ_STREAM_STATUS_OUTPUT.

Referenced by opj_stream_create_file_stream().

OPJ_API const char* OPJ_CALLCONV opj_version ( void  )

Referenced by opj_j2k_setup_encoder().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t p_codec,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_t p_stream 
)

Writes a tile with the given data.

Parameters
p_codecthe jpeg2000 codec.
p_tile_indexthe index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.
p_datapointer to the data to write. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO INTERLEAVING should be set.
p_data_sizethis value os used to make sure the data being written is correct. The size must be equal to the sum for each component of tile_width * tile_height * component_size. component_size can be 1,2 or 4 bytes, depending on the precision of the given component.
p_streamthe stream to write data to.
Returns
true if the data could be written.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.