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

Go to the source code of this file.

Data Structures

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

Macros

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

Typedefs

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

Enumerations

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

Functions

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

Macro Definition Documentation

◆ INLINE

#define INLINE

◆ JPWL_EXPECTED_COMPONENTS

#define JPWL_EXPECTED_COMPONENTS   3

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

◆ 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.

◆ JPWL_MAX_NO_TILESPECS

#define JPWL_MAX_NO_TILESPECS   16

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

◆ 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.

◆ JPWL_PRIVATEINDEX_NAME

#define JPWL_PRIVATEINDEX_NAME   "jpwl_index_privatefilename"

index file name used when JPWL is on

◆ OPJ_API

#define OPJ_API

◆ OPJ_ARG_NOT_USED

#define OPJ_ARG_NOT_USED (   x)    (void)(x)

◆ OPJ_CALLCONV

#define OPJ_CALLCONV

◆ OPJ_CINEMA_24_COMP

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

◆ 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.

◆ OPJ_CINEMA_48_COMP

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

◆ OPJ_CINEMA_48_CS

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

◆ OPJ_DEPRECATED

#define OPJ_DEPRECATED (   func)    func

◆ OPJ_DEPRECATED_STRUCT_MEMBER

#define OPJ_DEPRECATED_STRUCT_MEMBER (   memb,
  msg 
)    memb

◆ OPJ_DPARAMETERS_DUMP_FLAG

#define OPJ_DPARAMETERS_DUMP_FLAG   0x0002

◆ OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG

#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG   0x0001

◆ OPJ_EXTENSION_MCT

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

◆ OPJ_EXTENSION_NONE

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

JPEG 2000 Part-2 extensions.

◆ OPJ_FALSE

#define OPJ_FALSE   0

◆ OPJ_GET_IMF_MAINLEVEL

#define OPJ_GET_IMF_MAINLEVEL (   v)    ((v) & 0xf) /** Extract IMF main level */

◆ OPJ_GET_IMF_PROFILE

#define OPJ_GET_IMF_PROFILE (   v)    ((v) & 0xff00) /** Extract IMF profile without mainlevel/sublevel */

◆ OPJ_GET_IMF_SUBLEVEL

#define OPJ_GET_IMF_SUBLEVEL (   v)    (((v) >> 4) & 0xf) /** Extract IMF sub level */

◆ 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 */

◆ 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

◆ OPJ_IS_BROADCAST

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

◆ OPJ_IS_CINEMA

#define OPJ_IS_CINEMA (   v)    (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))

JPEG 2000 profile macros.

◆ OPJ_IS_IMF

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

◆ OPJ_IS_PART2

#define OPJ_IS_PART2 (   v)    ((v) & OPJ_PROFILE_PART2)

◆ OPJ_IS_STORAGE

#define OPJ_IS_STORAGE (   v)    ((v) == OPJ_PROFILE_CINEMA_LTS)

◆ OPJ_J2K_DEFAULT_HEADER_SIZE

#define OPJ_J2K_DEFAULT_HEADER_SIZE   1000

◆ OPJ_J2K_DEFAULT_NB_SEGS

#define OPJ_J2K_DEFAULT_NB_SEGS   10

◆ OPJ_J2K_MAXBANDS

#define OPJ_J2K_MAXBANDS   (3*OPJ_J2K_MAXRLVLS-2)

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

◆ OPJ_J2K_MAXRLVLS

#define OPJ_J2K_MAXRLVLS   33

Number of maximum resolution level authorized.

◆ OPJ_J2K_MCC_DEFAULT_NB_RECORDS

#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS   10

◆ OPJ_J2K_MCT_DEFAULT_NB_RECORDS

#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS   10

◆ OPJ_J2K_MH_IND

#define OPJ_J2K_MH_IND   16

Codestream index based only on the main header.

◆ OPJ_J2K_MH_INFO

#define OPJ_J2K_MH_INFO   2

Codestream information based only on the main header.

◆ OPJ_J2K_STREAM_CHUNK_SIZE

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

◆ OPJ_J2K_TCH_INFO

#define OPJ_J2K_TCH_INFO   8

Tile/Component information of all tiles.

◆ OPJ_J2K_TH_IND

#define OPJ_J2K_TH_IND   32

Tile index based on the current tile.

◆ OPJ_J2K_TH_INFO

#define OPJ_J2K_TH_INFO   4

Tile information based on the current tile header.

◆ OPJ_JP2_IND

#define OPJ_JP2_IND   256

JP2 file index.

◆ OPJ_JP2_INFO

#define OPJ_JP2_INFO   128

<

JP2 file information

◆ 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 */

◆ OPJ_PROFILE_CINEMA_4K

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

◆ 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 */

◆ OPJ_PROFILE_CINEMA_S4K

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

◆ OPJ_PROFILE_IMF_2K

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

◆ 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 */

◆ OPJ_PROFILE_IMF_4K

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

◆ 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 */

◆ OPJ_PROFILE_IMF_8K

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

◆ 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 */

◆ 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)

◆ OPJ_PROFILE_PART2

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

◆ 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

◆ 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

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

◆ OPJ_CODEC_FORMAT

Supported codec.

◆ opj_codec_t

typedef void* opj_codec_t

JPEG2000 codec V2.

◆ opj_codestream_index_t

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

◆ opj_codestream_info_t

Index structure of the codestream.

◆ opj_codestream_info_v2_t

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

◆ OPJ_COLOR_SPACE

Supported image color spaces.

◆ opj_cparameters_t

Compression parameters.

◆ opj_dparameters_t

Decompression parameters.

◆ OPJ_FLOAT32

typedef float OPJ_FLOAT32

◆ OPJ_FLOAT64

typedef double OPJ_FLOAT64

◆ opj_image_cmptparm_t

Component parameters structure used by the opj_image_create function.

◆ 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

Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

◆ opj_jp2_metadata_t

Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

◆ 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
msgEvent message
client_dataClient object where will be return the event message

◆ OPJ_OFF_T

typedef int64_t OPJ_OFF_T

◆ 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

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

Tile-component coding parameters information.

◆ opj_tile_index_t

Index structure about a tile.

◆ opj_tile_info_t

Index structure : information regarding tiles.

◆ 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

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

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

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

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_codecdecompressor or compressor handler
num_threadsnumber of threads.
Returns
OPJ_TRUE if the function is successful.

References opj_codec_private::m_codec, 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)

◆ opj_create_decompress()

OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress ( OPJ_CODEC_FORMAT  format)

◆ 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_decompressordecompressor handle
p_streamInput buffer stream
p_imagethe decoded image
Returns
true if success, otherwise false

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

Referenced by j2k_to_pnm().

◆ opj_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_codecthe jpeg2000 codec.
p_tile_indexthe index of the tile being decoded, this should be the value set by opj_read_tile_header.
p_datapointer to a memory block that will hold the decoded data.
p_data_sizesize of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.
p_streamthe stream to decode.
Returns
true if the data could be decoded.

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

◆ opj_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. If strict decoding is disabled, the decoder will decode partial bitstreams as much as possible without erroring

Parameters
p_codecdecompressor handler
strictOPJ_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_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_codecdecompressor handle to destroy

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

Referenced by j2k_to_pnm().

◆ opj_destroy_cstr_index()

OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index ( opj_codestream_index_t **  p_cstr_index)

◆ 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_infoCodestream information structure

References 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_codecthe jpeg2000 codec.
info_flagtype of information dump.
output_streamoutput stream where dump the information gotten from the codec.

References opj_codec_private::m_codec, 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_codeccompressor handle
p_streamOutput buffer stream
Returns
Returns true if successful, returns false otherwise

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

◆ opj_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_codecCompressor handle
p_optionsCompression 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, 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_codecCompressor handle
p_streamInput stgream

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

◆ opj_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_codecthe JPEG2000 codec to read.
p_streamthe JPEG2000 stream.

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

Referenced by j2k_to_pnm().

◆ opj_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_codecthe jpeg2000 codec.
Returns
a pointer to a codestream index structure.

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

◆ opj_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_codecthe jpeg2000 codec.
Returns
a pointer to a codestream information structure.

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

◆ opj_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_codecthe jpeg2000 codec.
p_streaminput stream
p_imageoutput image
tile_indexindex of the tile which will be decode
Returns
true if success, otherwise false

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

◆ opj_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_codecthe jpeg2000 codec.
Returns
a pointer to a JP2 index structure.

◆ 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_codecthe jpeg2000 codec.
Returns
a pointer to a JP2 metadata structure.

◆ opj_get_num_cpus()

OPJ_API int OPJ_CALLCONV opj_get_num_cpus ( void  )

Return the number of virtual CPUs.

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_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 
)

◆ 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
sizenumber of bytes to allocate
Returns
a new pointer if successful, NULL otherwise.
Since
2.2.0

References opj_aligned_malloc().

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
ptrPointer to free
Since
2.2.0

References opj_aligned_free().

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)

◆ 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
numcmptsthe number of components
cmptparmsthe components parameters
clrspcthe image color space
Returns
a new image structure if successful, NULL otherwise.

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

◆ opj_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_streamthe jpeg2000 stream.
p_codecthe jpeg2000 codec to read.
p_imagethe image structure initialized with the characteristics of encoded image.
Returns
true if the main header of the codestream and the JP2 header is correctly read.

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

Referenced by j2k_to_pnm().

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

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

◆ opj_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.

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_codecthe jpeg2000 codec.
p_imagethe decoded image previously set by opj_read_header
p_start_xthe left position of the rectangle to decode (in image coordinates).
p_end_xthe right position of the rectangle to decode (in image coordinates).
p_start_ythe up position of the rectangle to decode (in image coordinates).
p_end_ythe bottom position of the rectangle to decode (in image coordinates).
Returns
true if the area could be set.

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

Referenced by j2k_to_pnm().

◆ opj_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_codecthe jpeg2000 codec to read.
numcompsSize of the comps_indices array.
comps_indicesArray of numcomps values representing the indices of the components to decode (relative to the codestream, starting at 0)
apply_color_transformsWhether 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_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_codecthe jpeg2000 codec.
res_factorresolution factor to set
Returns
true if success, otherwise false

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

◆ opj_set_default_decoder_parameters()

OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters ( opj_dparameters_t parameters)

◆ 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
parametersCompression parameters

References opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cparameters::cod_format, opj_cparameters::cp_cinema, opj_cparameters::cp_disto_alloc, opj_cparameters::cp_fixed_alloc, opj_cparameters::cp_fixed_quality, opj_cparameters::cp_rsiz, opj_cparameters::decod_format, opj_cparameters::jpip_on, opj_cparameters::jpwl_epc_on, opj_cparameters::jpwl_hprot_MH, opj_cparameters::jpwl_hprot_TPH, opj_cparameters::jpwl_hprot_TPH_tileno, JPWL_MAX_NO_PACKSPECS, JPWL_MAX_NO_TILESPECS, opj_cparameters::jpwl_pprot, opj_cparameters::jpwl_pprot_packno, opj_cparameters::jpwl_pprot_tileno, opj_cparameters::jpwl_sens_addr, opj_cparameters::jpwl_sens_MH, opj_cparameters::jpwl_sens_range, opj_cparameters::jpwl_sens_size, opj_cparameters::jpwl_sens_TPH, opj_cparameters::jpwl_sens_TPH_tileno, opj_cparameters::max_comp_size, opj_cparameters::numresolution, OPJ_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_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

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

Referenced by j2k_to_pnm().

◆ opj_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_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

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

Referenced by j2k_to_pnm().

◆ opj_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
parametersthe parameters to change.
pEncodingMatrixthe encoding matrix.
p_dc_shiftthe dc shift coefficients to use.
pNbCompthe number of components of the image.
Returns
true if the parameters could be set.

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

◆ opj_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_codecthe codec previously initialise
p_callbackthe callback function which will be used
p_user_dataclient object where will be returned the message

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

Referenced by j2k_to_pnm().

◆ opj_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_codecdecompressor handler
parametersdecompression parameters
Returns
true if the decoder is correctly set

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

Referenced by j2k_to_pnm().

◆ opj_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_codecCompressor handle
parametersCompression parameters
imageInput filled image

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

◆ opj_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_codecCompressor handle
p_imageInput filled image
p_streamInput stgream

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

◆ opj_stream_create()

OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create ( OPJ_SIZE_T  p_buffer_size,
OPJ_BOOL  p_is_input 
)

◆ 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
fnamethe filename of the file to stream
p_is_read_streamwhether the stream is a read stream (true) or not (false)

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create_file_stream().

Referenced by j2k_to_pnm().

◆ opj_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
fnamethe filename of the file to stream
p_buffer_sizesize of the chunk used to stream
p_is_read_streamwhether the stream is a read stream (true) or not (false)

References opj_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_inputif set to true then the stream will be an input stream, an output stream else.
Returns
a stream object.

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create().

◆ opj_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_streamthe stream to destroy.

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

Referenced by j2k_to_pnm().

◆ opj_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_streamthe stream to modify
p_functionthe function to use a read function.

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

Referenced by opj_stream_create_file_stream().

◆ opj_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_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_seek_fn.

Referenced by opj_stream_create_file_stream().

◆ opj_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_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_skip_fn.

Referenced by opj_stream_create_file_stream().

◆ opj_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_streamthe stream to modify
p_datathe data to set.
p_functionthe function to free p_data when opj_stream_destroy() is called.

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

Referenced by opj_stream_create_file_stream().

◆ opj_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_streamthe stream to modify
data_lengthlength of the user_data.

References opj_stream_private::m_user_data_length.

Referenced by opj_stream_create_file_stream().

◆ opj_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_streamthe stream to modify
p_functionthe function to use a write function.

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

Referenced by opj_stream_create_file_stream().

◆ opj_version()

const OPJ_API char* OPJ_CALLCONV opj_version ( void  )

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

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