Grok  7.6.2
Classes | Macros | Typedefs | Enumerations
grok.h File Reference
#include "grk_config.h"
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>

Go to the source code of this file.

Classes

struct  _grk_poc
 Progression order changes. More...
 
struct  _grk_raw_comp_cparameters
 
struct  _grk_raw_cparameters
 
struct  _grk_cparameters
 Compress parameters. More...
 
struct  _grk_channel_description
 Channel definition: channel index, type, association. More...
 
struct  _grk_channel_definition
 Channel definitions and number of definitions. More...
 
struct  _grk_component_mapping_comp
 Component mappings: component index, mapping type, palette column. More...
 
struct  _grk_palette_data
 Palette data. More...
 
struct  _grk_jp2_color
 ICC profile, palette, channel definition. More...
 
struct  _grk_header_info
 Header info. More...
 
struct  _grk_dparameters
 Core decompress parameters. More...
 
struct  _grk_prec
 Precision. More...
 
struct  _grk_decompress_params
 Decompress parameters. More...
 
struct  _grk_image_comp
 Image component. More...
 
struct  _grk_image
 Image. More...
 
struct  _grk_image_comptparm
 Image component parameters. More...
 
struct  _grk_packet_info
 Packet info. More...
 
struct  _grk_marker_info
 Marker info. More...
 
struct  _grk_tile_info
 Tile info. More...
 
struct  _grk_codestream_info
 Code stream info. More...
 
struct  _grk_tccp_info
 Component coding parameters info. More...
 
struct  _grk_tile_v2_info
 Tile coding parameter info. More...
 
struct  _grk_codestream_info_v2
 Code stream info v2. More...
 
struct  _grk_tp_index
 Tile part index info. More...
 
struct  _grk_tile_index
 Tile index info. More...
 
struct  _grk_codestream_index
 Code stream index info. More...
 
struct  _grk_plugin_pass
 Plugin pass. More...
 
struct  _grk_plugin_code_block
 Plugin code block. More...
 
struct  _grk_plugin_precinct
 Plugin precinct. More...
 
struct  _grk_plugin_band
 Plugin band. More...
 
struct  _grk_plugin_resolution
 Plugin resolution. More...
 
struct  grk_plugin_tile_component
 Plugin tile component. More...
 
struct  _grk_plugin_tile
 Plugin tile. More...
 
struct  _grk_plugin_load_info
 
struct  _grk_plugin_init_info
 
struct  grk_plugin_compress_user_callback_info
 
struct  _grk_plugin_decompress_callback_info
 

Macros

#define GRK_DEPRECATED(func)   func
 
#define GRK_API   __attribute__ ((visibility ("default")))
 
#define GRK_CALLCONV
 
#define GRK_PATH_LEN   4096
 Maximum allowed size for filenames. More...
 
#define GRK_J2K_MAX_DECOMP_LVLS   32
 Maximum number of decomposition levels authorized. More...
 
#define GRK_J2K_MAXRLVLS   (GRK_J2K_MAX_DECOMP_LVLS+1)
 Maximum number of resolution levels authorized. More...
 
#define GRK_J2K_MAXBANDS   (3*GRK_J2K_MAXRLVLS-2)
 Maximum number of sub-bands. More...
 
#define GRK_IMG_INFO   1
 Basic image information provided to the user. More...
 
#define GRK_J2K_MH_INFO   2
 Codestream information based only on the main header. More...
 
#define GRK_J2K_TH_INFO   4
 Tile information based on the current tile header. More...
 
#define GRK_J2K_TCH_INFO   8
 Tile/Component information of all tiles. More...
 
#define GRK_J2K_MH_IND   16
 Codestream index based only on the main header. More...
 
#define GRK_J2K_TH_IND   32
 Tile index based on the current tile. More...
 
#define GRK_JP2_INFO   128
 JP2 file information. More...
 
#define GRK_JP2_IND   256
 JP2 file index. More...
 
#define GRK_CBLKSTY_LAZY   0x01
 Selective arithmetic coding bypass. More...
 
#define GRK_CBLKSTY_RESET   0x02
 Reset context probabilities on coding pass boundaries. More...
 
#define GRK_CBLKSTY_TERMALL   0x04
 Termination on each coding pass. More...
 
#define GRK_CBLKSTY_VSC   0x08
 Vertically stripe causal context. More...
 
#define GRK_CBLKSTY_PTERM   0x10
 Predictable termination. More...
 
#define GRK_CBLKSTY_SEGSYM   0x20
 Segmentation symbols are used. More...
 
#define GRK_CBLKSTY_HT   0x40
 high throughput block coding More...
 
#define GRK_JPH_RSIZ_FLAG   0x4000
 for JPH, bit 14 of RSIZ must be set to 1 More...
 
#define GRK_PROFILE_NONE   0x0000 /** no profile, conform to 15444-1 */
 JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMDs) More...
 
#define GRK_PROFILE_0   0x0001 /** Profile 0 as described in 15444-1,Table A.45 */
 
#define GRK_PROFILE_1   0x0002 /** Profile 1 as described in 15444-1,Table A.45 */
 
#define GRK_PROFILE_CINEMA_2K   0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */
 
#define GRK_PROFILE_CINEMA_4K   0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */
 
#define GRK_PROFILE_CINEMA_S2K   0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */
 
#define GRK_PROFILE_CINEMA_S4K   0x0006 /** Scalable 4K cinema profile defined in 15444-1 AMD2 */
 
#define GRK_PROFILE_CINEMA_LTS   0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */
 
#define GRK_PROFILE_BC_SINGLE   0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */
 
#define GRK_PROFILE_BC_MULTI   0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */
 
#define GRK_PROFILE_BC_MULTI_R   0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */
 
#define GRK_PROFILE_BC_MASK   0x030F /** Mask for broadcast profile including main level */
 
#define GRK_PROFILE_IMF_2K   0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_IMF_4K   0x0500 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_IMF_8K   0x0600 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_IMF_2K_R   0x0700 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_IMF_4K_R   0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_IMF_8K_R   0x0900 /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD8 */
 
#define GRK_PROFILE_MASK   0x0FFF /** Mask for profile bits */
 
#define GRK_PROFILE_PART2   0x8000 /** At least 1 extension defined in 15444-2 (Part-2) */
 
#define GRK_PROFILE_PART2_EXTENSIONS_MASK   0x3FFF
 
#define GRK_EXTENSION_NONE   0x0000 /** No Part-2 extension */
 JPEG 2000 Part-2 extensions. More...
 
#define GRK_EXTENSION_MCT   0x0100 /** Custom MCT support */
 
#define GRK_IS_PART2(v)   ((v) & GRK_PROFILE_PART2)
 
#define GRK_IS_CINEMA(v)   (((v) >= GRK_PROFILE_CINEMA_2K) && ((v) <= GRK_PROFILE_CINEMA_S4K))
 
#define GRK_IS_STORAGE(v)   ((v) == GRK_PROFILE_CINEMA_LTS)
 
#define GRK_GET_IMF_OR_BROADCAST_PROFILE(v)   ((v) & 0x0f00)
 Extract profile without mainlevel/sublevel. More...
 
#define GRK_LEVEL_MAX   11U /** Maximum (main) level */
 
#define GRK_GET_LEVEL(v)   ((v) & 0xf) /** Extract (main) level */
 
#define GRK_IS_BROADCAST(v)
 
#define GRK_BROADCAST_LEVEL_1_MBITSSEC   200U /** Mbits/sec for level 1 */
 
#define GRK_BROADCAST_LEVEL_2_MBITSSEC   200U /** Mbits/sec for level 2 */
 
#define GRK_BROADCAST_LEVEL_3_MBITSSEC   200U /** Mbits/sec for level 3 */
 
#define GRK_BROADCAST_LEVEL_4_MBITSSEC   400U /** Mbits/sec for level 4 */
 
#define GRK_BROADCAST_LEVEL_5_MBITSSEC   800U /** Mbits/sec for level 5 */
 
#define GRK_BROADCAST_LEVEL_6_MBITSSEC   1600U /** Mbits/sec for level 6 */
 
#define GRK_BROADCAST_LEVEL_7_MBITSSEC   3200U /** Mbits/sec for level 7 */
 
#define GRK_BROADCAST_LEVEL_8_MBITSSEC   6400U /** Mbits/sec for level 8 */
 
#define GRK_BROADCAST_LEVEL_9_MBITSSEC   12800U /** Mbits/sec for level 9 */
 
#define GRK_BROADCAST_LEVEL_10_MBITSSEC   25600U /** Mbits/sec for level 10 */
 
#define GRK_BROADCAST_LEVEL_11_MBITSSEC   51200U /** Mbits/sec for level 11 */
 
#define GRK_BROADCAST_LEVEL_1_MSAMPLESSEC   64U /** MSamples/sec for level 1 */
 
#define GRK_BROADCAST_LEVEL_2_MSAMPLESSEC   130U /** MSamples/sec for level 2 */
 
#define GRK_BROADCAST_LEVEL_3_MSAMPLESSEC   195U /** MSamples/sec for level 3 */
 
#define GRK_BROADCAST_LEVEL_4_MSAMPLESSEC   260U /** MSamples/sec for level 4 */
 
#define GRK_BROADCAST_LEVEL_5_MSAMPLESSEC   520U /** MSamples/sec for level 5 */
 
#define GRK_BROADCAST_LEVEL_6_MSAMPLESSEC   1200U /** MSamples/sec for level 6 */
 
#define GRK_BROADCAST_LEVEL_7_MSAMPLESSEC   2400U /** MSamples/sec for level 7 */
 
#define GRK_BROADCAST_LEVEL_8_MSAMPLESSEC   4800U /** MSamples/sec for level 8 */
 
#define GRK_BROADCAST_LEVEL_9_MSAMPLESSEC   9600U /** MSamples/sec for level 9 */
 
#define GRK_BROADCAST_LEVEL_10_MSAMPLESSEC   19200U /** MSamples/sec for level 10 */
 
#define GRK_BROADCAST_LEVEL_11_MSAMPLESSEC   38400U /** MSamples/sec for level 11 */
 
#define GRK_IS_IMF(v)
 
#define GRK_IMF_MAINLEVEL_1_MSAMPLESSEC   65U /** MSamples/sec for main level 1 */
 
#define GRK_IMF_MAINLEVEL_2_MSAMPLESSEC   130U /** MSamples/sec for main level 2 */
 
#define GRK_IMF_MAINLEVEL_3_MSAMPLESSEC   195U /** MSamples/sec for main level 3 */
 
#define GRK_IMF_MAINLEVEL_4_MSAMPLESSEC   260U /** MSamples/sec for main level 4 */
 
#define GRK_IMF_MAINLEVEL_5_MSAMPLESSEC   520U /** MSamples/sec for main level 5 */
 
#define GRK_IMF_MAINLEVEL_6_MSAMPLESSEC   1200U /** MSamples/sec for main level 6 */
 
#define GRK_IMF_MAINLEVEL_7_MSAMPLESSEC   2400U /** MSamples/sec for main level 7 */
 
#define GRK_IMF_MAINLEVEL_8_MSAMPLESSEC   4800U /** MSamples/sec for main level 8 */
 
#define GRK_IMF_MAINLEVEL_9_MSAMPLESSEC   9600U /** MSamples/sec for main level 9 */
 
#define GRK_IMF_MAINLEVEL_10_MSAMPLESSEC   19200U /** MSamples/sec for main level 10 */
 
#define GRK_IMF_MAINLEVEL_11_MSAMPLESSEC   38400U /** MSamples/sec for main level 11 */
 
#define GRK_IMF_SUBLEVEL_MAX   9U /** Maximum IMF sublevel */
 
#define GRK_GET_IMF_SUBLEVEL(v)   (((v) >> 4) & 0xf) /** Extract IMF sub level */
 
#define GRK_IMF_SUBLEVEL_1_MBITSSEC   200U /** Mbits/s for IMF sub level 1 */
 Maximum compressed bit rate (Mbits/s) per IMF sub level. More...
 
#define GRK_IMF_SUBLEVEL_2_MBITSSEC   400U /** Mbits/s for IMF sub level 2 */
 
#define GRK_IMF_SUBLEVEL_3_MBITSSEC   800U /** Mbits/s for IMF sub level 3 */
 
#define GRK_IMF_SUBLEVEL_4_MBITSSEC   1600U /** Mbits/s for IMF sub level 4 */
 
#define GRK_IMF_SUBLEVEL_5_MBITSSEC   3200U /** Mbits/s for IMF sub level 5 */
 
#define GRK_IMF_SUBLEVEL_6_MBITSSEC   6400U /** Mbits/s for IMF sub level 6 */
 
#define GRK_IMF_SUBLEVEL_7_MBITSSEC   12800U /** Mbits/s for IMF sub level 7 */
 
#define GRK_IMF_SUBLEVEL_8_MBITSSEC   25600U /** Mbits/s for IMF sub level 8 */
 
#define GRK_IMF_SUBLEVEL_9_MBITSSEC   51200U /** Mbits/s for IMF sub level 9 */
 
#define GRK_CINEMA_24_CS   1302083U /** Maximum code stream length @ 24fps */
 JPEG 2000 cinema profile code stream and component size limits. More...
 
#define GRK_CINEMA_48_CS   651041U /** Maximum code stream length @ 48fps */
 
#define GRK_CINEMA_24_COMP   1041666U /** Maximum size per color component @ 24fps */
 
#define GRK_CINEMA_48_COMP   520833U /** Maximum size per color component @ 48fps */
 
#define GRK_CUSTOM_CIELAB_SPACE   0x0
 
#define GRK_DEFAULT_CIELAB_SPACE   0x44454600
 
#define GRK_CIE_DAY   ((((uint32_t) 'C')<<24) + (((uint32_t) 'T')<<16))
 
#define GRK_CIE_D50   ((uint32_t) 0x00443530)
 
#define GRK_CIE_D65   ((uint32_t) 0x00443635)
 
#define GRK_CIE_D75   ((uint32_t) 0x00443735)
 
#define GRK_CIE_SA   ((uint32_t) 0x00005341)
 
#define GRK_CIE_SC   ((uint32_t) 0x00005343)
 
#define GRK_CIE_F2   ((uint32_t) 0x00004632)
 
#define GRK_CIE_F7   ((uint32_t) 0x00004637)
 
#define GRK_CIE_F11   ((uint32_t) 0x00463131)
 
#define GRK_NUM_COMMENTS_SUPPORTED   256
 
#define GRK_MAX_COMMENT_LENGTH   (UINT16_MAX-2)
 

Typedefs

typedef enum _GRK_PROG_ORDER GRK_PROG_ORDER
 Progression order. More...
 
typedef enum _GRK_COLOR_SPACE GRK_COLOR_SPACE
 Supported image color spaces. More...
 
typedef enum _GRK_CODEC_FORMAT GRK_CODEC_FORMAT
 Supported codecs. More...
 
typedef void(* grk_msg_callback) (const char *msg, void *client_data)
 Callback function prototype for logging. More...
 
typedef struct _grk_poc grk_poc
 Progression order changes. More...
 
RAW component compress parameters
typedef struct _grk_raw_comp_cparameters grk_raw_comp_cparameters
 

Enumerations

enum  GRK_SUPPORTED_FILE_FMT {
  GRK_UNK_FMT, GRK_J2K_FMT, GRK_JP2_FMT, GRK_PXM_FMT,
  GRK_PGX_FMT, GRK_PAM_FMT, GRK_BMP_FMT, GRK_TIF_FMT,
  GRK_RAW_FMT, GRK_PNG_FMT, GRK_RAWL_FMT, GRK_JPG_FMT
}
 
enum  _GRK_PROG_ORDER {
  GRK_PROG_UNKNOWN = -1, GRK_LRCP = 0, GRK_RLCP = 1, GRK_RPCL = 2,
  GRK_PCRL = 3, GRK_CPRL = 4, GRK_NUM_PROGRESSION_ORDERS = 5
}
 Progression order. More...
 
enum  _GRK_COLOR_SPACE {
  GRK_CLRSPC_UNKNOWN = 0, GRK_CLRSPC_SRGB = 2, GRK_CLRSPC_GRAY = 3, GRK_CLRSPC_SYCC = 4,
  GRK_CLRSPC_EYCC = 5, GRK_CLRSPC_CMYK = 6, GRK_CLRSPC_DEFAULT_CIE = 7, GRK_CLRSPC_CUSTOM_CIE = 8,
  GRK_CLRSPC_ICC = 9
}
 Supported image color spaces. More...
 
enum  GRK_ENUM_COLOUR_SPACE {
  GRK_ENUM_CLRSPC_UNKNOWN = 0, GRK_ENUM_CLRSPC_CMYK = 12, GRK_ENUM_CLRSPC_CIE = 14, GRK_ENUM_CLRSPC_SRGB = 16,
  GRK_ENUM_CLRSPC_GRAY = 17, GRK_ENUM_CLRSPC_SYCC = 18, GRK_ENUM_CLRSPC_EYCC = 24
}
 
enum  _GRK_CODEC_FORMAT { GRK_CODEC_UNKNOWN = -1, GRK_CODEC_J2K = 0, GRK_CODEC_JP2 = 2 }
 Supported codecs. More...
 

RAW image compress parameters

#define GRK_DECOMPRESS_COMPRESSION_LEVEL_DEFAULT   (UINT_MAX)
 
#define GRK_DECODE_HEADER   (1 << 0)
 
#define GRK_DECODE_T2   (1 << 1)
 
#define GRK_DECODE_T1   (1 << 2)
 
#define GRK_DECODE_POST_T1   (1 << 3)
 
#define GRK_PLUGIN_DECODE_CLEAN   (1 << 4)
 
#define GRK_DECODE_ALL   (GRK_PLUGIN_DECODE_CLEAN | GRK_DECODE_HEADER | GRK_DECODE_T2 | GRK_DECODE_T1 | GRK_DECODE_POST_T1)
 
#define GRK_PLUGIN_STATE_NO_DEBUG   0x0
 
#define GRK_PLUGIN_STATE_DEBUG   0x1
 
#define GRK_PLUGIN_STATE_PRE_TR1   0x2
 
#define GRK_PLUGIN_STATE_DWT_QUANTIZATION   0x4
 
#define GRK_PLUGIN_STATE_MCT_ONLY   0x8
 
enum  grk_prec_mode { GRK_PREC_MODE_CLIP, GRK_PREC_MODE_SCALE }
 Precision mode. More...
 
enum  GRK_COMPONENT_TYPE { GRK_COMPONENT_TYPE_COLOUR = 0, GRK_COMPONENT_TYPE_OPACITY = 1, GRK_COMPONENT_TYPE_PREMULTIPLIED_OPACITY = 2, GRK_COMPONENT_TYPE_UNSPECIFIED = 65535U }
 
enum  GRK_COMPONENT_ASSOC {
  GRK_COMPONENT_ASSOC_WHOLE_IMAGE = 0, GRK_COMPONENT_ASSOC_COLOUR_1 = 1, GRK_COMPONENT_ASSOC_COLOUR_2 = 2, GRK_COMPONENT_ASSOC_COLOUR_3 = 3,
  GRK_COMPONENT_ASSOC_UNASSOCIATED = 65535U
}
 
typedef struct _grk_raw_cparameters grk_raw_cparameters
 
typedef struct _grk_cparameters grk_cparameters
 Compress parameters. More...
 
typedef struct _grk_channel_description grk_channel_description
 Channel definition: channel index, type, association. More...
 
typedef struct _grk_channel_definition grk_channel_definition
 Channel definitions and number of definitions. More...
 
typedef struct _grk_component_mapping_comp grk_component_mapping_comp
 Component mappings: component index, mapping type, palette column. More...
 
typedef struct _grk_palette_data grk_palette_data
 Palette data. More...
 
typedef struct _grk_jp2_color grk_jp2_color
 ICC profile, palette, channel definition. More...
 
typedef struct _grk_header_info grk_header_info
 Header info. More...
 
typedef struct _grk_dparameters grk_dparameters
 Core decompress parameters. More...
 
typedef enum grk_prec_mode grk_precision_mode
 Precision mode. More...
 
typedef struct _grk_prec grk_precision
 Precision. More...
 
typedef struct _grk_decompress_params grk_decompress_parameters
 Decompress parameters. More...
 
typedef void * grk_codec
 
typedef size_t(* grk_stream_read_fn) (void *p_buffer, size_t nb_bytes, void *user_data)
 
typedef size_t(* grk_stream_write_fn) (void *p_buffer, size_t nb_bytes, void *user_data)
 
typedef bool(* grk_stream_seek_fn) (uint64_t nb_bytes, void *user_data)
 
typedef void(* grk_stream_free_user_data_fn) (void *user_data)
 
typedef void * grk_stream
 
typedef struct _grk_image_comp grk_image_comp
 Image component. More...
 
typedef struct _grk_image grk_image
 Image. More...
 
typedef struct _grk_image_comptparm grk_image_cmptparm
 Image component parameters. More...
 
typedef struct _grk_packet_info grk_packet_info
 Packet info. More...
 
typedef struct _grk_marker_info grk_marker_info
 Marker info. More...
 
typedef struct _grk_tile_info grk_tile_info
 Tile info. More...
 
typedef struct _grk_codestream_info grk_codestream_info
 Code stream info. More...
 
typedef struct _grk_tccp_info grk_tccp_info
 Component coding parameters info. More...
 
typedef struct _grk_tile_v2_info grk_tile_info_v2
 Tile coding parameter info. More...
 
typedef struct _grk_codestream_info_v2 grk_codestream_info_v2
 Code stream info v2. More...
 
typedef struct _grk_tp_index grk_tp_index
 Tile part index info. More...
 
typedef struct _grk_tile_index grk_tile_index
 Tile index info. More...
 
typedef struct _grk_codestream_index grk_codestream_index
 Code stream index info. More...
 
typedef struct _grk_plugin_pass grk_plugin_pass
 Plugin pass. More...
 
typedef struct _grk_plugin_code_block grk_plugin_code_block
 Plugin code block. More...
 
typedef struct _grk_plugin_precinct grk_plugin_precinct
 Plugin precinct. More...
 
typedef struct _grk_plugin_band grk_plugin_band
 Plugin band. More...
 
typedef struct _grk_plugin_resolution grk_plugin_resolution
 Plugin resolution. More...
 
typedef struct grk_plugin_tile_component grk_plugin_tile_component
 Plugin tile component. More...
 
typedef struct _grk_plugin_tile grk_plugin_tile
 Plugin tile. More...
 
typedef struct _grk_plugin_load_info grk_plugin_load_info
 
typedef struct _grk_plugin_init_info grk_plugin_init_info
 
typedef struct grk_plugin_compress_user_callback_info grk_plugin_compress_user_callback_info
 
typedef bool(* GRK_PLUGIN_COMPRESS_USER_CALLBACK) (grk_plugin_compress_user_callback_info *info)
 
typedef int(* GROK_INIT_DECOMPRESSORS) (grk_header_info *header_info, grk_image *image)
 
typedef struct _grk_plugin_decompress_callback_info grk_plugin_decompress_callback_info
 
typedef int32_t(* grk_plugin_decompress_callback) (grk_plugin_decompress_callback_info *info)
 
GRK_API const char *GRK_CALLCONV grk_version (void)
 library version More...
 
GRK_API bool GRK_CALLCONV grk_initialize (const char *plugin_path, uint32_t numthreads)
 Initialize library. More...
 
GRK_API void GRK_CALLCONV grk_deinitialize ()
 De-initialize library. More...
 
GRK_API grk_image *GRK_CALLCONV grk_image_create (uint16_t numcmpts, grk_image_cmptparm *cmptparms, GRK_COLOR_SPACE clrspc, bool allocData)
 Create image. More...
 
GRK_API void GRK_CALLCONV grk_image_destroy (grk_image *image)
 Deallocate all resources associated with an image. More...
 
GRK_API void GRK_CALLCONV grk_image_all_components_data_free (grk_image *image)
 Deallocate all component data for an image. More...
 
GRK_API void GRK_CALLCONV grk_image_single_component_data_free (grk_image_comp *image)
 Deallocate data for single image component. More...
 
GRK_API grk_stream *GRK_CALLCONV grk_stream_create (size_t buffer_size, bool is_input)
 Create an abstract stream. More...
 
GRK_API void GRK_CALLCONV grk_stream_destroy (grk_stream *stream)
 Destroy a stream created by grk_create_stream. More...
 
GRK_API void GRK_CALLCONV grk_stream_set_read_function (grk_stream *stream, grk_stream_read_fn p_function)
 Set the given function to be used as a read function. More...
 
GRK_API void GRK_CALLCONV grk_stream_set_write_function (grk_stream *stream, grk_stream_write_fn p_function)
 Set the given function to be used as a write function. More...
 
GRK_API void GRK_CALLCONV grk_stream_set_seek_function (grk_stream *stream, grk_stream_seek_fn p_function)
 Set the given function to be used as a seek function, the stream is then seekable. More...
 
GRK_API void GRK_CALLCONV grk_stream_set_user_data (grk_stream *stream, void *data, grk_stream_free_user_data_fn p_function)
 Set the given data to be used as a user data for the stream. More...
 
GRK_API void GRK_CALLCONV grk_stream_set_user_data_length (grk_stream *stream, uint64_t data_length)
 Set the length of the user data for the stream. More...
 
GRK_API grk_stream *GRK_CALLCONV grk_stream_create_file_stream (const char *fname, size_t buffer_size, bool is_read_stream)
 Create stream from a file identified with its filename with a specific buffer size. More...
 
GRK_API grk_stream *GRK_CALLCONV grk_stream_create_mem_stream (uint8_t *buf, size_t buffer_len, bool ownsBuffer, bool is_read_stream)
 Create stream from buffer. More...
 
GRK_API size_t GRK_CALLCONV grk_stream_get_write_mem_stream_length (grk_stream *stream)
 Get length of memory stream. More...
 
GRK_API grk_stream *GRK_CALLCONV grk_stream_create_mapped_file_stream (const char *fname, bool read_stream)
 Create mapped file stream. More...
 
GRK_API bool GRK_CALLCONV grk_set_info_handler (grk_msg_callback p_callback, void *user_data)
 Set info handler. More...
 
GRK_API bool GRK_CALLCONV grk_set_warning_handler (grk_msg_callback p_callback, void *user_data)
 Set warning handler. More...
 
GRK_API bool GRK_CALLCONV grk_set_error_handler (grk_msg_callback p_callback, void *user_data)
 Set error handler. More...
 
GRK_API grk_codec GRK_CALLCONV grk_create_decompress (GRK_CODEC_FORMAT format, grk_stream *stream)
 Create J2K/JP2 decompression structure. More...
 
GRK_API void GRK_CALLCONV grk_set_default_decompress_params (grk_dparameters *parameters)
 Initialize decompress parameters with default values. More...
 
GRK_API bool GRK_CALLCONV grk_init_decompress (grk_codec codec, grk_dparameters *parameters)
 Set up the decompressor with decompress parameters. More...
 
GRK_API bool GRK_CALLCONV grk_read_header (grk_codec codec, grk_header_info *header_info, grk_image **image)
 Decompress JPEG 2000 header. More...
 
GRK_API bool GRK_CALLCONV grk_set_decompress_window (grk_codec codec, 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 decompressed. More...
 
GRK_API bool GRK_CALLCONV grk_decompress (grk_codec p_decompressor, grk_plugin_tile *tile, grk_image *image)
 Decompress image from a JPEG 2000 code stream. More...
 
GRK_API bool GRK_CALLCONV grk_decompress_tile (grk_codec codec, grk_image *image, uint16_t tile_index)
 Decompress a specific tile. More...
 
GRK_API bool GRK_CALLCONV grk_end_decompress (grk_codec codec)
 End decompression. More...
 
GRK_API grk_codec GRK_CALLCONV grk_create_compress (GRK_CODEC_FORMAT format, grk_stream *stream)
 Creates a J2K/JP2 compression structure. More...
 
GRK_API void GRK_CALLCONV grk_set_default_compress_params (grk_cparameters *parameters)
 Set compressing parameters to default values, that means : More...
 
GRK_API bool GRK_CALLCONV grk_init_compress (grk_codec codec, grk_cparameters *parameters, grk_image *image)
 Set up the compressor parameters using the current image and user parameters. More...
 
GRK_API bool GRK_CALLCONV grk_start_compress (grk_codec codec)
 Start compressing current image. More...
 
GRK_API bool GRK_CALLCONV grk_compress (grk_codec codec)
 Encode an image into a JPEG 2000 code stream. More...
 
GRK_API bool GRK_CALLCONV grk_compress_tile (grk_codec codec, uint16_t tile_index, uint8_t *data, uint64_t data_size)
 Compress uncompressed data stored in a buffer. More...
 
GRK_API bool GRK_CALLCONV grk_compress_with_plugin (grk_codec codec, grk_plugin_tile *tile)
 Encode an image into a JPEG 2000 code stream using plugin. More...
 
GRK_API bool GRK_CALLCONV grk_end_compress (grk_codec codec)
 End to compress the current image. More...
 
GRK_API void GRK_CALLCONV grk_destroy_codec (grk_codec codec)
 Destroy codec. More...
 
GRK_API void GRK_CALLCONV grk_destroy_cstr_info (grk_codestream_info_v2 **cstr_info)
 Destroy Codestream information after compression or decompression. More...
 
GRK_API void GRK_CALLCONV grk_dump_codec (grk_codec codec, uint32_t info_flag, FILE *output_stream)
 Dump codec information to file. More...
 
GRK_API grk_codestream_info_v2 *GRK_CALLCONV grk_get_cstr_info (grk_codec codec)
 Get code stream information from codec. More...
 
GRK_API grk_codestream_index *GRK_CALLCONV grk_get_cstr_index (grk_codec codec)
 Get the code stream index from the codec. More...
 
GRK_API void GRK_CALLCONV grk_destroy_cstr_index (grk_codestream_index **p_cstr_index)
 Destroy code stream index. More...
 
GRK_API bool GRK_CALLCONV grk_set_MCT (grk_cparameters *parameters, float *pEncodingMatrix, int32_t *p_dc_shift, uint32_t pNbComp)
 Set the MCT matrix to use. More...
 
GRK_API bool GRK_CALLCONV grk_plugin_load (grk_plugin_load_info info)
 Load plugin. More...
 
GRK_API void GRK_CALLCONV grk_plugin_cleanup (void)
 Release plugin resources. More...
 
GRK_API uint32_t GRK_CALLCONV grk_plugin_get_debug_state ()
 Get debug state of plugin. More...
 
GRK_API bool GRK_CALLCONV grk_plugin_init (grk_plugin_init_info initInfo)
 Initialize plugin. More...
 
GRK_API int32_t GRK_CALLCONV grk_plugin_compress (grk_cparameters *compress_parameters, GRK_PLUGIN_COMPRESS_USER_CALLBACK callback)
 Compress with plugin. More...
 
GRK_API int32_t GRK_CALLCONV grk_plugin_batch_compress (const char *input_dir, const char *output_dir, grk_cparameters *compress_parameters, GRK_PLUGIN_COMPRESS_USER_CALLBACK callback)
 Batch compress with plugin. More...
 
GRK_API bool GRK_CALLCONV grk_plugin_is_batch_complete (void)
 Check if batch job is complete. More...
 
GRK_API void GRK_CALLCONV grk_plugin_stop_batch_compress (void)
 Stop batch compress. More...
 
GRK_API int32_t GRK_CALLCONV grk_plugin_decompress (grk_decompress_parameters *decompress_parameters, grk_plugin_decompress_callback callback)
 Decompress with plugin. More...
 
GRK_API int32_t GRK_CALLCONV grk_plugin_init_batch_decompress (const char *input_dir, const char *output_dir, grk_decompress_parameters *decompress_parameters, grk_plugin_decompress_callback callback)
 Initialize batch decompress. More...
 
GRK_API int32_t GRK_CALLCONV grk_plugin_batch_decompress (void)
 Batch decompress. More...
 
GRK_API void GRK_CALLCONV grk_plugin_stop_batch_decompress (void)
 Stop batch decompress. More...
 

Macro Definition Documentation

◆ GRK_API

#define GRK_API   __attribute__ ((visibility ("default")))

◆ GRK_BROADCAST_LEVEL_10_MBITSSEC

#define GRK_BROADCAST_LEVEL_10_MBITSSEC   25600U /** Mbits/sec for level 10 */

◆ GRK_BROADCAST_LEVEL_10_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_10_MSAMPLESSEC   19200U /** MSamples/sec for level 10 */

◆ GRK_BROADCAST_LEVEL_11_MBITSSEC

#define GRK_BROADCAST_LEVEL_11_MBITSSEC   51200U /** Mbits/sec for level 11 */

◆ GRK_BROADCAST_LEVEL_11_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_11_MSAMPLESSEC   38400U /** MSamples/sec for level 11 */

◆ GRK_BROADCAST_LEVEL_1_MBITSSEC

#define GRK_BROADCAST_LEVEL_1_MBITSSEC   200U /** Mbits/sec for level 1 */

◆ GRK_BROADCAST_LEVEL_1_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_1_MSAMPLESSEC   64U /** MSamples/sec for level 1 */

◆ GRK_BROADCAST_LEVEL_2_MBITSSEC

#define GRK_BROADCAST_LEVEL_2_MBITSSEC   200U /** Mbits/sec for level 2 */

◆ GRK_BROADCAST_LEVEL_2_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_2_MSAMPLESSEC   130U /** MSamples/sec for level 2 */

◆ GRK_BROADCAST_LEVEL_3_MBITSSEC

#define GRK_BROADCAST_LEVEL_3_MBITSSEC   200U /** Mbits/sec for level 3 */

◆ GRK_BROADCAST_LEVEL_3_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_3_MSAMPLESSEC   195U /** MSamples/sec for level 3 */

◆ GRK_BROADCAST_LEVEL_4_MBITSSEC

#define GRK_BROADCAST_LEVEL_4_MBITSSEC   400U /** Mbits/sec for level 4 */

◆ GRK_BROADCAST_LEVEL_4_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_4_MSAMPLESSEC   260U /** MSamples/sec for level 4 */

◆ GRK_BROADCAST_LEVEL_5_MBITSSEC

#define GRK_BROADCAST_LEVEL_5_MBITSSEC   800U /** Mbits/sec for level 5 */

◆ GRK_BROADCAST_LEVEL_5_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_5_MSAMPLESSEC   520U /** MSamples/sec for level 5 */

◆ GRK_BROADCAST_LEVEL_6_MBITSSEC

#define GRK_BROADCAST_LEVEL_6_MBITSSEC   1600U /** Mbits/sec for level 6 */

◆ GRK_BROADCAST_LEVEL_6_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_6_MSAMPLESSEC   1200U /** MSamples/sec for level 6 */

◆ GRK_BROADCAST_LEVEL_7_MBITSSEC

#define GRK_BROADCAST_LEVEL_7_MBITSSEC   3200U /** Mbits/sec for level 7 */

◆ GRK_BROADCAST_LEVEL_7_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_7_MSAMPLESSEC   2400U /** MSamples/sec for level 7 */

◆ GRK_BROADCAST_LEVEL_8_MBITSSEC

#define GRK_BROADCAST_LEVEL_8_MBITSSEC   6400U /** Mbits/sec for level 8 */

◆ GRK_BROADCAST_LEVEL_8_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_8_MSAMPLESSEC   4800U /** MSamples/sec for level 8 */

◆ GRK_BROADCAST_LEVEL_9_MBITSSEC

#define GRK_BROADCAST_LEVEL_9_MBITSSEC   12800U /** Mbits/sec for level 9 */

◆ GRK_BROADCAST_LEVEL_9_MSAMPLESSEC

#define GRK_BROADCAST_LEVEL_9_MSAMPLESSEC   9600U /** MSamples/sec for level 9 */

◆ GRK_CALLCONV

#define GRK_CALLCONV

◆ GRK_CBLKSTY_HT

#define GRK_CBLKSTY_HT   0x40

high throughput block coding

◆ GRK_CBLKSTY_LAZY

#define GRK_CBLKSTY_LAZY   0x01

Selective arithmetic coding bypass.

◆ GRK_CBLKSTY_PTERM

#define GRK_CBLKSTY_PTERM   0x10

Predictable termination.

◆ GRK_CBLKSTY_RESET

#define GRK_CBLKSTY_RESET   0x02

Reset context probabilities on coding pass boundaries.

◆ GRK_CBLKSTY_SEGSYM

#define GRK_CBLKSTY_SEGSYM   0x20

Segmentation symbols are used.

◆ GRK_CBLKSTY_TERMALL

#define GRK_CBLKSTY_TERMALL   0x04

Termination on each coding pass.

◆ GRK_CBLKSTY_VSC

#define GRK_CBLKSTY_VSC   0x08

Vertically stripe causal context.

◆ GRK_CIE_D50

#define GRK_CIE_D50   ((uint32_t) 0x00443530)

◆ GRK_CIE_D65

#define GRK_CIE_D65   ((uint32_t) 0x00443635)

◆ GRK_CIE_D75

#define GRK_CIE_D75   ((uint32_t) 0x00443735)

◆ GRK_CIE_DAY

#define GRK_CIE_DAY   ((((uint32_t) 'C')<<24) + (((uint32_t) 'T')<<16))

◆ GRK_CIE_F11

#define GRK_CIE_F11   ((uint32_t) 0x00463131)

◆ GRK_CIE_F2

#define GRK_CIE_F2   ((uint32_t) 0x00004632)

◆ GRK_CIE_F7

#define GRK_CIE_F7   ((uint32_t) 0x00004637)

◆ GRK_CIE_SA

#define GRK_CIE_SA   ((uint32_t) 0x00005341)

◆ GRK_CIE_SC

#define GRK_CIE_SC   ((uint32_t) 0x00005343)

◆ GRK_CINEMA_24_COMP

#define GRK_CINEMA_24_COMP   1041666U /** Maximum size per color component @ 24fps */

◆ GRK_CINEMA_24_CS

#define GRK_CINEMA_24_CS   1302083U /** Maximum code stream length @ 24fps */

JPEG 2000 cinema profile code stream and component size limits.

◆ GRK_CINEMA_48_COMP

#define GRK_CINEMA_48_COMP   520833U /** Maximum size per color component @ 48fps */

◆ GRK_CINEMA_48_CS

#define GRK_CINEMA_48_CS   651041U /** Maximum code stream length @ 48fps */

◆ GRK_CUSTOM_CIELAB_SPACE

#define GRK_CUSTOM_CIELAB_SPACE   0x0

◆ GRK_DECODE_ALL

◆ GRK_DECODE_HEADER

#define GRK_DECODE_HEADER   (1 << 0)

◆ GRK_DECODE_POST_T1

#define GRK_DECODE_POST_T1   (1 << 3)

◆ GRK_DECODE_T1

#define GRK_DECODE_T1   (1 << 2)

◆ GRK_DECODE_T2

#define GRK_DECODE_T2   (1 << 1)

◆ GRK_DECOMPRESS_COMPRESSION_LEVEL_DEFAULT

#define GRK_DECOMPRESS_COMPRESSION_LEVEL_DEFAULT   (UINT_MAX)

◆ GRK_DEFAULT_CIELAB_SPACE

#define GRK_DEFAULT_CIELAB_SPACE   0x44454600

◆ GRK_DEPRECATED

#define GRK_DEPRECATED (   func)    func

◆ GRK_EXTENSION_MCT

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

◆ GRK_EXTENSION_NONE

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

JPEG 2000 Part-2 extensions.

◆ GRK_GET_IMF_OR_BROADCAST_PROFILE

#define GRK_GET_IMF_OR_BROADCAST_PROFILE (   v)    ((v) & 0x0f00)

Extract profile without mainlevel/sublevel.

◆ GRK_GET_IMF_SUBLEVEL

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

◆ GRK_GET_LEVEL

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

◆ GRK_IMF_MAINLEVEL_10_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_10_MSAMPLESSEC   19200U /** MSamples/sec for main level 10 */

◆ GRK_IMF_MAINLEVEL_11_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_11_MSAMPLESSEC   38400U /** MSamples/sec for main level 11 */

◆ GRK_IMF_MAINLEVEL_1_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_1_MSAMPLESSEC   65U /** MSamples/sec for main level 1 */

◆ GRK_IMF_MAINLEVEL_2_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_2_MSAMPLESSEC   130U /** MSamples/sec for main level 2 */

◆ GRK_IMF_MAINLEVEL_3_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_3_MSAMPLESSEC   195U /** MSamples/sec for main level 3 */

◆ GRK_IMF_MAINLEVEL_4_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_4_MSAMPLESSEC   260U /** MSamples/sec for main level 4 */

◆ GRK_IMF_MAINLEVEL_5_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_5_MSAMPLESSEC   520U /** MSamples/sec for main level 5 */

◆ GRK_IMF_MAINLEVEL_6_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_6_MSAMPLESSEC   1200U /** MSamples/sec for main level 6 */

◆ GRK_IMF_MAINLEVEL_7_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_7_MSAMPLESSEC   2400U /** MSamples/sec for main level 7 */

◆ GRK_IMF_MAINLEVEL_8_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_8_MSAMPLESSEC   4800U /** MSamples/sec for main level 8 */

◆ GRK_IMF_MAINLEVEL_9_MSAMPLESSEC

#define GRK_IMF_MAINLEVEL_9_MSAMPLESSEC   9600U /** MSamples/sec for main level 9 */

◆ GRK_IMF_SUBLEVEL_1_MBITSSEC

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

Maximum compressed bit rate (Mbits/s) per IMF sub level.

◆ GRK_IMF_SUBLEVEL_2_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_3_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_4_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_5_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_6_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_7_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_8_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_9_MBITSSEC

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

◆ GRK_IMF_SUBLEVEL_MAX

#define GRK_IMF_SUBLEVEL_MAX   9U /** Maximum IMF sublevel */

◆ GRK_IMG_INFO

#define GRK_IMG_INFO   1

Basic image information provided to the user.

◆ GRK_IS_BROADCAST

#define GRK_IS_BROADCAST (   v)
Value:
( ((v) >= GRK_PROFILE_BC_SINGLE) && \
((v) <= (GRK_PROFILE_BC_MULTI_R | 0x000b) ) && \
( ((v) & 0xf) <= 0xb ) )

◆ GRK_IS_CINEMA

#define GRK_IS_CINEMA (   v)    (((v) >= GRK_PROFILE_CINEMA_2K) && ((v) <= GRK_PROFILE_CINEMA_S4K))

◆ GRK_IS_IMF

#define GRK_IS_IMF (   v)
Value:
( ((v) >= GRK_PROFILE_IMF_2K) && \
((v) <= (GRK_PROFILE_IMF_8K_R | 0x009b) ) && \
( ((v) & 0xf) <= 0xb ) && \
( ((v) & 0xf0) <= 0x90 ) )

◆ GRK_IS_PART2

#define GRK_IS_PART2 (   v)    ((v) & GRK_PROFILE_PART2)

◆ GRK_IS_STORAGE

#define GRK_IS_STORAGE (   v)    ((v) == GRK_PROFILE_CINEMA_LTS)

◆ GRK_J2K_MAX_DECOMP_LVLS

#define GRK_J2K_MAX_DECOMP_LVLS   32

Maximum number of decomposition levels authorized.

◆ GRK_J2K_MAXBANDS

#define GRK_J2K_MAXBANDS   (3*GRK_J2K_MAXRLVLS-2)

Maximum number of sub-bands.

◆ GRK_J2K_MAXRLVLS

#define GRK_J2K_MAXRLVLS   (GRK_J2K_MAX_DECOMP_LVLS+1)

Maximum number of resolution levels authorized.

◆ GRK_J2K_MH_IND

#define GRK_J2K_MH_IND   16

Codestream index based only on the main header.

◆ GRK_J2K_MH_INFO

#define GRK_J2K_MH_INFO   2

Codestream information based only on the main header.

◆ GRK_J2K_TCH_INFO

#define GRK_J2K_TCH_INFO   8

Tile/Component information of all tiles.

◆ GRK_J2K_TH_IND

#define GRK_J2K_TH_IND   32

Tile index based on the current tile.

◆ GRK_J2K_TH_INFO

#define GRK_J2K_TH_INFO   4

Tile information based on the current tile header.

◆ GRK_JP2_IND

#define GRK_JP2_IND   256

JP2 file index.

◆ GRK_JP2_INFO

#define GRK_JP2_INFO   128

JP2 file information.

◆ GRK_JPH_RSIZ_FLAG

#define GRK_JPH_RSIZ_FLAG   0x4000

for JPH, bit 14 of RSIZ must be set to 1

◆ GRK_LEVEL_MAX

#define GRK_LEVEL_MAX   11U /** Maximum (main) level */

◆ GRK_MAX_COMMENT_LENGTH

#define GRK_MAX_COMMENT_LENGTH   (UINT16_MAX-2)

◆ GRK_NUM_COMMENTS_SUPPORTED

#define GRK_NUM_COMMENTS_SUPPORTED   256

◆ GRK_PATH_LEN

#define GRK_PATH_LEN   4096

Maximum allowed size for filenames.

◆ GRK_PLUGIN_DECODE_CLEAN

#define GRK_PLUGIN_DECODE_CLEAN   (1 << 4)

◆ GRK_PLUGIN_STATE_DEBUG

#define GRK_PLUGIN_STATE_DEBUG   0x1

◆ GRK_PLUGIN_STATE_DWT_QUANTIZATION

#define GRK_PLUGIN_STATE_DWT_QUANTIZATION   0x4

◆ GRK_PLUGIN_STATE_MCT_ONLY

#define GRK_PLUGIN_STATE_MCT_ONLY   0x8

◆ GRK_PLUGIN_STATE_NO_DEBUG

#define GRK_PLUGIN_STATE_NO_DEBUG   0x0

◆ GRK_PLUGIN_STATE_PRE_TR1

#define GRK_PLUGIN_STATE_PRE_TR1   0x2

◆ GRK_PROFILE_0

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

◆ GRK_PROFILE_1

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

◆ GRK_PROFILE_BC_MASK

#define GRK_PROFILE_BC_MASK   0x030F /** Mask for broadcast profile including main level */

◆ GRK_PROFILE_BC_MULTI

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

◆ GRK_PROFILE_BC_MULTI_R

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

◆ GRK_PROFILE_BC_SINGLE

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

◆ GRK_PROFILE_CINEMA_2K

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

◆ GRK_PROFILE_CINEMA_4K

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

◆ GRK_PROFILE_CINEMA_LTS

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

◆ GRK_PROFILE_CINEMA_S2K

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

◆ GRK_PROFILE_CINEMA_S4K

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

◆ GRK_PROFILE_IMF_2K

#define GRK_PROFILE_IMF_2K   0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD8 */

◆ GRK_PROFILE_IMF_2K_R

#define GRK_PROFILE_IMF_2K_R   0x0700 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD8 */

◆ GRK_PROFILE_IMF_4K

#define GRK_PROFILE_IMF_4K   0x0500 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD8 */

◆ GRK_PROFILE_IMF_4K_R

#define GRK_PROFILE_IMF_4K_R   0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD8 */

◆ GRK_PROFILE_IMF_8K

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

◆ GRK_PROFILE_IMF_8K_R

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

◆ GRK_PROFILE_MASK

#define GRK_PROFILE_MASK   0x0FFF /** Mask for profile bits */

◆ GRK_PROFILE_NONE

#define GRK_PROFILE_NONE   0x0000 /** no profile, conform to 15444-1 */

JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMDs)

These values help choose the RSIZ value for the JPEG 2000 code stream. The RSIZ value forces various compressing options, as detailed in Table A.10. If GRK_PROFILE_PART2 is chosen, it must be combined with one or more extensions described below.

Example: rsiz = GRK_PROFILE_PART2 | GRK_EXTENSION_MCT;

For broadcast profiles, the GRK_PROFILE_X value has to be combined with the target level (3-0 LSB, value between 0 and 11): Example: rsiz = GRK_PROFILE_BC_MULTI | 0x0005; //level equals 5

For IMF profiles, the GRK_PROFILE_X value has to be combined with the target main-level (3-0 LSB, value between 0 and 11) and sub-level (7-4 LSB, value between 0 and 9): Example: rsiz = GRK_PROFILE_IMF_2K | 0x0040 | 0x0005; // main-level equals 5 and sub-level equals 4

◆ GRK_PROFILE_PART2

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

◆ GRK_PROFILE_PART2_EXTENSIONS_MASK

#define GRK_PROFILE_PART2_EXTENSIONS_MASK   0x3FFF

Typedef Documentation

◆ grk_channel_definition

Channel definitions and number of definitions.

◆ grk_channel_description

Channel definition: channel index, type, association.

◆ grk_codec

typedef void* grk_codec

◆ GRK_CODEC_FORMAT

Supported codecs.

◆ grk_codestream_index

Code stream index info.

◆ grk_codestream_info

Code stream info.

◆ grk_codestream_info_v2

Code stream info v2.

◆ GRK_COLOR_SPACE

Supported image color spaces.

◆ grk_component_mapping_comp

Component mappings: component index, mapping type, palette column.

◆ grk_cparameters

Compress parameters.

◆ grk_decompress_parameters

Decompress parameters.

◆ grk_dparameters

Core decompress parameters.

◆ grk_header_info

Header info.

◆ grk_image

typedef struct _grk_image grk_image

Image.

◆ grk_image_cmptparm

Image component parameters.

◆ grk_image_comp

Image component.

◆ grk_jp2_color

typedef struct _grk_jp2_color grk_jp2_color

ICC profile, palette, channel definition.

◆ grk_marker_info

Marker info.

◆ grk_msg_callback

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

Callback function prototype for logging.

Parameters
msgEvent message
client_dataClient object where will be return the event message

◆ grk_packet_info

Packet info.

◆ grk_palette_data

Palette data.

◆ grk_plugin_band

Plugin band.

◆ grk_plugin_code_block

Plugin code block.

◆ GRK_PLUGIN_COMPRESS_USER_CALLBACK

typedef bool(* GRK_PLUGIN_COMPRESS_USER_CALLBACK) (grk_plugin_compress_user_callback_info *info)

◆ grk_plugin_compress_user_callback_info

◆ grk_plugin_decompress_callback

typedef int32_t(* grk_plugin_decompress_callback) (grk_plugin_decompress_callback_info *info)

◆ grk_plugin_decompress_callback_info

◆ grk_plugin_init_info

◆ grk_plugin_load_info

◆ grk_plugin_pass

Plugin pass.

◆ grk_plugin_precinct

Plugin precinct.

◆ grk_plugin_resolution

Plugin resolution.

◆ grk_plugin_tile

Plugin tile.

◆ grk_plugin_tile_component

Plugin tile component.

◆ grk_poc

typedef struct _grk_poc grk_poc

Progression order changes.

◆ grk_precision

typedef struct _grk_prec grk_precision

Precision.

◆ grk_precision_mode

Precision mode.

◆ GRK_PROG_ORDER

Progression order.

◆ grk_raw_comp_cparameters

◆ grk_raw_cparameters

◆ grk_stream

typedef void* grk_stream

◆ grk_stream_free_user_data_fn

typedef void(* grk_stream_free_user_data_fn) (void *user_data)

◆ grk_stream_read_fn

typedef size_t(* grk_stream_read_fn) (void *p_buffer, size_t nb_bytes, void *user_data)

◆ grk_stream_seek_fn

typedef bool(* grk_stream_seek_fn) (uint64_t nb_bytes, void *user_data)

◆ grk_stream_write_fn

typedef size_t(* grk_stream_write_fn) (void *p_buffer, size_t nb_bytes, void *user_data)

◆ grk_tccp_info

typedef struct _grk_tccp_info grk_tccp_info

Component coding parameters info.

◆ grk_tile_index

Tile index info.

◆ grk_tile_info

typedef struct _grk_tile_info grk_tile_info

Tile info.

◆ grk_tile_info_v2

Tile coding parameter info.

◆ grk_tp_index

typedef struct _grk_tp_index grk_tp_index

Tile part index info.

◆ GROK_INIT_DECOMPRESSORS

typedef int(* GROK_INIT_DECOMPRESSORS) (grk_header_info *header_info, grk_image *image)

Enumeration Type Documentation

◆ _GRK_CODEC_FORMAT

Supported codecs.

Enumerator
GRK_CODEC_UNKNOWN 

place-holder

GRK_CODEC_J2K 

JPEG 2000 code stream : read/write.

GRK_CODEC_JP2 

JP2 file format : read/write.

◆ _GRK_COLOR_SPACE

Supported image color spaces.

Enumerator
GRK_CLRSPC_UNKNOWN 

unknown

GRK_CLRSPC_SRGB 

sRGB

GRK_CLRSPC_GRAY 

grayscale

GRK_CLRSPC_SYCC 

standard YCC (YUV)

GRK_CLRSPC_EYCC 

extended YCC

GRK_CLRSPC_CMYK 

CMYK.

GRK_CLRSPC_DEFAULT_CIE 

default CIE LAB

GRK_CLRSPC_CUSTOM_CIE 

custom CIE LAB

GRK_CLRSPC_ICC 

ICC profile.

◆ _GRK_PROG_ORDER

Progression order.

Enumerator
GRK_PROG_UNKNOWN 

place-holder

GRK_LRCP 

layer-resolution-component-precinct order

GRK_RLCP 

resolution-layer-component-precinct order

GRK_RPCL 

resolution-precinct-component-layer order

GRK_PCRL 

precinct-component-resolution-layer order

GRK_CPRL 

component-precinct-resolution-layer order

GRK_NUM_PROGRESSION_ORDERS 

◆ GRK_COMPONENT_ASSOC

Enumerator
GRK_COMPONENT_ASSOC_WHOLE_IMAGE 
GRK_COMPONENT_ASSOC_COLOUR_1 
GRK_COMPONENT_ASSOC_COLOUR_2 
GRK_COMPONENT_ASSOC_COLOUR_3 
GRK_COMPONENT_ASSOC_UNASSOCIATED 

◆ GRK_COMPONENT_TYPE

Enumerator
GRK_COMPONENT_TYPE_COLOUR 
GRK_COMPONENT_TYPE_OPACITY 
GRK_COMPONENT_TYPE_PREMULTIPLIED_OPACITY 
GRK_COMPONENT_TYPE_UNSPECIFIED 

◆ GRK_ENUM_COLOUR_SPACE

Enumerator
GRK_ENUM_CLRSPC_UNKNOWN 
GRK_ENUM_CLRSPC_CMYK 
GRK_ENUM_CLRSPC_CIE 
GRK_ENUM_CLRSPC_SRGB 
GRK_ENUM_CLRSPC_GRAY 
GRK_ENUM_CLRSPC_SYCC 
GRK_ENUM_CLRSPC_EYCC 

◆ grk_prec_mode

Precision mode.

Enumerator
GRK_PREC_MODE_CLIP 
GRK_PREC_MODE_SCALE 

◆ GRK_SUPPORTED_FILE_FMT

Enumerator
GRK_UNK_FMT 
GRK_J2K_FMT 
GRK_JP2_FMT 
GRK_PXM_FMT 
GRK_PGX_FMT 
GRK_PAM_FMT 
GRK_BMP_FMT 
GRK_TIF_FMT 
GRK_RAW_FMT 
GRK_PNG_FMT 
GRK_RAWL_FMT 
GRK_JPG_FMT 

Function Documentation

◆ grk_compress()

GRK_API bool GRK_CALLCONV grk_compress ( grk_codec  codec)

Encode an image into a JPEG 2000 code stream.

Parameters
codeccompressor handle
Returns
Returns true if successful, returns false otherwise

References grk_compress_with_plugin().

◆ grk_compress_tile()

GRK_API bool GRK_CALLCONV grk_compress_tile ( grk_codec  codec,
uint16_t  tile_index,
uint8_t *  data,
uint64_t  data_size 
)

Compress uncompressed data stored in a buffer.

This method should be called right after grk_start_compress, and before grk_end_compress.

Parameters
codecJPEG 2000 code stream
tile_indexthe index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.
datapointer to the data to write. Data is arranged in planar sequence, data_comp0, data_comp1 etc, The data should NOT BE INTERLEAVED.
data_sizethis value is used to ensure the data being written is correct. The size must be equal to the sum for each component of tile_width * tile_height * component_size. component_size can be 1 or 2 bytes, depending on the precision of the given component.
Returns
true if the data could be written.

◆ grk_compress_with_plugin()

GRK_API bool GRK_CALLCONV grk_compress_with_plugin ( grk_codec  codec,
grk_plugin_tile tile 
)

Encode an image into a JPEG 2000 code stream using plugin.

Parameters
codeccompressor handle
tileplugin tile
Returns
Returns true if successful, returns false otherwise

Referenced by grk_compress().

◆ grk_create_compress()

GRK_API grk_codec GRK_CALLCONV grk_create_compress ( GRK_CODEC_FORMAT  format,
grk_stream stream 
)

Creates a J2K/JP2 compression structure.

Parameters
formatCoder to select
streamthe JPEG 2000 stream.
Returns
Returns a handle to a compressor if successful, returns nullptr otherwise

References grk::grk_calloc(), GRK_CODEC_J2K, GRK_CODEC_JP2, GRK_CODEC_UNKNOWN, and grk::grk_free().

◆ grk_create_decompress()

GRK_API grk_codec GRK_CALLCONV grk_create_decompress ( GRK_CODEC_FORMAT  format,
grk_stream stream 
)

Create J2K/JP2 decompression structure.

Parameters
formatJPEG 2000 format
streamJPEG 2000 stream.
Returns
a handle to a decompressor if successful, otherwise nullptr

References grk::grk_calloc(), GRK_CODEC_J2K, GRK_CODEC_JP2, GRK_CODEC_UNKNOWN, and grk::grk_free().

◆ grk_decompress()

GRK_API bool GRK_CALLCONV grk_decompress ( grk_codec  p_decompressor,
grk_plugin_tile tile,
grk_image image 
)

Decompress image from a JPEG 2000 code stream.

Parameters
p_decompressordecompressor handle
tiletile struct from plugin
imagethe decompressed image
Returns
true if success, otherwise false

◆ grk_decompress_tile()

GRK_API bool GRK_CALLCONV grk_decompress_tile ( grk_codec  codec,
grk_image image,
uint16_t  tile_index 
)

Decompress a specific tile.

Parameters
codecJPEG 2000 code stream
imageoutput image
tile_indexindex of the tile to be decompressed
Returns
true if success, otherwise false

◆ grk_deinitialize()

GRK_API void GRK_CALLCONV grk_deinitialize ( )

De-initialize library.

References grk_plugin_cleanup(), and ThreadPool::release().

Referenced by main().

◆ grk_destroy_codec()

GRK_API void GRK_CALLCONV grk_destroy_codec ( grk_codec  codec)

Destroy codec.

Parameters
codecJPEG 2000 code stream

References grk::grk_free().

◆ grk_destroy_cstr_index()

GRK_API void GRK_CALLCONV grk_destroy_cstr_index ( grk_codestream_index **  p_cstr_index)

Destroy code stream index.

Parameters
p_cstr_indexcode stream index

References grk::j2k_destroy_cstr_index().

◆ grk_destroy_cstr_info()

GRK_API void GRK_CALLCONV grk_destroy_cstr_info ( grk_codestream_info_v2 **  cstr_info)

Destroy Codestream information after compression or decompression.

Parameters
cstr_infoCodestream information structure

References grk::grk_free().

Referenced by grk::j2k_get_cstr_info().

◆ grk_dump_codec()

GRK_API void GRK_CALLCONV grk_dump_codec ( grk_codec  codec,
uint32_t  info_flag,
FILE *  output_stream 
)

Dump codec information to file.

Parameters
codecJPEG 2000 code stream.
info_flagtype of information dump.
output_streamoutput stream where dump the information get from the codec.

◆ grk_end_compress()

GRK_API bool GRK_CALLCONV grk_end_compress ( grk_codec  codec)

End to compress the current image.

Parameters
codecCompressor handle

◆ grk_end_decompress()

GRK_API bool GRK_CALLCONV grk_end_decompress ( grk_codec  codec)

End decompression.

Parameters
codecJPEG 2000 code stream

◆ grk_get_cstr_index()

GRK_API grk_codestream_index* GRK_CALLCONV grk_get_cstr_index ( grk_codec  codec)

Get the code stream index from the codec.

Parameters
codecJPEG 2000 code stream.
Returns
pointer to a code stream index structure.

◆ grk_get_cstr_info()

GRK_API grk_codestream_info_v2* GRK_CALLCONV grk_get_cstr_info ( grk_codec  codec)

Get code stream information from codec.

Parameters
codecJPEG 2000 code stream
Returns
pointer to a code stream information structure.

◆ grk_image_all_components_data_free()

GRK_API void GRK_CALLCONV grk_image_all_components_data_free ( grk_image image)

Deallocate all component data for an image.

Parameters
imageimage

References _grk_image::comps, grk_image_single_component_data_free(), and _grk_image::numcomps.

Referenced by grk::grk_copy_image_header(), and grk_image_destroy().

◆ grk_image_create()

GRK_API grk_image* GRK_CALLCONV grk_image_create ( uint16_t  numcmpts,
grk_image_cmptparm cmptparms,
GRK_COLOR_SPACE  clrspc,
bool  allocData 
)

◆ grk_image_destroy()

GRK_API void GRK_CALLCONV grk_image_destroy ( grk_image image)

◆ grk_image_single_component_data_free()

GRK_API void GRK_CALLCONV grk_image_single_component_data_free ( grk_image_comp image)

◆ grk_init_compress()

GRK_API bool GRK_CALLCONV grk_init_compress ( grk_codec  codec,
grk_cparameters parameters,
grk_image image 
)

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

Parameters
codecJPEG 2000 code stream
parameterscompression parameters
imageinput image

◆ grk_init_decompress()

GRK_API bool GRK_CALLCONV grk_init_decompress ( grk_codec  codec,
grk_dparameters parameters 
)

Set up the decompressor with decompress parameters.

Parameters
codecdecompressor handler
parametersdecompression parameters
Returns
true if the decompressor is correctly set

◆ grk_initialize()

GRK_API bool GRK_CALLCONV grk_initialize ( const char *  plugin_path,
uint32_t  numthreads 
)

Initialize library.

Parameters
plugin_pathpath to plugin
numthreadsnumber of threads to use for compress/decompress

References ojph::local::decode_vlc_init_tables(), ojph::local::encode_uvlc_init_tables(), ojph::local::encode_vlc_init_tables(), grk_plugin_load(), ojph::info, ThreadPool::instance(), and is_plugin_initialized.

Referenced by main().

◆ grk_plugin_batch_compress()

GRK_API int32_t GRK_CALLCONV grk_plugin_batch_compress ( const char *  input_dir,
const char *  output_dir,
grk_cparameters compress_parameters,
GRK_PLUGIN_COMPRESS_USER_CALLBACK  callback 
)

Batch compress with plugin.

Parameters
input_dirdirectory holding input images
output_dirdirectory holding compressed output images
compress_parameterscompress parameters
callbackcallback
Returns
0 if successful

References grk_plugin_internal_encode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_batch_encode_method_name, pluginLoaded, and userEncodeCallback.

◆ grk_plugin_batch_decompress()

GRK_API int32_t GRK_CALLCONV grk_plugin_batch_decompress ( void  )

◆ grk_plugin_cleanup()

GRK_API void GRK_CALLCONV grk_plugin_cleanup ( void  )

Release plugin resources.

References grk::minpf_cleanup_plugin_manager(), and pluginLoaded.

Referenced by grk_deinitialize().

◆ grk_plugin_compress()

GRK_API int32_t GRK_CALLCONV grk_plugin_compress ( grk_cparameters compress_parameters,
GRK_PLUGIN_COMPRESS_USER_CALLBACK  callback 
)

Compress with plugin.

Parameters
compress_parameterscompress parameters
callbackcallback

References grk_plugin_internal_encode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_encode_method_name, pluginLoaded, and userEncodeCallback.

◆ grk_plugin_decompress()

GRK_API int32_t GRK_CALLCONV grk_plugin_decompress ( grk_decompress_parameters decompress_parameters,
grk_plugin_decompress_callback  callback 
)

Decompress with plugin.

Parameters
decompress_parametersdecompress parameters
callbackcallback

References decodeCallback, grk_plugin_internal_decode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_decode_method_name, and pluginLoaded.

◆ grk_plugin_get_debug_state()

GRK_API uint32_t GRK_CALLCONV grk_plugin_get_debug_state ( )

◆ grk_plugin_init()

GRK_API bool GRK_CALLCONV grk_plugin_init ( grk_plugin_init_info  initInfo)

◆ grk_plugin_init_batch_decompress()

GRK_API int32_t GRK_CALLCONV grk_plugin_init_batch_decompress ( const char *  input_dir,
const char *  output_dir,
grk_decompress_parameters decompress_parameters,
grk_plugin_decompress_callback  callback 
)

Initialize batch decompress.

Parameters
input_dirinput directory holding compressed images
output_diroutput directory holding decompressed images
decompress_parametersdecompress parameters
callbackcallback
Returns
0 if successful

References decodeCallback, grk_plugin_internal_decode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_init_batch_decode_method_name, and pluginLoaded.

◆ grk_plugin_is_batch_complete()

GRK_API bool GRK_CALLCONV grk_plugin_is_batch_complete ( void  )

◆ grk_plugin_load()

GRK_API bool GRK_CALLCONV grk_plugin_load ( grk_plugin_load_info  info)

◆ grk_plugin_stop_batch_compress()

GRK_API void GRK_CALLCONV grk_plugin_stop_batch_compress ( void  )

◆ grk_plugin_stop_batch_decompress()

GRK_API void GRK_CALLCONV grk_plugin_stop_batch_decompress ( void  )

◆ grk_read_header()

GRK_API bool GRK_CALLCONV grk_read_header ( grk_codec  codec,
grk_header_info header_info,
grk_image **  image 
)

Decompress JPEG 2000 header.

Parameters
codecJPEG 2000 code stream to read.
header_infoinformation read from JPEG 2000 header.
imagethe image structure initialized with the characteristics of encoded image.
Returns
true if the main header of the code stream and the JP2 header is correctly read.

◆ grk_set_decompress_window()

GRK_API bool GRK_CALLCONV grk_set_decompress_window ( grk_codec  codec,
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 decompressed.

This function should be called right after grk_read_header is called, and before any tile header is read.

Parameters
codecJPEG 2000 code stream.
imageimage created by grk_read_header
start_xleft position of the rectangle to decompress (in image coordinates).
end_xthe right position of the rectangle to decompress (in image coordinates).
start_yup 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.

◆ grk_set_default_compress_params()

GRK_API void GRK_CALLCONV grk_set_default_compress_params ( grk_cparameters parameters)

Set compressing parameters to default values, that means :

Lossless Single tile Size of precinct : 2^15 x 2^15 (i.e. single precinct) Size of code block : 64 x 64 Number of resolutions: 6 No SOP marker in the code stream No EPH marker in the code stream No sub-sampling in x or y direction No mode switch activated Progression order: LRCP No index file No ROI upshifted Image origin lies at (0,0) Tile origin lies at (0,0) Reversible DWT 5-3 transform

Parameters
parametersCompression parameters

References _grk_cparameters::cblockh_init, _grk_cparameters::cblockw_init, _grk_cparameters::cod_format, _grk_cparameters::cp_disto_alloc, _grk_cparameters::cp_fixed_quality, _grk_cparameters::decod_format, _grk_cparameters::deviceId, grk::GRK_COMP_PARAM_DEFAULT_CBLOCKH, grk::GRK_COMP_PARAM_DEFAULT_CBLOCKW, grk::GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION, grk::GRK_COMP_PARAM_DEFAULT_PROG_ORDER, GRK_PROFILE_NONE, GRK_UNK_FMT, ThreadPool::hardware_concurrency(), _grk_cparameters::max_comp_size, _grk_cparameters::numresolution, _grk_cparameters::numThreads, _grk_cparameters::prog_order, _grk_cparameters::repeats, _grk_cparameters::roi_compno, _grk_cparameters::rsiz, _grk_cparameters::subsampling_dx, _grk_cparameters::subsampling_dy, _grk_cparameters::tcp_numlayers, _grk_cparameters::tcp_rates, _grk_cparameters::tp_on, _grk_cparameters::writePLT, and _grk_cparameters::writeTLM.

◆ grk_set_default_decompress_params()

GRK_API void GRK_CALLCONV grk_set_default_decompress_params ( grk_dparameters parameters)

Initialize decompress parameters with default values.

Parameters
parametersdecompression parameters

◆ grk_set_error_handler()

GRK_API bool GRK_CALLCONV grk_set_error_handler ( grk_msg_callback  p_callback,
void *  user_data 
)

Set error handler.

Parameters
p_callbackthe callback function which will be used
user_dataclient object where will be returned the message

References grk::logger::error_handler, grk::logger::m_error_data, and grk::logger::m_logger.

◆ grk_set_info_handler()

GRK_API bool GRK_CALLCONV grk_set_info_handler ( grk_msg_callback  p_callback,
void *  user_data 
)

Set info handler.

Parameters
p_callbackthe callback function which will be used
user_dataclient object where will be returned the message

References grk::logger::info_handler, grk::logger::m_info_data, and grk::logger::m_logger.

◆ grk_set_MCT()

GRK_API bool GRK_CALLCONV grk_set_MCT ( grk_cparameters parameters,
float *  pEncodingMatrix,
int32_t *  p_dc_shift,
uint32_t  pNbComp 
)

Set the MCT matrix to use.

Parameters
parametersthe parameters to change.
pEncodingMatrixthe compressing matrix.
p_dc_shiftthe dc shift coefficients to use.
pNbCompthe number of components of the image.
Returns
true if the parameters could be set.

References GRK_EXTENSION_MCT, GRK_IS_PART2, grk::grk_malloc(), GRK_PROFILE_PART2, _grk_cparameters::irreversible, _grk_cparameters::mct_data, _grk_cparameters::rsiz, and _grk_cparameters::tcp_mct.

◆ grk_set_warning_handler()

GRK_API bool GRK_CALLCONV grk_set_warning_handler ( grk_msg_callback  p_callback,
void *  user_data 
)

Set warning handler.

Parameters
p_callbackthe callback function which will be used
user_dataclient object where will be returned the message

References grk::logger::m_logger, grk::logger::m_warning_data, and grk::logger::warning_handler.

◆ grk_start_compress()

GRK_API bool GRK_CALLCONV grk_start_compress ( grk_codec  codec)

Start compressing current image.

Parameters
codecCompressor handle

◆ grk_stream_create()

GRK_API grk_stream* GRK_CALLCONV grk_stream_create ( size_t  buffer_size,
bool  is_input 
)

Create an abstract stream.

This function does nothing except allocate memory and initialize abstract stream.

Parameters
buffer_sizesize of stream's double-buffer
is_inputif set to true then the stream will be an input stream, an output stream else.
Returns
stream object.

Referenced by grk_stream_create_file_stream().

◆ grk_stream_create_file_stream()

GRK_API grk_stream* GRK_CALLCONV grk_stream_create_file_stream ( const char *  fname,
size_t  buffer_size,
bool  is_read_stream 
)

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

Parameters
fnamethe filename of the file to stream
buffer_sizesize of the chunk used to stream
is_read_streamwhether the stream is a read stream (true) or not (false)

References grk_free_file(), grk_get_data_length_from_file(), grk_read_from_file(), grk_seek_in_file(), grk_stream_create(), grk_stream_set_read_function(), grk_stream_set_seek_function(), grk_stream_set_user_data(), grk_stream_set_user_data_length(), grk_stream_set_write_function(), and grk_write_to_file().

◆ grk_stream_create_mapped_file_stream()

GRK_API grk_stream* GRK_CALLCONV grk_stream_create_mapped_file_stream ( const char *  fname,
bool  read_stream 
)

Create mapped file stream.

Parameters
fnamefile name
read_streamtrue if this is a read stream, otherwise false

References grk::create_mapped_file_read_stream(), and grk::create_mapped_file_write_stream().

◆ grk_stream_create_mem_stream()

GRK_API grk_stream* GRK_CALLCONV grk_stream_create_mem_stream ( uint8_t *  buf,
size_t  buffer_len,
bool  ownsBuffer,
bool  is_read_stream 
)

Create stream from buffer.

Parameters
bufbuffer
buffer_lenlength of buffer
ownsBufferif true, library will delete[] buffer. Otherwise, it is the caller's responsibility to delete the buffer
is_read_streamwhether the stream is a read stream (true) or not (false)

References grk::create_mem_stream().

◆ grk_stream_destroy()

GRK_API void GRK_CALLCONV grk_stream_destroy ( grk_stream stream)

Destroy a stream created by grk_create_stream.

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

Parameters
streamthe stream to destroy.

◆ grk_stream_get_write_mem_stream_length()

GRK_API size_t GRK_CALLCONV grk_stream_get_write_mem_stream_length ( grk_stream stream)

Get length of memory stream.

Parameters
streammemory stream

References grk::get_mem_stream_offset().

◆ grk_stream_set_read_function()

GRK_API void GRK_CALLCONV grk_stream_set_read_function ( grk_stream stream,
grk_stream_read_fn  p_function 
)

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

Parameters
streamthe stream to modify
p_functionthe function to use a read function.

References GROK_STREAM_STATUS_INPUT.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

◆ grk_stream_set_seek_function()

GRK_API void GRK_CALLCONV grk_stream_set_seek_function ( grk_stream stream,
grk_stream_seek_fn  p_function 
)

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

Parameters
streamthe stream to modify
p_functionthe function to use a skip function.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

◆ grk_stream_set_user_data()

GRK_API void GRK_CALLCONV grk_stream_set_user_data ( grk_stream stream,
void *  data,
grk_stream_free_user_data_fn  p_function 
)

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

Parameters
streamthe stream to modify
datathe data to set.
p_functionthe function to free data when grk_stream_destroy() is called.

Referenced by grk::create_mapped_file_read_stream(), grk::create_mapped_file_write_stream(), grk::create_mem_stream(), and grk_stream_create_file_stream().

◆ grk_stream_set_user_data_length()

GRK_API void GRK_CALLCONV grk_stream_set_user_data_length ( grk_stream stream,
uint64_t  data_length 
)

Set the length of the user data for the stream.

Parameters
streamthe stream to modify
data_lengthlength of the user_data.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

◆ grk_stream_set_write_function()

GRK_API void GRK_CALLCONV grk_stream_set_write_function ( grk_stream stream,
grk_stream_write_fn  p_function 
)

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

Parameters
streamthe stream to modify
p_functionthe function to use a write function.

References GROK_STREAM_STATUS_OUTPUT.

Referenced by grk_stream_create_file_stream(), and grk::set_up_mem_stream().

◆ grk_version()

GRK_API const char* GRK_CALLCONV grk_version ( void  )

library version

Referenced by grk::CodeStream::init_compress(), and main().

GRK_PROFILE_BC_MULTI_R
#define GRK_PROFILE_BC_MULTI_R
Definition: grok.h:133
GRK_PROFILE_IMF_8K_R
#define GRK_PROFILE_IMF_8K_R
Definition: grok.h:140
GRK_PROFILE_IMF_2K
#define GRK_PROFILE_IMF_2K
Definition: grok.h:135
GRK_PROFILE_BC_SINGLE
#define GRK_PROFILE_BC_SINGLE
Definition: grok.h:131