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

Defines

#define INLINE
#define OPJ_DEPRECATED(func)   func
#define OPJ_API
#define OPJ_LOCAL
#define OPJ_CALLCONV
#define OPJ_TRUE   1
#define OPJ_FALSE   0
#define OPJ_ARG_NOT_USED(x)   (void)(x)
#define OPJ_PATH_LEN   4096
 Maximum allowed size for filenames.
#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
#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
 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
#define OPJ_PROFILE_1   0x0002
#define OPJ_PROFILE_PART2   0x8000
#define OPJ_PROFILE_CINEMA_2K   0x0003
#define OPJ_PROFILE_CINEMA_4K   0x0004
#define OPJ_PROFILE_CINEMA_S2K   0x0005
#define OPJ_PROFILE_CINEMA_S4K   0x0006
#define OPJ_PROFILE_CINEMA_LTS   0x0007
#define OPJ_PROFILE_BC_SINGLE   0x0100
#define OPJ_PROFILE_BC_MULTI   0x0200
#define OPJ_PROFILE_BC_MULTI_R   0x0300
#define OPJ_PROFILE_IMF_2K   0x0400
#define OPJ_PROFILE_IMF_4K   0x0401
#define OPJ_PROFILE_IMF_8K   0x0402
#define OPJ_PROFILE_IMF_2K_R   0x0403
#define OPJ_PROFILE_IMF_4K_R   0x0800
#define OPJ_PROFILE_IMF_8K_R   0x0801
#define OPJ_EXTENSION_NONE   0x0000
 JPEG 2000 Part-2 extensions.
#define OPJ_EXTENSION_MCT   0x0100
#define OPJ_IS_CINEMA(v)   (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
 JPEG 2000 profile macros.
#define OPJ_IS_STORAGE(v)   ((v) == OPJ_PROFILE_CINEMA_LTS)
#define OPJ_IS_BROADCAST(v)   (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))
#define OPJ_IS_IMF(v)   (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))
#define OPJ_IS_PART2(v)   ((v) & OPJ_PROFILE_PART2)
#define OPJ_CINEMA_24_CS   1302083
 JPEG 2000 codestream and component size limits in cinema profiles.
#define OPJ_CINEMA_48_CS   651041
#define OPJ_CINEMA_24_COMP   1041666
#define OPJ_CINEMA_48_COMP   520833
#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.
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_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_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.

Define Documentation

#define INLINE
#define JPWL_EXPECTED_COMPONENTS   3

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

Referenced by opj_set_default_decoder_parameters().

#define JPWL_MAX_NO_MARKERS   512

Maximum number of JPWL markers: increase at your will.

#define JPWL_MAX_NO_PACKSPECS   16

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

Referenced by opj_j2k_setup_encoder(), and opj_set_default_encoder_parameters().

#define JPWL_MAX_NO_TILESPECS   16

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

Referenced by opj_j2k_setup_encoder(), and opj_set_default_encoder_parameters().

#define JPWL_MAXIMUM_EPB_ROOM   65450

Expect this maximum number of bytes for composition of EPBs.

#define JPWL_MAXIMUM_HAMMING   2

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

#define JPWL_MAXIMUM_TILES   8192

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

Referenced by opj_set_default_decoder_parameters().

#define JPWL_PRIVATEINDEX_NAME   "jpwl_index_privatefilename"

index file name used when JPWL is on

#define OPJ_API
#define OPJ_ARG_NOT_USED (  )     (void)(x)
#define OPJ_CALLCONV
#define OPJ_CINEMA_24_COMP   1041666
#define OPJ_CINEMA_24_CS   1302083

JPEG 2000 codestream and component size limits in cinema profiles.

Referenced by opj_j2k_set_cinema_parameters(), and opj_j2k_setup_encoder().

#define OPJ_CINEMA_48_COMP   520833

Referenced by opj_j2k_setup_encoder().

#define OPJ_CINEMA_48_CS   651041

Referenced by opj_j2k_setup_encoder().

#define OPJ_DEPRECATED ( func   )     func
#define OPJ_DPARAMETERS_DUMP_FLAG   0x0002

Referenced by opj_j2k_setup_decoder().

#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG   0x0001

Referenced by opj_jp2_setup_decoder().

#define OPJ_EXTENSION_MCT   0x0100
#define OPJ_EXTENSION_NONE   0x0000

JPEG 2000 Part-2 extensions.

Referenced by opj_j2k_setup_encoder().

#define OPJ_FALSE   0

Referenced by associate_channel(), check_JP2boxidx(), close_channel(), delete_session(), enqueue_metabins(), fread_jpip(), fwrite_jp2k(), gene_cachemodel(), gene_JPIPstream(), gene_metamsg(), get_initquery(), get_mainheader_from_j2kstream(), handle_clientreq(), identify_cid(), identify_target(), is_allsent(), isJPPstream(), isJPTfeasible(), main(), 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_dwt_decode_partial_97(), opj_dwt_decode_partial_tile(), opj_dwt_decode_tile(), opj_dwt_decode_tile_97(), opj_dwt_encode_procedure(), opj_encode(), 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_check_poc_val(), opj_j2k_compare_coc(), opj_j2k_compare_SPCod_SPCoc(), opj_j2k_compare_SQcd_SQcc(), opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_tcd(), opj_j2k_decode(), opj_j2k_decode_one_tile(), opj_j2k_decode_tile(), opj_j2k_decode_tiles(), opj_j2k_encode(), opj_j2k_encoding_validation(), opj_j2k_end_compress(), opj_j2k_get_sot_values(), opj_j2k_get_tile(), opj_j2k_is_cinema_compliant(), opj_j2k_merge_ppm(), opj_j2k_merge_ppt(), opj_j2k_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_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_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_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_t2_decode_packet(), opj_t2_decode_packets(), opj_t2_encode_packet(), opj_t2_encode_packets(), opj_t2_init_seg(), opj_t2_read_packet_data(), opj_t2_read_packet_header(), opj_t2_skip_packet(), opj_t2_skip_packet_data(), opj_tcd_code_block_dec_allocate(), opj_tcd_code_block_enc_allocate(), opj_tcd_code_block_enc_allocate_data(), opj_tcd_copy_tile_data(), opj_tcd_decode_tile(), opj_tcd_dwt_decode(), opj_tcd_dwt_encode(), opj_tcd_encode_tile(), opj_tcd_init(), opj_tcd_init_decode_tile(), opj_tcd_init_tile(), opj_tcd_mct_decode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_rateallocate(), opj_tcd_t1_decode(), opj_tcd_t1_encode(), opj_tcd_t2_decode(), opj_tcd_t2_encode(), opj_tcd_update_tile_data(), opj_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(), and set_tpixdata().

#define OPJ_IMG_INFO   1

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

Basic image information provided to the user

Referenced by j2k_dump().

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

Referenced by opj_j2k_setup_encoder().

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

Referenced by opj_j2k_setup_encoder().

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

Referenced by opj_j2k_setup_encoder().

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

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

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

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

Codestream index based only on the main header.

Referenced by j2k_dump().

#define OPJ_J2K_MH_INFO   2

Codestream information based only on the main header.

Referenced by j2k_dump().

#define OPJ_J2K_STREAM_CHUNK_SIZE   0x100000
#define OPJ_J2K_TCH_INFO   8

Tile/Component information of all tiles.

Referenced by j2k_dump().

#define OPJ_J2K_TH_IND   32

Tile index based on the current tile.

Referenced by j2k_dump().

#define OPJ_J2K_TH_INFO   4

Tile information based on the current tile header.

Referenced by j2k_dump().

#define OPJ_JP2_IND   256

JP2 file index.

Referenced by j2k_dump().

#define OPJ_JP2_INFO   128

<

JP2 file information

Referenced by j2k_dump().

#define OPJ_LOCAL
#define OPJ_PATH_LEN   4096

Maximum allowed size for filenames.

#define OPJ_PROFILE_0   0x0001
#define OPJ_PROFILE_1   0x0002
#define OPJ_PROFILE_BC_MULTI   0x0200
#define OPJ_PROFILE_BC_MULTI_R   0x0300
#define OPJ_PROFILE_BC_SINGLE   0x0100
#define OPJ_PROFILE_CINEMA_2K   0x0003
#define OPJ_PROFILE_CINEMA_4K   0x0004
#define OPJ_PROFILE_CINEMA_LTS   0x0007
#define OPJ_PROFILE_CINEMA_S2K   0x0005

Referenced by opj_j2k_setup_encoder().

#define OPJ_PROFILE_CINEMA_S4K   0x0006

Referenced by opj_j2k_setup_encoder().

#define OPJ_PROFILE_IMF_2K   0x0400
#define OPJ_PROFILE_IMF_2K_R   0x0403
#define OPJ_PROFILE_IMF_4K   0x0401
#define OPJ_PROFILE_IMF_4K_R   0x0800
#define OPJ_PROFILE_IMF_8K   0x0402
#define OPJ_PROFILE_IMF_8K_R   0x0801
#define OPJ_PROFILE_NONE   0x0000

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

#define OPJ_PROFILE_PART2   0x8000
#define OPJ_STREAM_READ   OPJ_TRUE

Stream open flags.

The stream was opened for reading.

#define OPJ_STREAM_WRITE   OPJ_FALSE

The stream was opened for writing.

#define OPJ_TRUE   1

Referenced by associate_channel(), check_JP2boxidx(), close_channel(), delete_session(), enqueue_mainheader(), enqueue_metabins(), enqueue_metadata(), enqueue_precinct(), enqueue_tile(), enqueue_tileheader(), fread_jpip(), fwrite_jp2k(), gene_cachemodel(), gene_JPIPstream(), gene_target(), get_mainheader_from_j2kstream(), handle_clientreq(), handle_dstCIDreqMSG(), handle_JPIPstreamMSG(), identify_cid(), identify_target(), init_dec_server(), init_jpipdecoder(), is_allsent(), isJPPstream(), isJPTfeasible(), j2k_to_pnm(), main(), modify_COCmkrstream(), modify_mainheader(), modify_SIZmkrstream(), modify_tileheader(), open_channel(), opj_alloc_tile_component_data(), opj_bio_bytein(), opj_bio_byteout(), opj_bio_flush(), opj_bio_inalign(), opj_check_EPHuse(), opj_create_decompress(), opj_dwt_decode_partial_97(), opj_dwt_decode_partial_tile(), opj_dwt_decode_tile(), opj_dwt_decode_tile_97(), 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_build_decoder(), opj_j2k_build_encoder(), opj_j2k_calculate_tp(), opj_j2k_check_poc_val(), opj_j2k_compare_SPCod_SPCoc(), opj_j2k_compare_SQcd_SQcc(), opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_tcd(), opj_j2k_decode_one_tile(), opj_j2k_decode_tile(), opj_j2k_decode_tiles(), opj_j2k_decoding_validation(), opj_j2k_destroy_header_memory(), opj_j2k_encode(), opj_j2k_encoding_validation(), opj_j2k_end_compress(), opj_j2k_end_decompress(), opj_j2k_end_encoding(), opj_j2k_exec(), opj_j2k_get_end_header(), opj_j2k_get_sot_values(), opj_j2k_is_cinema_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_cbd(), opj_j2k_read_coc(), opj_j2k_read_cod(), opj_j2k_read_com(), opj_j2k_read_crg(), opj_j2k_read_header(), opj_j2k_read_header_procedure(), opj_j2k_read_mcc(), opj_j2k_read_mco(), opj_j2k_read_mct(), opj_j2k_read_plm(), opj_j2k_read_plt(), opj_j2k_read_poc(), opj_j2k_read_ppm(), opj_j2k_read_ppt(), opj_j2k_read_qcc(), opj_j2k_read_qcd(), opj_j2k_read_rgn(), opj_j2k_read_siz(), opj_j2k_read_soc(), opj_j2k_read_sod(), opj_j2k_read_sot(), opj_j2k_read_SPCod_SPCoc(), opj_j2k_read_SQcd_SQcc(), opj_j2k_read_tile_header(), opj_j2k_read_tlm(), opj_j2k_read_unk(), opj_j2k_set_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_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_pclr(), opj_jp2_check_color(), opj_jp2_decode(), opj_jp2_default_validation(), opj_jp2_exec(), opj_jp2_get_tile(), opj_jp2_read_boxhdr(), opj_jp2_read_boxhdr_char(), opj_jp2_read_bpcc(), opj_jp2_read_cdef(), opj_jp2_read_cmap(), opj_jp2_read_colr(), opj_jp2_read_ftyp(), opj_jp2_read_header_procedure(), opj_jp2_read_ihdr(), opj_jp2_read_jp(), opj_jp2_read_jp2h(), opj_jp2_read_pclr(), opj_jp2_setup_decoding_validation(), opj_jp2_setup_encoder(), opj_jp2_setup_encoding_validation(), opj_jp2_setup_end_header_reading(), opj_jp2_setup_end_header_writing(), opj_jp2_setup_header_reading(), opj_jp2_setup_header_writing(), opj_jp2_skip_jp2c(), opj_jp2_write_jp(), opj_jp2_write_jp2c(), opj_jp2_write_jp2h(), opj_jpip_skip_iptr(), opj_lupDecompose(), opj_matrix_inversion_f(), opj_mct_decode_custom(), opj_mct_encode_custom(), opj_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_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_t2_decode_packet(), opj_t2_decode_packets(), opj_t2_encode_packet(), opj_t2_encode_packets(), opj_t2_init_seg(), opj_t2_read_packet_data(), opj_t2_read_packet_header(), opj_t2_skip_packet(), opj_t2_skip_packet_data(), opj_tcd_code_block_dec_allocate(), opj_tcd_code_block_enc_allocate(), opj_tcd_code_block_enc_allocate_data(), opj_tcd_copy_tile_data(), opj_tcd_dc_level_shift_decode(), opj_tcd_dc_level_shift_encode(), opj_tcd_decode_tile(), opj_tcd_dwt_decode(), opj_tcd_dwt_encode(), opj_tcd_encode_tile(), opj_tcd_init(), opj_tcd_init_encode_tile(), opj_tcd_init_tile(), opj_tcd_mct_decode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_rateallocate(), opj_tcd_t1_decode(), opj_tcd_t1_encode(), opj_tcd_t2_decode(), opj_tcd_t2_encode(), opj_tcd_update_tile_data(), opj_thread_pool_get_next_job(), opj_thread_pool_setup(), opj_thread_pool_submit_job(), opj_tls_set(), opj_v4dwt_interleave_partial_h(), opj_v4dwt_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(), search_session_and_channel(), set_cidxdata(), set_CODmkrdata(), set_cptrdata(), set_mainmhixdata(), set_ppixdata(), set_SIZmkrdata(), set_thixdata(), and set_tpixdata().


Typedef Documentation

typedef int OPJ_BOOL
typedef unsigned char OPJ_BYTE
typedef char OPJ_CHAR

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

Supported codec.

typedef void* opj_codec_t

JPEG2000 codec V2.

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

Index structure of the codestream.

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

Supported image color spaces.

Compression parameters.

Decompression parameters.

typedef float OPJ_FLOAT32
typedef double OPJ_FLOAT64

Component parameters structure used by the opj_image_create function.

Defines a single image component.

typedef struct opj_image opj_image_t

Defines image data and characteristics.

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

Index structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

Info structure of the JP2 file EXPERIMENTAL FOR THE MOMENT.

Marker structure.

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

Callback function prototype for events.

Parameters:
msg Event message
client_data Client object where will be return the event message
typedef int64_t OPJ_OFF_T

Index structure : Information concerning a packet inside tile.

typedef struct opj_poc opj_poc_t

Progression order changes.

typedef enum PROG_ORDER OPJ_PROG_ORDER

Progression order.

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

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

Tile-component coding parameters information.

Index structure about a tile.

Index structure : information regarding tiles.

Tile coding parameters information.

typedef struct opj_tp_index opj_tp_index_t

Index structure about a tile part.

typedef struct opj_tp_info opj_tp_info_t

Index structure : Information concerning tile-parts.

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

Enumeration Type Documentation

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

Enumerator:
OPJ_OFF 
OPJ_CINEMA2K_24 

Not Digital Cinema.

OPJ_CINEMA2K_48 

2K Digital Cinema at 24 fps

OPJ_CINEMA4K_24 

2K Digital Cinema at 48 fps

Supported codec.

Enumerator:
OPJ_CODEC_UNKNOWN 

place-holder

OPJ_CODEC_J2K 

JPEG-2000 codestream : read/write.

OPJ_CODEC_JPT 

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

OPJ_CODEC_JP2 

JP2 file format : read/write.

OPJ_CODEC_JPP 

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

OPJ_CODEC_JPX 

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

Supported image color spaces.

Enumerator:
OPJ_CLRSPC_UNKNOWN 

not supported by the library

OPJ_CLRSPC_UNSPECIFIED 

not specified in the codestream

OPJ_CLRSPC_SRGB 

sRGB

OPJ_CLRSPC_GRAY 

grayscale

OPJ_CLRSPC_SYCC 

YUV.

OPJ_CLRSPC_EYCC 

e-YCC

OPJ_CLRSPC_CMYK 

CMYK.

enum PROG_ORDER

Progression order.

Enumerator:
OPJ_PROG_UNKNOWN 

place-holder

OPJ_LRCP 

layer-resolution-component-precinct order

OPJ_RLCP 

resolution-layer-component-precinct order

OPJ_RPCL 

resolution-precinct-component-layer order

OPJ_PCRL 

precinct-component-resolution-layer order

OPJ_CPRL 

component-precinct-resolution-layer order

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

Enumerator:
OPJ_STD_RSIZ 
OPJ_CINEMA2K 

Standard JPEG2000 profile.

OPJ_CINEMA4K 

Profile name for a 2K image.

OPJ_MCT 

Profile name for a 4K image.


Function Documentation

OPJ_API OPJ_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.

Note: currently only has effect on the decompressor.

Parameters:
p_codec decompressor handler
num_threads number of threads.
Returns:
OPJ_TRUE if the decoder is correctly set

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

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

Decode an image from a JPEG-2000 codestream.

Parameters:
p_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, and OPJ_FALSE.

Referenced by j2k_to_pnm().

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

Reads a tile data.

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

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

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

Referenced by j2k_to_pnm().

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

Destroy Codestream information after compression or decompression.

Parameters:
cstr_info Codestream information structure

References opj_free().

Referenced by j2k_get_cstr_info().

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

Dump the codec information into the output stream.

Parameters:
p_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, and opj_codec_private::opj_dump_codec.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Encode an image into a JPEG-2000 codestream.

Parameters:
p_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, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

End to compress the current image.

Parameters:
p_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, and OPJ_FALSE.

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Read after the codestream if necessary.

Parameters:
p_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, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_API opj_codestream_index_t* OPJ_CALLCONV opj_get_cstr_index ( opj_codec_t p_codec  ) 

Get the codestream index from the codec.

Parameters:
p_codec the jpeg2000 codec.
Returns:
a pointer to a codestream index structure.

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

OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info ( opj_codec_t p_codec  ) 

Get the codestream information from the codec.

Parameters:
p_codec the jpeg2000 codec.
Returns:
a pointer to a codestream information structure.

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

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

Get the decoded tile from the codec.

Parameters:
p_codec the jpeg2000 codec.
p_stream input streamm
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, and OPJ_FALSE.

OPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index ( opj_codec_t p_codec  ) 

Get the JP2 file index from the codec FIXME.

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

Get the JP2 file information from the codec FIXME.

Parameters:
p_codec the jpeg2000 codec.
Returns:
a pointer to a JP2 metadata structure.
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_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_API opj_image_t* OPJ_CALLCONV opj_image_create ( OPJ_UINT32  numcmpts,
opj_image_cmptparm_t cmptparms,
OPJ_COLOR_SPACE  clrspc 
)
OPJ_API void* OPJ_CALLCONV opj_image_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().

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

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_API void OPJ_CALLCONV opj_image_destroy ( opj_image_t 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).

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_comptparm::dx, opj_image_comp::dx, opj_image_comptparm::dy, opj_image_comp::dy, opj_image_comptparm::h, opj_image_comp::h, opj_image::numcomps, opj_calloc(), opj_image_destroy(), opj_image_comptparm::prec, opj_image_comp::prec, opj_image_comptparm::sgnd, opj_image_comp::sgnd, opj_image_comptparm::w, opj_image_comp::w, opj_image_comptparm::x0, opj_image_comp::x0, opj_image_comptparm::y0, and opj_image_comp::y0.

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

Decodes an image header.

Parameters:
p_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_event_msg(), and OPJ_FALSE.

Referenced by j2k_to_pnm().

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

Reads a tile header.

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

Parameters:
p_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, and OPJ_FALSE.

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

Sets the given area to be decoded.

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

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_codec the jpeg2000 codec.
p_image the decoded image previously setted 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, and OPJ_FALSE.

Referenced by j2k_to_pnm().

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

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

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

Set encoding parameters to default values, that means :.

  • Lossless
  • 1 tile
  • Size of precinct : 2^15 x 2^15 (means 1 precinct)
  • Size of code-block : 64 x 64
  • Number of resolutions: 6
  • No SOP marker in the codestream
  • No EPH marker in the codestream
  • No sub-sampling in x or y direction
  • No mode switch activated
  • Progression order: LRCP
  • No index file
  • No ROI upshifted
  • No offset of the origin of the image
  • No offset of the origin of the tiles
  • Reversible DWT 5-3
Parameters:
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_FALSE, OPJ_LRCP, OPJ_OFF, OPJ_PROFILE_NONE, OPJ_STD_RSIZ, opj_cparameters::prog_order, opj_cparameters::roi_compno, opj_cparameters::rsiz, opj_cparameters::subsampling_dx, opj_cparameters::subsampling_dy, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, and opj_cparameters::tp_on.

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

Set the error handler use by openjpeg.

Parameters:
p_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_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

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

Set the info handler use by openjpeg.

Parameters:
p_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_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

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

Sets the MCT matrix to use.

Parameters:
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_EXTENSION_MCT, OPJ_FALSE, OPJ_IS_PART2, opj_malloc(), OPJ_PROFILE_PART2, OPJ_TRUE, opj_cparameters::rsiz, and opj_cparameters::tcp_mct.

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

Set the warning handler use by openjpeg.

Parameters:
p_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_FALSE, OPJ_TRUE, and opj_event_mgr::warning_handler.

Referenced by j2k_to_pnm().

OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder ( opj_codec_t p_codec,
opj_dparameters_t parameters 
)

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

Parameters:
p_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_event_msg(), OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

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

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

Parameters:
p_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, and OPJ_FALSE.

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

Start to compress the current image.

Parameters:
p_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, and OPJ_FALSE.

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

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

Parameters:
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_J2K_STREAM_CHUNK_SIZE, and opj_stream_create_file_stream().

Referenced by j2k_to_pnm().

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

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

Parameters:
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_get_data_length_from_file(), opj_read_from_file(), opj_seek_from_file(), opj_skip_from_file(), opj_stream_create(), opj_stream_set_read_function(), opj_stream_set_seek_function(), opj_stream_set_skip_function(), opj_stream_set_user_data(), opj_stream_set_user_data_length(), opj_stream_set_write_function(), and opj_write_from_file().

Referenced by opj_stream_create_default_file_stream().

OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create ( OPJ_BOOL  p_is_input  ) 

Creates an abstract stream.

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

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

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create().

OPJ_API void OPJ_CALLCONV opj_stream_destroy ( opj_stream_t p_stream  ) 

Destroys a stream created by opj_create_stream.

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

Parameters:
p_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, and opj_free().

Referenced by j2k_to_pnm().

OPJ_API void OPJ_CALLCONV opj_stream_set_read_function ( opj_stream_t p_stream,
opj_stream_read_fn  p_function 
)

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

Parameters:
p_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, and OPJ_STREAM_STATUS_INPUT.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function ( opj_stream_t p_stream,
opj_stream_seek_fn  p_function 
)

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

Parameters:
p_stream the stream to modify
p_function the function to use a skip function.

References opj_stream_private::m_seek_fn.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function ( opj_stream_t p_stream,
opj_stream_skip_fn  p_function 
)

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

Parameters:
p_stream the stream to modify
p_function the function to use a skip function.

References opj_stream_private::m_skip_fn.

Referenced by opj_stream_create_file_stream().

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

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

Parameters:
p_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, and opj_stream_private::m_user_data.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length ( opj_stream_t p_stream,
OPJ_UINT64  data_length 
)

Sets the length of the user data for the stream.

Parameters:
p_stream the stream to modify
data_length length of the user_data.

References opj_stream_private::m_user_data_length.

Referenced by opj_stream_create_file_stream().

OPJ_API void OPJ_CALLCONV opj_stream_set_write_function ( opj_stream_t p_stream,
opj_stream_write_fn  p_function 
)

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

Parameters:
p_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, and OPJ_STREAM_STATUS_OUTPUT.

Referenced by opj_stream_create_file_stream().

OPJ_API const char* OPJ_CALLCONV opj_version ( void   ) 

Referenced by opj_j2k_setup_encoder().

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

Writes a tile with the given data.

Parameters:
p_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, and OPJ_FALSE.


Generated on 20 Feb 2018 for OpenJPEG by  doxygen 1.6.1