Grok 14.0.0
grok.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#include "grk_config.h"

Go to the source code of this file.

Classes

struct  _grk_msg_handlers
 
struct  _grk_object
 
struct  _grk_progression
 
struct  _grk_raw_comp_cparameters
 
struct  _grk_raw_cparameters
 
struct  _grk_component_mapping_comp
 
struct  _grk_palette_data
 
struct  _grk_channel_description
 
struct  _grk_channel_definition
 
struct  _grk_asoc
 
struct  _grk_precision
 
struct  _grk_progression_state
 
struct  _grk_io_buf
 
struct  _grk_io_init
 
struct  _grk_stream_params
 
struct  _grk_decompress_core_params
 
struct  _grk_decompress_params
 
struct  _grk_image_comp
 
struct  _grk_color
 
struct  _grk_image_meta
 
struct  _grk_image
 
struct  _grk_header_info
 
struct  _grk_plugin_pass
 
struct  _grk_plugin_code_block
 
struct  _grk_plugin_precinct
 grk_plugin_precinct More...
 
struct  _grk_plugin_band
 
struct  _grk_plugin_resolution
 
struct  grk_plugin_tile_component
 Plugin tile component. More...
 
struct  _grk_plugin_tile
 
struct  _grk_synthesis
 
struct  _grk_cparameters
 
struct  _grk_plugin_load_info
 
struct  _grk_plugin_init_info
 
struct  grk_plugin_compress_user_callback_info
 Plugin compress user callback info. More...
 
struct  grk_plugin_compress_batch_info
 Plugin batch compress info. More...
 
struct  _grk_plugin_decompress_callback_info
 

Macros

#define GRK_CALLCONV
 
#define GRK_API   __attribute__((visibility("default")))
 
#define GRK_NUM_COMMENTS_SUPPORTED   256
 maximum Grok supported number of comments
 
#define GRK_NUM_ASOC_BOXES_SUPPORTED   256
 maximum Grok supported number of asoc boxes
 
#define GRK_MAX_COMMENT_LENGTH   (UINT16_MAX - 2)
 maximum Grok supported comment length
 
#define GRK_MAX_SUPPORTED_IMAGE_PRECISION   16
 maximum Grok supported precision
 
#define GRK_BIBO_EXTRA_BITS   7
 BIBO analysis - extra bits needed to avoid overflow:
 
#define GRK_MAX_PASSES   (3 * (GRK_MAX_SUPPORTED_IMAGE_PRECISION + GRK_BIBO_EXTRA_BITS) - 2)
 Grok maximum number of passes.
 
#define GRK_PATH_LEN   4096 /* Maximum allowed filename size */
 
#define GRK_MAX_LAYERS   256 /* Grok maximum number of quality layers */
 
#define GRK_MAX_DECOMP_LVLS
 
#define GRK_MAXRLVLS    (GRK_MAX_DECOMP_LVLS + 1) /* Maximum number of resolution levels allowed by standard*/
 
#define GRK_MAXBANDS   (3 * GRK_MAXRLVLS - 2) /* Maximum number of sub-bands allowed by standard */
 
#define GRK_DECOMPRESS_COMPRESSION_LEVEL_DEFAULT   (UINT_MAX)
 default compression level for decompress output file formats that are also comressed, such as PNG or JPEG
 
#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
 
#define GRK_IMG_INFO   1 /* Basic image information provided to the user */
 
#define GRK_MH_INFO   2 /* Codestream information based only on the main header */
 
#define GRK_TH_INFO   4 /* Tile information based on the current tile header */
 
#define GRK_TCH_INFO   8 /** Tile/Component information of all tiles */
 
#define GRK_MH_IND   16 /** Codestream index based only on the main header */
 
#define GRK_TH_IND   32 /** Tile index based on the current tile */
 
#define GRK_CBLKSTY_LAZY   0x01 /** Selective arithmetic coding bypass */
 
#define GRK_CBLKSTY_RESET   0x02 /** Reset context probabilities on coding pass boundaries */
 
#define GRK_CBLKSTY_TERMALL   0x04 /** Termination on each coding pass */
 
#define GRK_CBLKSTY_VSC   0x08 /** Vertical stripe causal context */
 
#define GRK_CBLKSTY_PTERM   0x10 /** Predictable termination */
 
#define GRK_CBLKSTY_SEGSYM   0x20 /** Segmentation symbols are used */
 
#define GRK_CBLKSTY_HT_ONLY   0x40 /** high throughput only block coding */
 
#define GRK_CBLKSTY_HT_MIXED   0xC0 /** mixed high throughput block coding */
 
#define GRK_JPH_RSIZ_FLAG   0x4000 /**for JPH, bit 14 of RSIZ must be set to 1 */
 
#define GRK_PROFILE_NONE   0x0000 /** no profile, conform to 15444-1 */
 
#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 /* Mask for Part-2 extension bits */
 
#define GRK_EXTENSION_NONE   0x0000 /** No Part-2 extension */
 JPEG 2000 Part-2 extensions.
 
#define GRK_EXTENSION_MCT   0x0100 /** Custom MCT support */
 
#define GRK_IS_PART2(v)
 
#define GRK_IS_CINEMA(v)
 
#define GRK_IS_STORAGE(v)
 
#define GRK_GET_IMF_OR_BROADCAST_PROFILE(v)
 
#define GRK_LEVEL_MAX   11U /** Maximum (main) level */
 
#define GRK_GET_LEVEL(v)
 
#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)
 
#define GRK_IMF_SUBLEVEL_1_MBITSSEC   200U /** Mbits/s for IMF sub level 1 */
 Maximum compressed bit rate (Mbits/s) per IMF sub level.
 
#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_DCI_MAX_BANDWIDTH   250000000
 JPEG 2000 cinema profile code stream and component size limits.
 
#define GRK_CINEMA_24_CS   1302083 /** Maximum code stream length @ 24fps */
 
#define GRK_CINEMA_24_COMP   1041666 /** Maximum size per color component @ 24fps */
 
#define GRK_CINEMA_48_CS   651041 /** Maximum code stream length @ 48fps */
 
#define GRK_CINEMA_48_COMP   520833 /** Maximum size per color component @ 48fps */
 
#define GRK_CINEMA_4K_DEFAULT_NUM_RESOLUTIONS   7 /* Default number of resolutions for 4K cinema */
 
#define GRK_CUSTOM_CIELAB_SPACE   0x0
 
#define GRK_DEFAULT_CIELAB_SPACE   0x44454600 /* 'DEF' */
 
#define GRK_RANDOM_ACCESS_PLT   1 /* use PLT marker if present */
 Toggle random access markers.
 
#define GRK_RANDOM_ACCESS_TLM   2 /* use TLM marker if present */
 
#define GRK_RANDOM_ACCESS_PLM   4 /* use PLM marker if present */
 
#define GRK_PLUGIN_STATE_NO_DEBUG   0x0
 No debug is done on plugin.
 
#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
 

Typedefs

typedef enum _GRK_PROG_ORDER GRK_PROG_ORDER
 Progression order.
 
typedef enum _GRK_COLOR_SPACE GRK_COLOR_SPACE
 Grok supported color spaces.
 
typedef enum _GRK_ENUM_COLOUR_SPACE GRK_ENUM_COLOUR_SPACE
 JPEG 2000 standard color spaces.
 
typedef void(* grk_msg_callback) (const char *msg, void *client_data)
 Logging callback.
 
typedef struct _grk_msg_handlers grk_msg_handlers
 
typedef struct _grk_object grk_object
 
typedef struct _grk_progression grk_progression
 
typedef struct _grk_raw_comp_cparameters grk_raw_comp_cparameters
 
typedef struct _grk_raw_cparameters grk_raw_cparameters
 
typedef enum _GRK_RATE_CONTROL_ALGORITHM GRK_RATE_CONTROL_ALGORITHM
 Rate control algorithms.
 
typedef enum _GRK_SUPPORTED_FILE_FMT GRK_SUPPORTED_FILE_FMT
 All supported file formats.
 
typedef enum _GRK_CODEC_FORMAT GRK_CODEC_FORMAT
 Supported JPEG 2000 formats.
 
typedef struct _grk_component_mapping_comp grk_component_mapping_comp
 
typedef struct _grk_palette_data grk_palette_data
 
typedef enum _GRK_CHANNEL_TYPE GRK_CHANNEL_TYPE
 
typedef enum _GRK_CHANNEL_ASSOC GRK_CHANNEL_ASSOC
 Channel association.
 
typedef struct _grk_channel_description grk_channel_description
 
typedef struct _grk_channel_definition grk_channel_definition
 
typedef struct _grk_asoc grk_asoc
 
typedef enum _grk_precision_mode grk_precision_mode
 
typedef struct _grk_precision grk_precision
 
typedef struct _grk_progression_state grk_progression_state
 
typedef struct _grk_io_buf grk_io_buf
 
typedef struct _grk_io_init grk_io_init
 
typedef bool(* grk_io_callback) (uint32_t thread_id, grk_io_buf buffer, void *io_user_data)
 Grok IO callback.
 
typedef void(* grk_io_register_reclaim_callback) (grk_io_init io_init, grk_io_callback reclaim_callback, void *io_user_data, void *reclaim_user_data)
 Grok IO register reclaim callback.
 
typedef bool(* grk_io_pixels_callback) (uint32_t thread_id, grk_io_buf buffer, void *user_data)
 Grok IO pixels callback.
 
typedef size_t(* grk_stream_read_fn) (uint8_t *buffer, size_t numBytes, void *user_data)
 Read stream callback.
 
typedef size_t(* grk_stream_write_fn) (const uint8_t *buffer, size_t numBytes, void *user_data)
 Write stream callback.
 
typedef bool(* grk_stream_seek_fn) (uint64_t offset, void *user_data)
 Seek (absolute) callback.
 
typedef void(* grk_stream_free_user_data_fn) (void *user_data)
 Free user data callback.
 
typedef struct _grk_stream_params grk_stream_params
 
typedef enum _GRK_TILE_CACHE_STRATEGY GRK_TILE_CACHE_STRATEGY
 Grok tile cache strategy.
 
typedef struct _grk_decompress_core_params grk_decompress_core_params
 
typedef struct _grk_decompress_params grk_decompress_parameters
 
typedef struct _grk_image_comp grk_image_comp
 
typedef struct _grk_color grk_color
 
typedef struct _grk_image_meta grk_image_meta
 
typedef struct _grk_image grk_image
 
typedef struct _grk_header_info grk_header_info
 
typedef struct _grk_plugin_pass grk_plugin_pass
 
typedef struct _grk_plugin_code_block grk_plugin_code_block
 
typedef struct _grk_plugin_precinct grk_plugin_precinct
 grk_plugin_precinct
 
typedef struct _grk_plugin_band grk_plugin_band
 
typedef struct _grk_plugin_resolution grk_plugin_resolution
 
typedef struct grk_plugin_tile_component grk_plugin_tile_component
 
typedef struct _grk_plugin_tile grk_plugin_tile
 
typedef struct _grk_synthesis grk_synthesis
 
typedef struct _grk_cparameters grk_cparameters
 
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 uint64_t(* GRK_PLUGIN_COMPRESS_USER_CALLBACK) (grk_plugin_compress_user_callback_info *info)
 Plugin compress user callback.
 
typedef struct grk_plugin_compress_batch_info grk_plugin_compress_batch_info
 Plugin batch compress info.
 
typedef int(* GROK_INIT_DECOMPRESSORS) (grk_header_info *header_info, grk_image *image)
 Plugin init decompressors.
 
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)
 Plugin decompress callback.
 

Enumerations

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
}
 Grok supported color spaces. More...
 
enum  _GRK_ENUM_COLOUR_SPACE {
  GRK_ENUM_CLRSPC_UNKNOWN = 0xFFFFFFFF , GRK_ENUM_CLRSPC_BILEVEL1 = 0 , GRK_ENUM_CLRSPC_YCBCR1 = 1 , GRK_ENUM_CLRSPC_YCBCR2 = 3 ,
  GRK_ENUM_CLRSPC_YCBCR3 = 4 , GRK_ENUM_CLRSPC_PHOTO_YCC = 9 , GRK_ENUM_CLRSPC_CMY = 11 , GRK_ENUM_CLRSPC_CMYK = 12 ,
  GRK_ENUM_CLRSPC_YCCK = 13 , GRK_ENUM_CLRSPC_CIE = 14 , GRK_ENUM_CLRSPC_BILEVEL2 = 15 , GRK_ENUM_CLRSPC_SRGB = 16 ,
  GRK_ENUM_CLRSPC_GRAY = 17 , GRK_ENUM_CLRSPC_SYCC = 18 , GRK_ENUM_CLRSPC_CIEJAB = 19 , GRK_ENUM_CLRSPC_ESRGB = 20 ,
  GRK_ENUM_CLRSPC_ROMMRGB = 21 , GRK_ENUM_CLRSPC_YPBPR60 = 22 , GRK_ENUM_CLRSPC_YPBPR50 = 23 , GRK_ENUM_CLRSPC_EYCC = 24
}
 JPEG 2000 standard color spaces. More...
 
enum  _GRK_RATE_CONTROL_ALGORITHM { GRK_RATE_CONTROL_BISECT , GRK_RATE_CONTROL_PCRD_OPT }
 Rate control algorithms. More...
 
enum  _GRK_SUPPORTED_FILE_FMT {
  GRK_FMT_UNK , GRK_FMT_J2K , GRK_FMT_JP2 , GRK_FMT_PXM ,
  GRK_FMT_PGX , GRK_FMT_PAM , GRK_FMT_BMP , GRK_FMT_TIF ,
  GRK_FMT_RAW , GRK_FMT_PNG , GRK_FMT_RAWL , GRK_FMT_JPG ,
  GRK_FMT_YUV
}
 All supported file formats. More...
 
enum  _GRK_CODEC_FORMAT { GRK_CODEC_UNK , GRK_CODEC_J2K , GRK_CODEC_JP2 , GRK_CODEC_MJ2 }
 Supported JPEG 2000 formats. More...
 
enum  _GRK_CHANNEL_TYPE { GRK_CHANNEL_TYPE_COLOUR = 0 , GRK_CHANNEL_TYPE_OPACITY = 1 , GRK_CHANNEL_TYPE_PREMULTIPLIED_OPACITY = 2 , GRK_CHANNEL_TYPE_UNSPECIFIED = 65535U }
 
enum  _GRK_CHANNEL_ASSOC {
  GRK_CHANNEL_ASSOC_WHOLE_IMAGE = 0 , GRK_CHANNEL_ASSOC_COLOUR_1 = 1 , GRK_CHANNEL_ASSOC_COLOUR_2 = 2 , GRK_CHANNEL_ASSOC_COLOUR_3 = 3 ,
  GRK_CHANNEL_ASSOC_UNASSOCIATED = 65535U
}
 Channel association. More...
 
enum  _grk_precision_mode { GRK_PREC_MODE_CLIP , GRK_PREC_MODE_SCALE }
 
enum  _GRK_TILE_CACHE_STRATEGY { GRK_TILE_CACHE_NONE , GRK_TILE_CACHE_IMAGE , GRK_TILE_CACHE_ALL }
 Grok tile cache strategy. More...
 

Functions

GRK_API const char *GRK_CALLCONV grk_version (void)
 Gets library version.
 
GRK_API bool GRK_CALLCONV grk_initialize (const char *pluginPath, uint32_t num_threads, bool verbose)
 Initializes library.
 
GRK_API void GRK_CALLCONV grk_deinitialize ()
 De-initializes library.
 
GRK_API grk_object *GRK_CALLCONV grk_object_ref (grk_object *obj)
 Increments ref count.
 
GRK_API void GRK_CALLCONV grk_object_unref (grk_object *obj)
 
GRK_API void GRK_CALLCONV grk_set_msg_handlers (grk_msg_handlers msg_handlers)
 Sets log message handlers.
 
GRK_API grk_image *GRK_CALLCONV grk_image_new (uint16_t numcmpts, grk_image_comp *cmptparms, GRK_COLOR_SPACE clrspc, bool alloc_data)
 Creates image.
 
GRK_API grk_image_meta *GRK_CALLCONV grk_image_meta_new (void)
 Creates meta.
 
GRK_API bool GRK_CALLCONV grk_decompress_detect_format (const char *file_name, GRK_CODEC_FORMAT *fmt)
 Detects JPEG 2000 format from file.
 
GRK_API void GRK_CALLCONV grk_decompress_set_default_params (grk_decompress_parameters *parameters)
 Initializes decompress parameters with default values.
 
GRK_API grk_object *GRK_CALLCONV grk_decompress_init (grk_stream_params *stream_params, grk_decompress_parameters *params)
 Initializes decompressor.
 
GRK_API bool GRK_CALLCONV grk_decompress_update (grk_decompress_parameters *params, grk_object *codec)
 Updates decompressor.
 
GRK_API grk_progression_state GRK_CALLCONV grk_decompress_get_progression_state (grk_object *codec, uint16_t tile_index)
 Gets grk_progression_state for a tile.
 
GRK_API bool GRK_CALLCONV grk_decompress_set_progression_state (grk_object *codec, grk_progression_state state)
 Sets grk_progression_state for a tile.
 
GRK_API bool GRK_CALLCONV grk_decompress_read_header (grk_object *codec, grk_header_info *header_info)
 Decompresses JPEG 2000 header.
 
GRK_API grk_image *GRK_CALLCONV grk_decompress_get_tile_image (grk_object *codec, uint16_t tile_index)
 Gets decompressed tile image.
 
GRK_API grk_image *GRK_CALLCONV grk_decompress_get_image (grk_object *codec)
 Gets decompressed image.
 
GRK_API bool GRK_CALLCONV grk_decompress_set_window (grk_object *codec, double start_x, double start_y, double end_x, double end_y)
 Specifies area to be decompressed.
 
GRK_API bool GRK_CALLCONV grk_decompress (grk_object *codec, grk_plugin_tile *tile)
 Decompresses image from a JPEG 2000 code stream.
 
GRK_API bool GRK_CALLCONV grk_decompress_tile (grk_object *codec, uint16_t tile_index)
 Decompresses a specific tile.
 
GRK_API void GRK_CALLCONV grk_compress_set_default_params (grk_cparameters *parameters)
 Sets compression parameters to default values:
 
GRK_API grk_object *GRK_CALLCONV grk_compress_init (grk_stream_params *stream_params, grk_cparameters *parameters, grk_image *image)
 Initializes compression process.
 
GRK_API uint64_t GRK_CALLCONV grk_compress (grk_object *codec, grk_plugin_tile *tile)
 Compresses an image into a JPEG 2000 code stream using plugin.
 
GRK_API void GRK_CALLCONV grk_dump_codec (grk_object *codec, uint32_t info_flag, FILE *output_stream)
 Dumps codec information to file.
 
GRK_API bool GRK_CALLCONV grk_set_MCT (grk_cparameters *parameters, float *encoding_matrix, int32_t *dc_shift, uint32_t nb_comp)
 Sets MCT matrix.
 
GRK_API bool GRK_CALLCONV grk_plugin_load (grk_plugin_load_info info)
 Loads plugin.
 
GRK_API void GRK_CALLCONV grk_plugin_cleanup (void)
 Cleans up plugin resources.
 
GRK_API uint32_t GRK_CALLCONV grk_plugin_get_debug_state ()
 Gets debug state of plugin.
 
GRK_API bool GRK_CALLCONV grk_plugin_init (grk_plugin_init_info init_info)
 Initializes plugin.
 
GRK_API int32_t GRK_CALLCONV grk_plugin_compress (grk_cparameters *compress_parameters, GRK_PLUGIN_COMPRESS_USER_CALLBACK callback)
 Compresses with plugin.
 
GRK_API int32_t GRK_CALLCONV grk_plugin_batch_compress (grk_plugin_compress_batch_info info)
 Batch-compresses with plugin.
 
GRK_API void GRK_CALLCONV grk_plugin_wait_for_batch_complete (void)
 Waits for batch job to complete.
 
GRK_API void GRK_CALLCONV grk_plugin_stop_batch_compress (void)
 Stops batch compress.
 
GRK_API int32_t GRK_CALLCONV grk_plugin_decompress (grk_decompress_parameters *decompress_parameters, grk_plugin_decompress_callback callback)
 Decompresses single image with plugin.
 
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)
 Initializes batch decompress with plugin.
 
GRK_API int32_t GRK_CALLCONV grk_plugin_batch_decompress (void)
 Initiates batch decompress.
 
GRK_API void GRK_CALLCONV grk_plugin_stop_batch_decompress (void)
 Stops batch decompress.
 

Macro Definition Documentation

◆ GRK_API

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

◆ GRK_BIBO_EXTRA_BITS

#define GRK_BIBO_EXTRA_BITS   7

BIBO analysis - extra bits needed to avoid overflow:

Lossless: without colour transform: 4 extra bits with colour transform: 5 extra bits

Lossy: 1 extra bit

Worst-case scenario is lossless with colour transform : add 5 more bits to prec to avoid overflow. Add two more bits for good measure.

Referenced by grk::decompress_synch_plugin_with_host().

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

#define GRK_CBLKSTY_HT_MIXED   0xC0 /** mixed high throughput block coding */

◆ GRK_CBLKSTY_HT_ONLY

#define GRK_CBLKSTY_HT_ONLY   0x40 /** high throughput only 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

◆ GRK_CINEMA_24_COMP

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

◆ GRK_CINEMA_24_CS

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

◆ GRK_CINEMA_48_COMP

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

◆ GRK_CINEMA_48_CS

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

◆ GRK_CINEMA_4K_DEFAULT_NUM_RESOLUTIONS

#define GRK_CINEMA_4K_DEFAULT_NUM_RESOLUTIONS   7 /* Default number of resolutions for 4K cinema */

◆ GRK_CINEMA_DCI_MAX_BANDWIDTH

#define GRK_CINEMA_DCI_MAX_BANDWIDTH   250000000

JPEG 2000 cinema profile code stream and component size limits.

◆ GRK_CUSTOM_CIELAB_SPACE

#define GRK_CUSTOM_CIELAB_SPACE   0x0

◆ GRK_DECODE_ALL

#define GRK_DECODE_ALL
Value:
#define GRK_DECODE_T1
Definition grok.h:947
#define GRK_DECODE_POST_T1
Definition grok.h:948
#define GRK_DECODE_T2
Definition grok.h:946
#define GRK_DECODE_HEADER
Definition grok.h:945
#define GRK_PLUGIN_DECODE_CLEAN
Definition grok.h:949

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

default compression level for decompress output file formats that are also comressed, such as PNG or JPEG

◆ GRK_DEFAULT_CIELAB_SPACE

#define GRK_DEFAULT_CIELAB_SPACE   0x44454600 /* 'DEF' */

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

Referenced by grk::CodeStreamCompress::init().

◆ GRK_GET_IMF_OR_BROADCAST_PROFILE

◆ GRK_GET_IMF_SUBLEVEL

#define GRK_GET_IMF_SUBLEVEL ( v)
Value:
(((v) >> 4) & 0xf)

Referenced by grk::Profile::is_imf_compliant().

◆ GRK_GET_LEVEL

#define GRK_GET_LEVEL ( v)

◆ 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))
#define GRK_PROFILE_BC_MULTI_R
Definition grok.h:1422
#define GRK_PROFILE_BC_SINGLE
Definition grok.h:1420

Referenced by grk::CodeStreamCompress::init(), and grk::SIZMarker::read().

◆ GRK_IS_CINEMA

#define GRK_IS_CINEMA ( v)
Value:
#define GRK_PROFILE_CINEMA_2K
Definition grok.h:1414
#define GRK_PROFILE_CINEMA_S4K
Definition grok.h:1417

Referenced by grk::TileProcessor::canWritePocMarker(), grk::PacketIter::enable_tile_part_generation(), grk::CodeStreamCompress::init(), and grk::PacketManager::PacketManager().

◆ 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))
#define GRK_PROFILE_IMF_8K_R
Definition grok.h:1432
#define GRK_PROFILE_IMF_2K
Definition grok.h:1425

Referenced by grk::PacketIter::enable_tile_part_generation(), grk::CodeStreamCompress::init(), and grk::SIZMarker::read().

◆ GRK_IS_PART2

#define GRK_IS_PART2 ( v)
Value:
#define GRK_PROFILE_PART2
Definition grok.h:1435

Referenced by grk_set_MCT(), and grk::CodeStreamCompress::init().

◆ GRK_IS_STORAGE

#define GRK_IS_STORAGE ( v)
Value:
#define GRK_PROFILE_CINEMA_LTS
Definition grok.h:1418

Referenced by grk::CodeStreamCompress::init().

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

maximum Grok supported comment length

Referenced by grk::CodeStreamCompress::init(), and grk::CodeStreamCompress::write_com().

◆ GRK_MAX_DECOMP_LVLS

#define GRK_MAX_DECOMP_LVLS
Value:
32 /* Maximum number of decomposition levels allowed by standard \
*/

Referenced by grk::CodeStreamDecompress::read_SPCod_SPCoc().

◆ GRK_MAX_LAYERS

#define GRK_MAX_LAYERS   256 /* Grok maximum number of quality layers */

◆ GRK_MAX_PASSES

#define GRK_MAX_PASSES   (3 * (GRK_MAX_SUPPORTED_IMAGE_PRECISION + GRK_BIBO_EXTRA_BITS) - 2)

Grok maximum number of passes.

◆ GRK_MAX_SUPPORTED_IMAGE_PRECISION

#define GRK_MAX_SUPPORTED_IMAGE_PRECISION   16

◆ GRK_MAXBANDS

#define GRK_MAXBANDS   (3 * GRK_MAXRLVLS - 2) /* Maximum number of sub-bands allowed by standard */

◆ GRK_MAXRLVLS

◆ GRK_MH_IND

#define GRK_MH_IND   16 /** Codestream index based only on the main header */

◆ GRK_MH_INFO

#define GRK_MH_INFO   2 /* Codestream information based only on the main header */

◆ GRK_NUM_ASOC_BOXES_SUPPORTED

#define GRK_NUM_ASOC_BOXES_SUPPORTED   256

maximum Grok supported number of asoc boxes

Referenced by grk::FileFormatDecompress::serializeAsoc().

◆ GRK_NUM_COMMENTS_SUPPORTED

#define GRK_NUM_COMMENTS_SUPPORTED   256

maximum Grok supported number of comments

Referenced by grk::CodeStreamDecompress::read_com().

◆ GRK_PATH_LEN

#define GRK_PATH_LEN   4096 /* Maximum allowed filename size */

◆ GRK_PLUGIN_DECODE_CLEAN

#define GRK_PLUGIN_DECODE_CLEAN   (1 << 4)

◆ GRK_PLUGIN_STATE_DEBUG

◆ 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

No debug is done on plugin.

Production setting.

Referenced by grk_plugin_get_debug_state().

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

Referenced by grk::SIZMarker::read().

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

Referenced by grk::SIZMarker::read().

◆ GRK_PROFILE_NONE

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

◆ 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 /* Mask for Part-2 extension bits */

◆ GRK_RANDOM_ACCESS_PLM

#define GRK_RANDOM_ACCESS_PLM   4 /* use PLM marker if present */

◆ GRK_RANDOM_ACCESS_PLT

#define GRK_RANDOM_ACCESS_PLT   1 /* use PLT marker if present */

Toggle random access markers.

Referenced by grk_decompress_set_default_params().

◆ GRK_RANDOM_ACCESS_TLM

#define GRK_RANDOM_ACCESS_TLM   2 /* use TLM marker if present */

◆ GRK_TCH_INFO

#define GRK_TCH_INFO   8 /** Tile/Component information of all tiles */

◆ GRK_TH_IND

#define GRK_TH_IND   32 /** Tile index based on the current tile */

◆ GRK_TH_INFO

#define GRK_TH_INFO   4 /* Tile information based on the current tile header */

Typedef Documentation

◆ grk_asoc

typedef struct _grk_asoc grk_asoc

◆ GRK_CHANNEL_ASSOC

Channel association.

◆ grk_channel_definition

typedef struct _grk_channel_definition grk_channel_definition

◆ grk_channel_description

typedef struct _grk_channel_description grk_channel_description

◆ GRK_CHANNEL_TYPE

◆ GRK_CODEC_FORMAT

Supported JPEG 2000 formats.

◆ grk_color

typedef struct _grk_color grk_color

◆ GRK_COLOR_SPACE

Grok supported color spaces.

◆ grk_component_mapping_comp

typedef struct _grk_component_mapping_comp grk_component_mapping_comp

◆ grk_cparameters

typedef struct _grk_cparameters grk_cparameters

◆ grk_decompress_core_params

typedef struct _grk_decompress_core_params grk_decompress_core_params

◆ grk_decompress_parameters

typedef struct _grk_decompress_params grk_decompress_parameters

◆ GRK_ENUM_COLOUR_SPACE

JPEG 2000 standard color spaces.

◆ grk_header_info

typedef struct _grk_header_info grk_header_info

◆ grk_image

typedef struct _grk_image grk_image

◆ grk_image_comp

typedef struct _grk_image_comp grk_image_comp

◆ grk_image_meta

◆ grk_io_buf

typedef struct _grk_io_buf grk_io_buf

◆ grk_io_callback

typedef bool(* grk_io_callback) (uint32_t thread_id, grk_io_buf buffer, void *io_user_data)

Grok IO callback.

Parameters
thread_idthread id
bufferio buffer (see grk_io_buf)
io_user_datauser data

◆ grk_io_init

typedef struct _grk_io_init grk_io_init

◆ grk_io_pixels_callback

typedef bool(* grk_io_pixels_callback) (uint32_t thread_id, grk_io_buf buffer, void *user_data)

Grok IO pixels callback.

Parameters
thread_idthread id
bufferGrok io buffer (see grk_io_buf)
user_datauser data

◆ grk_io_register_reclaim_callback

typedef void(* grk_io_register_reclaim_callback) (grk_io_init io_init, grk_io_callback reclaim_callback, void *io_user_data, void *reclaim_user_data)

Grok IO register reclaim callback.

Parameters
io_initio initialization (see grk_io_init)
reclaim_callback(see grk_io_callback)
io_user_dataio user data
reclaim_user_datareclaim user data

◆ grk_msg_callback

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

Logging callback.

Parameters
msgmessage
client_dataclient data passed to callback

◆ grk_msg_handlers

typedef struct _grk_msg_handlers grk_msg_handlers

◆ grk_object

typedef struct _grk_object grk_object

◆ grk_palette_data

typedef struct _grk_palette_data grk_palette_data

◆ grk_plugin_band

typedef struct _grk_plugin_band grk_plugin_band

◆ grk_plugin_code_block

typedef struct _grk_plugin_code_block grk_plugin_code_block

◆ grk_plugin_compress_batch_info

typedef struct grk_plugin_compress_batch_info grk_plugin_compress_batch_info

Plugin batch compress info.

◆ GRK_PLUGIN_COMPRESS_USER_CALLBACK

typedef uint64_t(* GRK_PLUGIN_COMPRESS_USER_CALLBACK) (grk_plugin_compress_user_callback_info *info)

Plugin compress user callback.

Parameters
infocallback info (see grk_plugin_compress_user_callback_info)

◆ grk_plugin_compress_user_callback_info

typedef struct grk_plugin_compress_user_callback_info grk_plugin_compress_user_callback_info

◆ grk_plugin_decompress_callback

typedef int32_t(* grk_plugin_decompress_callback) (grk_plugin_decompress_callback_info *info)

Plugin decompress callback.

Parameters
infocallback info (see grk_plugin_decompress_callback_info)
Returns
0 if successful, otherwise return error code

◆ grk_plugin_decompress_callback_info

typedef struct _grk_plugin_decompress_callback_info grk_plugin_decompress_callback_info

◆ grk_plugin_init_info

◆ grk_plugin_load_info

typedef struct _grk_plugin_load_info grk_plugin_load_info

◆ grk_plugin_pass

typedef struct _grk_plugin_pass grk_plugin_pass

◆ grk_plugin_precinct

grk_plugin_precinct

Plugin precinct

◆ grk_plugin_resolution

typedef struct _grk_plugin_resolution grk_plugin_resolution

◆ grk_plugin_tile

typedef struct _grk_plugin_tile grk_plugin_tile

◆ grk_plugin_tile_component

typedef struct grk_plugin_tile_component grk_plugin_tile_component

◆ grk_precision

typedef struct _grk_precision grk_precision

◆ grk_precision_mode

typedef enum _grk_precision_mode grk_precision_mode

◆ GRK_PROG_ORDER

Progression order.

◆ grk_progression

typedef struct _grk_progression grk_progression

◆ grk_progression_state

typedef struct _grk_progression_state grk_progression_state

◆ GRK_RATE_CONTROL_ALGORITHM

Rate control algorithms.

GRK_RATE_CONTROL_BISECT: bisect with all truncation points GRK_RATE_CONTROL_PCRD_OPT: bisect with only feasible truncation points

◆ grk_raw_comp_cparameters

typedef struct _grk_raw_comp_cparameters grk_raw_comp_cparameters

◆ grk_raw_cparameters

typedef struct _grk_raw_cparameters grk_raw_cparameters

◆ grk_stream_free_user_data_fn

typedef void(* grk_stream_free_user_data_fn) (void *user_data)

Free user data callback.

Parameters
user_datauser data

◆ grk_stream_params

typedef struct _grk_stream_params grk_stream_params

◆ grk_stream_read_fn

typedef size_t(* grk_stream_read_fn) (uint8_t *buffer, size_t numBytes, void *user_data)

Read stream callback.

Parameters
bufferbuffer to write stream to
numBytesnumber of bytes to write to buffer
user_datauser data

◆ grk_stream_seek_fn

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

Seek (absolute) callback.

Parameters
offsetabsolute stream offset
user_datauser data

◆ grk_stream_write_fn

typedef size_t(* grk_stream_write_fn) (const uint8_t *buffer, size_t numBytes, void *user_data)

Write stream callback.

Parameters
bufferbuffer to read stream from
numBytesnumber of bytes to read from buffer
user_datauser data

◆ GRK_SUPPORTED_FILE_FMT

All supported file formats.

◆ grk_synthesis

typedef struct _grk_synthesis grk_synthesis

◆ GRK_TILE_CACHE_STRATEGY

Grok tile cache strategy.

◆ GROK_INIT_DECOMPRESSORS

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

Plugin init decompressors.

Enumeration Type Documentation

◆ _GRK_CHANNEL_ASSOC

Channel association.

Enumerator
GRK_CHANNEL_ASSOC_WHOLE_IMAGE 
GRK_CHANNEL_ASSOC_COLOUR_1 
GRK_CHANNEL_ASSOC_COLOUR_2 
GRK_CHANNEL_ASSOC_COLOUR_3 
GRK_CHANNEL_ASSOC_UNASSOCIATED 

◆ _GRK_CHANNEL_TYPE

Enumerator
GRK_CHANNEL_TYPE_COLOUR 
GRK_CHANNEL_TYPE_OPACITY 
GRK_CHANNEL_TYPE_PREMULTIPLIED_OPACITY 
GRK_CHANNEL_TYPE_UNSPECIFIED 

◆ _GRK_CODEC_FORMAT

Supported JPEG 2000 formats.

Enumerator
GRK_CODEC_UNK 
GRK_CODEC_J2K 

unknown format

GRK_CODEC_JP2 

JPEG 2000 code-stream.

GRK_CODEC_MJ2 

JPEG 2000 JP2 file format.

Motion JPEG 2000

◆ _GRK_COLOR_SPACE

Grok supported color spaces.

Enumerator
GRK_CLRSPC_UNKNOWN 
GRK_CLRSPC_SRGB 

unknown

GRK_CLRSPC_GRAY 

sRGB

GRK_CLRSPC_SYCC 

grayscale

GRK_CLRSPC_EYCC 

standard YCC (YUV)

GRK_CLRSPC_CMYK 

extended YCC

GRK_CLRSPC_DEFAULT_CIE 

CMYK.

GRK_CLRSPC_CUSTOM_CIE 

default CIE LAB

GRK_CLRSPC_ICC 

custom CIE LAB

◆ _GRK_ENUM_COLOUR_SPACE

JPEG 2000 standard color spaces.

Enumerator
GRK_ENUM_CLRSPC_UNKNOWN 
GRK_ENUM_CLRSPC_BILEVEL1 
GRK_ENUM_CLRSPC_YCBCR1 
GRK_ENUM_CLRSPC_YCBCR2 
GRK_ENUM_CLRSPC_YCBCR3 
GRK_ENUM_CLRSPC_PHOTO_YCC 
GRK_ENUM_CLRSPC_CMY 
GRK_ENUM_CLRSPC_CMYK 
GRK_ENUM_CLRSPC_YCCK 
GRK_ENUM_CLRSPC_CIE 
GRK_ENUM_CLRSPC_BILEVEL2 
GRK_ENUM_CLRSPC_SRGB 
GRK_ENUM_CLRSPC_GRAY 
GRK_ENUM_CLRSPC_SYCC 
GRK_ENUM_CLRSPC_CIEJAB 
GRK_ENUM_CLRSPC_ESRGB 
GRK_ENUM_CLRSPC_ROMMRGB 
GRK_ENUM_CLRSPC_YPBPR60 
GRK_ENUM_CLRSPC_YPBPR50 
GRK_ENUM_CLRSPC_EYCC 

◆ _grk_precision_mode

Enumerator
GRK_PREC_MODE_CLIP 
GRK_PREC_MODE_SCALE 

◆ _GRK_PROG_ORDER

Progression order.

Enumerator
GRK_PROG_UNKNOWN 
GRK_LRCP 

unknown progression order

GRK_RLCP 

layer-resolution-component-precinct order

GRK_RPCL 

resolution-layer-component-precinct order

GRK_PCRL 

resolution-precinct-component-layer order

GRK_CPRL 

precinct-component-resolution-layer order

GRK_NUM_PROGRESSION_ORDERS 

component-precinct-resolution-layer order

◆ _GRK_RATE_CONTROL_ALGORITHM

Rate control algorithms.

GRK_RATE_CONTROL_BISECT: bisect with all truncation points GRK_RATE_CONTROL_PCRD_OPT: bisect with only feasible truncation points

Enumerator
GRK_RATE_CONTROL_BISECT 
GRK_RATE_CONTROL_PCRD_OPT 

◆ _GRK_SUPPORTED_FILE_FMT

All supported file formats.

Enumerator
GRK_FMT_UNK 
GRK_FMT_J2K 
GRK_FMT_JP2 
GRK_FMT_PXM 
GRK_FMT_PGX 
GRK_FMT_PAM 
GRK_FMT_BMP 
GRK_FMT_TIF 
GRK_FMT_RAW 
GRK_FMT_PNG 
GRK_FMT_RAWL 
GRK_FMT_JPG 
GRK_FMT_YUV 

◆ _GRK_TILE_CACHE_STRATEGY

Grok tile cache strategy.

Enumerator
GRK_TILE_CACHE_NONE 
GRK_TILE_CACHE_IMAGE 
GRK_TILE_CACHE_ALL 

Function Documentation

◆ grk_compress()

GRK_API uint64_t GRK_CALLCONV grk_compress ( grk_object * codec,
grk_plugin_tile * tile )

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

Parameters
codeccompression codec (see grk_object)
tileplugin tile (see grk_plugin_tile)
Returns
number of bytes written if successful, 0 otherwise

References GrkCodec::getImpl().

◆ grk_compress_init()

GRK_API grk_object *GRK_CALLCONV grk_compress_init ( grk_stream_params * stream_params,
grk_cparameters * parameters,
grk_image * image )

Initializes compression process.

Parameters
stream_paramsStream parameters (see grk_stream_params)
parametersCompression parameters (see grk_cparameters)
imageInput image (see grk_image)
Returns
pointer to initialized codec.

References grk::create_mem_stream(), grk::Logger::error(), GrkCodec::getImpl(), GRK_CODEC_J2K, GRK_CODEC_JP2, grk_compress_create(), grk_compress_start(), GRK_FMT_J2K, GRK_FMT_JP2, grk_object_unref(), grk_stream_create_file_stream(), grk_stream_create_stream(), and grk::Logger::logger_.

◆ grk_compress_set_default_params()

GRK_API void GRK_CALLCONV grk_compress_set_default_params ( grk_cparameters * parameters)

Sets compression parameters to default values:

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 mode switches Progression order: LRCP No ROI upshifted Image origin lies at (0,0) Tile origin lies at (0,0) Reversible DWT 5-3 transform

Parameters
parametersCompression parameters (see grk_cparameters)

References grk::GRK_COMP_PARAM_DEFAULT_CBLOCKH, grk::GRK_COMP_PARAM_DEFAULT_CBLOCKW, grk::GRK_DEFAULT_NUMRESOLUTION, grk::GRK_DEFAULT_PROG_ORDER, GRK_FMT_UNK, and GRK_PROFILE_NONE.

◆ grk_decompress()

GRK_API bool GRK_CALLCONV grk_decompress ( grk_object * codec,
grk_plugin_tile * tile )

Decompresses image from a JPEG 2000 code stream.

Parameters
codecdecompression codec (see grk_object)
tiletile struct from plugin (see grk_plugin_tile)
Returns
true if successful, otherwise false

References GrkCodec::getImpl().

◆ grk_decompress_detect_format()

GRK_API bool GRK_CALLCONV grk_decompress_detect_format ( const char * file_name,
GRK_CODEC_FORMAT * fmt )

Detects JPEG 2000 format from file.

Format is either GRK_FMT_J2K, GRK_FMT_JP2 or GRK_FMT_MJ2

Parameters
file_namefile name
fmtpointer to detected format (see GRK_CODEC_FORMAT)
Returns
true if format was detected, otherwise false

References grk_decompress_buffer_detect_format().

◆ grk_decompress_get_image()

GRK_API grk_image *GRK_CALLCONV grk_decompress_get_image ( grk_object * codec)

Gets decompressed image.

Parameters
codecdecompression codec (see grk_object)
Returns
pointer to grk_image

References GrkCodec::getImpl().

◆ grk_decompress_get_progression_state()

GRK_API grk_progression_state GRK_CALLCONV grk_decompress_get_progression_state ( grk_object * codec,
uint16_t tile_index )

Gets grk_progression_state for a tile.

Parameters
codeccodec (see grk_object)
tile_indextile index
Returns
grk_progression_state. Struct will be all zeros if tile has not been decompressed yet

◆ grk_decompress_get_tile_image()

GRK_API grk_image *GRK_CALLCONV grk_decompress_get_tile_image ( grk_object * codec,
uint16_t tile_index )

Gets decompressed tile image.

Parameters
codecdecompression codec (see grk_object)
tile_indextile index
Returns
pointer to grk_image

References GrkCodec::getImpl().

◆ grk_decompress_init()

GRK_API grk_object *GRK_CALLCONV grk_decompress_init ( grk_stream_params * stream_params,
grk_decompress_parameters * params )

Initializes decompressor.

Parameters
stream_paramssource stream parameters (see grk_stream_params)
paramsdecompress parameters (see grk_decompress_parameters) object will be created, otherwise the codec object stored in *codec will be re-initialized
Returns
pointer to grk_object if successful, otherwise nullptr

References GrkCodec::getImpl(), grk_decompress_create_from_buffer(), grk_decompress_create_from_callbacks(), grk_decompress_create_from_file(), and grk_object_unref().

◆ grk_decompress_read_header()

GRK_API bool GRK_CALLCONV grk_decompress_read_header ( grk_object * codec,
grk_header_info * header_info )

Decompresses JPEG 2000 header.

Parameters
codecdecompression codec (see grk_object)
header_infoinformation read from JPEG 2000 header (see grk_header_info)
Returns
true if the main header of the code stream and the JP2 header is correctly read.

References GrkCodec::getImpl().

◆ grk_decompress_set_default_params()

GRK_API void GRK_CALLCONV grk_decompress_set_default_params ( grk_decompress_parameters * parameters)

Initializes decompress parameters with default values.

Parameters
parametersdecompression parameters (see grk_decompress_parameters)

References GRK_RANDOM_ACCESS_PLM, GRK_RANDOM_ACCESS_PLT, GRK_RANDOM_ACCESS_TLM, and GRK_TILE_CACHE_NONE.

◆ grk_decompress_set_progression_state()

GRK_API bool GRK_CALLCONV grk_decompress_set_progression_state ( grk_object * codec,
grk_progression_state state )

Sets grk_progression_state for a tile.

Parameters
codeccodec (see grk_object)
stategrk_progression_state
Returns
true if tile exists in cache and state marked tile as dirty

◆ grk_decompress_set_window()

GRK_API bool GRK_CALLCONV grk_decompress_set_window ( grk_object * codec,
double start_x,
double start_y,
double end_x,
double end_y )

Specifies area to be decompressed.

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

Parameters
codecdecompression codec (see grk_object)
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.

References GrkCodec::getImpl().

◆ grk_decompress_tile()

GRK_API bool GRK_CALLCONV grk_decompress_tile ( grk_object * codec,
uint16_t tile_index )

Decompresses a specific tile.

Parameters
codecdecompression codec (see grk_object)
tile_indexindex of the tile to be decompressed
Returns
true if successful, otherwise false

References GrkCodec::getImpl().

◆ grk_decompress_update()

GRK_API bool GRK_CALLCONV grk_decompress_update ( grk_decompress_parameters * params,
grk_object * codec )

Updates decompressor.

Parameters
paramsdecompress parameters (see grk_decompress_parameters)
codeccodec (see grk_object)
Returns
true if successful, otherwise false

◆ grk_deinitialize()

GRK_API void GRK_CALLCONV grk_deinitialize ( )

De-initializes library.

References ExecSingleton::destroy(), and grk_plugin_cleanup().

◆ grk_dump_codec()

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

Dumps codec information to file.

Parameters
codecdecompression codec (see grk_object)
info_flagtype of information dump.
output_streamcodec information is dumped to output stream

References GrkCodec::getImpl().

◆ grk_image_meta_new()

◆ grk_image_new()

GRK_API grk_image *GRK_CALLCONV grk_image_new ( uint16_t numcmpts,
grk_image_comp * cmptparms,
GRK_COLOR_SPACE clrspc,
bool alloc_data )

Creates image.

Parameters
numcmptsnumber of components
cmptparmscomponent parameters (see grk_image_comp)
clrspcimage color space (see GRK_COLOR_SPACE)
alloc_dataif true, allocate component data buffers
Returns
returns a new image if successful, otherwise NULL

References grk::GrkImage::create().

◆ grk_initialize()

GRK_API bool GRK_CALLCONV grk_initialize ( const char * pluginPath,
uint32_t num_threads,
bool verbose )

Initializes library.

Parameters
pluginPathpath to plugin
num_threadsnumber of threads to use for compress/decompress
verbosetoggle verbose mode

References errorCallback(), grk_plugin_load(), grk_set_msg_handlers(), grk::Logger::info(), infoCallback(), ExecSingleton::instance(), is_plugin_initialized, grk::Logger::logger_, and warningCallback().

◆ grk_object_ref()

GRK_API grk_object *GRK_CALLCONV grk_object_ref ( grk_object * obj)

Increments ref count.

Parameters
objGrok object (see grk_object)

Referenced by grk::GrkImage::copyHeader(), and grk::FileFormatCompress::init().

◆ grk_object_unref()

◆ grk_plugin_batch_compress()

◆ grk_plugin_batch_decompress()

GRK_API int32_t GRK_CALLCONV grk_plugin_batch_decompress ( void )

Initiates batch decompress.

Returns
0 if successful, otherwise return error code

References grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_batch_decode_method_name, and pluginLoaded.

◆ grk_plugin_cleanup()

GRK_API void GRK_CALLCONV grk_plugin_cleanup ( void )

Cleans up 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 )

Compresses with plugin.

Parameters
compress_parameterscompress parameters (see grk_cparameters)
callbackcallback (see GRK_PLUGIN_COMPRESS_USER_CALLBACK)

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 )

Decompresses single image with plugin.

Parameters
decompress_parametersdecompress parameters (see grk_decompress_parameters)
callbackcallback (see grk_plugin_decompress_callback)
Returns
0 if successful, otherwise return error code

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

GRK_API bool GRK_CALLCONV grk_plugin_init ( grk_plugin_init_info init_info)

Initializes plugin.

Parameters
init_infoplugin init info (see grk_plugin_init_info)

References grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_init_method_name, and pluginLoaded.

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

Initializes batch decompress with plugin.

Parameters
input_dirinput directory holding compressed images
output_diroutput directory holding decompressed images
decompress_parametersdecompress parameters (see grk_decompress_parameters)
callbackcallback (see grk_plugin_decompress_callback)
Returns
0 if successful, otherwise return error code

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

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

GRK_API void GRK_CALLCONV grk_plugin_wait_for_batch_complete ( void )

◆ grk_set_MCT()

GRK_API bool GRK_CALLCONV grk_set_MCT ( grk_cparameters * parameters,
float * encoding_matrix,
int32_t * dc_shift,
uint32_t nb_comp )

Sets MCT matrix.

Parameters
parameterscompression parameters (see grk_cparameters)
encoding_matrixmatrix
dc_shiftdc shift coefficients to use
nb_compnumber of components of the image.
Returns
true if matrix was successfully set

References GRK_EXTENSION_MCT, GRK_IS_PART2, grk::grk_malloc(), and GRK_PROFILE_PART2.

◆ grk_set_msg_handlers()

◆ grk_version()

GRK_API const char *GRK_CALLCONV grk_version ( void )

Gets library version.

Referenced by grk::CodeStreamCompress::init().