openjpeg.h File Reference
`#include <stdint.h>`
`#include <stdio.h>`
`#include "opj_config.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)
#define | OPJ_DEPRECATED_STRUCT_MEMBER(memb, msg)
#define | OPJ_API
#define | OPJ_LOCAL
#define | OPJ_CALLCONV
#define | OPJ_TRUE 1
#define | OPJ_FALSE 0
#define | OPJ_ARG_NOT_USED(x)
#define | OPJ_PATH_LEN 4096
| Maximum allowed size for filenames.
#define | OPJ_J2K_MAXRLVLS 33
| Number of maximum resolution level authorized.
#define | OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2)
| Number of maximum sub-band linked to number of resolution level.
#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.
#define | JPWL_MAX_NO_PACKSPECS 16
| Maximum number of packet parts expected by JPWL: increase at your will.
#define | JPWL_MAX_NO_MARKERS 512
| Maximum number of JPWL markers: increase at your will.
#define | JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename"
| index file name used when JPWL is on
#define | JPWL_EXPECTED_COMPONENTS 3
| Expect this number of components, so you'll find better the first EPB.
#define | JPWL_MAXIMUM_TILES 8192
| Expect this maximum number of tiles, to avoid some crashes.
#define | JPWL_MAXIMUM_HAMMING 2
| Expect this maximum number of bit errors in marker id's.
#define | JPWL_MAXIMUM_EPB_ROOM 65450
| Expect this maximum number of bytes for composition of EPBs.
#define | OPJ_IMG_INFO 1
| EXPERIMENTAL FOR THE MOMENT Supported options about file information used only in j2k_dump.
#define | OPJ_J2K_MH_INFO 2
| Codestream information based only on the main header.
#define | OPJ_J2K_TH_INFO 4
| Tile information based on the current tile header.
#define | OPJ_J2K_TCH_INFO 8
| Tile/Component information of all tiles.
#define | OPJ_J2K_MH_IND 16
| Codestream index based only on the main header.
#define | OPJ_J2K_TH_IND 32
| Tile index based on the current tile.
#define | OPJ_JP2_INFO 128
| <
#define | OPJ_JP2_IND 256
| JP2 file index.
#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 choosing the RSIZ value for the J2K codestream.
#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 0x0500 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define | OPJ_PROFILE_IMF_8K 0x0600 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define | OPJ_PROFILE_IMF_2K_R 0x0700 /** 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 0x0900 /** 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.
#define | OPJ_EXTENSION_MCT 0x0100 /** Custom MCT support */
#define | OPJ_IS_CINEMA(v)
| JPEG 2000 profile macros.
#define | OPJ_IS_STORAGE(v)
#define | OPJ_IS_BROADCAST(v)
#define | OPJ_IS_IMF(v)
#define | OPJ_IS_PART2(v)
#define | OPJ_GET_IMF_PROFILE(v)
#define | OPJ_GET_IMF_MAINLEVEL(v)
#define | OPJ_GET_IMF_SUBLEVEL(v)
#define | OPJ_IMF_MAINLEVEL_MAX 11 /** Maximum main level */
#define | OPJ_IMF_MAINLEVEL_1_MSAMPLESEC 65 /** MSamples/sec for IMF main level 1 */
| Max.
#define | OPJ_IMF_MAINLEVEL_2_MSAMPLESEC 130 /** MSamples/sec for IMF main level 2 */
#define | OPJ_IMF_MAINLEVEL_3_MSAMPLESEC 195 /** MSamples/sec for IMF main level 3 */
#define | OPJ_IMF_MAINLEVEL_4_MSAMPLESEC 260 /** MSamples/sec for IMF main level 4 */
#define | OPJ_IMF_MAINLEVEL_5_MSAMPLESEC 520 /** MSamples/sec for IMF main level 5 */
#define | OPJ_IMF_MAINLEVEL_6_MSAMPLESEC 1200 /** MSamples/sec for IMF main level 6 */
#define | OPJ_IMF_MAINLEVEL_7_MSAMPLESEC 2400 /** MSamples/sec for IMF main level 7 */
#define | OPJ_IMF_MAINLEVEL_8_MSAMPLESEC 4800 /** MSamples/sec for IMF main level 8 */
#define | OPJ_IMF_MAINLEVEL_9_MSAMPLESEC 9600 /** MSamples/sec for IMF main level 9 */
#define | OPJ_IMF_MAINLEVEL_10_MSAMPLESEC 19200 /** MSamples/sec for IMF main level 10 */
#define | OPJ_IMF_MAINLEVEL_11_MSAMPLESEC 38400 /** MSamples/sec for IMF main level 11 */
#define | OPJ_IMF_SUBLEVEL_1_MBITSSEC 200 /** Mbits/s for IMF sub level 1 */
| Max.
#define | OPJ_IMF_SUBLEVEL_2_MBITSSEC 400 /** Mbits/s for IMF sub level 2 */
#define | OPJ_IMF_SUBLEVEL_3_MBITSSEC 800 /** Mbits/s for IMF sub level 3 */
#define | OPJ_IMF_SUBLEVEL_4_MBITSSEC 1600 /** Mbits/s for IMF sub level 4 */
#define | OPJ_IMF_SUBLEVEL_5_MBITSSEC 3200 /** Mbits/s for IMF sub level 5 */
#define | OPJ_IMF_SUBLEVEL_6_MBITSSEC 6400 /** Mbits/s for IMF sub level 6 */
#define | OPJ_IMF_SUBLEVEL_7_MBITSSEC 12800 /** Mbits/s for IMF sub level 7 */
#define | OPJ_IMF_SUBLEVEL_8_MBITSSEC 25600 /** Mbits/s for IMF sub level 8 */
#define | OPJ_IMF_SUBLEVEL_9_MBITSSEC 51200 /** Mbits/s for IMF sub level 9 */
#define | OPJ_CINEMA_24_CS 1302083 /** Maximum codestream length for 24fps */
| JPEG 2000 codestream and component size limits in cinema profiles.
#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_UINT32_SEMANTICALLY_BUT_INT32 OPJ_INT32
#define | OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001
#define | OPJ_DPARAMETERS_DUMP_FLAG 0x0002
#define | OPJ_STREAM_READ OPJ_TRUE
| Stream open flags.
#define | OPJ_STREAM_WRITE OPJ_FALSE
| The stream was opened for writing.

## 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.
typedef enum CINEMA_MODE | OPJ_CINEMA_MODE
| DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Digital cinema operation mode.
typedef enum PROG_ORDER | OPJ_PROG_ORDER
| Progression order.
typedef enum COLOR_SPACE | OPJ_COLOR_SPACE
| Supported image color spaces.
typedef enum CODEC_FORMAT | OPJ_CODEC_FORMAT
| Supported codec.
typedef void(* | opj_msg_callback) (const char *msg, void *client_data)
| Callback function prototype for events.
typedef struct opj_poc | opj_poc_t
| Progression order changes.
typedef struct opj_cparameters | opj_cparameters_t
| Compression parameters.
typedef struct opj_dparameters | opj_dparameters_t
| Decompression parameters.
typedef void * | opj_codec_t
| JPEG2000 codec V2.
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.
typedef struct opj_image | opj_image_t
| Defines image data and characteristics.
typedef struct opj_image_comptparm | opj_image_cmptparm_t
| Component parameters structure used by the opj_image_create function.
typedef struct opj_packet_info | opj_packet_info_t
| Index structure : Information concerning a packet inside tile.
typedef struct opj_marker_info | opj_marker_info_t
| Marker structure.
typedef struct opj_tp_info | opj_tp_info_t
| Index structure : Information concerning tile-parts.
typedef struct opj_tile_info | opj_tile_info_t
| Index structure : information regarding tiles.
typedef struct opj_codestream_info | opj_codestream_info_t
| Index structure of the codestream.
typedef struct opj_tccp_info | opj_tccp_info_t
| Tile-component coding parameters information.
typedef struct opj_tile_v2_info | opj_tile_info_v2_t
| Tile coding parameters information.
typedef struct opj_codestream_info_v2 | opj_codestream_info_v2_t
| Information structure about the codestream (FIXME should be expand and enhance).
typedef struct opj_tp_index | opj_tp_index_t
| Index structure about a tile part.
typedef struct opj_tile_index | opj_tile_index_t
| Index structure about a tile.
typedef struct opj_codestream_index | opj_codestream_index_t
| Index structure of the codestream (FIXME should be expand and enhance).
typedef struct opj_jp2_metadata | opj_jp2_metadata_t
| Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.
typedef struct opj_jp2_index | opj_jp2_index_t
| Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

## 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.
OPJ_API void OPJ_CALLCONV | opj_image_destroy (opj_image_t *image)
| Deallocate any resources associated with an image.
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).
OPJ_API void *OPJ_CALLCONV | opj_image_data_alloc (OPJ_SIZE_T size)
| Allocator for opj_image_t->comps[].data To be paired with opj_image_data_free.
OPJ_API void OPJ_CALLCONV | opj_image_data_free (void *ptr)
| Destructor for opj_image_t->comps[].data To be paired with opj_image_data_alloc.
OPJ_API opj_stream_t *OPJ_CALLCONV | opj_stream_default_create (OPJ_BOOL p_is_input)
| Creates an abstract stream.
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.
OPJ_API void OPJ_CALLCONV | opj_stream_destroy (opj_stream_t *p_stream)
| Destroys a stream created by opj_create_stream.
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.
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.
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.
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, using SEEK_SET behavior.
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.
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.
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).
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.
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.
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.
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.
OPJ_API opj_codec_t *OPJ_CALLCONV | opj_create_decompress (OPJ_CODEC_FORMAT format)
| Creates a J2K/JP2 decompression structure.
OPJ_API void OPJ_CALLCONV | opj_destroy_codec (opj_codec_t *p_codec)
| Destroy a decompressor handle.
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.
OPJ_API void OPJ_CALLCONV | opj_set_default_decoder_parameters (opj_dparameters_t *parameters)
| Set decoding parameters to default values.
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.
OPJ_API OPJ_BOOL OPJ_CALLCONV | opj_decoder_set_strict_mode (opj_codec_t *p_codec, OPJ_BOOL strict)
| Set strict decoding parameter for this decoder.
OPJ_API OPJ_BOOL OPJ_CALLCONV | opj_codec_set_threads (opj_codec_t *p_codec, int num_threads)
| Allocates worker threads for the compressor/decompressor.
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.
OPJ_API OPJ_BOOL OPJ_CALLCONV | opj_set_decoded_components (opj_codec_t *p_codec, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, OPJ_BOOL apply_color_transforms)
| Restrict the number of components to decode.
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.
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.
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.
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.
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.
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.
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.
OPJ_API opj_codec_t *OPJ_CALLCONV | opj_create_compress (OPJ_CODEC_FORMAT format)
| Creates a J2K/JP2 compression structure.
OPJ_API void OPJ_CALLCONV | opj_set_default_encoder_parameters (opj_cparameters_t *parameters)
| Set encoding parameters to default values, that means :
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.
OPJ_API OPJ_BOOL OPJ_CALLCONV | opj_encoder_set_extra_options (opj_codec_t *p_codec, const char *const *p_options)
| Specify extra options for the encoder.
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.
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.
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.
OPJ_API void OPJ_CALLCONV | opj_destroy_cstr_info (opj_codestream_info_v2_t **cstr_info)
| Destroy Codestream information after compression or decompression.
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.
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.
OPJ_API opj_codestream_index_t *OPJ_CALLCONV | opj_get_cstr_index (opj_codec_t *p_codec)
| Get the codestream index from the codec.
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.
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.
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.
OPJ_API OPJ_BOOL OPJ_CALLCONV | opj_has_thread_support (void)
| Returns if the library is built with thread support.
OPJ_API int OPJ_CALLCONV | opj_get_num_cpus (void)
| Return the number of virtual CPUs.

## Macro Definition Documentation

## INLINE

#define INLINE

Referenced by opj_aligned_alloc_n(), opj_aligned_realloc_n(), opj_dwt_deinterleave_v_cols(), opj_dwt_encode_procedure(), opj_int64_ceildivpow2(), opj_int64_clamp(), opj_int_abs(), opj_int_add_no_overflow(), opj_int_ceildiv(), opj_int_ceildivpow2(), opj_int_clamp(), opj_int_fix_mul(), opj_int_fix_mul_t1(), opj_int_floordivpow2(), opj_int_floorlog2(), opj_int_max(), opj_int_min(), opj_int_sub_no_overflow(), opj_lrintf(), opj_mqc_bytein(), opj_mqc_codelps(), opj_mqc_codemps(), opj_mqc_encode(), opj_mqc_raw_decode(), opj_mqc_renorme(), opj_t1_dec_refpass_step_mqc(), opj_t1_dec_refpass_step_raw(), opj_t1_dec_sigpass_step_mqc(), opj_t1_dec_sigpass_step_raw(), opj_t1_getctxno_mag(), opj_t1_getctxno_sc(), opj_t1_getctxno_zc(), opj_t1_getctxtno_sc_or_spb_index(), opj_t1_getspb(), opj_t1_update_flags(), opj_tcd_init_tile(), opj_uint64_ceildiv_res_uint32(), opj_uint_adds(), opj_uint_ceildiv(), opj_uint_ceildivpow2(), opj_uint_floordivpow2(), opj_uint_floorlog2(), opj_uint_max(), opj_uint_min(), opj_uint_subs(), opj_v8dwt_interleave_v(), and read_le_uint32().

## JPWL_EXPECTED_COMPONENTS

#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().

## JPWL_MAX_NO_MARKERS

#define JPWL_MAX_NO_MARKERS 512

Maximum number of JPWL markers: increase at your will.

## JPWL_MAX_NO_PACKSPECS

#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().

## JPWL_MAX_NO_TILESPECS

#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().

## JPWL_MAXIMUM_EPB_ROOM

#define JPWL_MAXIMUM_EPB_ROOM 65450

Expect this maximum number of bytes for composition of EPBs.

## JPWL_MAXIMUM_HAMMING

#define JPWL_MAXIMUM_HAMMING 2

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

## JPWL_MAXIMUM_TILES

#define JPWL_MAXIMUM_TILES 8192

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

Referenced by opj_set_default_decoder_parameters().

## JPWL_PRIVATEINDEX_NAME

#define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename"

index file name used when JPWL is on

## OPJ_API

#define OPJ_API

Referenced by opj_get_jp2_index(), and opj_get_jp2_metadata().

## OPJ_ARG_NOT_USED

#define OPJ_ARG_NOT_USED | ( |  | x | ) |

Value:
(void)(x)

Referenced by opj_default_callback(), opj_mct_decode_custom(), opj_mct_encode_custom(), opj_pi_update_decode_poc(), opj_pi_update_encode_poc_and_final(), opj_stream_default_read(), opj_stream_default_seek(), opj_stream_default_skip(), opj_stream_default_write(), opj_stream_read_seek(), opj_t1_getwmsedec(), opj_t2_decode_packets(), opj_t2_read_packet_data(), and opj_t2_skip_packet_data().

## OPJ_CALLCONV

#define OPJ_CALLCONV

Referenced by accept_connection(), decode_jpip(), destroy_index(), destroy_jpipdecoder(), fread_jpip(), fwrite_jp2k(), get_index_from_JP2file(), handle_clientreq(), init_dec_server(), init_jpipdecoder(), opj_codec_set_threads(), opj_create_compress(), opj_create_decompress(), opj_decode(), opj_decode_tile_data(), opj_decoder_set_strict_mode(), opj_destroy_codec(), opj_destroy_cstr_index(), opj_destroy_cstr_info(), opj_dump_codec(), opj_encode(), opj_encoder_set_extra_options(), opj_end_compress(), opj_end_decompress(), opj_get_cstr_index(), opj_get_cstr_info(), opj_get_decoded_tile(), opj_get_jp2_index(), opj_get_jp2_metadata(), opj_get_num_cpus(), opj_has_thread_support(), opj_image_create(), opj_image_data_alloc(), opj_image_data_free(), opj_image_destroy(), opj_image_tile_create(), opj_read_header(), opj_read_tile_header(), opj_set_decode_area(), opj_set_decoded_components(), 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_create(), opj_stream_create_default_file_stream(), opj_stream_create_file_stream(), opj_stream_default_create(), opj_stream_destroy(), 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(), opj_version(), opj_write_tile(), output_index(), output_log(), and terminate_dec_server().

## OPJ_CINEMA_24_COMP

#define OPJ_CINEMA_24_COMP 1041666 /** Maximum size per color component for 2K & 4K @ 24fps */

Referenced by opj_j2k_set_cinema_parameters(), and opj_j2k_setup_encoder().

## OPJ_CINEMA_24_CS

#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().

## OPJ_CINEMA_48_COMP

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

Referenced by opj_j2k_setup_encoder().

## OPJ_CINEMA_48_CS

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

Referenced by opj_j2k_setup_encoder().

## OPJ_DEPRECATED

#define OPJ_DEPRECATED | ( |  | func | ) |

Value:
func

## OPJ_DEPRECATED_STRUCT_MEMBER

#define OPJ_DEPRECATED_STRUCT_MEMBER | ( |  | memb,
|  |  | msg )

Value:
memb

## OPJ_DPARAMETERS_DUMP_FLAG

#define OPJ_DPARAMETERS_DUMP_FLAG 0x0002

Referenced by opj_j2k_setup_decoder().

## OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG

#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001

Referenced by opj_jp2_setup_decoder().

## OPJ_EXTENSION_MCT

#define OPJ_EXTENSION_MCT 0x0100 /** Custom MCT support */

Referenced by opj_j2k_setup_encoder(), opj_j2k_setup_header_writing(), and opj_set_MCT().

## OPJ_EXTENSION_NONE

#define OPJ_EXTENSION_NONE 0x0000 /** No Part-2 extension */

JPEG 2000 Part-2 extensions.

Referenced by opj_j2k_setup_encoder().

## OPJ_FALSE

#define OPJ_FALSE 0

Referenced by associate_channel(), check_JP2boxidx(), close_channel(), delete_session(), enqueue_metabins(), fread_jpip(), frwd_init(), fwrite_jp2k(), gene_cachemodel(), gene_JPIPstream(), gene_metamsg(), get_initquery(), get_mainheader_from_j2kstream(), handle_clientreq(), identify_cid(), identify_target(), is_allsent(), isJPPstream(), isJPTfeasible(), main(), main(), mel_init(), 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_codec_set_threads(), opj_create_compress(), opj_decode(), opj_decode_tile_data(), opj_decoder_set_strict_mode(), opj_dwt_decode_partial_97(), opj_dwt_decode_partial_tile(), opj_dwt_decode_tile(), opj_dwt_decode_tile_97(), opj_dwt_encode_h_func(), opj_dwt_encode_procedure(), opj_encode(), opj_encoder_set_extra_options(), opj_end_compress(), opj_end_decompress(), opj_event_msg(), opj_get_decoded_tile(), opj_has_thread_support(), opj_j2k_add_mct(), opj_j2k_add_mhmarker(), opj_j2k_add_tlmarker(), opj_j2k_allocate_tile_element_cstr_index(), opj_j2k_are_all_used_components_decoded(), 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_encoder_set_extra_options(), opj_j2k_encoding_validation(), opj_j2k_end_compress(), opj_j2k_get_sot_values(), opj_j2k_get_tile(), opj_j2k_is_cinema_compliant(), opj_j2k_is_imf_compliant(), opj_j2k_merge_ppm(), opj_j2k_merge_ppt(), opj_j2k_move_data_from_codec_to_output_image(), 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_components(), opj_j2k_set_decoded_resolution_factor(), opj_j2k_set_threads(), 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_image_dimensions(), 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_plt_in_memory(), 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_apply_color_postprocessing(), opj_jp2_apply_pclr(), 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_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_components(), 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_sparse_array_int32_read_or_write(), opj_sparse_array_int32_write(), opj_start_compress(), opj_stream_default_seek(), opj_stream_flush(), opj_stream_read_seek(), opj_stream_write_seek(), opj_t1_allocate_buffers(), opj_t1_allocate_buffers(), opj_t1_cblk_encode_processor(), opj_t1_clbl_decode_processor(), opj_t1_dec_clnpass_64x64_novsc(), opj_t1_dec_clnpass_generic_novsc(), opj_t1_dec_clnpass_step(), opj_t1_dec_sigpass_mqc_64x64_novsc(), opj_t1_dec_sigpass_mqc_generic_novsc(), opj_t1_dec_sigpass_raw(), opj_t1_decode_cblk(), opj_t1_decode_cblks(), opj_t1_enc_is_term_pass(), opj_t1_encode_cblks(), opj_t1_ht_decode_cblk(), 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_makelayer(), opj_tcd_mct_decode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_rateallocate(), opj_tcd_t1_decode(), opj_tcd_t2_decode(), opj_tcd_t2_encode(), opj_tcd_update_tile_data(), opj_thread_pool_get_next_job(), opj_thread_pool_setup(), opj_thread_pool_submit_job(), opj_tls_set(), opj_worker_thread_function(), 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(), set_tpixdata(), and vlc_init_tables().

## OPJ_GET_IMF_MAINLEVEL

#define OPJ_GET_IMF_MAINLEVEL | ( |  | v | ) |

Value:
((v) & 0xf)

Referenced by opj_j2k_is_imf_compliant().

## OPJ_GET_IMF_PROFILE

#define OPJ_GET_IMF_PROFILE | ( |  | v | ) |

Value:
((v) & 0xff00)

Referenced by opj_j2k_get_imf_max_NL(), opj_j2k_is_imf_compliant(), and opj_j2k_set_imf_parameters().

## OPJ_GET_IMF_SUBLEVEL

#define OPJ_GET_IMF_SUBLEVEL | ( |  | v | ) |

Value:
(((v) >> 4) & 0xf)

Referenced by opj_j2k_is_imf_compliant().

## OPJ_IMF_MAINLEVEL_10_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_10_MSAMPLESEC 19200 /** MSamples/sec for IMF main level 10 */

## OPJ_IMF_MAINLEVEL_11_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_11_MSAMPLESEC 38400 /** MSamples/sec for IMF main level 11 */

## OPJ_IMF_MAINLEVEL_1_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_1_MSAMPLESEC 65 /** MSamples/sec for IMF main level 1 */

Max.

Components Sampling Rate (MSamples/sec) per IMF main level

## OPJ_IMF_MAINLEVEL_2_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_2_MSAMPLESEC 130 /** MSamples/sec for IMF main level 2 */

## OPJ_IMF_MAINLEVEL_3_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_3_MSAMPLESEC 195 /** MSamples/sec for IMF main level 3 */

## OPJ_IMF_MAINLEVEL_4_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_4_MSAMPLESEC 260 /** MSamples/sec for IMF main level 4 */

## OPJ_IMF_MAINLEVEL_5_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_5_MSAMPLESEC 520 /** MSamples/sec for IMF main level 5 */

## OPJ_IMF_MAINLEVEL_6_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_6_MSAMPLESEC 1200 /** MSamples/sec for IMF main level 6 */

## OPJ_IMF_MAINLEVEL_7_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_7_MSAMPLESEC 2400 /** MSamples/sec for IMF main level 7 */

## OPJ_IMF_MAINLEVEL_8_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_8_MSAMPLESEC 4800 /** MSamples/sec for IMF main level 8 */

## OPJ_IMF_MAINLEVEL_9_MSAMPLESEC

#define OPJ_IMF_MAINLEVEL_9_MSAMPLESEC 9600 /** MSamples/sec for IMF main level 9 */

## OPJ_IMF_MAINLEVEL_MAX

#define OPJ_IMF_MAINLEVEL_MAX 11 /** Maximum main level */

Referenced by opj_j2k_is_imf_compliant().

## OPJ_IMF_SUBLEVEL_1_MBITSSEC

#define OPJ_IMF_SUBLEVEL_1_MBITSSEC 200 /** Mbits/s for IMF sub level 1 */

Max.

compressed Bit Rate (Mbits/s) per IMF sub level

## OPJ_IMF_SUBLEVEL_2_MBITSSEC

#define OPJ_IMF_SUBLEVEL_2_MBITSSEC 400 /** Mbits/s for IMF sub level 2 */

## OPJ_IMF_SUBLEVEL_3_MBITSSEC

#define OPJ_IMF_SUBLEVEL_3_MBITSSEC 800 /** Mbits/s for IMF sub level 3 */

## OPJ_IMF_SUBLEVEL_4_MBITSSEC

#define OPJ_IMF_SUBLEVEL_4_MBITSSEC 1600 /** Mbits/s for IMF sub level 4 */

## OPJ_IMF_SUBLEVEL_5_MBITSSEC

#define OPJ_IMF_SUBLEVEL_5_MBITSSEC 3200 /** Mbits/s for IMF sub level 5 */

## OPJ_IMF_SUBLEVEL_6_MBITSSEC

#define OPJ_IMF_SUBLEVEL_6_MBITSSEC 6400 /** Mbits/s for IMF sub level 6 */

## OPJ_IMF_SUBLEVEL_7_MBITSSEC

#define OPJ_IMF_SUBLEVEL_7_MBITSSEC 12800 /** Mbits/s for IMF sub level 7 */

## OPJ_IMF_SUBLEVEL_8_MBITSSEC

#define OPJ_IMF_SUBLEVEL_8_MBITSSEC 25600 /** Mbits/s for IMF sub level 8 */

## OPJ_IMF_SUBLEVEL_9_MBITSSEC

#define OPJ_IMF_SUBLEVEL_9_MBITSSEC 51200 /** Mbits/s for IMF sub level 9 */

## OPJ_IMG_INFO

#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().

## OPJ_IS_BROADCAST

#define OPJ_IS_BROADCAST | ( |  | v | ) |

Value:
(((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))
OPJ_PROFILE_BC_SINGLE
#define OPJ_PROFILE_BC_SINGLE
Definition openjpeg.h:211
OPJ_PROFILE_BC_MULTI_R
#define OPJ_PROFILE_BC_MULTI_R
Definition openjpeg.h:213

Referenced by opj_j2k_setup_encoder().

## OPJ_IS_CINEMA

#define OPJ_IS_CINEMA | ( |  | v | ) |

Value:
(((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
OPJ_PROFILE_CINEMA_2K
#define OPJ_PROFILE_CINEMA_2K
Definition openjpeg.h:206
OPJ_PROFILE_CINEMA_S4K
#define OPJ_PROFILE_CINEMA_S4K
Definition openjpeg.h:209

JPEG 2000 profile macros.

Referenced by opj_j2k_get_specific_header_sizes(), opj_j2k_setup_encoder(), opj_j2k_write_first_tile_part(), opj_pi_create_encode(), opj_pi_initialise_encode(), and opj_tcd_rateallocate().

## OPJ_IS_IMF

#define OPJ_IS_IMF | ( |  | v | ) |

Value:
(((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))
OPJ_PROFILE_IMF_8K_R
#define OPJ_PROFILE_IMF_8K_R
Definition openjpeg.h:219
OPJ_PROFILE_IMF_2K
#define OPJ_PROFILE_IMF_2K
Definition openjpeg.h:214

Referenced by opj_j2k_setup_encoder(), opj_pi_create_encode(), and opj_tcd_rateallocate().

## OPJ_IS_PART2

#define OPJ_IS_PART2 | ( |  | v | ) |

Value:
((v) & OPJ_PROFILE_PART2)
OPJ_PROFILE_PART2
#define OPJ_PROFILE_PART2
Definition openjpeg.h:205

Referenced by opj_j2k_setup_encoder(), and opj_set_MCT().

## OPJ_IS_STORAGE

#define OPJ_IS_STORAGE | ( |  | v | ) |

Value:
((v) == OPJ_PROFILE_CINEMA_LTS)
OPJ_PROFILE_CINEMA_LTS
#define OPJ_PROFILE_CINEMA_LTS
Definition openjpeg.h:210

Referenced by opj_j2k_setup_encoder().

## OPJ_J2K_DEFAULT_HEADER_SIZE

#define OPJ_J2K_DEFAULT_HEADER_SIZE 1000

Referenced by opj_j2k_create_compress(), and opj_j2k_create_decompress().

## OPJ_J2K_DEFAULT_NB_SEGS

#define OPJ_J2K_DEFAULT_NB_SEGS 10

Referenced by opj_t2_init_seg(), and opj_tcd_code_block_dec_allocate().

## OPJ_J2K_MAXBANDS

#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().

## OPJ_J2K_MAXRLVLS

#define OPJ_J2K_MAXRLVLS 33

Number of maximum resolution level authorized.

Referenced by j2k_get_cstr_info(), opj_j2k_read_SPCod_SPCoc(), opj_j2k_setup_encoder(), opj_pi_create_decode(), and opj_pi_initialise_encode().

## OPJ_J2K_MCC_DEFAULT_NB_RECORDS

#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS 10

Referenced by opj_j2k_read_mcc(), and opj_j2k_read_siz().

## OPJ_J2K_MCT_DEFAULT_NB_RECORDS

#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS 10

Referenced by opj_j2k_read_mct(), opj_j2k_read_siz(), and opj_j2k_setup_mct_encoding().

## OPJ_J2K_MH_IND

#define OPJ_J2K_MH_IND 16

Codestream index based only on the main header.

Referenced by j2k_dump().

## OPJ_J2K_MH_INFO

#define OPJ_J2K_MH_INFO 2

Codestream information based only on the main header.

Referenced by j2k_dump().

## OPJ_J2K_STREAM_CHUNK_SIZE

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

Referenced by opj_stream_create_default_file_stream(), and opj_stream_default_create().

## OPJ_J2K_TCH_INFO

#define OPJ_J2K_TCH_INFO 8

Tile/Component information of all tiles.

Referenced by j2k_dump().

## OPJ_J2K_TH_IND

#define OPJ_J2K_TH_IND 32

Tile index based on the current tile.

Referenced by j2k_dump().

## OPJ_J2K_TH_INFO

#define OPJ_J2K_TH_INFO 4

Tile information based on the current tile header.

Referenced by j2k_dump().

## OPJ_JP2_IND

#define OPJ_JP2_IND 256

JP2 file index.

Referenced by j2k_dump().

## OPJ_JP2_INFO

#define OPJ_JP2_INFO 128

<

JP2 file information

Referenced by j2k_dump().

## OPJ_LOCAL

#define OPJ_LOCAL

## OPJ_PATH_LEN

#define OPJ_PATH_LEN 4096

Maximum allowed size for filenames.

## OPJ_PROFILE_0

#define OPJ_PROFILE_0 0x0001 /** Profile 0 as described in 15444-1,Table A.45 */

## OPJ_PROFILE_1

#define OPJ_PROFILE_1 0x0002 /** Profile 1 as described in 15444-1,Table A.45 */

## OPJ_PROFILE_BC_MULTI

#define OPJ_PROFILE_BC_MULTI 0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */

## OPJ_PROFILE_BC_MULTI_R

#define OPJ_PROFILE_BC_MULTI_R 0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */

## OPJ_PROFILE_BC_SINGLE

#define OPJ_PROFILE_BC_SINGLE 0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */

## OPJ_PROFILE_CINEMA_2K

#define OPJ_PROFILE_CINEMA_2K 0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */

Referenced by opj_j2k_is_cinema_compliant(), opj_j2k_set_cinema_parameters(), and opj_j2k_setup_encoder().

## OPJ_PROFILE_CINEMA_4K

#define OPJ_PROFILE_CINEMA_4K 0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */

Referenced by opj_j2k_is_cinema_compliant(), opj_j2k_set_cinema_parameters(), opj_j2k_setup_encoder(), opj_j2k_setup_header_writing(), and opj_t2_encode_packets().

## OPJ_PROFILE_CINEMA_LTS

#define OPJ_PROFILE_CINEMA_LTS 0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */

## OPJ_PROFILE_CINEMA_S2K

#define OPJ_PROFILE_CINEMA_S2K 0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */

Referenced by opj_j2k_setup_encoder().

## OPJ_PROFILE_CINEMA_S4K

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

Referenced by opj_j2k_setup_encoder().

## OPJ_PROFILE_IMF_2K

#define OPJ_PROFILE_IMF_2K 0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), opj_j2k_is_imf_compliant(), and opj_j2k_set_imf_parameters().

## OPJ_PROFILE_IMF_2K_R

#define OPJ_PROFILE_IMF_2K_R 0x0700 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), and opj_j2k_is_imf_compliant().

## OPJ_PROFILE_IMF_4K

#define OPJ_PROFILE_IMF_4K 0x0500 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), opj_j2k_is_imf_compliant(), and opj_j2k_set_imf_parameters().

## OPJ_PROFILE_IMF_4K_R

#define OPJ_PROFILE_IMF_4K_R 0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), and opj_j2k_is_imf_compliant().

## OPJ_PROFILE_IMF_8K

#define OPJ_PROFILE_IMF_8K 0x0600 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), opj_j2k_is_imf_compliant(), and opj_j2k_set_imf_parameters().

## OPJ_PROFILE_IMF_8K_R

#define OPJ_PROFILE_IMF_8K_R 0x0900 /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */

Referenced by opj_j2k_get_imf_max_NL(), and opj_j2k_is_imf_compliant().

## OPJ_PROFILE_NONE

#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 choosing 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().

## OPJ_PROFILE_PART2

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

Referenced by opj_j2k_setup_encoder(), opj_j2k_setup_header_writing(), and opj_set_MCT().

## OPJ_STREAM_READ

#define OPJ_STREAM_READ OPJ_TRUE

Stream open flags.

The stream was opened for reading.

## OPJ_STREAM_WRITE

#define OPJ_STREAM_WRITE OPJ_FALSE

The stream was opened for writing.

## OPJ_TRUE

#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(), main(), mel_init(), 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_decoder_set_strict_mode(), opj_dwt_decode_partial_97(), opj_dwt_decode_partial_tile(), opj_dwt_decode_tile(), opj_dwt_decode_tile_97(), opj_dwt_encode_h_func(), opj_dwt_encode_procedure(), opj_dwt_init_sparse_array(), opj_dwt_interleave_partial_h(), opj_dwt_interleave_partial_v(), opj_event_msg(), opj_j2k_add_mct(), opj_j2k_add_mhmarker(), opj_j2k_add_tlmarker(), opj_j2k_allocate_tile_element_cstr_index(), opj_j2k_are_all_used_components_decoded(), opj_j2k_build_decoder(), opj_j2k_build_encoder(), opj_j2k_build_tp_index_from_tlm(), opj_j2k_calculate_tp(), opj_j2k_compare_SPCod_SPCoc(), opj_j2k_compare_SQcd_SQcc(), opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_decompress(), opj_j2k_create_tcd(), 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_encoder_set_extra_options(), 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_is_cinema_compliant(), opj_j2k_is_imf_compliant(), opj_j2k_mct_validation(), opj_j2k_merge_ppm(), opj_j2k_merge_ppt(), opj_j2k_move_data_from_codec_to_output_image(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_post_write_tile(), opj_j2k_pre_write_tile(), opj_j2k_read_cap(), opj_j2k_read_cbd(), opj_j2k_read_coc(), opj_j2k_read_cod(), opj_j2k_read_com(), opj_j2k_read_cpf(), 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_decoded_components(), opj_j2k_set_decoded_resolution_factor(), opj_j2k_set_threads(), 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_image_dimensions(), 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_plt_in_memory(), 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_apply_color_postprocessing(), opj_jp2_apply_pclr(), opj_jp2_check_color(), opj_jp2_default_validation(), opj_jp2_exec(), 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_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_sparse_array_int32_read(), opj_sparse_array_int32_read_or_write(), opj_stream_flush(), opj_stream_read_seek(), opj_stream_write_seek(), opj_t1_allocate_buffers(), opj_t1_allocate_buffers(), opj_t1_cblk_encode_processor(), opj_t1_dec_clnpass_64x64_vsc(), opj_t1_dec_clnpass_generic_vsc(), opj_t1_dec_clnpass_step(), opj_t1_dec_sigpass_mqc_64x64_vsc(), opj_t1_dec_sigpass_mqc_generic_vsc(), opj_t1_decode_cblk(), opj_t1_enc_is_term_pass(), opj_t1_encode_cblks(), opj_t1_ht_decode_cblk(), 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_makelayer(), 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_thread_pool_get_next_job(), opj_thread_pool_setup(), opj_thread_pool_submit_job(), opj_tls_set(), opj_v8dwt_interleave_partial_h(), opj_v8dwt_interleave_partial_v(), opj_worker_thread_function(), parse_comps(), parse_JPIPstream(), parse_metareq(), parse_req_box_prop(), recons_codestream_from_JPPstream(), recons_codestream_from_JPTstream(), recons_packet(), recons_precinct(), recv_ack(), rev_init_mrp(), search_session_and_channel(), set_cidxdata(), set_CODmkrdata(), set_cptrdata(), set_mainmhixdata(), set_ppixdata(), set_SIZmkrdata(), set_thixdata(), set_tpixdata(), and vlc_init_tables().

## OPJ_UINT32_SEMANTICALLY_BUT_INT32

#define OPJ_UINT32_SEMANTICALLY_BUT_INT32 OPJ_INT32

## Typedef Documentation

## OPJ_BOOL

typedef int OPJ_BOOL

## OPJ_BYTE

typedef unsigned char OPJ_BYTE

## OPJ_CHAR

typedef char OPJ_CHAR

## OPJ_CINEMA_MODE

typedef enum CINEMA_MODE OPJ_CINEMA_MODE

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

## OPJ_CODEC_FORMAT

typedef enum CODEC_FORMAT OPJ_CODEC_FORMAT

Supported codec.

## opj_codec_t

typedef void* opj_codec_t

JPEG2000 codec V2.

## opj_codestream_index_t

typedef struct opj_codestream_index opj_codestream_index_t

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

## opj_codestream_info_t

typedef struct opj_codestream_info opj_codestream_info_t

Index structure of the codestream.

## opj_codestream_info_v2_t

typedef struct opj_codestream_info_v2 opj_codestream_info_v2_t

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

## OPJ_COLOR_SPACE

typedef enum COLOR_SPACE OPJ_COLOR_SPACE

Supported image color spaces.

## opj_cparameters_t

typedef struct opj_cparameters opj_cparameters_t

Compression parameters.

## opj_dparameters_t

typedef struct opj_dparameters opj_dparameters_t

Decompression parameters.

## OPJ_FLOAT32

typedef float OPJ_FLOAT32

## OPJ_FLOAT64

typedef double OPJ_FLOAT64

## opj_image_cmptparm_t

typedef struct opj_image_comptparm opj_image_cmptparm_t

Component parameters structure used by the opj_image_create function.

## opj_image_comp_t

typedef struct opj_image_comp opj_image_comp_t

Defines a single image component.

## opj_image_t

typedef struct opj_image opj_image_t

Defines image data and characteristics.

## OPJ_INT16

typedef int16_t OPJ_INT16

## OPJ_INT32

typedef int32_t OPJ_INT32

## OPJ_INT64

typedef int64_t OPJ_INT64

## OPJ_INT8

typedef int8_t OPJ_INT8

## opj_jp2_index_t

typedef struct opj_jp2_index opj_jp2_index_t

Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

## opj_jp2_metadata_t

typedef struct opj_jp2_metadata opj_jp2_metadata_t

Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

## opj_marker_info_t

typedef struct opj_marker_info opj_marker_info_t

Marker structure.

## opj_msg_callback

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

Callback function prototype for events.

Parameters

  msg | Event message
  client_data | Client object where will be return the event message

## OPJ_OFF_T

typedef int64_t OPJ_OFF_T

## opj_packet_info_t

typedef struct opj_packet_info opj_packet_info_t

Index structure : Information concerning a packet inside tile.

## opj_poc_t

typedef struct opj_poc opj_poc_t

Progression order changes.

## OPJ_PROG_ORDER

typedef enum PROG_ORDER OPJ_PROG_ORDER

Progression order.

## OPJ_RSIZ_CAPABILITIES

typedef enum RSIZ_CAPABILITIES OPJ_RSIZ_CAPABILITIES

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

## OPJ_SIZE_T

typedef size_t OPJ_SIZE_T

## opj_stream_free_user_data_fn

typedef void(* opj_stream_free_user_data_fn) (void *p_user_data)

## opj_stream_read_fn

typedef OPJ_SIZE_T(* opj_stream_read_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)

## opj_stream_seek_fn

typedef OPJ_BOOL(* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)

## opj_stream_skip_fn

typedef OPJ_OFF_T(* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void *p_user_data)

## opj_stream_t

typedef void* opj_stream_t

## opj_stream_write_fn

typedef OPJ_SIZE_T(* opj_stream_write_fn) (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)

## opj_tccp_info_t

typedef struct opj_tccp_info opj_tccp_info_t

Tile-component coding parameters information.

## opj_tile_index_t

typedef struct opj_tile_index opj_tile_index_t

Index structure about a tile.

## opj_tile_info_t

typedef struct opj_tile_info opj_tile_info_t

Index structure : information regarding tiles.

## opj_tile_info_v2_t

typedef struct opj_tile_v2_info opj_tile_info_v2_t

Tile coding parameters information.

## opj_tp_index_t

typedef struct opj_tp_index opj_tp_index_t

Index structure about a tile part.

## opj_tp_info_t

typedef struct opj_tp_info opj_tp_info_t

Index structure : Information concerning tile-parts.

## OPJ_UINT16

typedef uint16_t OPJ_UINT16

## OPJ_UINT32

typedef uint32_t OPJ_UINT32

## OPJ_UINT64

typedef uint64_t OPJ_UINT64

## OPJ_UINT8

typedef uint8_t OPJ_UINT8

## Enumeration Type Documentation

## CINEMA_MODE

enum CINEMA_MODE

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

## CODEC_FORMAT

enum CODEC_FORMAT

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.

## COLOR_SPACE

enum COLOR_SPACE

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.

## PROG_ORDER

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

## RSIZ_CAPABILITIES

enum RSIZ_CAPABILITIES

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_codec_set_threads()

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_codec_set_threads | ( | opj_codec_t * | p_codec,
|  | int | num_threads )

Allocates worker threads for the compressor/decompressor.

By default, only the main thread is used. If this function is not used, but the OPJ_NUM_THREADS environment variable is set, its value will be used to initialize the number of threads. The value can be either an integer number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called, this function will override the behaviour of the environment variable.

This function must be called after opj_setup_decoder() and before opj_read_header() for the decoding side, or after opj_setup_encoder() and before opj_start_compress() for the encoding side.

Parameters

  p_codec | decompressor or compressor handler
  num_threads | number of threads.

Returns
  OPJ_TRUE if the function is successful.

References opj_codec_private::m_codec, OPJ_CALLCONV, OPJ_FALSE, and opj_codec_private::opj_set_threads.

## opj_create_compress()

OPJ_API opj_codec_t *OPJ_CALLCONV opj_create_compress | ( | OPJ_CODEC_FORMAT | format | ) |

Creates a J2K/JP2 compression structure.

Parameters

  format | Coder to select

Returns
  Returns a handle to a compressor if successful, returns NULL 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, OPJ_CALLCONV, opj_calloc(), OPJ_CODEC_J2K, OPJ_CODEC_JP2, OPJ_CODEC_JPT, OPJ_CODEC_UNKNOWN, OPJ_FALSE, opj_free(), opj_j2k_create_compress(), opj_j2k_destroy(), opj_j2k_encode(), opj_j2k_encoder_set_extra_options(), opj_j2k_end_compress(), opj_j2k_set_threads(), opj_j2k_setup_encoder(), opj_j2k_start_compress(), opj_j2k_write_tile(), opj_jp2_create(), opj_jp2_destroy(), opj_jp2_encode(), opj_jp2_encoder_set_extra_options(), opj_jp2_end_compress(), opj_jp2_set_threads(), opj_jp2_setup_encoder(), opj_jp2_start_compress(), opj_jp2_write_tile(), opj_set_default_event_handler(), and opj_codec_private::opj_set_threads.

## opj_create_decompress()

OPJ_API opj_codec_t *OPJ_CALLCONV opj_create_decompress | ( | OPJ_CODEC_FORMAT | format | ) |

Creates a J2K/JP2 decompression structure.

Parameters

  format | Decoder to select

Returns
  Returns a handle to a decompressor if successful, returns NULL otherwise

References opj_codec_private::is_decompressor, j2k_dump(), j2k_get_cstr_index(), j2k_get_cstr_info(), jp2_dump(), jp2_get_cstr_index(), jp2_get_cstr_info(), opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, OPJ_CALLCONV, opj_calloc(), OPJ_CODEC_J2K, OPJ_CODEC_JP2, OPJ_CODEC_JPT, OPJ_CODEC_UNKNOWN, opj_codec_private::opj_dump_codec, opj_free(), opj_codec_private::opj_get_codec_index, opj_codec_private::opj_get_codec_info, opj_j2k_create_decompress(), opj_j2k_decode(), opj_j2k_decode_tile(), opj_j2k_decoder_set_strict_mode(), opj_j2k_destroy(), opj_j2k_end_decompress(), opj_j2k_get_tile(), opj_j2k_read_header(), opj_j2k_read_tile_header(), opj_j2k_set_decode_area(), opj_j2k_set_decoded_components(), opj_j2k_set_decoded_resolution_factor(), opj_j2k_set_threads(), opj_j2k_setup_decoder(), opj_jp2_create(), opj_jp2_decode(), opj_jp2_decode_tile(), opj_jp2_decoder_set_strict_mode(), opj_jp2_destroy(), opj_jp2_end_decompress(), opj_jp2_get_tile(), opj_jp2_read_header(), opj_jp2_read_tile_header(), opj_jp2_set_decode_area(), opj_jp2_set_decoded_components(), opj_jp2_set_decoded_resolution_factor(), opj_jp2_set_threads(), opj_jp2_setup_decoder(), opj_set_default_event_handler(), opj_codec_private::opj_set_threads, and OPJ_TRUE.

Referenced by j2k_to_pnm().

## opj_decode()

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_decompressor | decompressor handle
  p_stream | Input buffer stream
  p_image | the 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, OPJ_CALLCONV, and OPJ_FALSE.

Referenced by j2k_to_pnm().

## opj_decode_tile_data()

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.

Note: opj_decode_tile_data() should not be used together with opj_set_decoded_components().

Parameters

  p_codec | the jpeg2000 codec.
  p_tile_index | the index of the tile being decoded, this should be the value set by opj_read_tile_header.
  p_data | pointer to a memory block that will hold the decoded data.
  p_data_size | size of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.
  p_stream | the 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_decoder_set_strict_mode()

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decoder_set_strict_mode | ( | opj_codec_t * | p_codec,
|  | OPJ_BOOL | strict )

Set strict decoding parameter for this decoder.

If strict decoding is enabled, partial bit streams will fail to decode, and the check for invalid TPSOT values added in https://github.com/uclouvain/openjpeg/pull/514 will be disabled. If strict decoding is disabled, the decoder will decode partial bitstreams as much as possible without erroring, and the TPSOT fixing logic will be enabled.

Parameters

  p_codec | decompressor handler
  strict | OPJ_TRUE to enable strict decoding, OPJ_FALSE to disable

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_CALLCONV, opj_event_msg(), OPJ_FALSE, and OPJ_TRUE.

## opj_destroy_codec()

OPJ_API void OPJ_CALLCONV opj_destroy_codec | ( | opj_codec_t * | p_codec | ) |

Destroy a decompressor handle.

Parameters

  p_codec | decompressor 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, OPJ_CALLCONV, and opj_free().

Referenced by j2k_to_pnm().

## opj_destroy_cstr_index()

OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index | ( | opj_codestream_index_t ** | p_cstr_index | ) |

References j2k_destroy_cstr_index(), and OPJ_CALLCONV.

## opj_destroy_cstr_info()

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_info | Codestream information structure

References OPJ_CALLCONV, and opj_free().

Referenced by j2k_get_cstr_info().

## opj_dump_codec()

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_codec | the jpeg2000 codec.
  info_flag | type of information dump.
  output_stream | output stream where dump the information gotten from the codec.

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

## opj_encode()

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_codec | compressor handle
  p_stream | Output 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_encoder_set_extra_options()

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encoder_set_extra_options | ( | opj_codec_t * | p_codec,
|  | const char *const * | p_options )

Specify extra options for the encoder.

This may be called after opj_setup_encoder() and before opj_start_compress()

This is the way to add new options in a fully ABI compatible way, without extending the opj_cparameters_t structure.

Currently supported options are:

- PLT=YES/NO. Defaults to NO. If set to YES, PLT marker segments, indicating the length of each packet in the tile-part header, will be written. Since 2.4.0
- TLM=YES/NO. Defaults to NO (except for Cinema and IMF profiles). If set to YES, TLM marker segments, indicating the length of each tile-part part will be written. Since 2.4.0
- GUARD_BITS=value. Number of guard bits in [0,7] range. Default value is 2. 1 may be used sometimes (like in SMPTE DCP Bv2.1 Application Profile for 2K images). Since 2.5.0

Parameters

  p_codec | Compressor handle
  p_options | Compression options. This should be a NULL terminated array of strings. Each string is of the form KEY=VALUE.

Returns
  OPJ_TRUE in case of success.

Since
  2.4.0

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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_end_compress()

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_codec | Compressor handle
  p_stream | Input 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_end_decompress()

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_codec | the JPEG2000 codec to read.
  p_stream | the 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, OPJ_CALLCONV, and OPJ_FALSE.

Referenced by j2k_to_pnm().

## opj_get_cstr_index()

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_codec | the jpeg2000 codec.

Returns
  a pointer to a codestream index structure.

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

## opj_get_cstr_info()

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_codec | the jpeg2000 codec.

Returns
  a pointer to a codestream information structure.

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

## opj_get_decoded_tile()

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_codec | the jpeg2000 codec.
  p_stream | input stream
  p_image | output image
  tile_index | index 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_get_jp2_index()

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_codec | the jpeg2000 codec.

Returns
  a pointer to a JP2 index structure.

References OPJ_API, and OPJ_CALLCONV.

## opj_get_jp2_metadata()

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_codec | the jpeg2000 codec.

Returns
  a pointer to a JP2 metadata structure.

References OPJ_API, and OPJ_CALLCONV.

## opj_get_num_cpus()

OPJ_API int OPJ_CALLCONV opj_get_num_cpus | ( | void |  | ) |

Return the number of virtual CPUs.

References OPJ_CALLCONV.

Referenced by opj_j2k_get_default_thread_count().

## opj_has_thread_support()

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_has_thread_support | ( | void |  | ) |

Returns if the library is built with thread support.

OPJ_TRUE if mutex, condition, thread, thread pool are available.

References OPJ_CALLCONV, and OPJ_FALSE.

Referenced by opj_j2k_get_default_thread_count(), and opj_j2k_set_threads().

## opj_image_create()

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.

Parameters

  numcmpts | number of components
  cmptparms | components parameters
  clrspc | image color space

Returns
  returns a new image structure if successful, returns 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_CALLCONV, opj_calloc(), opj_image_data_alloc(), opj_image_destroy(), opj_image_comp::prec, opj_image_comptparm::prec, opj_image_comp::sgnd, opj_image_comptparm::sgnd, SIZE_MAX, 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_image_data_alloc()

OPJ_API void *OPJ_CALLCONV opj_image_data_alloc | ( | OPJ_SIZE_T | size | ) |

Allocator for opj_image_t->comps[].data To be paired with opj_image_data_free.

Parameters

  size | number of bytes to allocate

Returns
  a new pointer if successful, NULL otherwise.

Since
  2.2.0

References opj_aligned_malloc(), and OPJ_CALLCONV.

Referenced by opj_alloc_tile_component_data(), opj_image_create(), opj_j2k_update_image_data(), opj_jp2_apply_pclr(), and opj_tcd_decode_tile().

## opj_image_data_free()

OPJ_API void OPJ_CALLCONV opj_image_data_free | ( | void * | ptr | ) |

Destructor for opj_image_t->comps[].data To be paired with opj_image_data_alloc.

Parameters

  ptr | Pointer to free

Since
  2.2.0

References opj_aligned_free(), and OPJ_CALLCONV.

Referenced by opj_alloc_tile_component_data(), opj_copy_image_header(), opj_image_destroy(), opj_j2k_decode_tiles(), opj_j2k_get_tile(), opj_j2k_move_data_from_codec_to_output_image(), opj_jp2_apply_pclr(), opj_tcd_decode_tile(), opj_tcd_free_tile(), and opj_tcd_init_tile().

## opj_image_destroy()

OPJ_API void OPJ_CALLCONV opj_image_destroy | ( | opj_image_t * | image | ) |

Deallocate any resources associated with an image.

Parameters

  image | image to be destroyed

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

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

## opj_image_tile_create()

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

  numcmpts | the number of components
  cmptparms | the components parameters
  clrspc | the 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_CALLCONV, 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_read_header()

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_stream | the jpeg2000 stream.
  p_codec | the jpeg2000 codec to read.
  p_image | the 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_CALLCONV, opj_event_msg(), and OPJ_FALSE.

Referenced by j2k_to_pnm().

## opj_read_tile_header()

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_codec | the jpeg2000 codec.
  p_tile_index | pointer to a value that will hold the index of the tile being decoded, in case of success.
  p_data_size | pointer 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_x0 | pointer to a value that will hold the x0 pos of the tile (in the image).
  p_tile_y0 | pointer to a value that will hold the y0 pos of the tile (in the image).
  p_tile_x1 | pointer to a value that will hold the x1 pos of the tile (in the image).
  p_tile_y1 | pointer to a value that will hold the y1 pos of the tile (in the image).
  p_nb_comps | pointer to a value that will hold the number of components in the tile.
  p_should_go_on | pointer 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_stream | the 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_set_decode_area()

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.

The coordinates passed to this function should be expressed in the reference grid, that is to say at the highest resolution level, even if requesting the image at lower resolution levels.

Note: If p_start_x, p_start_y, p_end_x, p_end_y are all 0, then the whole image is decoded.

Generally opj_set_decode_area() should be followed by opj_decode(), and the codec cannot be re-used. In the particular case of an image made of a single tile, several sequences of calls to opoj_set_decode_area() and opj_decode() are allowed, and will bring performance improvements when reading an image by chunks.

Parameters

  p_codec | the jpeg2000 codec.
  p_image | the decoded image previously set by opj_read_header
  p_start_x | the left position of the rectangle to decode (in image coordinates).
  p_end_x | the right position of the rectangle to decode (in image coordinates).
  p_start_y | the up position of the rectangle to decode (in image coordinates).
  p_end_y | the 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, OPJ_CALLCONV, and OPJ_FALSE.

Referenced by j2k_to_pnm().

## opj_set_decoded_components()

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_components | ( | opj_codec_t * | p_codec,
|  | OPJ_UINT32 | numcomps,
|  | const OPJ_UINT32 * | comps_indices,
|  | OPJ_BOOL | apply_color_transforms )

Restrict the number of components to decode.

This function should be called after opj_read_header().

This function enables to restrict the set of decoded components to the specified indices. Note that the current implementation (apply_color_transforms == OPJ_FALSE) is such that neither the multi-component transform at codestream level, nor JP2 channel transformations will be applied. Consequently the indices are relative to the codestream.

Note: opj_decode_tile_data() should not be used together with opj_set_decoded_components().

Parameters

  p_codec | the jpeg2000 codec to read.
  numcomps | Size of the comps_indices array.
  comps_indices | Array of numcomps values representing the indices of the components to decode (relative to the codestream, starting at 0)
  apply_color_transforms | Whether multi-component transform at codestream level or JP2 channel transformations should be applied. Currently this parameter should be set to OPJ_FALSE. Setting it to OPJ_TRUE will result in an error.

Returns
  OPJ_TRUE in case of success.

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_CALLCONV, opj_event_msg(), and OPJ_FALSE.

## opj_set_decoded_resolution_factor()

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_codec | the jpeg2000 codec.
  res_factor | resolution 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_set_default_decoder_parameters()

OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters | ( | opj_dparameters_t * | parameters | ) |

Set decoding parameters to default values.

Parameters

  parameters | Decompression parameters

References opj_dparameters::cod_format, opj_dparameters::cp_layer, opj_dparameters::cp_reduce, opj_dparameters::decod_format, opj_dparameters::flags, opj_dparameters::jpwl_correct, opj_dparameters::jpwl_exp_comps, JPWL_EXPECTED_COMPONENTS, opj_dparameters::jpwl_max_tiles, JPWL_MAXIMUM_TILES, OPJ_CALLCONV, and OPJ_FALSE.

Referenced by j2k_to_pnm().

## opj_set_default_encoder_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

  parameters | Compression 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_CALLCONV, OPJ_COMP_PARAM_DEFAULT_CBLOCKH, OPJ_COMP_PARAM_DEFAULT_CBLOCKW, OPJ_COMP_PARAM_DEFAULT_NUMRESOLUTION, OPJ_COMP_PARAM_DEFAULT_PROG_ORDER, OPJ_FALSE, 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_set_error_handler()

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_codec | the codec previously initialise
  p_callback | the callback function which will be used
  p_user_data | client 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_CALLCONV, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

## opj_set_info_handler()

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_codec | the codec previously initialise
  p_callback | the callback function which will be used
  p_user_data | client 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_CALLCONV, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

## opj_set_MCT()

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

  parameters | the parameters to change.
  pEncodingMatrix | the encoding matrix.
  p_dc_shift | the dc shift coefficients to use.
  pNbComp | the number of components of the image.

Returns
  true if the parameters could be set.

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

## opj_set_warning_handler()

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_codec | the codec previously initialise
  p_callback | the callback function which will be used
  p_user_data | client object where will be returned the message

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

Referenced by j2k_to_pnm().

## opj_setup_decoder()

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_codec | decompressor handler
  parameters | decompression 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_CALLCONV, opj_event_msg(), OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

## opj_setup_encoder()

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_codec | Compressor handle
  parameters | Compression parameters
  image | Input 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_start_compress()

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_codec | Compressor handle
  p_image | Input filled image
  p_stream | Input 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, OPJ_CALLCONV, and OPJ_FALSE.

## opj_stream_create()

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.

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

Parameters

  p_buffer_size | FIXME DOC
  p_is_input | if set to true then the stream will be an input stream, an output stream else.

Returns
  a stream object.

References opj_stream_private::m_buffer_size, opj_stream_private::m_current_data, opj_stream_private::m_opj_seek, opj_stream_private::m_opj_skip, opj_stream_private::m_read_fn, opj_stream_private::m_seek_fn, opj_stream_private::m_skip_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_write_fn, OPJ_CALLCONV, opj_calloc(), opj_free(), opj_malloc(), opj_stream_default_read(), opj_stream_default_seek(), opj_stream_default_skip(), opj_stream_default_write(), opj_stream_read_seek(), opj_stream_read_skip(), OPJ_STREAM_STATUS_INPUT, OPJ_STREAM_STATUS_OUTPUT, opj_stream_write_seek(), and opj_stream_write_skip().

Referenced by opj_stream_create_file_stream(), and opj_stream_default_create().

## opj_stream_create_default_file_stream()

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

  fname | the filename of the file to stream
  p_is_read_stream | whether the stream is a read stream (true) or not (false)

References OPJ_CALLCONV, OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create_file_stream().

Referenced by j2k_to_pnm().

## opj_stream_create_file_stream()

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

  fname | the filename of the file to stream
  p_buffer_size | size of the chunk used to stream
  p_is_read_stream | whether the stream is a read stream (true) or not (false)

References OPJ_CALLCONV, opj_close_from_file(), 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_stream_default_create()

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_input | if set to true then the stream will be an input stream, an output stream else.

Returns
  a stream object.

References OPJ_CALLCONV, OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create().

## opj_stream_destroy()

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_stream | the stream to destroy.

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

Referenced by j2k_to_pnm().

## opj_stream_set_read_function()

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_stream | the stream to modify
  p_function | the function to use a read function.

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

Referenced by opj_stream_create_file_stream().

## opj_stream_set_seek_function()

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, using SEEK_SET behavior.

Parameters

  p_stream | the stream to modify
  p_function | the function to use a skip function.

References opj_stream_private::m_seek_fn, and OPJ_CALLCONV.

Referenced by opj_stream_create_file_stream().

## opj_stream_set_skip_function()

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_stream | the stream to modify
  p_function | the function to use a skip function.

References opj_stream_private::m_skip_fn, and OPJ_CALLCONV.

Referenced by opj_stream_create_file_stream().

## opj_stream_set_user_data()

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_stream | the stream to modify
  p_data | the data to set.
  p_function | the function to free p_data when opj_stream_destroy() is called.

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

Referenced by opj_stream_create_file_stream().

## opj_stream_set_user_data_length()

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_stream | the stream to modify
  data_length | length of the user_data.

References opj_stream_private::m_user_data_length, and OPJ_CALLCONV.

Referenced by opj_stream_create_file_stream().

## opj_stream_set_write_function()

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_stream | the stream to modify
  p_function | the function to use a write function.

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

Referenced by opj_stream_create_file_stream().

## opj_version()

OPJ_API const char *OPJ_CALLCONV opj_version | ( | void |  | ) |

References OPJ_CALLCONV.

Referenced by opj_j2k_setup_encoder().

## opj_write_tile()

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_codec | the jpeg2000 codec.
  p_tile_index | the index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.
  p_data | pointer to the data to write. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO INTERLEAVING should be set.
  p_data_size | this 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_stream | the 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, OPJ_CALLCONV, and OPJ_FALSE.