OpenJPEG  2.5.0
Data Structures | Macros | Typedefs | Enumerations
j2k.h File Reference

The JPEG-2000 Codestream Reader/Writer (J2K) More...

Go to the source code of this file.

Data Structures

struct  opj_stepsize
 Quantization stepsize. More...
 
struct  opj_tccp
 Tile-component coding parameters. More...
 
struct  opj_mct_data
 FIXME DOC. More...
 
struct  opj_simple_mcc_decorrelation_data
 FIXME DOC. More...
 
struct  opj_ppx_struct
 
struct  opj_tcp
 Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header) More...
 
struct  opj_encoding_param
 
struct  opj_decoding_param
 
struct  opj_cp
 Coding parameters. More...
 
struct  opj_j2k_dec
 
struct  opj_j2k_enc
 
struct  opj_j2k
 JPEG-2000 codestream reader/writer. More...
 

Macros

#define J2K_CP_CSTY_PRT   0x01
 
#define J2K_CP_CSTY_SOP   0x02
 
#define J2K_CP_CSTY_EPH   0x04
 
#define J2K_CCP_CSTY_PRT   0x01
 
#define J2K_CCP_CBLKSTY_LAZY   0x01
 Selective arithmetic coding bypass. More...
 
#define J2K_CCP_CBLKSTY_RESET   0x02
 Reset context probabilities on coding pass boundaries. More...
 
#define J2K_CCP_CBLKSTY_TERMALL   0x04
 Termination on each coding pass. More...
 
#define J2K_CCP_CBLKSTY_VSC   0x08
 Vertically stripe causal context. More...
 
#define J2K_CCP_CBLKSTY_PTERM   0x10
 Predictable termination. More...
 
#define J2K_CCP_CBLKSTY_SEGSYM   0x20
 Segmentation symbols are used. More...
 
#define J2K_CCP_CBLKSTY_HT   0x40
 (high throughput) HT codeblocks More...
 
#define J2K_CCP_CBLKSTY_HTMIXED   0x80
 MIXED mode HT codeblocks. More...
 
#define J2K_CCP_QNTSTY_NOQNT   0
 
#define J2K_CCP_QNTSTY_SIQNT   1
 
#define J2K_CCP_QNTSTY_SEQNT   2
 
#define J2K_MS_SOC   0xff4f
 SOC marker value. More...
 
#define J2K_MS_SOT   0xff90
 SOT marker value. More...
 
#define J2K_MS_SOD   0xff93
 SOD marker value. More...
 
#define J2K_MS_EOC   0xffd9
 EOC marker value. More...
 
#define J2K_MS_CAP   0xff50
 CAP marker value. More...
 
#define J2K_MS_SIZ   0xff51
 SIZ marker value. More...
 
#define J2K_MS_COD   0xff52
 COD marker value. More...
 
#define J2K_MS_COC   0xff53
 COC marker value. More...
 
#define J2K_MS_CPF   0xff59
 CPF marker value. More...
 
#define J2K_MS_RGN   0xff5e
 RGN marker value. More...
 
#define J2K_MS_QCD   0xff5c
 QCD marker value. More...
 
#define J2K_MS_QCC   0xff5d
 QCC marker value. More...
 
#define J2K_MS_POC   0xff5f
 POC marker value. More...
 
#define J2K_MS_TLM   0xff55
 TLM marker value. More...
 
#define J2K_MS_PLM   0xff57
 PLM marker value. More...
 
#define J2K_MS_PLT   0xff58
 PLT marker value. More...
 
#define J2K_MS_PPM   0xff60
 PPM marker value. More...
 
#define J2K_MS_PPT   0xff61
 PPT marker value. More...
 
#define J2K_MS_SOP   0xff91
 SOP marker value. More...
 
#define J2K_MS_EPH   0xff92
 EPH marker value. More...
 
#define J2K_MS_CRG   0xff63
 CRG marker value. More...
 
#define J2K_MS_COM   0xff64
 COM marker value. More...
 
#define J2K_MS_CBD   0xff78
 CBD marker value. More...
 
#define J2K_MS_MCC   0xff75
 MCC marker value. More...
 
#define J2K_MS_MCT   0xff74
 MCT marker value. More...
 
#define J2K_MS_MCO   0xff77
 MCO marker value. More...
 
#define J2K_MS_UNK   0
 UNKNOWN marker value. More...
 
#define J2K_MS_EPC   0xff68
 EPC marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_EPB   0xff66
 EPB marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_ESD   0xff67
 ESD marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_RED   0xff69
 RED marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_SEC   0xff65
 SEC marker value (Part 8: Secure JPEG 2000) More...
 
#define J2K_MS_INSEC   0xff94
 INSEC marker value (Part 8: Secure JPEG 2000) More...
 
#define J2K_MAX_POCS   32
 Maximum number of POCs. More...
 

Typedefs

typedef enum J2K_STATUS J2K_STATUS
 Values that specify the status of the decoding process when decoding the main header. More...
 
typedef enum MCT_ELEMENT_TYPE J2K_MCT_ELEMENT_TYPE
 Type of elements storing in the MCT data. More...
 
typedef enum MCT_ARRAY_TYPE J2K_MCT_ARRAY_TYPE
 Type of MCT array. More...
 
typedef enum T2_MODE J2K_T2_MODE
 T2 encoding mode. More...
 
typedef struct opj_stepsize opj_stepsize_t
 Quantization stepsize. More...
 
typedef struct opj_tccp opj_tccp_t
 Tile-component coding parameters. More...
 
typedef struct opj_mct_data opj_mct_data_t
 FIXME DOC. More...
 
typedef struct opj_simple_mcc_decorrelation_data opj_simple_mcc_decorrelation_data_t
 FIXME DOC. More...
 
typedef struct opj_ppx_struct opj_ppx
 
typedef struct opj_tcp opj_tcp_t
 Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header) More...
 
typedef struct opj_encoding_param opj_encoding_param_t
 
typedef struct opj_decoding_param opj_decoding_param_t
 
typedef struct opj_cp opj_cp_t
 Coding parameters. More...
 
typedef struct opj_j2k_dec opj_j2k_dec_t
 
typedef struct opj_j2k_enc opj_j2k_enc_t
 
typedef struct opj_j2k opj_j2k_t
 JPEG-2000 codestream reader/writer. More...
 

Enumerations

enum  J2K_STATUS {
  J2K_STATE_NONE = 0x0000, J2K_STATE_MHSOC = 0x0001, J2K_STATE_MHSIZ = 0x0002, J2K_STATE_MH = 0x0004,
  J2K_STATE_TPHSOT = 0x0008, J2K_STATE_TPH = 0x0010, J2K_STATE_MT = 0x0020, J2K_STATE_NEOC = 0x0040,
  J2K_STATE_DATA = 0x0080, J2K_STATE_EOC = 0x0100, J2K_STATE_ERR = 0x8000
}
 Values that specify the status of the decoding process when decoding the main header. More...
 
enum  MCT_ELEMENT_TYPE { MCT_TYPE_INT16 = 0, MCT_TYPE_INT32 = 1, MCT_TYPE_FLOAT = 2, MCT_TYPE_DOUBLE = 3 }
 Type of elements storing in the MCT data. More...
 
enum  MCT_ARRAY_TYPE { MCT_TYPE_DEPENDENCY = 0, MCT_TYPE_DECORRELATION = 1, MCT_TYPE_OFFSET = 2 }
 Type of MCT array. More...
 
enum  T2_MODE { THRESH_CALC = 0, FINAL_PASS = 1 }
 T2 encoding mode. More...
 

Functions

Exported functions
void opj_j2k_setup_decoder (opj_j2k_t *j2k, opj_dparameters_t *parameters)
 Setup the decoder decoding parameters using user parameters. More...
 
void opj_j2k_decoder_set_strict_mode (opj_j2k_t *j2k, OPJ_BOOL strict)
 
OPJ_BOOL opj_j2k_set_threads (opj_j2k_t *j2k, OPJ_UINT32 num_threads)
 
opj_j2k_topj_j2k_create_compress (void)
 Creates a J2K compression structure. More...
 
OPJ_BOOL opj_j2k_setup_encoder (opj_j2k_t *p_j2k, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
 
const char * opj_j2k_convert_progression_order (OPJ_PROG_ORDER prg_order)
 Converts an enum type progression order to string type. More...
 
OPJ_BOOL opj_j2k_end_decompress (opj_j2k_t *j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Ends the decompression procedures and possibiliy add data to be read after the codestream. More...
 
OPJ_BOOL opj_j2k_read_header (opj_stream_private_t *p_stream, opj_j2k_t *p_j2k, opj_image_t **p_image, opj_event_mgr_t *p_manager)
 Reads a jpeg2000 codestream header structure. More...
 
void opj_j2k_destroy (opj_j2k_t *p_j2k)
 Destroys a jpeg2000 codec. More...
 
void j2k_destroy_cstr_index (opj_codestream_index_t *p_cstr_ind)
 Destroys a codestream index structure. More...
 
OPJ_BOOL opj_j2k_decode_tile (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Decode tile data. More...
 
OPJ_BOOL opj_j2k_read_tile_header (opj_j2k_t *p_j2k, 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_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Reads a tile header. More...
 
OPJ_BOOL opj_j2k_set_decoded_components (opj_j2k_t *p_j2k, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
 Sets the indices of the components to decode. More...
 
OPJ_BOOL opj_j2k_set_decode_area (opj_j2k_t *p_j2k, 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, opj_event_mgr_t *p_manager)
 Sets the given area to be decoded. More...
 
opj_j2k_topj_j2k_create_decompress (void)
 Creates a J2K decompression structure. More...
 
void j2k_dump (opj_j2k_t *p_j2k, OPJ_INT32 flag, FILE *out_stream)
 Dump some elements from the J2K decompression structure . More...
 
void j2k_dump_image_header (opj_image_t *image, OPJ_BOOL dev_dump_flag, FILE *out_stream)
 Dump an image header structure. More...
 
void j2k_dump_image_comp_header (opj_image_comp_t *comp, OPJ_BOOL dev_dump_flag, FILE *out_stream)
 Dump a component image header structure. More...
 
opj_codestream_info_v2_tj2k_get_cstr_info (opj_j2k_t *p_j2k)
 Get the codestream info from a JPEG2000 codec. More...
 
opj_codestream_index_tj2k_get_cstr_index (opj_j2k_t *p_j2k)
 Get the codestream index from a JPEG2000 codec. More...
 
OPJ_BOOL opj_j2k_decode (opj_j2k_t *j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
 Decode an image from a JPEG-2000 codestream. More...
 
OPJ_BOOL opj_j2k_get_tile (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
 
OPJ_BOOL opj_j2k_set_decoded_resolution_factor (opj_j2k_t *p_j2k, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
 
OPJ_BOOL opj_j2k_encoder_set_extra_options (opj_j2k_t *p_j2k, const char *const *p_options, opj_event_mgr_t *p_manager)
 Specify extra options for the encoder. More...
 
OPJ_BOOL opj_j2k_write_tile (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes a tile. More...
 
OPJ_BOOL opj_j2k_encode (opj_j2k_t *p_j2k, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
 Encodes an image into a JPEG-2000 codestream. More...
 
OPJ_BOOL opj_j2k_start_compress (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
 Starts a compression scheme, i.e. More...
 
OPJ_BOOL opj_j2k_end_compress (opj_j2k_t *p_j2k, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
 Ends the compression procedures and possibiliy add data to be read after the codestream. More...
 
OPJ_BOOL opj_j2k_setup_mct_encoding (opj_tcp_t *p_tcp, opj_image_t *p_image)
 

Detailed Description

The JPEG-2000 Codestream Reader/Writer (J2K)

The functions in J2K.C have for goal to read/write the several parts of the codestream: markers and data.

Macro Definition Documentation

◆ J2K_CCP_CBLKSTY_HT

#define J2K_CCP_CBLKSTY_HT   0x40

(high throughput) HT codeblocks

◆ J2K_CCP_CBLKSTY_HTMIXED

#define J2K_CCP_CBLKSTY_HTMIXED   0x80

MIXED mode HT codeblocks.

◆ J2K_CCP_CBLKSTY_LAZY

#define J2K_CCP_CBLKSTY_LAZY   0x01

Selective arithmetic coding bypass.

◆ J2K_CCP_CBLKSTY_PTERM

#define J2K_CCP_CBLKSTY_PTERM   0x10

Predictable termination.

◆ J2K_CCP_CBLKSTY_RESET

#define J2K_CCP_CBLKSTY_RESET   0x02

Reset context probabilities on coding pass boundaries.

◆ J2K_CCP_CBLKSTY_SEGSYM

#define J2K_CCP_CBLKSTY_SEGSYM   0x20

Segmentation symbols are used.

◆ J2K_CCP_CBLKSTY_TERMALL

#define J2K_CCP_CBLKSTY_TERMALL   0x04

Termination on each coding pass.

◆ J2K_CCP_CBLKSTY_VSC

#define J2K_CCP_CBLKSTY_VSC   0x08

Vertically stripe causal context.

◆ J2K_CCP_CSTY_PRT

#define J2K_CCP_CSTY_PRT   0x01

◆ J2K_CCP_QNTSTY_NOQNT

#define J2K_CCP_QNTSTY_NOQNT   0

◆ J2K_CCP_QNTSTY_SEQNT

#define J2K_CCP_QNTSTY_SEQNT   2

◆ J2K_CCP_QNTSTY_SIQNT

#define J2K_CCP_QNTSTY_SIQNT   1

◆ J2K_CP_CSTY_EPH

#define J2K_CP_CSTY_EPH   0x04

◆ J2K_CP_CSTY_PRT

#define J2K_CP_CSTY_PRT   0x01

◆ J2K_CP_CSTY_SOP

#define J2K_CP_CSTY_SOP   0x02

◆ J2K_MAX_POCS

#define J2K_MAX_POCS   32

Maximum number of POCs.

◆ J2K_MS_CAP

#define J2K_MS_CAP   0xff50

CAP marker value.

◆ J2K_MS_CBD

#define J2K_MS_CBD   0xff78

CBD marker value.

◆ J2K_MS_COC

#define J2K_MS_COC   0xff53

COC marker value.

◆ J2K_MS_COD

#define J2K_MS_COD   0xff52

COD marker value.

◆ J2K_MS_COM

#define J2K_MS_COM   0xff64

COM marker value.

◆ J2K_MS_CPF

#define J2K_MS_CPF   0xff59

CPF marker value.

◆ J2K_MS_CRG

#define J2K_MS_CRG   0xff63

CRG marker value.

◆ J2K_MS_EOC

#define J2K_MS_EOC   0xffd9

EOC marker value.

◆ J2K_MS_EPB

#define J2K_MS_EPB   0xff66

EPB marker value (Part 11: JPEG 2000 for Wireless)

◆ J2K_MS_EPC

#define J2K_MS_EPC   0xff68

EPC marker value (Part 11: JPEG 2000 for Wireless)

◆ J2K_MS_EPH

#define J2K_MS_EPH   0xff92

EPH marker value.

◆ J2K_MS_ESD

#define J2K_MS_ESD   0xff67

ESD marker value (Part 11: JPEG 2000 for Wireless)

◆ J2K_MS_INSEC

#define J2K_MS_INSEC   0xff94

INSEC marker value (Part 8: Secure JPEG 2000)

◆ J2K_MS_MCC

#define J2K_MS_MCC   0xff75

MCC marker value.

◆ J2K_MS_MCO

#define J2K_MS_MCO   0xff77

MCO marker value.

◆ J2K_MS_MCT

#define J2K_MS_MCT   0xff74

MCT marker value.

◆ J2K_MS_PLM

#define J2K_MS_PLM   0xff57

PLM marker value.

◆ J2K_MS_PLT

#define J2K_MS_PLT   0xff58

PLT marker value.

◆ J2K_MS_POC

#define J2K_MS_POC   0xff5f

POC marker value.

◆ J2K_MS_PPM

#define J2K_MS_PPM   0xff60

PPM marker value.

◆ J2K_MS_PPT

#define J2K_MS_PPT   0xff61

PPT marker value.

◆ J2K_MS_QCC

#define J2K_MS_QCC   0xff5d

QCC marker value.

◆ J2K_MS_QCD

#define J2K_MS_QCD   0xff5c

QCD marker value.

◆ J2K_MS_RED

#define J2K_MS_RED   0xff69

RED marker value (Part 11: JPEG 2000 for Wireless)

◆ J2K_MS_RGN

#define J2K_MS_RGN   0xff5e

RGN marker value.

◆ J2K_MS_SEC

#define J2K_MS_SEC   0xff65

SEC marker value (Part 8: Secure JPEG 2000)

◆ J2K_MS_SIZ

#define J2K_MS_SIZ   0xff51

SIZ marker value.

◆ J2K_MS_SOC

#define J2K_MS_SOC   0xff4f

SOC marker value.

◆ J2K_MS_SOD

#define J2K_MS_SOD   0xff93

SOD marker value.

◆ J2K_MS_SOP

#define J2K_MS_SOP   0xff91

SOP marker value.

◆ J2K_MS_SOT

#define J2K_MS_SOT   0xff90

SOT marker value.

◆ J2K_MS_TLM

#define J2K_MS_TLM   0xff55

TLM marker value.

◆ J2K_MS_UNK

#define J2K_MS_UNK   0

UNKNOWN marker value.

Typedef Documentation

◆ J2K_MCT_ARRAY_TYPE

Type of MCT array.

◆ J2K_MCT_ELEMENT_TYPE

Type of elements storing in the MCT data.

◆ J2K_STATUS

typedef enum J2K_STATUS J2K_STATUS

Values that specify the status of the decoding process when decoding the main header.

These values may be combined with a | operator.

◆ J2K_T2_MODE

typedef enum T2_MODE J2K_T2_MODE

T2 encoding mode.

◆ opj_cp_t

typedef struct opj_cp opj_cp_t

Coding parameters.

◆ opj_decoding_param_t

◆ opj_encoding_param_t

◆ opj_j2k_dec_t

typedef struct opj_j2k_dec opj_j2k_dec_t

◆ opj_j2k_enc_t

typedef struct opj_j2k_enc opj_j2k_enc_t

◆ opj_j2k_t

typedef struct opj_j2k opj_j2k_t

JPEG-2000 codestream reader/writer.

◆ opj_mct_data_t

typedef struct opj_mct_data opj_mct_data_t

FIXME DOC.

◆ opj_ppx

typedef struct opj_ppx_struct opj_ppx

◆ opj_simple_mcc_decorrelation_data_t

FIXME DOC.

◆ opj_stepsize_t

typedef struct opj_stepsize opj_stepsize_t

Quantization stepsize.

◆ opj_tccp_t

typedef struct opj_tccp opj_tccp_t

Tile-component coding parameters.

◆ opj_tcp_t

typedef struct opj_tcp opj_tcp_t

Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header)

Enumeration Type Documentation

◆ J2K_STATUS

enum J2K_STATUS

Values that specify the status of the decoding process when decoding the main header.

These values may be combined with a | operator.

Enumerator
J2K_STATE_NONE 

a SOC marker is expected

J2K_STATE_MHSOC 

a SOC marker is expected

J2K_STATE_MHSIZ 

a SIZ marker is expected

J2K_STATE_MH 

the decoding process is in the main header

J2K_STATE_TPHSOT 

the decoding process is in a tile part header and expects a SOT marker

J2K_STATE_TPH 

the decoding process is in a tile part header

J2K_STATE_MT 

the EOC marker has just been read

J2K_STATE_NEOC 

the decoding process must not expect a EOC marker because the codestream is truncated

J2K_STATE_DATA 

a tile header has been successfully read and codestream is expected

J2K_STATE_EOC 

the decoding process has encountered the EOC marker

J2K_STATE_ERR 

the decoding process has encountered an error (FIXME warning V1 = 0x0080)

◆ MCT_ARRAY_TYPE

Type of MCT array.

Enumerator
MCT_TYPE_DEPENDENCY 
MCT_TYPE_DECORRELATION 
MCT_TYPE_OFFSET 

◆ MCT_ELEMENT_TYPE

Type of elements storing in the MCT data.

Enumerator
MCT_TYPE_INT16 
MCT_TYPE_INT32 

MCT data is stored as signed shorts.

MCT_TYPE_FLOAT 

MCT data is stored as signed integers.

MCT_TYPE_DOUBLE 

MCT data is stored as floats.

◆ T2_MODE

enum T2_MODE

T2 encoding mode.

Enumerator
THRESH_CALC 
FINAL_PASS 

Function called in Rate allocation process.

Function Documentation

◆ j2k_destroy_cstr_index()

void j2k_destroy_cstr_index ( opj_codestream_index_t p_cstr_ind)

Destroys a codestream index structure.

Parameters
p_cstr_indthe codestream index parameter to destroy.

References opj_tile_index::marker, opj_codestream_index::marker, opj_codestream_index::nb_of_tiles, opj_free(), opj_tile_index::packet_index, opj_codestream_index::tile_index, and opj_tile_index::tp_index.

Referenced by opj_destroy_cstr_index(), and opj_j2k_destroy().

◆ j2k_dump()

void j2k_dump ( opj_j2k_t p_j2k,
OPJ_INT32  flag,
FILE *  out_stream 
)

Dump some elements from the J2K decompression structure .

Parameters
p_j2kthe jpeg2000 codec.
flagflag to describe what elements are dump.
out_streamoutput stream where dump the elements.

References j2k_dump_image_header(), opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, OPJ_IMG_INFO, opj_j2k_dump_MH_index(), opj_j2k_dump_MH_info(), opj_j2k_dump_tile_info(), OPJ_J2K_MH_IND, OPJ_J2K_MH_INFO, OPJ_J2K_TCH_INFO, OPJ_J2K_TH_IND, OPJ_J2K_TH_INFO, OPJ_JP2_IND, OPJ_JP2_INFO, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by jp2_dump(), and opj_create_decompress().

◆ j2k_dump_image_comp_header()

void j2k_dump_image_comp_header ( opj_image_comp_t comp,
OPJ_BOOL  dev_dump_flag,
FILE *  out_stream 
)

Dump a component image header structure.

Parameters
compthe component image header to dump.
dev_dump_flagflag to describe if we are in the case of this function is use outside j2k_dump function
out_streamoutput stream where dump the elements.

References opj_image_comp::dx, opj_image_comp::dy, opj_image_comp::prec, and opj_image_comp::sgnd.

Referenced by j2k_dump_image_header().

◆ j2k_dump_image_header()

void j2k_dump_image_header ( opj_image_t image,
OPJ_BOOL  dev_dump_flag,
FILE *  out_stream 
)

Dump an image header structure.

Parameters
imagethe image header to dump.
dev_dump_flagflag to describe if we are in the case of this function is use outside j2k_dump function
out_streamoutput stream where dump the elements.

References opj_image::comps, j2k_dump_image_comp_header(), opj_image::numcomps, opj_image::x0, opj_image::x1, opj_image::y0, and opj_image::y1.

Referenced by j2k_dump().

◆ j2k_get_cstr_index()

opj_codestream_index_t* j2k_get_cstr_index ( opj_j2k_t p_j2k)

◆ j2k_get_cstr_info()

opj_codestream_info_v2_t* j2k_get_cstr_info ( opj_j2k_t p_j2k)

Get the codestream info from a JPEG2000 codec.

Parameters
p_j2kthe component image header to dump.
Returns
the codestream information extract from the jpg2000 codec

References opj_tccp::cblkh, opj_tccp_info::cblkh, opj_tccp::cblksty, opj_tccp_info::cblksty, opj_tccp::cblkw, opj_tccp_info::cblkw, opj_tccp::csty, opj_tcp::csty, opj_tccp_info::csty, opj_tile_v2_info::csty, opj_stepsize::expn, J2K_CCP_QNTSTY_SIQNT, opj_j2k::m_cp, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_codestream_info_v2::m_default_tile_info, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_stepsize::mant, opj_tcp::mct, opj_tile_v2_info::mct, opj_codestream_info_v2::nbcomps, opj_image::numcomps, opj_tccp::numgbits, opj_tccp_info::numgbits, opj_tcp::numlayers, opj_tile_v2_info::numlayers, opj_tccp::numresolutions, opj_tccp_info::numresolutions, opj_calloc(), opj_destroy_cstr_info(), OPJ_J2K_MAXBANDS, OPJ_J2K_MAXRLVLS, opj_tccp::prch, opj_tccp_info::prch, opj_tccp::prcw, opj_tccp_info::prcw, opj_tcp::prg, opj_tile_v2_info::prg, opj_tccp::qmfbid, opj_tccp_info::qmfbid, opj_tccp::qntsty, opj_tccp_info::qntsty, opj_tccp::roishift, opj_tccp_info::roishift, opj_tccp::stepsizes, opj_tccp_info::stepsizes_expn, opj_tccp_info::stepsizes_mant, opj_tile_v2_info::tccp_info, opj_tcp::tccps, opj_cp::tdx, opj_codestream_info_v2::tdx, opj_cp::tdy, opj_codestream_info_v2::tdy, opj_cp::th, opj_codestream_info_v2::th, opj_codestream_info_v2::tile_info, opj_cp::tw, opj_codestream_info_v2::tw, opj_cp::tx0, opj_codestream_info_v2::tx0, opj_cp::ty0, and opj_codestream_info_v2::ty0.

Referenced by jp2_get_cstr_info(), and opj_create_decompress().

◆ opj_j2k_convert_progression_order()

const char* opj_j2k_convert_progression_order ( OPJ_PROG_ORDER  prg_order)

Converts an enum type progression order to string type.

References j2k_prog_order::enum_prog, j2k_prog_order_list, and j2k_prog_order::str_prog.

Referenced by opj_j2k_get_num_tp(), and opj_pi_create_encode().

◆ opj_j2k_create_compress()

opj_j2k_t* opj_j2k_create_compress ( void  )

◆ opj_j2k_create_decompress()

opj_j2k_t* opj_j2k_create_decompress ( void  )

◆ opj_j2k_decode()

OPJ_BOOL opj_j2k_decode ( opj_j2k_t j2k,
opj_stream_private_t p_stream,
opj_image_t p_image,
opj_event_mgr_t p_manager 
)

◆ opj_j2k_decode_tile()

OPJ_BOOL opj_j2k_decode_tile ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)

◆ opj_j2k_decoder_set_strict_mode()

void opj_j2k_decoder_set_strict_mode ( opj_j2k_t j2k,
OPJ_BOOL  strict 
)

◆ opj_j2k_destroy()

void opj_j2k_destroy ( opj_j2k_t p_j2k)

◆ opj_j2k_encode()

OPJ_BOOL opj_j2k_encode ( opj_j2k_t p_j2k,
opj_stream_private_t cio,
opj_event_mgr_t p_manager 
)

◆ opj_j2k_encoder_set_extra_options()

OPJ_BOOL opj_j2k_encoder_set_extra_options ( opj_j2k_t p_j2k,
const char *const *  p_options,
opj_event_mgr_t p_manager 
)

Specify extra options for the encoder.

Parameters
p_j2kthe jpeg2000 codec.
p_optionsoptions
p_managerthe user event manager
See also
opj_encoder_set_extra_options() for more details.

References EVT_ERROR, opj_j2k::m_cp, opj_j2k::m_encoder, opj_j2k_enc::m_nb_comps, opj_j2k_enc::m_PLT, opj_j2k::m_specific_param, opj_j2k_enc::m_TLM, opj_tccp::numgbits, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, tcp, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_create_compress(), and opj_jp2_encoder_set_extra_options().

◆ opj_j2k_end_compress()

OPJ_BOOL opj_j2k_end_compress ( opj_j2k_t p_j2k,
opj_stream_private_t cio,
opj_event_mgr_t p_manager 
)

Ends the compression procedures and possibiliy add data to be read after the codestream.

References opj_j2k::m_procedure_list, OPJ_FALSE, opj_j2k_exec(), opj_j2k_setup_end_compress(), and OPJ_TRUE.

Referenced by opj_create_compress(), and opj_jp2_end_compress().

◆ opj_j2k_end_decompress()

OPJ_BOOL opj_j2k_end_decompress ( opj_j2k_t j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)

Ends the decompression procedures and possibiliy add data to be read after the codestream.

References OPJ_TRUE.

Referenced by opj_create_decompress(), and opj_jp2_end_decompress().

◆ opj_j2k_get_tile()

OPJ_BOOL opj_j2k_get_tile ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_image_t p_image,
opj_event_mgr_t p_manager,
OPJ_UINT32  tile_index 
)

◆ opj_j2k_read_header()

OPJ_BOOL opj_j2k_read_header ( opj_stream_private_t p_stream,
opj_j2k_t p_j2k,
opj_image_t **  p_image,
opj_event_mgr_t p_manager 
)

Reads a jpeg2000 codestream header structure.

Parameters
p_streamthe stream to read data from.
p_j2kthe jpeg2000 codec.
p_imageFIXME DOC
p_managerthe user event manager.
Returns
true if the box is valid.

References opj_j2k::m_private_image, opj_j2k::m_procedure_list, opj_j2k::m_validation_list, opj_copy_image_header(), OPJ_FALSE, opj_image_create0(), opj_image_destroy(), opj_j2k_allocate_tile_element_cstr_index(), opj_j2k_exec(), opj_j2k_setup_decoding_validation(), opj_j2k_setup_header_reading(), and OPJ_TRUE.

Referenced by opj_create_decompress(), and opj_jp2_read_header().

◆ opj_j2k_read_tile_header()

OPJ_BOOL opj_j2k_read_tile_header ( opj_j2k_t p_j2k,
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_go_on,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)

Reads a tile header.

Parameters
p_j2kthe jpeg2000 codec.
p_tile_indexFIXME DOC
p_data_sizeFIXME DOC
p_tile_x0FIXME DOC
p_tile_y0FIXME DOC
p_tile_x1FIXME DOC
p_tile_y1FIXME DOC
p_nb_compsFIXME DOC
p_go_onFIXME DOC
p_streamthe stream to write data to.
p_managerthe user event manager.

References opj_j2k::cstr_index, EVT_ERROR, EVT_INFO, EVT_WARNING, opj_dec_memory_marker_handler::handler, opj_dec_memory_marker_handler::id, J2K_MS_EOC, J2K_MS_SOD, J2K_MS_SOT, J2K_STATE_DATA, J2K_STATE_EOC, J2K_STATE_NEOC, J2K_STATE_TPH, J2K_STATE_TPHSOT, opj_j2k_dec::m_can_decode, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_tcp::m_current_tile_part_number, opj_tcp::m_data, opj_j2k::m_decoder, opj_j2k_dec::m_header_data, opj_j2k_dec::m_header_data_size, opj_j2k_dec::m_last_sot_read_pos, opj_tcp::m_nb_tile_parts, opj_j2k_dec::m_nb_tile_parts_correction, opj_j2k_dec::m_nb_tile_parts_correction_checked, opj_j2k_dec::m_skip_data, opj_j2k_dec::m_sot_length, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_j2k::m_tcd, opj_tcd_tile::numcomps, opj_event_msg(), OPJ_FALSE, opj_free(), opj_j2k_add_tlmarker(), opj_j2k_get_marker_handler(), opj_j2k_merge_ppt(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_read_sod(), opj_read_bytes, opj_realloc(), opj_stream_get_number_byte_left(), opj_stream_read_data(), opj_stream_skip(), opj_stream_tell(), opj_tcd_get_decoded_tile_size(), opj_tcd_init_decode_tile(), OPJ_TRUE, opj_dec_memory_marker_handler::states, opj_tcd::tcd_image, opj_cp::tcps, opj_cp::th, opj_tcd_image::tiles, opj_cp::tw, opj_tcd_tile::x0, opj_tcd_tile::x1, opj_tcd_tile::y0, and opj_tcd_tile::y1.

Referenced by opj_create_decompress(), opj_j2k_decode_one_tile(), opj_j2k_decode_tiles(), and opj_jp2_read_tile_header().

◆ opj_j2k_set_decode_area()

OPJ_BOOL opj_j2k_set_decode_area ( opj_j2k_t p_j2k,
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,
opj_event_mgr_t p_manager 
)

Sets the given area to be decoded.

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

Parameters
p_j2kthe jpeg2000 codec.
p_imageFIXME DOC
p_start_xthe left position of the rectangle to decode (in image coordinates).
p_start_ythe up position of the rectangle to decode (in image coordinates).
p_end_xthe right position of the rectangle to decode (in image coordinates).
p_end_ythe bottom position of the rectangle to decode (in image coordinates).
p_managerthe user event manager
Returns
true if the area could be set.

References opj_image::comps, EVT_ERROR, EVT_INFO, EVT_WARNING, opj_image_comp::factor, J2K_STATE_TPHSOT, opj_j2k::m_cp, opj_tcp::m_data, opj_cp::m_dec, opj_j2k::m_decoder, opj_j2k_dec::m_discard_tiles, opj_j2k_dec::m_end_tile_x, opj_j2k_dec::m_end_tile_y, opj_j2k::m_private_image, opj_decoding_param::m_reduce, opj_cp::m_specific_param, opj_j2k::m_specific_param, opj_j2k_dec::m_start_tile_x, opj_j2k_dec::m_start_tile_y, opj_j2k_dec::m_state, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_int_ceildiv(), opj_j2k_update_image_dimensions(), opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, opj_cp::th, opj_cp::tw, opj_cp::tx0, opj_cp::ty0, opj_image::x0, opj_image::x1, opj_image::y0, and opj_image::y1.

Referenced by opj_create_decompress(), and opj_jp2_set_decode_area().

◆ opj_j2k_set_decoded_components()

OPJ_BOOL opj_j2k_set_decoded_components ( opj_j2k_t p_j2k,
OPJ_UINT32  numcomps,
const OPJ_UINT32 comps_indices,
opj_event_mgr_t p_manager 
)

Sets the indices of the components to decode.

Parameters
p_j2kthe jpeg2000 codec.
numcompsNumber of components to decode.
comps_indicesArray of num_compts indices (numbering starting at 0) corresponding to the components to decode.
p_managerEvent manager
Returns
OPJ_TRUE in case of success.

References EVT_ERROR, opj_j2k_dec::m_comps_indices_to_decode, opj_j2k::m_decoder, opj_j2k_dec::m_numcomps_to_decode, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_image::numcomps, opj_calloc(), opj_event_msg(), OPJ_FALSE, opj_free(), opj_malloc(), and OPJ_TRUE.

Referenced by opj_create_decompress(), and opj_jp2_set_decoded_components().

◆ opj_j2k_set_decoded_resolution_factor()

OPJ_BOOL opj_j2k_set_decoded_resolution_factor ( opj_j2k_t p_j2k,
OPJ_UINT32  res_factor,
opj_event_mgr_t p_manager 
)

◆ opj_j2k_set_threads()

OPJ_BOOL opj_j2k_set_threads ( opj_j2k_t j2k,
OPJ_UINT32  num_threads 
)

◆ opj_j2k_setup_decoder()

void opj_j2k_setup_decoder ( opj_j2k_t j2k,
opj_dparameters_t parameters 
)

◆ opj_j2k_setup_encoder()

OPJ_BOOL opj_j2k_setup_encoder ( opj_j2k_t p_j2k,
opj_cparameters_t parameters,
opj_image_t image,
opj_event_mgr_t p_manager 
)

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cp::comment, opj_poc::compno0, opj_poc::compno1, opj_image::comps, opj_cparameters::cp_cinema, opj_cparameters::cp_comment, opj_cparameters::cp_disto_alloc, opj_cparameters::cp_fixed_alloc, opj_cparameters::cp_fixed_quality, opj_cparameters::cp_matrice, opj_cparameters::cp_rsiz, opj_cparameters::cp_tdx, opj_cparameters::cp_tdy, opj_cparameters::cp_tx0, opj_cparameters::cp_ty0, opj_tccp::csty, opj_cparameters::csty, opj_image_comp::dx, opj_image_comp::dy, opj_cp::epb_on, opj_cp::epc_on, opj_cp::esd_on, EVT_ERROR, EVT_WARNING, opj_image_comp::h, opj_cp::hprot_MH, opj_cp::hprot_TPH, opj_cp::hprot_TPH_tileno, opj_cp::info_on, opj_cparameters::irreversible, J2K_CCP_CSTY_PRT, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SEQNT, 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_poc::layno1, opj_j2k::m_cp, opj_tccp::m_dc_level_shift, opj_encoding_param::m_disto_alloc, opj_cp::m_enc, opj_j2k::m_encoder, opj_encoding_param::m_fixed_alloc, opj_encoding_param::m_fixed_quality, opj_encoding_param::m_matrice, opj_encoding_param::m_max_comp_size, opj_j2k_enc::m_nb_comps, opj_cp::m_specific_param, opj_j2k::m_specific_param, opj_j2k_enc::m_TLM, opj_encoding_param::m_tp_flag, opj_encoding_param::m_tp_on, opj_cparameters::max_comp_size, opj_cparameters::max_cs_size, opj_cparameters::mct_data, opj_cparameters::mode, opj_image::numcomps, opj_tccp::numgbits, opj_cparameters::numpocs, opj_cparameters::numresolution, opj_tccp::numresolutions, opj_calculate_norms(), opj_calloc(), OPJ_CINEMA2K, OPJ_CINEMA2K_24, OPJ_CINEMA2K_48, OPJ_CINEMA4K, OPJ_CINEMA4K_24, OPJ_CINEMA_24_COMP, OPJ_CINEMA_24_CS, OPJ_CINEMA_48_COMP, OPJ_CINEMA_48_CS, opj_dwt_calc_explicit_stepsizes(), opj_event_msg(), OPJ_EXTENSION_MCT, OPJ_EXTENSION_NONE, OPJ_FALSE, opj_free(), opj_int_ceildiv(), opj_int_floorlog2(), OPJ_IS_BROADCAST, OPJ_IS_CINEMA, OPJ_IS_IMF, OPJ_IS_PART2, OPJ_IS_STORAGE, opj_j2k_check_poc_val(), opj_j2k_is_cinema_compliant(), opj_j2k_is_imf_compliant(), OPJ_J2K_MAXRLVLS, opj_j2k_set_cinema_parameters(), opj_j2k_set_imf_parameters(), opj_j2k_setup_mct_encoding(), opj_malloc(), opj_matrix_inversion_f(), OPJ_MCT, OPJ_OFF, OPJ_PROFILE_CINEMA_2K, OPJ_PROFILE_CINEMA_4K, OPJ_PROFILE_CINEMA_S2K, OPJ_PROFILE_CINEMA_S4K, OPJ_PROFILE_NONE, OPJ_PROFILE_PART2, OPJ_STD_RSIZ, OPJ_TRUE, opj_uint_min(), opj_version(), opj_cparameters::POC, opj_cp::pprot, opj_cp::pprot_packno, opj_cp::pprot_tileno, opj_tccp::prch, opj_cparameters::prch_init, opj_tccp::prcw, opj_cparameters::prcw_init, opj_image_comp::prec, opj_poc::prg1, opj_cparameters::prog_order, opj_tccp::qmfbid, opj_tccp::qntsty, opj_cp::red_on, opj_cparameters::res_spec, opj_poc::resno0, opj_poc::resno1, opj_cparameters::roi_compno, opj_cparameters::roi_shift, opj_tccp::roishift, opj_cp::rsiz, opj_cparameters::rsiz, opj_cp::sens_addr, opj_cp::sens_MH, opj_cp::sens_range, opj_cp::sens_size, opj_cp::sens_TPH, opj_cp::sens_TPH_tileno, opj_image_comp::sgnd, tcp, opj_cparameters::tcp_distoratio, opj_cparameters::tcp_mct, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, opj_cp::th, opj_poc::tile, opj_cparameters::tile_size_on, opj_cparameters::tp_flag, opj_cparameters::tp_on, opj_cp::tw, opj_cp::tx0, opj_cp::ty0, opj_image_comp::w, opj_image::x1, and opj_image::y1.

Referenced by opj_create_compress(), and opj_jp2_setup_encoder().

◆ opj_j2k_setup_mct_encoding()

OPJ_BOOL opj_j2k_setup_mct_encoding ( opj_tcp_t p_tcp,
opj_image_t p_image 
)

◆ opj_j2k_start_compress()

OPJ_BOOL opj_j2k_start_compress ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_image_t p_image,
opj_event_mgr_t p_manager 
)

Starts a compression scheme, i.e.

validates the codec parameters, writes the header.

Parameters
p_j2kthe jpeg2000 codec.
p_streamthe stream object.
p_imageFIXME DOC
p_managerthe user event manager.
Returns
true if the codec is valid.

References opj_image::comps, opj_image_comp::data, EVT_ERROR, opj_j2k::m_private_image, opj_j2k::m_procedure_list, opj_j2k::m_validation_list, opj_image::numcomps, opj_copy_image_header(), opj_event_msg(), OPJ_FALSE, opj_image_create0(), opj_j2k_exec(), opj_j2k_setup_encoding_validation(), opj_j2k_setup_header_writing(), and OPJ_TRUE.

Referenced by opj_create_compress(), and opj_jp2_start_compress().

◆ opj_j2k_write_tile()

OPJ_BOOL opj_j2k_write_tile ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)

Writes a tile.

Parameters
p_j2kthe jpeg2000 codec.
p_tile_indexFIXME DOC
p_dataFIXME DOC
p_data_sizeFIXME DOC
p_streamthe stream to write data to.
p_managerthe user event manager.

References opj_tcd_tile::comps, EVT_ERROR, opj_tcd::image, opj_j2k::m_tcd, opj_image::numcomps, opj_alloc_tile_component_data(), opj_event_msg(), OPJ_FALSE, opj_j2k_post_write_tile(), opj_j2k_pre_write_tile(), opj_tcd_copy_tile_data(), OPJ_TRUE, opj_tcd::tcd_image, and opj_tcd_image::tiles.

Referenced by opj_create_compress(), and opj_jp2_write_tile().