Grok  7.6.0
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
grk Namespace Reference

Copyright (C) 2016-2020 Grok Image Compression Inc. More...

Namespaces

 t1_ht
 
 t1_part1
 

Data Structures

class  BitIO
 
struct  buf_info
 
struct  BufferedStream
 Byte input-output stream. More...
 
struct  cblk_dec
 
struct  cblk_enc
 
struct  ChunkBuffer
 
struct  CodeStream
 
struct  CodingParams
 Coding parameters. More...
 
class  CorruptJP2BoxException
 
class  CPUArch
 
struct  decodeBlockInfo
 
struct  DecoderState
 
class  DecodeUnknownMarkerAtEndOfTileException
 
struct  DecodingParams
 
class  dwt53
 
class  dwt97
 
class  dwt_utils
 
struct  encodeBlockInfo
 
struct  EncoderState
 
struct  EncodingParams
 
struct  FileFormat
 JPEG 2000 file format reader/writer. More...
 
struct  grk_band
 
struct  grk_buffer
 
struct  grk_buffer_2d
 
struct  grk_cblk
 
struct  grk_cblk_dec
 
struct  grk_cblk_enc
 
union  grk_coeff97
 
struct  grk_dec_memory_marker_handler
 
struct  grk_dwt53
 
struct  grk_dwt97
 
struct  grk_dwt97_info
 
union  grk_dwt_4vec
 
struct  grk_jp2_box
 JP2 Box. More...
 
struct  grk_jp2_buffer
 
struct  grk_jp2_comps
 JP2 component. More...
 
struct  grk_jp2_header_handler
 
struct  grk_jp2_img_header_writer_handler
 
struct  grk_jp2_uuid
 
struct  grk_layer
 
struct  grk_mct_data
 MCT data. More...
 
struct  grk_packet_length_info
 
struct  grk_pass
 
struct  grk_pi_comp
 Packet iterator component. More...
 
struct  grk_pi_resolution
 
struct  grk_plugin_debug_mqc
 
struct  grk_point
 
struct  grk_ppx
 
struct  grk_precinct
 
struct  grk_rectangle
 
struct  grk_resolution
 
struct  grk_seg
 
struct  grk_simple_mcc_decorrelation_data
 MCC decorrelation data. More...
 
struct  grk_stepsize
 Quantization stepsize. More...
 
struct  grk_tile
 
struct  grk_tl_info
 
class  IBitIO
 Bit input/output. More...
 
struct  IBufferedStream
 
struct  logger
 
class  mct
 
struct  minpf_dynamic_library
 
struct  minpf_object_params
 
struct  minpf_platform_services
 
struct  minpf_plugin_api_version
 
struct  minpf_plugin_manager
 
struct  minpf_register_params
 
struct  mqc_state
 
struct  mqcoder
 
struct  PacketIter
 Packet iterator. More...
 
struct  PacketLengthMarkers
 
struct  PacketTracker
 
struct  param_qcd
 
struct  pass_enc
 
struct  plugin_encode_user_callback_info
 
struct  PluginDecodeCallbackInfo
 
class  PluginDecodeUnsupportedException
 
class  PPMMarker
 
class  Profile
 
class  Quantizer
 
class  RateControl
 
class  RateInfo
 
struct  res_buf
 
struct  seg
 
struct  seg_data_chunk
 
class  SIZMarker
 
class  SOTMarker
 
class  sparse_array
 
class  sqrt_energy_gains
 
struct  t1_info
 
class  T1Decoder
 
class  T1Encoder
 
class  T1Factory
 
class  T1Interface
 
class  T2
 
struct  T2Decode
 Tier-2 coding. More...
 
struct  T2Encode
 Tier-2 coding. More...
 
class  TagTree
 Tag tree. More...
 
struct  TagTreeNode
 Tag node. More...
 
class  Tier1
 
struct  TileCodingParams
 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  TileComponent
 
struct  TileComponentBuffer
 
struct  TileComponentCodingParams
 Tile-component coding parameters. More...
 
struct  TileLengthMarkers
 
struct  TileProcessor
 Tile coder/decoder. More...
 
class  TruncatedStreamException
 
class  Wavelet
 
class  WaveletForward
 

Typedefs

typedef bool(* j2k_procedure) (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 
typedef bool(* jp2_procedure) (FileFormat *fileFormat, BufferedStream *)
 
typedef std::vector< grk_tl_infoTL_INFO_VEC
 
typedef std::map< uint8_t, TL_INFO_VEC * > TL_MAP
 
typedef std::vector< uint32_t > PL_INFO_VEC
 
typedef std::map< uint8_t, PL_INFO_VEC * > PL_MAP
 
typedef void(* j2k_mct_function) (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
typedef struct grk::minpf_object_params minpf_object_params
 
typedef struct grk::minpf_plugin_api_version minpf_plugin_api_version
 
typedef void *(* minpf_create_func) (minpf_object_params *)
 
typedef int32_t(* minpf_destroy_func) (void *)
 
typedef struct grk::minpf_register_params minpf_register_params
 
typedef int32_t(* minpf_register_func) (const char *nodeType, const minpf_register_params *params)
 
typedef int32_t(* minpf_invoke_service_func) (const char *serviceName, void *serviceParams)
 
typedef struct grk::minpf_platform_services minpf_platform_services
 
typedef int32_t(* minpf_exit_func) ()
 
typedef minpf_exit_func(* minpf_post_load_func) (const char *pluginPath, const minpf_platform_services *)
 
typedef struct grk::minpf_plugin_manager minpf_plugin_manager
 
typedef uint32_t(* PLUGIN_GET_DEBUG_STATE) (void)
 
typedef void(* PLUGIN_DEBUG_MQC_NEXT_CXD) (grk_plugin_debug_mqc *mqc, uint32_t d)
 
typedef void(* PLUGIN_DEBUG_MQC_NEXT_PLANE) (grk_plugin_debug_mqc *mqc)
 
typedef void(* PLUGIN_ENCODE_USER_CALLBACK) (plugin_encode_user_callback_info *info)
 
typedef bool(* PLUGIN_INIT) (grk_plugin_init_info initInfo)
 
typedef int32_t(* PLUGIN_ENCODE) (grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK callback)
 
typedef int32_t(* PLUGIN_BATCH_ENCODE) (const char *input_dir, const char *output_dir, grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK userCallback)
 
typedef void(* PLUGIN_STOP_BATCH_ENCODE) (void)
 
typedef bool(* PLUGIN_IS_BATCH_COMPLETE) (void)
 
typedef int32_t(* PLUGIN_DECODE_USER_CALLBACK) (PluginDecodeCallbackInfo *info)
 
typedef int32_t(* PLUGIN_DECODE) (grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)
 
typedef int32_t(* PLUGIN_INIT_BATCH_DECODE) (const char *input_dir, const char *output_dir, grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)
 
typedef int32_t(* PLUGIN_BATCH_DECODE) (void)
 
typedef void(* PLUGIN_STOP_BATCH_DECODE) (void)
 
typedef uint32_t grk_flag
 Flags for 4 consecutive rows of a column. More...
 
typedef int32_t grk_handle
 
using grk_pt = grk_point< int64_t >
 
using grk_rect = grk_rectangle< int64_t >
 
using grk_rect_u32 = grk_rectangle< uint32_t >
 
using grk_buf = grk_buffer< uint8_t >
 

Enumerations

enum  J2K_STATUS {
  J2K_DEC_STATE_NONE = 0x0000, J2K_DEC_STATE_MH_SOC = 0x0001, J2K_DEC_STATE_MH_SIZ = 0x0002, J2K_DEC_STATE_MH = 0x0004,
  J2K_DEC_STATE_TPH_SOT = 0x0008, J2K_DEC_STATE_TPH = 0x0010, J2K_DEC_STATE_NO_EOC = 0x0020, J2K_DEC_STATE_DATA = 0x0040,
  J2K_DEC_STATE_EOC = 0x0080, J2K_DEC_STATE_ERR = 0x0100
}
 Values that specify the status of the decoding process when decoding the main header. More...
 
enum  J2K_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  J2K_MCT_ARRAY_TYPE { MCT_TYPE_DEPENDENCY = 0, MCT_TYPE_DECORRELATION = 1, MCT_TYPE_OFFSET = 2 }
 Type of MCT array. More...
 
enum  JP2_STATE {
  JP2_STATE_NONE = 0x0, JP2_STATE_SIGNATURE = 0x1, JP2_STATE_FILE_TYPE = 0x2, JP2_STATE_HEADER = 0x4,
  JP2_STATE_CODESTREAM = 0x8, JP2_STATE_END_CODESTREAM = 0x10, JP2_STATE_UNKNOWN = 0x7fffffff
}
 
enum  JP2_IMG_STATE { JP2_IMG_STATE_NONE = 0x0, JP2_IMG_STATE_UNKNOWN = 0x7fffffff }
 
enum  J2K_T2_MODE { THRESH_CALC = 0, FINAL_PASS = 1 }
 T2 encoding mode. More...
 

Functions

void j2k_dump (CodeStream *codeStream, int32_t flag, FILE *out_stream)
 Dump some elements from the J2K decompression structure . More...
 
void j2k_dump_image_header (grk_image *image, bool dev_dump_flag, FILE *out_stream)
 Dump an image header structure. More...
 
void j2k_dump_image_comp_header (grk_image_comp *comp, bool dev_dump_flag, FILE *out_stream)
 Dump a component image header structure. More...
 
grk_codestream_info_v2j2k_get_cstr_info (CodeStream *codeStream)
 Get the code stream info from a JPEG2000 codec. More...
 
grk_codestream_indexj2k_get_cstr_index (CodeStream *codeStream)
 Get the code stream index from a JPEG2000 codec. More...
 
grk_codestream_indexj2k_create_cstr_index (void)
 
bool j2k_allocate_tile_element_cstr_index (CodeStream *codeStream)
 
void j2k_destroy_cstr_index (grk_codestream_index *p_cstr_ind)
 Destroys a code stream index structure. More...
 
void jp2_dump (FileFormat *fileFormat, int32_t flag, FILE *out_stream)
 Dump some elements from the JP2 decompression structure . More...
 
grk_codestream_info_v2jp2_get_cstr_info (FileFormat *fileFormat)
 Get the code stream info from a JPEG2000 codec. More...
 
grk_codestream_indexjp2_get_cstr_index (FileFormat *fileFormat)
 Get the code stream index from a JPEG2000 codec. More...
 
void j2k_read_int16_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int32_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float32_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float64_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int16_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int32_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float32_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float64_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_int16 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_float64 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
bool j2k_add_mhmarker (grk_codestream_index *cstr_index, uint32_t type, uint64_t pos, uint32_t len)
 Add main header marker information. More...
 
bool j2k_write_soc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the SOC marker (Start Of Codestream) More...
 
bool j2k_read_soc (CodeStream *codeStream, BufferedStream *stream)
 Reads a SOC marker (Start of Codestream) More...
 
bool j2k_write_siz (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the SIZ marker (image and tile size) More...
 
bool j2k_read_siz (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a SIZ marker (image and tile size) More...
 
bool j2k_read_cap (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a CAP marker. More...
 
bool j2k_write_cap (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the CAP marker. More...
 
bool j2k_write_com (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the COM marker (comment) More...
 
bool j2k_read_com (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a COM marker (comments) More...
 
bool j2k_write_cod (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the COD marker (Coding style default) More...
 
bool j2k_read_cod (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a COD marker (Coding Style defaults) More...
 
bool j2k_compare_coc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compares 2 COC markers (Coding style component) More...
 
bool j2k_write_coc (CodeStream *codeStream, uint32_t comp_no, BufferedStream *stream)
 Writes the COC marker (Coding style component) More...
 
bool j2k_read_coc (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a COC marker (Coding Style Component) More...
 
bool j2k_write_qcd (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the QCD marker (quantization default) More...
 
bool j2k_read_qcd (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a QCD marker (Quantization defaults) More...
 
bool j2k_compare_qcc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compare QCC markers (quantization component) More...
 
bool j2k_write_qcc (CodeStream *codeStream, uint16_t tile_index, uint32_t comp_no, BufferedStream *stream)
 Writes the QCC marker (quantization component) More...
 
bool j2k_read_qcc (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a QCC marker (Quantization component) More...
 
uint16_t getPocSize (uint32_t l_nb_comp, uint32_t l_nb_poc)
 
bool j2k_write_poc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the POC marker (Progression Order Change) More...
 
bool j2k_read_poc (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a POC marker (Progression Order Change) More...
 
bool j2k_read_crg (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a CRG marker (Component registration) More...
 
bool j2k_read_tlm (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a TLM marker (Tile Length Marker) More...
 
bool j2k_write_tlm_end (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 End writing the updated tlm. More...
 
bool j2k_write_tlm_begin (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Begin writing the TLM marker (Tile Length Marker) More...
 
bool j2k_read_plm (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a PLM marker (Packet length, main header marker) More...
 
bool j2k_read_plt (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a PLT marker (Packet length, tile-part header) More...
 
bool j2k_read_ppm (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a PPM marker (Packed headers, main header) More...
 
bool j2k_merge_ppm (CodingParams *p_cp)
 Merges all PPM markers read (Packed headers, main header) More...
 
bool j2k_read_ppt (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a PPT marker (Packed packet headers, tile-part header) More...
 
bool j2k_merge_ppt (TileCodingParams *p_tcp)
 Merges all PPT markers read (Packed headers, tile-part header) More...
 
bool j2k_read_sot (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Read SOT (Start of tile part) marker. More...
 
bool j2k_compare_SPCod_SPCoc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compare 2 a SPCod/ SPCoc elements, i.e. More...
 
bool j2k_write_SPCod_SPCoc (CodeStream *codeStream, uint32_t comp_no, BufferedStream *stream)
 Writes a SPCod or SPCoc element, i.e. More...
 
uint32_t j2k_get_SPCod_SPCoc_size (CodeStream *codeStream, uint32_t comp_no)
 Gets the size taken by writing a SPCod or SPCoc for the given tile and component. More...
 
bool j2k_read_SPCod_SPCoc (CodeStream *codeStream, TileProcessor *tileProcessor, uint32_t compno, uint8_t *p_header_data, uint16_t *header_size)
 Reads a SPCod or SPCoc element, i.e. More...
 
uint32_t j2k_get_SQcd_SQcc_size (CodeStream *codeStream, uint32_t comp_no)
 Gets the size taken by writing SQcd or SQcc element, i.e. More...
 
bool j2k_compare_SQcd_SQcc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compares 2 SQcd or SQcc element, i.e. More...
 
bool j2k_write_SQcd_SQcc (CodeStream *codeStream, uint32_t comp_no, BufferedStream *stream)
 Writes a SQcd or SQcc element, i.e. More...
 
void j2k_update_tlm (CodeStream *codeStream, uint16_t tile_index, uint32_t tile_part_size)
 Updates the Tile Length Marker. More...
 
bool j2k_read_SQcd_SQcc (CodeStream *codeStream, TileProcessor *tileProcessor, bool fromQCC, uint32_t compno, uint8_t *p_header_data, uint16_t *header_size)
 Reads a SQcd or SQcc element, i.e. More...
 
bool j2k_write_mct_record (grk_mct_data *p_mct_record, BufferedStream *stream)
 Writes the MCT marker (Multiple Component Transform) More...
 
bool j2k_read_mct (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCT marker (Multiple Component Transform) More...
 
bool j2k_write_mcc_record (grk_simple_mcc_decorrelation_data *p_mcc_record, BufferedStream *stream)
 Writes the MCC marker (Multiple Component Collection) More...
 
bool j2k_read_mcc (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCC marker (Multiple Component Collection) More...
 
bool j2k_write_mco (CodeStream *codeStream, BufferedStream *stream)
 Writes the MCO marker (Multiple component transformation ordering) More...
 
bool j2k_read_mco (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCO marker (Multiple Component Transform Ordering) More...
 
bool j2k_add_mct (TileCodingParams *p_tcp, grk_image *p_image, uint32_t index)
 
bool j2k_write_cbd (CodeStream *codeStream, BufferedStream *stream)
 Writes the CBD marker (Component bit depth definition) More...
 
bool j2k_read_cbd (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a CBD marker (Component bit depth definition) More...
 
bool j2k_write_all_coc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes COC marker for each component. More...
 
bool j2k_write_all_qcc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes QCC marker for each component. More...
 
bool j2k_write_regions (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes regions of interests. More...
 
bool j2k_write_epc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes EPC ???? More...
 
bool j2k_read_sod (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Reads a SOD marker (Start Of Data) More...
 
bool j2k_write_rgn (CodeStream *codeStream, uint16_t tile_no, uint32_t comp_no, uint32_t nb_comps, BufferedStream *stream)
 Writes the RGN marker (Region Of Interest) More...
 
bool j2k_read_rgn (CodeStream *codeStream, TileProcessor *tileProcessor, uint8_t *p_header_data, uint16_t header_size)
 Reads a RGN marker (Region Of Interest) More...
 
bool j2k_write_eoc (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the EOC marker (End of Codestream) More...
 
bool j2k_write_mct_data_group (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)
 Writes the CBD-MCT-MCC-MCO markers (Multi components transform) More...
 
grk_imagegrk_image_create0 (void)
 Create an empty image. More...
 
void grk_image_comp_header_update (grk_image *image, const CodingParams *p_cp)
 Update image components with coding parameters. More...
 
void grk_copy_image_header (const grk_image *p_image_src, grk_image *p_image_dest)
 
bool update_image_dimensions (grk_image *p_image, uint32_t reduce)
 
void transfer_image_data (grk_image *src, grk_image *dest)
 Transfer data from src to dest for each component, and null out src data. More...
 
minpf_dynamic_libraryminpf_load_dynamic_library (const char *path, char *error)
 
bool minpf_unload_dynamic_library (minpf_dynamic_library *library)
 
void * minpf_get_symbol (minpf_dynamic_library *library, const char *symbol)
 
bool minpf_get_full_path (const char *path, void *addr, dynamic_handle_t handle, char *fullPath, size_t fullPathLen)
 
PLUGIN_API minpf_exit_func minpf_init_plugin (const char *pluginPath, const minpf_platform_services *params)
 
minpf_plugin_managerminpf_get_plugin_manager (void)
 
void minpf_cleanup_plugin_manager (void)
 
int32_t minpf_load_from_dir (const char *dir, minpf_invoke_service_func func)
 
int32_t minpf_load_from_path (const char *path, minpf_invoke_service_func func)
 
const char * minpf_get_dynamic_library_extension (void)
 
void decode_synch_plugin_with_host (TileProcessor *tcd)
 
void encode_synch_with_plugin (TileProcessor *tcd, uint32_t compno, uint32_t resno, uint32_t bandno, uint64_t precno, uint64_t cblkno, grk_band *band, grk_cblk_enc *cblk, uint32_t *numPix)
 
bool tile_equals (grk_plugin_tile *plugin_tile, grk_tile *p_tile)
 
void set_context_stream (TileProcessor *p_tileProcessor)
 
void nextCXD (grk_plugin_debug_mqc *mqc, uint32_t d)
 
void mqc_next_plane (grk_plugin_debug_mqc *mqc)
 
uint32_t mqc_numbytes_enc (mqcoder *mqc)
 
void mqc_resetstates (mqcoder *mqc)
 
void mqc_init_enc (mqcoder *mqc, uint8_t *bp)
 
void mqc_encode (mqcoder *mqc, uint32_t d)
 
void mqc_flush_enc (mqcoder *mqc)
 
void mqc_bypass_init_enc (mqcoder *mqc)
 
uint32_t mqc_bypass_get_extra_bytes_enc (mqcoder *mqc, bool erterm)
 
void mqc_bypass_enc (mqcoder *mqc, uint32_t d)
 
void mqc_bypass_flush_enc (mqcoder *mqc, bool erterm)
 
void mqc_restart_init_enc (mqcoder *mqc)
 
void mqc_erterm_enc (mqcoder *mqc)
 
void mqc_segmark_enc (mqcoder *mqc)
 
void mqc_init_dec (mqcoder *mqc, uint8_t *bp, uint32_t len)
 Initialize the decoder for MQ decoding. More...
 
void mqc_raw_init_dec (mqcoder *mqc, uint8_t *bp, uint32_t len)
 Initialize the decoder for RAW decoding. More...
 
void mqc_finish_dec (mqcoder *mqc)
 Terminate RAW/MQC decoding. More...
 
bool t1_decode_cblk (t1_info *t1, cblk_dec *cblk, uint32_t orient, uint32_t roishift, uint32_t cblksty)
 
void t1_code_block_enc_deallocate (cblk_enc *p_code_block)
 
bool t1_allocate_buffers (t1_info *t1, uint32_t w, uint32_t h)
 
double t1_encode_cblk (t1_info *t1, cblk_enc *cblk, uint32_t max, uint8_t orient, uint32_t compno, uint32_t level, uint32_t qmfbid, double stepsize, uint32_t cblksty, const double *mct_norms, uint32_t mct_numcomps, bool doRateControl)
 
t1_infot1_create (bool isEncoder)
 
void t1_destroy (t1_info *p_t1)
 
bool decode_53 (TileProcessor *p_tcd, TileComponent *GRK_RESTRICT tilec, uint32_t numres)
 Inverse 5-3 wavelet transform in 2-D. More...
 
bool decode_97 (TileProcessor *p_tcd, TileComponent *GRK_RESTRICT tilec, uint32_t numres)
 Inverse 9-7 wavelet transform in 2-D. More...
 
template<typename TYPE >
void grk_write (uint8_t *p_buffer, TYPE value, uint32_t nb_bytes)
 
template<typename TYPE >
void grk_write (uint8_t *p_buffer, TYPE value)
 
template<typename TYPE >
void grk_read (const uint8_t *p_buffer, TYPE *value, uint32_t nb_bytes)
 
template<typename TYPE >
void grk_read (const uint8_t *p_buffer, TYPE *value)
 
static uint32_t uint_subs (uint32_t a, uint32_t b)
 Get the saturated difference of two unsigned integers. More...
 
static uint32_t uint_adds (uint32_t a, uint32_t b)
 Get the saturated sum of two unsigned integers. More...
 
template<typename T >
uint32_t ceildiv (T a, T b)
 Divide an integer by another integer and round upwards. More...
 
template<typename T >
ceildivpow2 (T a, uint32_t b)
 
static uint32_t uint64_ceildivpow2 (uint64_t a, uint32_t b)
 Divide a 64-bit integer by a power of 2 and round upwards. More...
 
static uint32_t uint_floordivpow2 (uint32_t a, uint32_t b)
 Divide an unsigned integer by a power of 2 and round downwards. More...
 
template<typename T >
floorlog2 (uint32_t a)
 Get logarithm of an integer and round downwards. More...
 
static int32_t int_fix_mul (int32_t a, int32_t b)
 Multiply two fixed-point numbers. More...
 
void GROK_INFO (const char *fmt,...)
 
void GROK_WARN (const char *fmt,...)
 
void GROK_ERROR (const char *fmt,...)
 
grk_streamcreate_mem_stream (uint8_t *buf, size_t len, bool ownsBuffer, bool is_read_stream)
 
size_t get_mem_stream_offset (grk_stream *stream)
 
grk_streamcreate_mapped_file_read_stream (const char *fname)
 
uint32_t grk_make_aligned_width (uint32_t width)
 
void * grk_malloc (size_t size)
 Allocate an uninitialized memory block. More...
 
void * grk_calloc (size_t numOfElements, size_t sizeOfElements)
 Allocate a memory block with elements initialized to 0. More...
 
void * grk_aligned_malloc (size_t size)
 Allocate memory aligned to a 16 byte boundary. More...
 
void grk_aligned_free (void *ptr)
 
void * grk_realloc (void *m, size_t s)
 Reallocate memory blocks. More...
 
void grk_free (void *m)
 Deallocates or frees a memory block. More...
 
bool mult_will_overflow (uint32_t a, uint32_t b)
 
bool mult64_will_overflow (uint64_t a, uint64_t b)
 

Variables

const uint32_t sot_marker_segment_len = 12U
 
const uint32_t SPCod_SPCoc_len = 5U
 
const uint32_t cod_coc_len = 5U
 
const uint32_t tlm_len_per_tile_part = 5
 
const uint32_t GRK_COMP_PARAM_DEFAULT_CBLOCKW = 64
 
const uint32_t GRK_COMP_PARAM_DEFAULT_CBLOCKH = 64
 
const GRK_PROG_ORDER GRK_COMP_PARAM_DEFAULT_PROG_ORDER = GRK_LRCP
 
const uint32_t GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION = 6
 
const uint32_t max_precision_jpeg_2000 = 38
 
const uint32_t max_num_components = 16384
 
const uint32_t max_passes_per_segment = (max_precision_jpeg_2000-1) * 3 +1
 
const uint32_t max_num_tiles = 65535
 
const uint32_t max_num_tile_parts_per_tile = 255
 
const uint32_t max_num_tile_parts = 65535
 
const uint32_t max_tile_part_size = UINT_MAX
 
const uint64_t max_tile_area = 67108864000
 
const uint32_t max_supported_precision = 16
 
const uint32_t default_numbers_segments = 10
 
const uint32_t default_header_size = 1000
 
const uint32_t default_number_mcc_records = 10
 
const uint32_t default_number_mct_records = 10
 
const uint8_t IPTC_UUID [16]
 
const uint8_t XMP_UUID [16]
 
const uint32_t available_packet_len_bytes_per_plt = USHRT_MAX - 1 - 4
 
const uint32_t min_packets_per_full_plt = available_packet_len_bytes_per_plt / 5
 
const uint32_t MCT_ELEMENT_SIZE [] = { 2, 4, 4, 8 }
 
const uint32_t tag_tree_uninitialized_node_value = 999
 
const uint32_t A_MIN = 0x8000
 
const uint32_t k_max_bit_planes = 31-T1_NMSEDEC_FRACBITS
 

Exported functions

void j2k_init_decompressor (void *j2k, grk_dparameters *parameters)
 Setup the decoder decoding parameters using user parameters. More...
 
bool j2k_init_compress (CodeStream *codeStream, grk_cparameters *parameters, grk_image *image)
 
char * j2k_convert_progression_order (GRK_PROG_ORDER prg_order)
 Converts an enum type progression order to string type. More...
 
bool j2k_end_decompress (CodeStream *j2k, BufferedStream *stream)
 Ends the decompression procedures and possibiliy add data to be read after the code stream. More...
 
bool j2k_read_header (BufferedStream *stream, CodeStream *codeStream, grk_header_info *header_info, grk_image **image)
 Read a JPEG 2000 code stream header. More...
 
void j2k_destroy (CodeStream *codeStream)
 Destroys a JPEG 2000 code stream. More...
 
bool j2k_read_tile_header (CodeStream *codeStream, TileProcessor *tileProcessor, bool *can_decode_tile_data, BufferedStream *stream)
 Reads a tile header. More...
 
bool j2k_set_decompress_area (CodeStream *codeStream, grk_image *image, uint32_t start_x, uint32_t start_y, uint32_t end_x, uint32_t end_y)
 Set the given area to be decoded. More...
 
bool j2k_decompress (CodeStream *codeStream, grk_plugin_tile *tile, BufferedStream *stream, grk_image *image)
 Decode an image from a JPEG 2000 code stream. More...
 
bool j2k_decompress_tile (CodeStream *codeStream, BufferedStream *stream, grk_image *p_image, uint16_t tile_index)
 
bool j2k_compress_tile (CodeStream *codeStream, TileProcessor *tileProcessor, uint16_t tile_index, uint8_t *p_data, uint64_t uncompressed_data_size, BufferedStream *stream)
 Writes a tile. More...
 
bool j2k_compress (CodeStream *codeStream, grk_plugin_tile *tile, BufferedStream *stream)
 Encodes an image into a JPEG 2000 code stream. More...
 
bool j2k_start_compress (CodeStream *codeStream, BufferedStream *stream)
 Starts a compression scheme, i.e. More...
 
bool j2k_end_compress (CodeStream *codeStream, BufferedStream *stream)
 Ends the compression procedures and possibility add data to be read after the code stream. More...
 
bool j2k_init_mct_encoding (TileCodingParams *p_tcp, grk_image *p_image)
 
void jp2_destroy (FileFormat *fileFormat)
 Destroy a JP2 decompressor handle. More...
 
bool jp2_init_compress (FileFormat *fileFormat, grk_cparameters *parameters, grk_image *image)
 Set up compress parameters using the current image and using user parameters. More...
 
bool jp2_start_compress (FileFormat *fileFormat, BufferedStream *stream)
 Starts a compression scheme, i.e. More...
 
bool jp2_compress (FileFormat *fileFormat, grk_plugin_tile *tile, BufferedStream *stream)
 Encode an image into a JPEG 2000 file stream. More...
 
bool jp2_compress_tile (FileFormat *fileFormat, TileProcessor *tileProcessor, uint16_t tile_index, uint8_t *p_data, uint64_t uncompressed_data_size, BufferedStream *stream)
 Compress tile. More...
 
bool jp2_end_compress (FileFormat *fileFormat, BufferedStream *stream)
 Ends the compression procedures and possibly add data to be read after the code stream. More...
 
void jp2_init_decompress (void *fileFormat, grk_dparameters *parameters)
 Set up the decompress parameters using user parameters. More...
 
bool jp2_decompress (FileFormat *fileFormat, grk_plugin_tile *tile, BufferedStream *stream, grk_image *p_image)
 Decompress an image from a JPEG 2000 file stream. More...
 
bool jp2_end_decompress (FileFormat *fileFormat, BufferedStream *stream)
 Ends the decompression procedures and possibly add data to be read after the code stream. More...
 
bool jp2_read_header (BufferedStream *stream, FileFormat *fileFormat, grk_header_info *header_info, grk_image **p_image)
 Read a JPEG 2000 file header. More...
 
bool jp2_read_tile_header (FileFormat *fileFormat, uint16_t *tile_index, bool *can_decode_tile_data, BufferedStream *stream)
 Reads a tile header. More...
 
bool jp2_set_decompress_area (FileFormat *fileFormat, grk_image *image, uint32_t start_x, uint32_t start_y, uint32_t end_x, uint32_t end_y)
 Sets the given area to be decompressed. More...
 
bool jp2_decompress_tile (FileFormat *fileFormat, BufferedStream *stream, grk_image *p_image, uint16_t tile_index)
 
PacketIterpi_initialise_encode (const grk_image *image, CodingParams *cp, uint16_t tileno, J2K_T2_MODE t2_mode)
 Creates a packet iterator for encoding. More...
 
void pi_update_encoding_parameters (const grk_image *p_image, CodingParams *p_cp, uint16_t tile_no)
 Updates the encoding parameters of the codec. More...
 
void pi_init_encode (PacketIter *pi, CodingParams *cp, uint16_t tileno, uint32_t pino, uint32_t tpnum, uint32_t tppos, J2K_T2_MODE t2_mode)
 Modify the packet iterator for enabling tile part generation. More...
 
PacketIterpi_create_decode (grk_image *image, CodingParams *cp, uint16_t tileno)
 Create a packet iterator for Decoder. More...
 
void pi_destroy (PacketIter *p_pi, uint32_t nb_elements)
 Destroys a packet iterator array. More...
 
bool pi_next (PacketIter *pi)
 Modify the packet iterator to point to the next packet. More...
 
bool matrix_inversion_f (float *pSrcMatrix, float *pDestMatrix, uint32_t n)
 Calculate a n x n double matrix inversion with a LUP method. More...
 

Detailed Description

Copyright (C) 2016-2020 Grok Image Compression Inc.

This source code is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.

This source code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Typedef Documentation

◆ grk_buf

using grk::grk_buf = typedef grk_buffer<uint8_t>

◆ grk_flag

typedef uint32_t grk::grk_flag

Flags for 4 consecutive rows of a column.

◆ grk_handle

typedef int32_t grk::grk_handle

◆ grk_pt

using grk::grk_pt = typedef grk_point<int64_t>

◆ grk_rect

typedef grk_rectangle< int64_t > grk::grk_rect

◆ grk_rect_u32

typedef grk_rectangle< uint32_t > grk::grk_rect_u32

◆ j2k_mct_function

typedef void(* grk::j2k_mct_function) (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)

◆ j2k_procedure

typedef bool(* grk::j2k_procedure) (CodeStream *codeStream, TileProcessor *tileProcessor, BufferedStream *stream)

◆ jp2_procedure

typedef bool(* grk::jp2_procedure) (FileFormat *fileFormat, BufferedStream *)

◆ minpf_create_func

typedef void*(* grk::minpf_create_func) (minpf_object_params *)

◆ minpf_destroy_func

typedef int32_t(* grk::minpf_destroy_func) (void *)

◆ minpf_exit_func

typedef int32_t(* grk::minpf_exit_func) ()

◆ minpf_invoke_service_func

typedef int32_t(* grk::minpf_invoke_service_func) (const char *serviceName, void *serviceParams)

◆ minpf_object_params

◆ minpf_platform_services

◆ minpf_plugin_api_version

◆ minpf_plugin_manager

◆ minpf_post_load_func

typedef minpf_exit_func(* grk::minpf_post_load_func) (const char *pluginPath, const minpf_platform_services *)

◆ minpf_register_func

typedef int32_t(* grk::minpf_register_func) (const char *nodeType, const minpf_register_params *params)

◆ minpf_register_params

◆ PL_INFO_VEC

typedef std::vector<uint32_t> grk::PL_INFO_VEC

◆ PL_MAP

typedef std::map<uint8_t, PL_INFO_VEC*> grk::PL_MAP

◆ PLUGIN_BATCH_DECODE

typedef int32_t(* grk::PLUGIN_BATCH_DECODE) (void)

◆ PLUGIN_BATCH_ENCODE

typedef int32_t(* grk::PLUGIN_BATCH_ENCODE) (const char *input_dir, const char *output_dir, grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK userCallback)

◆ PLUGIN_DEBUG_MQC_NEXT_CXD

typedef void(* grk::PLUGIN_DEBUG_MQC_NEXT_CXD) (grk_plugin_debug_mqc *mqc, uint32_t d)

◆ PLUGIN_DEBUG_MQC_NEXT_PLANE

typedef void(* grk::PLUGIN_DEBUG_MQC_NEXT_PLANE) (grk_plugin_debug_mqc *mqc)

◆ PLUGIN_DECODE

typedef int32_t(* grk::PLUGIN_DECODE) (grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)

◆ PLUGIN_DECODE_USER_CALLBACK

typedef int32_t(* grk::PLUGIN_DECODE_USER_CALLBACK) (PluginDecodeCallbackInfo *info)

◆ PLUGIN_ENCODE

typedef int32_t(* grk::PLUGIN_ENCODE) (grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK callback)

◆ PLUGIN_ENCODE_USER_CALLBACK

typedef void(* grk::PLUGIN_ENCODE_USER_CALLBACK) (plugin_encode_user_callback_info *info)

◆ PLUGIN_GET_DEBUG_STATE

typedef uint32_t(* grk::PLUGIN_GET_DEBUG_STATE) (void)

◆ PLUGIN_INIT

typedef bool(* grk::PLUGIN_INIT) (grk_plugin_init_info initInfo)

◆ PLUGIN_INIT_BATCH_DECODE

typedef int32_t(* grk::PLUGIN_INIT_BATCH_DECODE) (const char *input_dir, const char *output_dir, grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)

◆ PLUGIN_IS_BATCH_COMPLETE

typedef bool(* grk::PLUGIN_IS_BATCH_COMPLETE) (void)

◆ PLUGIN_STOP_BATCH_DECODE

typedef void(* grk::PLUGIN_STOP_BATCH_DECODE) (void)

◆ PLUGIN_STOP_BATCH_ENCODE

typedef void(* grk::PLUGIN_STOP_BATCH_ENCODE) (void)

◆ TL_INFO_VEC

typedef std::vector<grk_tl_info> grk::TL_INFO_VEC

◆ TL_MAP

typedef std::map<uint8_t, TL_INFO_VEC*> grk::TL_MAP

Enumeration Type Documentation

◆ J2K_MCT_ARRAY_TYPE

Type of MCT array.

Enumerator
MCT_TYPE_DEPENDENCY 
MCT_TYPE_DECORRELATION 
MCT_TYPE_OFFSET 

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

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

no decode state

J2K_DEC_STATE_MH_SOC 

a SOC marker is expected

J2K_DEC_STATE_MH_SIZ 

a SIZ marker is expected

J2K_DEC_STATE_MH 

the decoding process is in the main header

J2K_DEC_STATE_TPH_SOT 

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

J2K_DEC_STATE_TPH 

the decoding process is in a tile part header

J2K_DEC_STATE_NO_EOC 

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

J2K_DEC_STATE_DATA 

the decoding process is expecting to read tile data from the code stream

J2K_DEC_STATE_EOC 

the decoding process has encountered the EOC marker

J2K_DEC_STATE_ERR 

the decoding process has encountered an error

◆ J2K_T2_MODE

T2 encoding mode.

Enumerator
THRESH_CALC 
FINAL_PASS 

Function called in Rate allocation process.

◆ JP2_IMG_STATE

Enumerator
JP2_IMG_STATE_NONE 
JP2_IMG_STATE_UNKNOWN 

◆ JP2_STATE

Enumerator
JP2_STATE_NONE 
JP2_STATE_SIGNATURE 
JP2_STATE_FILE_TYPE 
JP2_STATE_HEADER 
JP2_STATE_CODESTREAM 
JP2_STATE_END_CODESTREAM 
JP2_STATE_UNKNOWN 

Function Documentation

◆ ceildiv()

template<typename T >
uint32_t grk::ceildiv ( a,
b 
)

Divide an integer by another integer and round upwards.

Parameters
ainteger of type T
binteger of type T
Returns
a divided by b

Referenced by grk::grk_rectangle< uint32_t >::subsample().

◆ ceildivpow2()

template<typename T >
T grk::ceildivpow2 ( a,
uint32_t  b 
)

◆ create_mapped_file_read_stream()

grk_stream* grk::create_mapped_file_read_stream ( const char *  fname)

◆ create_mem_stream()

grk_stream* grk::create_mem_stream ( uint8_t *  buf,
size_t  len,
bool  ownsBuffer,
bool  is_read_stream 
)

◆ decode_53()

bool grk::decode_53 ( TileProcessor p_tcd,
TileComponent *GRK_RESTRICT  tilec,
uint32_t  numres 
)

Inverse 5-3 wavelet transform in 2-D.

Apply a reversible inverse DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)
numresNumber of resolution levels to decompress

◆ decode_97()

bool grk::decode_97 ( TileProcessor p_tcd,
TileComponent *GRK_RESTRICT  tilec,
uint32_t  numres 
)

Inverse 9-7 wavelet transform in 2-D.

Apply an irreversible inverse DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)
numresNumber of resolution levels to decompress

◆ decode_synch_plugin_with_host()

void grk::decode_synch_plugin_with_host ( TileProcessor tcd)

◆ encode_synch_with_plugin()

void grk::encode_synch_with_plugin ( TileProcessor tcd,
uint32_t  compno,
uint32_t  resno,
uint32_t  bandno,
uint64_t  precno,
uint64_t  cblkno,
grk_band band,
grk_cblk_enc cblk,
uint32_t *  numPix 
)

◆ floorlog2()

template<typename T >
T grk::floorlog2 ( uint32_t  a)

Get logarithm of an integer and round downwards.

Parameters
a32 bit integer
Returns
log2(a)

◆ get_mem_stream_offset()

size_t grk::get_mem_stream_offset ( grk_stream stream)

◆ getPocSize()

uint16_t grk::getPocSize ( uint32_t  l_nb_comp,
uint32_t  l_nb_poc 
)

◆ grk_aligned_free()

void grk::grk_aligned_free ( void *  ptr)

◆ grk_aligned_malloc()

void* grk::grk_aligned_malloc ( size_t  size)

Allocate memory aligned to a 16 byte boundary.

Parameters
sizeBytes to allocate
Returns
a void pointer to the allocated space, or nullptr if there is insufficient memory available

Referenced by grk::grk_buffer_2d< T >::alloc(), and grk::WaveletForward< DWT >::run().

◆ grk_calloc()

void* grk::grk_calloc ( size_t  numOfElements,
size_t  sizeOfElements 
)

Allocate a memory block with elements initialized to 0.

Parameters
numOfElementsBlocks to allocate
sizeOfElementsBytes per block to allocate
Returns
a void pointer to the allocated space, or nullptr if there is insufficient memory available

◆ grk_copy_image_header()

void grk::grk_copy_image_header ( const grk_image p_image_src,
grk_image p_image_dest 
)

◆ grk_free()

void grk::grk_free ( void *  m)

Deallocates or frees a memory block.

Parameters
mPreviously allocated memory block to be freed

◆ grk_image_comp_header_update()

void grk::grk_image_comp_header_update ( grk_image image,
const CodingParams p_cp 
)

Update image components with coding parameters.

Parameters
imageimage to update.
p_cpcoding parameters from which to update the image.

◆ grk_image_create0()

grk_image* grk::grk_image_create0 ( void  )

Create an empty image.

Returns
returns an empty image if successful, returns nullptr otherwise

◆ grk_make_aligned_width()

uint32_t grk::grk_make_aligned_width ( uint32_t  width)

◆ grk_malloc()

void* grk::grk_malloc ( size_t  size)

Allocate an uninitialized memory block.

Parameters
sizeBytes to allocate
Returns
a void pointer to the allocated space, or nullptr if there is insufficient memory available

◆ grk_read() [1/2]

template<typename TYPE >
void grk::grk_read ( const uint8_t *  p_buffer,
TYPE *  value 
)

◆ grk_read() [2/2]

template<typename TYPE >
void grk::grk_read ( const uint8_t *  p_buffer,
TYPE *  value,
uint32_t  nb_bytes 
)

◆ grk_realloc()

void* grk::grk_realloc ( void *  m,
size_t  s 
)

Reallocate memory blocks.

Parameters
mPointer to previously allocated memory block
sNew size in bytes
Returns
a void pointer to the reallocated (and possibly moved) memory block

◆ grk_write() [1/2]

template<typename TYPE >
void grk::grk_write ( uint8_t *  p_buffer,
TYPE  value 
)

◆ grk_write() [2/2]

template<typename TYPE >
void grk::grk_write ( uint8_t *  p_buffer,
TYPE  value,
uint32_t  nb_bytes 
)

◆ GROK_ERROR()

void grk::GROK_ERROR ( const char *  fmt,
  ... 
)

◆ GROK_INFO()

void grk::GROK_INFO ( const char *  fmt,
  ... 
)

◆ GROK_WARN()

void grk::GROK_WARN ( const char *  fmt,
  ... 
)

◆ int_fix_mul()

static int32_t grk::int_fix_mul ( int32_t  a,
int32_t  b 
)
inlinestatic

Multiply two fixed-point numbers.

Parameters
aN-bit precision fixed point number
b13-bit precision fixed point number
Returns
a * b in N-bit precision fixed point

◆ j2k_add_mct()

bool grk::j2k_add_mct ( TileCodingParams p_tcp,
grk_image p_image,
uint32_t  index 
)

◆ j2k_add_mhmarker()

bool grk::j2k_add_mhmarker ( grk_codestream_index cstr_index,
uint32_t  type,
uint64_t  pos,
uint32_t  len 
)

Add main header marker information.

Parameters
cstr_indexCodestream information structure
typemarker type
posbyte offset of marker segment
lenlength of marker segment

◆ j2k_allocate_tile_element_cstr_index()

bool grk::j2k_allocate_tile_element_cstr_index ( CodeStream codeStream)

◆ j2k_compare_coc()

bool grk::j2k_compare_coc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compares 2 COC markers (Coding style component)

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe index of the first component to compare.
second_comp_nothe index of the second component to compare.
Returns
true if equals

◆ j2k_compare_qcc()

bool grk::j2k_compare_qcc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compare QCC markers (quantization component)

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe index of the first component to compare.
second_comp_nothe index of the second component to compare.
Returns
true if equals.

◆ j2k_compare_SPCod_SPCoc()

bool grk::j2k_compare_SPCod_SPCoc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compare 2 a SPCod/ SPCoc elements, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
first_comp_noThe 1st component number to compare.
second_comp_noThe 1st component number to compare.
Returns
true if SPCdod are equals.

◆ j2k_compare_SQcd_SQcc()

bool grk::j2k_compare_SQcd_SQcc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compares 2 SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe first component number to compare.
second_comp_nothe second component number to compare.
Returns
true if equals.

◆ j2k_compress()

bool grk::j2k_compress ( CodeStream codeStream,
grk_plugin_tile tile,
BufferedStream stream 
)

Encodes an image into a JPEG 2000 code stream.

◆ j2k_compress_tile()

bool grk::j2k_compress_tile ( CodeStream codeStream,
TileProcessor tileProcessor,
uint16_t  tile_index,
uint8_t *  p_data,
uint64_t  uncompressed_data_size,
BufferedStream stream 
)

Writes a tile.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
tile_indextile index
datauncompressed data
uncompressed_data_sizeuncompressed data size
streambuffered stream.

◆ j2k_convert_progression_order()

char* grk::j2k_convert_progression_order ( GRK_PROG_ORDER  prg_order)

Converts an enum type progression order to string type.

◆ j2k_create_cstr_index()

grk_codestream_index* grk::j2k_create_cstr_index ( void  )

◆ j2k_decompress()

bool grk::j2k_decompress ( CodeStream codeStream,
grk_plugin_tile tile,
BufferedStream stream,
grk_image image 
)

Decode an image from a JPEG 2000 code stream.

Parameters
codeStreamcode stream
tileplugin tile
streamstream
imageimage
Returns
true if decompression is successful

◆ j2k_decompress_tile()

bool grk::j2k_decompress_tile ( CodeStream codeStream,
BufferedStream stream,
grk_image p_image,
uint16_t  tile_index 
)

◆ j2k_destroy()

void grk::j2k_destroy ( CodeStream codeStream)

Destroys a JPEG 2000 code stream.

Parameters
codeStreamthe jpeg20000 structure to destroy.

◆ j2k_destroy_cstr_index()

void grk::j2k_destroy_cstr_index ( grk_codestream_index p_cstr_ind)

Destroys a code stream index structure.

Parameters
p_cstr_indthe code stream index parameter to destroy.

◆ j2k_dump()

void grk::j2k_dump ( CodeStream codeStream,
int32_t  flag,
FILE *  out_stream 
)

Dump some elements from the J2K decompression structure .

Parameters
codeStreamJPEG 2000 code stream
flagflag to describe what elements are dumped.
out_streamoutput stream where dump the elements.

◆ j2k_dump_image_comp_header()

void grk::j2k_dump_image_comp_header ( grk_image_comp comp,
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.

◆ j2k_dump_image_header()

void grk::j2k_dump_image_header ( grk_image image,
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.

◆ j2k_end_compress()

bool grk::j2k_end_compress ( CodeStream codeStream,
BufferedStream stream 
)

Ends the compression procedures and possibility add data to be read after the code stream.

◆ j2k_end_decompress()

bool grk::j2k_end_decompress ( CodeStream j2k,
BufferedStream stream 
)

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

◆ j2k_get_cstr_index()

grk_codestream_index* grk::j2k_get_cstr_index ( CodeStream codeStream)

Get the code stream index from a JPEG2000 codec.

Parameters
codeStreamthe component image header to dump.
Returns
the code stream index extract from the jpg2000 codec

◆ j2k_get_cstr_info()

grk_codestream_info_v2* grk::j2k_get_cstr_info ( CodeStream codeStream)

Get the code stream info from a JPEG2000 codec.

Parameters
codeStreamthe component image header to dump.
Returns
the code stream information extract from the jpg2000 codec

◆ j2k_get_SPCod_SPCoc_size()

uint32_t grk::j2k_get_SPCod_SPCoc_size ( CodeStream codeStream,
uint32_t  comp_no 
)

Gets the size taken by writing a SPCod or SPCoc for the given tile and component.

Parameters
codeStreamthe JPEG 2000 code stream
comp_nothe component being outputted.
Returns
the number of bytes taken by the SPCod element.

◆ j2k_get_SQcd_SQcc_size()

uint32_t grk::j2k_get_SQcd_SQcc_size ( CodeStream codeStream,
uint32_t  comp_no 
)

Gets the size taken by writing SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamthe JPEG 2000 code stream
comp_nothe component being output.
Returns
the number of bytes taken by the SPCod element.

◆ j2k_init_compress()

bool grk::j2k_init_compress ( CodeStream codeStream,
grk_cparameters parameters,
grk_image image 
)

◆ j2k_init_decompressor()

void grk::j2k_init_decompressor ( void *  j2k,
grk_dparameters parameters 
)

Setup the decoder decoding parameters using user parameters.

Decoding parameters are returned in j2k->cp.

Parameters
j2kJ2K decompressor handle
parametersdecompression parameters

◆ j2k_init_mct_encoding()

bool grk::j2k_init_mct_encoding ( TileCodingParams p_tcp,
grk_image p_image 
)

◆ j2k_merge_ppm()

bool grk::j2k_merge_ppm ( CodingParams p_cp)

Merges all PPM markers read (Packed headers, main header)

Parameters
p_cpmain coding parameters.

◆ j2k_merge_ppt()

bool grk::j2k_merge_ppt ( TileCodingParams p_tcp)

Merges all PPT markers read (Packed headers, tile-part header)

Parameters
p_tcpthe tile.

◆ j2k_read_cap()

bool grk::j2k_read_cap ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CAP marker.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_cbd()

bool grk::j2k_read_cbd ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CBD marker (Component bit depth definition)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_coc()

bool grk::j2k_read_coc ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COC marker (Coding Style Component)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_cod()

bool grk::j2k_read_cod ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COD marker (Coding Style defaults)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_com()

bool grk::j2k_read_com ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COM marker (comments)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_crg()

bool grk::j2k_read_crg ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CRG marker (Component registration)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_float32_to_float()

void grk::j2k_read_float32_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float32_to_int32()

void grk::j2k_read_float32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float64_to_float()

void grk::j2k_read_float64_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float64_to_int32()

void grk::j2k_read_float64_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_header()

bool grk::j2k_read_header ( BufferedStream stream,
CodeStream codeStream,
grk_header_info header_info,
grk_image **  image 
)

Read a JPEG 2000 code stream header.

Parameters
streamstream to read data from.
codeStreamJPEG 2000 code stream.
header_infoheader info struct to store header info
imagepointer to image
Returns
true if the box is valid.

◆ j2k_read_int16_to_float()

void grk::j2k_read_int16_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int16_to_int32()

void grk::j2k_read_int16_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int32_to_float()

void grk::j2k_read_int32_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int32_to_int32()

void grk::j2k_read_int32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_mcc()

bool grk::j2k_read_mcc ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCC marker (Multiple Component Collection)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_mco()

bool grk::j2k_read_mco ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCO marker (Multiple Component Transform Ordering)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data.
header_sizesize of header data

◆ j2k_read_mct()

bool grk::j2k_read_mct ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCT marker (Multiple Component Transform)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_plm()

bool grk::j2k_read_plm ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PLM marker (Packet length, main header marker)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_plt()

bool grk::j2k_read_plt ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PLT marker (Packet length, tile-part header)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_poc()

bool grk::j2k_read_poc ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a POC marker (Progression Order Change)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_ppm()

bool grk::j2k_read_ppm ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PPM marker (Packed headers, main header)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_ppt()

bool grk::j2k_read_ppt ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PPT marker (Packed packet headers, tile-part header)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_qcc()

bool grk::j2k_read_qcc ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a QCC marker (Quantization component)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_qcd()

bool grk::j2k_read_qcd ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a QCD marker (Quantization defaults)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_rgn()

bool grk::j2k_read_rgn ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a RGN marker (Region Of Interest)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_siz()

bool grk::j2k_read_siz ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a SIZ marker (image and tile size)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_read_soc()

bool grk::j2k_read_soc ( CodeStream codeStream,
BufferedStream stream 
)

Reads a SOC marker (Start of Codestream)

Parameters
codeStreamJPEG 2000 code stream.
streamXXX needs data

◆ j2k_read_sod()

bool grk::j2k_read_sod ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Reads a SOD marker (Start Of Data)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streamstream to read from

◆ j2k_read_sot()

bool grk::j2k_read_sot ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Read SOT (Start of tile part) marker.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data.
header_sizesize of header data

◆ j2k_read_SPCod_SPCoc()

bool grk::j2k_read_SPCod_SPCoc ( CodeStream codeStream,
TileProcessor tileProcessor,
uint32_t  compno,
uint8_t *  p_header_data,
uint16_t *  header_size 
)

Reads a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
compnocomponent number
p_header_datathe data contained in the COM box.
header_sizethe size of the data contained in the COM marker.

◆ j2k_read_SQcd_SQcc()

bool grk::j2k_read_SQcd_SQcc ( CodeStream codeStream,
TileProcessor tileProcessor,
bool  fromQCC,
uint32_t  compno,
uint8_t *  p_header_data,
uint16_t *  header_size 
)

Reads a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
fromQCCtrue if reading QCC, otherwise false (reading QCD)
compnothe component number to output.
p_header_datathe data buffer.
header_sizepointer to the size of the data buffer, it is changed by the function.

◆ j2k_read_tile_header()

bool grk::j2k_read_tile_header ( CodeStream codeStream,
TileProcessor tileProcessor,
bool *  can_decode_tile_data,
BufferedStream stream 
)

Reads a tile header.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
can_decode_tile_dataset to true if tile data is ready to be decoded
streambuffered stream.
Returns
true if tile header could be read

◆ j2k_read_tlm()

bool grk::j2k_read_tlm ( CodeStream codeStream,
TileProcessor tileProcessor,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a TLM marker (Tile Length Marker)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
p_header_dataheader data
header_sizesize of header data

◆ j2k_set_decompress_area()

bool grk::j2k_set_decompress_area ( CodeStream codeStream,
grk_image image,
uint32_t  start_x,
uint32_t  start_y,
uint32_t  end_x,
uint32_t  end_y 
)

Set the given area to be decoded.

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

Parameters
codeStreamJPEG 2000 code stream
imageimage
start_xleft position of the rectangle to decompress (in image coordinates).
start_ytop position of the rectangle to decompress (in image coordinates).
end_xright position of the rectangle to decompress (in image coordinates).
end_ybottom position of the rectangle to decompress (in image coordinates).
Returns
true if the area could be set.

◆ j2k_start_compress()

bool grk::j2k_start_compress ( CodeStream codeStream,
BufferedStream stream 
)

Starts a compression scheme, i.e.

validates the codec parameters, writes the header.

Parameters
codeStreamJPEG 2000 code stream
streamthe stream object.
Returns
true if the codec is valid.

◆ j2k_update_tlm()

void grk::j2k_update_tlm ( CodeStream codeStream,
uint16_t  tile_index,
uint32_t  tile_part_size 
)

Updates the Tile Length Marker.

◆ j2k_write_all_coc()

bool grk::j2k_write_all_coc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes COC marker for each component.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_all_qcc()

bool grk::j2k_write_all_qcc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes QCC marker for each component.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_cap()

bool grk::j2k_write_cap ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the CAP marker.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_cbd()

bool grk::j2k_write_cbd ( CodeStream codeStream,
BufferedStream stream 
)

Writes the CBD marker (Component bit depth definition)

Parameters
codeStreamJPEG 2000 code stream
streambuffered stream.

◆ j2k_write_coc()

bool grk::j2k_write_coc ( CodeStream codeStream,
uint32_t  comp_no,
BufferedStream stream 
)

Writes the COC marker (Coding style component)

Parameters
codeStreamJPEG 2000 code stream
comp_nothe index of the component to output.
streambuffered stream.

◆ j2k_write_cod()

bool grk::j2k_write_cod ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the COD marker (Coding style default)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_com()

bool grk::j2k_write_com ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the COM marker (comment)

Parameters
codeStreamJPEG 2000 code stream
streambuffered stream.

◆ j2k_write_eoc()

bool grk::j2k_write_eoc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the EOC marker (End of Codestream)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_epc()

bool grk::j2k_write_epc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes EPC ????

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_float_to_float()

void grk::j2k_write_float_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_float64()

void grk::j2k_write_float_to_float64 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_int16()

void grk::j2k_write_float_to_int16 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_int32()

void grk::j2k_write_float_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_mcc_record()

bool grk::j2k_write_mcc_record ( grk_simple_mcc_decorrelation_data p_mcc_record,
BufferedStream stream 
)

Writes the MCC marker (Multiple Component Collection)

Parameters
p_mcc_recordMCC record
streambuffered stream.

◆ j2k_write_mco()

bool grk::j2k_write_mco ( CodeStream codeStream,
BufferedStream stream 
)

Writes the MCO marker (Multiple component transformation ordering)

Parameters
codeStreamJPEG 2000 code stream
streambuffered stream.

◆ j2k_write_mct_data_group()

bool grk::j2k_write_mct_data_group ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the CBD-MCT-MCC-MCO markers (Multi components transform)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_mct_record()

bool grk::j2k_write_mct_record ( grk_mct_data p_mct_record,
BufferedStream stream 
)

Writes the MCT marker (Multiple Component Transform)

Parameters
p_mct_recordMCT record
streambuffered stream.

◆ j2k_write_poc()

bool grk::j2k_write_poc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the POC marker (Progression Order Change)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_qcc()

bool grk::j2k_write_qcc ( CodeStream codeStream,
uint16_t  tile_index,
uint32_t  comp_no,
BufferedStream stream 
)

Writes the QCC marker (quantization component)

Parameters
codeStreamJPEG 2000 code stream
tile_indexcurrent tile index
comp_nothe index of the component to output.
streambuffered stream.

◆ j2k_write_qcd()

bool grk::j2k_write_qcd ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the QCD marker (quantization default)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_regions()

bool grk::j2k_write_regions ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes regions of interests.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_rgn()

bool grk::j2k_write_rgn ( CodeStream codeStream,
uint16_t  tile_no,
uint32_t  comp_no,
uint32_t  nb_comps,
BufferedStream stream 
)

Writes the RGN marker (Region Of Interest)

Parameters
tile_nothe tile to output
comp_nothe component to output
nb_compsthe number of components
streambuffered stream.
codeStreamJPEG 2000 code stream

◆ j2k_write_siz()

bool grk::j2k_write_siz ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the SIZ marker (image and tile size)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_soc()

bool grk::j2k_write_soc ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Writes the SOC marker (Start Of Codestream)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_SPCod_SPCoc()

bool grk::j2k_write_SPCod_SPCoc ( CodeStream codeStream,
uint32_t  comp_no,
BufferedStream stream 
)

Writes a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
comp_nothe component number to output.
streambuffered stream.
Returns
true if successful

◆ j2k_write_SQcd_SQcc()

bool grk::j2k_write_SQcd_SQcc ( CodeStream codeStream,
uint32_t  comp_no,
BufferedStream stream 
)

Writes a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
comp_nothe component number to output.
streambuffered stream.

◆ j2k_write_tlm_begin()

bool grk::j2k_write_tlm_begin ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

Begin writing the TLM marker (Tile Length Marker)

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ j2k_write_tlm_end()

bool grk::j2k_write_tlm_end ( CodeStream codeStream,
TileProcessor tileProcessor,
BufferedStream stream 
)

End writing the updated tlm.

Parameters
codeStreamJPEG 2000 code stream
tileProcessortile processor
streambuffered stream.

◆ jp2_compress()

bool grk::jp2_compress ( FileFormat fileFormat,
grk_plugin_tile tile,
BufferedStream stream 
)

Encode an image into a JPEG 2000 file stream.

Parameters
fileFormatJP2 compressor handle
tileplugin tile
streamOutput buffer stream
Returns
true if successful, returns false otherwise

◆ jp2_compress_tile()

bool grk::jp2_compress_tile ( FileFormat fileFormat,
TileProcessor tileProcessor,
uint16_t  tile_index,
uint8_t *  p_data,
uint64_t  uncompressed_data_size,
BufferedStream stream 
)

Compress tile.

Parameters
fileFormatJPEG 2000 file format
tileProcessortile processor
tile_indextile index
p_datauncompressed data
uncompressed_data_sizeuncompressed data size
streambuffered stream.

◆ jp2_decompress()

bool grk::jp2_decompress ( FileFormat fileFormat,
grk_plugin_tile tile,
BufferedStream stream,
grk_image p_image 
)

Decompress an image from a JPEG 2000 file stream.

Parameters
fileFormatJP2 decompressor handle
tileplugin tile
streamstream
p_imageimage
Returns
a decoded image if successful, otherwise nullptr

◆ jp2_decompress_tile()

bool grk::jp2_decompress_tile ( FileFormat fileFormat,
BufferedStream stream,
grk_image p_image,
uint16_t  tile_index 
)

◆ jp2_destroy()

void grk::jp2_destroy ( FileFormat fileFormat)

Destroy a JP2 decompressor handle.

Parameters
fileFormatJP2 decompressor handle to destroy

◆ jp2_dump()

void grk::jp2_dump ( FileFormat fileFormat,
int32_t  flag,
FILE *  out_stream 
)

Dump some elements from the JP2 decompression structure .

Parameters
fileFormatthe jp2 codec.
flagflag to describe what elements are dump.
out_streamoutput stream where dump the elements.

◆ jp2_end_compress()

bool grk::jp2_end_compress ( FileFormat fileFormat,
BufferedStream stream 
)

Ends the compression procedures and possibly add data to be read after the code stream.

◆ jp2_end_decompress()

bool grk::jp2_end_decompress ( FileFormat fileFormat,
BufferedStream stream 
)

Ends the decompression procedures and possibly add data to be read after the code stream.

◆ jp2_get_cstr_index()

grk_codestream_index* grk::jp2_get_cstr_index ( FileFormat fileFormat)

Get the code stream index from a JPEG2000 codec.

Parameters
fileFormatjp2 codec.
Returns
the code stream index extract from the jpg2000 codec

◆ jp2_get_cstr_info()

grk_codestream_info_v2* grk::jp2_get_cstr_info ( FileFormat fileFormat)

Get the code stream info from a JPEG2000 codec.

Parameters
fileFormatjp2 codec.
Returns
the code stream information extract from the jpg2000 codec

◆ jp2_init_compress()

bool grk::jp2_init_compress ( FileFormat fileFormat,
grk_cparameters parameters,
grk_image image 
)

Set up compress parameters using the current image and using user parameters.

Coding parameters are returned in fileFormat->j2k->cp.

Parameters
fileFormatJP2 compressor handle
parameterscompression parameters
imageinput filled image
Returns
true if successful, false otherwise

◆ jp2_init_decompress()

void grk::jp2_init_decompress ( void *  fileFormat,
grk_dparameters parameters 
)

Set up the decompress parameters using user parameters.

Decoding parameters are returned in fileFormat->j2k->cp.

Parameters
fileFormatJP2 decompressor handle
parametersdecompression parameters

◆ jp2_read_header()

bool grk::jp2_read_header ( BufferedStream stream,
FileFormat fileFormat,
grk_header_info header_info,
grk_image **  p_image 
)

Read a JPEG 2000 file header.

Parameters
streamstream to read data from.
fileFormatJPEG 2000 file format
header_infoheader structure to store header info
p_imageinput image
Returns
true if the box is valid.

◆ jp2_read_tile_header()

bool grk::jp2_read_tile_header ( FileFormat fileFormat,
uint16_t *  tile_index,
bool *  can_decode_tile_data,
BufferedStream stream 
)

Reads a tile header.

Parameters
fileFormatJPEG 2000 file format
tile_indextile index
can_decode_tile_dataset to true if ready to decode tile data
streambuffered stream.
Returns
true if successful

◆ jp2_set_decompress_area()

bool grk::jp2_set_decompress_area ( FileFormat fileFormat,
grk_image image,
uint32_t  start_x,
uint32_t  start_y,
uint32_t  end_x,
uint32_t  end_y 
)

Sets the given area to be decompressed.

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

Parameters
fileFormatJPEG 2000 code stream
imageoutput image
start_xthe left position of the rectangle to decompress (in image coordinates).
start_ythe up position of the rectangle to decompress (in image coordinates).
end_xthe right position of the rectangle to decompress (in image coordinates).
end_ythe bottom position of the rectangle to decompress (in image coordinates).
Returns
true if the area could be set.

◆ jp2_start_compress()

bool grk::jp2_start_compress ( FileFormat fileFormat,
BufferedStream stream 
)

Starts a compression scheme, i.e.

validates the codec parameters, writes the header.

Parameters
fileFormatJPEG 2000 file codec.
streamthe stream object.
Returns
true if the codec is valid.

◆ matrix_inversion_f()

bool grk::matrix_inversion_f ( float *  pSrcMatrix,
float *  pDestMatrix,
uint32_t  n 
)

Calculate a n x n double matrix inversion with a LUP method.

Data is aligned, rows after rows (or columns after columns). The function does not take ownership of any memory block, data must be freed by the user.

Parameters
pSrcMatrixthe matrix to invert.
pDestMatrixdata to store the inverted matrix.
nsize of the matrix
Returns
true if the inversion is successful, false if the matrix is singular.

◆ minpf_cleanup_plugin_manager()

void grk::minpf_cleanup_plugin_manager ( void  )

◆ minpf_get_dynamic_library_extension()

const char* grk::minpf_get_dynamic_library_extension ( void  )

◆ minpf_get_full_path()

bool grk::minpf_get_full_path ( const char *  path,
void *  addr,
dynamic_handle_t  handle,
char *  fullPath,
size_t  fullPathLen 
)

◆ minpf_get_plugin_manager()

minpf_plugin_manager* grk::minpf_get_plugin_manager ( void  )

◆ minpf_get_symbol()

void* grk::minpf_get_symbol ( minpf_dynamic_library library,
const char *  symbol 
)

◆ minpf_init_plugin()

PLUGIN_API minpf_exit_func grk::minpf_init_plugin ( const char *  pluginPath,
const minpf_platform_services params 
)

◆ minpf_load_dynamic_library()

minpf_dynamic_library* grk::minpf_load_dynamic_library ( const char *  path,
char *  error 
)

◆ minpf_load_from_dir()

int32_t grk::minpf_load_from_dir ( const char *  dir,
minpf_invoke_service_func  func 
)

◆ minpf_load_from_path()

int32_t grk::minpf_load_from_path ( const char *  path,
minpf_invoke_service_func  func 
)

◆ minpf_unload_dynamic_library()

bool grk::minpf_unload_dynamic_library ( minpf_dynamic_library library)

◆ mqc_bypass_enc()

void grk::mqc_bypass_enc ( mqcoder mqc,
uint32_t  d 
)

◆ mqc_bypass_flush_enc()

void grk::mqc_bypass_flush_enc ( mqcoder mqc,
bool  erterm 
)

◆ mqc_bypass_get_extra_bytes_enc()

uint32_t grk::mqc_bypass_get_extra_bytes_enc ( mqcoder mqc,
bool  erterm 
)

◆ mqc_bypass_init_enc()

void grk::mqc_bypass_init_enc ( mqcoder mqc)

◆ mqc_encode()

void grk::mqc_encode ( mqcoder mqc,
uint32_t  d 
)

◆ mqc_erterm_enc()

void grk::mqc_erterm_enc ( mqcoder mqc)

◆ mqc_finish_dec()

void grk::mqc_finish_dec ( mqcoder mqc)

Terminate RAW/MQC decoding.

This restores the bytes temporarily overwritten by mqc_init_dec()/ mqc_raw_init_dec()

Parameters
mqcMQC handle

◆ mqc_flush_enc()

void grk::mqc_flush_enc ( mqcoder mqc)

◆ mqc_init_dec()

void grk::mqc_init_dec ( mqcoder mqc,
uint8_t *  bp,
uint32_t  len 
)

Initialize the decoder for MQ decoding.

mqc_finish_dec() must be absolutely called after finishing the decoding passes, so as to restore the bytes temporarily overwritten.

Parameters
mqcMQC handle
bpPointer to the start of the buffer from which the bytes will be read Note that OPJ_COMMON_CBLK_DATA_EXTRA bytes at the end of the buffer will be temporarily overwritten with an artificial 0xFF 0xFF marker. (they will be backuped in the mqc structure to be restored later) So bp must be at least len + OPJ_COMMON_CBLK_DATA_EXTRA large, and writable.
lenLength of the input buffer

◆ mqc_init_enc()

void grk::mqc_init_enc ( mqcoder mqc,
uint8_t *  bp 
)

◆ mqc_next_plane()

void grk::mqc_next_plane ( grk_plugin_debug_mqc mqc)

◆ mqc_numbytes_enc()

uint32_t grk::mqc_numbytes_enc ( mqcoder mqc)

◆ mqc_raw_init_dec()

void grk::mqc_raw_init_dec ( mqcoder mqc,
uint8_t *  bp,
uint32_t  len 
)

Initialize the decoder for RAW decoding.

mqc_finish_dec() must be absolutely called after finishing the decoding passes, so as to restore the bytes temporarily overwritten.

Parameters
mqcMQC handle
bpPointer to the start of the buffer from which the bytes will be read Note that OPJ_COMMON_CBLK_DATA_EXTRA bytes at the end of the buffer will be temporarily overwritten with an artificial 0xFF 0xFF marker. (they will be backuped in the mqc structure to be restored later) So bp must be at least len + OPJ_COMMON_CBLK_DATA_EXTRA large, and writable.
lenLength of the input buffer

◆ mqc_resetstates()

void grk::mqc_resetstates ( mqcoder mqc)

◆ mqc_restart_init_enc()

void grk::mqc_restart_init_enc ( mqcoder mqc)

◆ mqc_segmark_enc()

void grk::mqc_segmark_enc ( mqcoder mqc)

◆ mult64_will_overflow()

bool grk::mult64_will_overflow ( uint64_t  a,
uint64_t  b 
)
inline

◆ mult_will_overflow()

bool grk::mult_will_overflow ( uint32_t  a,
uint32_t  b 
)
inline

◆ nextCXD()

void grk::nextCXD ( grk_plugin_debug_mqc mqc,
uint32_t  d 
)

◆ pi_create_decode()

PacketIter* grk::pi_create_decode ( grk_image image,
CodingParams cp,
uint16_t  tileno 
)

Create a packet iterator for Decoder.

Parameters
imageRaw image for which the packets will be listed
cpCoding parameters
tilenoNumber that identifies the tile for which to list the packets
Returns
a packet iterator that points to the first packet of the tile
See also
pi_destroy

◆ pi_destroy()

void grk::pi_destroy ( PacketIter p_pi,
uint32_t  nb_elements 
)

Destroys a packet iterator array.

Parameters
p_pithe packet iterator array to destroy.
nb_elementsthe number of elements in the array.

◆ pi_init_encode()

void grk::pi_init_encode ( PacketIter pi,
CodingParams cp,
uint16_t  tileno,
uint32_t  pino,
uint32_t  tpnum,
uint32_t  tppos,
J2K_T2_MODE  t2_mode 
)

Modify the packet iterator for enabling tile part generation.

Parameters
piHandle to the packet iterator generated in pi_initialise_encode
cpCoding parameters
tilenoNumber that identifies the tile for which to list the packets
pinopacket iterator number
tpnumTile part number of the current tile
tpposThe position of the tile part flag in the progression order
t2_modeT2 mode

◆ pi_initialise_encode()

PacketIter* grk::pi_initialise_encode ( const grk_image image,
CodingParams cp,
uint16_t  tileno,
J2K_T2_MODE  t2_mode 
)

Creates a packet iterator for encoding.

Parameters
imagethe image being encoded.
cpthe coding parameters.
tilenoindex of the tile being encoded.
t2_modethe type of pass for generating the packet iterator
Returns
a list of packet iterator that points to the first packet of the tile (not true).

◆ pi_next()

bool grk::pi_next ( PacketIter pi)

Modify the packet iterator to point to the next packet.

Parameters
piPacket iterator to modify
Returns
false if pi pointed to the last packet or else returns true

◆ pi_update_encoding_parameters()

void grk::pi_update_encoding_parameters ( const grk_image p_image,
CodingParams p_cp,
uint16_t  tile_no 
)

Updates the encoding parameters of the codec.

Parameters
p_imagethe image being encoded.
p_cpthe coding parameters.
tile_noindex of the tile being encoded.

◆ set_context_stream()

void grk::set_context_stream ( TileProcessor p_tileProcessor)

◆ t1_allocate_buffers()

bool grk::t1_allocate_buffers ( t1_info t1,
uint32_t  w,
uint32_t  h 
)

◆ t1_code_block_enc_deallocate()

void grk::t1_code_block_enc_deallocate ( cblk_enc p_code_block)

◆ t1_create()

t1_info* grk::t1_create ( bool  isEncoder)

◆ t1_decode_cblk()

bool grk::t1_decode_cblk ( t1_info t1,
cblk_dec cblk,
uint32_t  orient,
uint32_t  roishift,
uint32_t  cblksty 
)

◆ t1_destroy()

void grk::t1_destroy ( t1_info p_t1)

◆ t1_encode_cblk()

double grk::t1_encode_cblk ( t1_info t1,
cblk_enc cblk,
uint32_t  max,
uint8_t  orient,
uint32_t  compno,
uint32_t  level,
uint32_t  qmfbid,
double  stepsize,
uint32_t  cblksty,
const double *  mct_norms,
uint32_t  mct_numcomps,
bool  doRateControl 
)

◆ tile_equals()

bool grk::tile_equals ( grk_plugin_tile plugin_tile,
grk_tile p_tile 
)

◆ transfer_image_data()

void grk::transfer_image_data ( grk_image src,
grk_image dest 
)

Transfer data from src to dest for each component, and null out src data.

Assumption: src and dest have the same number of components

◆ uint64_ceildivpow2()

static uint32_t grk::uint64_ceildivpow2 ( uint64_t  a,
uint32_t  b 
)
inlinestatic

Divide a 64-bit integer by a power of 2 and round upwards.

Parameters
a64-bit integer
bpower of two
Returns
a divided by 2^b

◆ uint_adds()

static uint32_t grk::uint_adds ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Get the saturated sum of two unsigned integers.

Parameters
ainteger
binteger
Returns
saturated sum of a+b

◆ uint_floordivpow2()

static uint32_t grk::uint_floordivpow2 ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Divide an unsigned integer by a power of 2 and round downwards.

Returns
a divided by 2^b

◆ uint_subs()

static uint32_t grk::uint_subs ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Get the saturated difference of two unsigned integers.

Returns
Returns saturated sum of a-b

◆ update_image_dimensions()

bool grk::update_image_dimensions ( grk_image p_image,
uint32_t  reduce 
)

Variable Documentation

◆ A_MIN

const uint32_t grk::A_MIN = 0x8000

◆ available_packet_len_bytes_per_plt

const uint32_t grk::available_packet_len_bytes_per_plt = USHRT_MAX - 1 - 4

◆ cod_coc_len

const uint32_t grk::cod_coc_len = 5U

◆ default_header_size

const uint32_t grk::default_header_size = 1000

◆ default_number_mcc_records

const uint32_t grk::default_number_mcc_records = 10

◆ default_number_mct_records

const uint32_t grk::default_number_mct_records = 10

◆ default_numbers_segments

const uint32_t grk::default_numbers_segments = 10

◆ GRK_COMP_PARAM_DEFAULT_CBLOCKH

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_CBLOCKH = 64

◆ GRK_COMP_PARAM_DEFAULT_CBLOCKW

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_CBLOCKW = 64

◆ GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION = 6

◆ GRK_COMP_PARAM_DEFAULT_PROG_ORDER

const GRK_PROG_ORDER grk::GRK_COMP_PARAM_DEFAULT_PROG_ORDER = GRK_LRCP

◆ IPTC_UUID

const uint8_t grk::IPTC_UUID[16]
Initial value:
= { 0x33, 0xC7, 0xA4, 0xD2, 0xB8, 0x1D, 0x47, 0x23,
0xA0, 0xBA, 0xF1, 0xA3, 0xE0, 0x97, 0xAD, 0x38 }

◆ k_max_bit_planes

const uint32_t grk::k_max_bit_planes = 31-T1_NMSEDEC_FRACBITS

◆ max_num_components

const uint32_t grk::max_num_components = 16384

◆ max_num_tile_parts

const uint32_t grk::max_num_tile_parts = 65535

◆ max_num_tile_parts_per_tile

const uint32_t grk::max_num_tile_parts_per_tile = 255

◆ max_num_tiles

const uint32_t grk::max_num_tiles = 65535

◆ max_passes_per_segment

const uint32_t grk::max_passes_per_segment = (max_precision_jpeg_2000-1) * 3 +1

◆ max_precision_jpeg_2000

const uint32_t grk::max_precision_jpeg_2000 = 38

◆ max_supported_precision

const uint32_t grk::max_supported_precision = 16

◆ max_tile_area

const uint64_t grk::max_tile_area = 67108864000

◆ max_tile_part_size

const uint32_t grk::max_tile_part_size = UINT_MAX

◆ MCT_ELEMENT_SIZE

const uint32_t grk::MCT_ELEMENT_SIZE[] = { 2, 4, 4, 8 }

◆ min_packets_per_full_plt

const uint32_t grk::min_packets_per_full_plt = available_packet_len_bytes_per_plt / 5

◆ sot_marker_segment_len

const uint32_t grk::sot_marker_segment_len = 12U

◆ SPCod_SPCoc_len

const uint32_t grk::SPCod_SPCoc_len = 5U

◆ tag_tree_uninitialized_node_value

const uint32_t grk::tag_tree_uninitialized_node_value = 999

◆ tlm_len_per_tile_part

const uint32_t grk::tlm_len_per_tile_part = 5

◆ XMP_UUID

const uint8_t grk::XMP_UUID[16]
Initial value:
= { 0xBE, 0x7A, 0xCF, 0xCB, 0x97, 0xA9, 0x42, 0xE8,
0x9C, 0x71, 0x99, 0x94, 0x91, 0xE3, 0xAF, 0xAC }