Grok 10.0.5
|
#include <sys/stat.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include "grk_includes.h"
Classes | |
struct | GrkCodec |
Variables | |
static bool | is_plugin_initialized = false |
static const char * | JP2_RFC3745_MAGIC = "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a" |
static const char * | J2K_CODESTREAM_MAGIC = "\xff\x4f\xff\x51" |
static const char * | plugin_get_debug_state_method_name = "plugin_get_debug_state" |
static const char * | plugin_init_method_name = "plugin_init" |
static const char * | plugin_encode_method_name = "plugin_encode" |
static const char * | plugin_batch_encode_method_name = "plugin_batch_encode" |
static const char * | plugin_stop_batch_encode_method_name = "plugin_stop_batch_encode" |
static const char * | plugin_is_batch_complete_method_name = "plugin_is_batch_complete" |
static const char * | plugin_decode_method_name = "plugin_decompress" |
static const char * | plugin_init_batch_decode_method_name = "plugin_init_batch_decompress" |
static const char * | plugin_batch_decode_method_name = "plugin_batch_decompress" |
static const char * | plugin_stop_batch_decode_method_name = "plugin_stop_batch_decompress" |
bool | pluginLoaded = false |
GRK_PLUGIN_COMPRESS_USER_CALLBACK | userEncodeCallback = 0 |
PLUGIN_IS_BATCH_COMPLETE | funcPluginIsBatchComplete = nullptr |
grk_plugin_decompress_callback | decodeCallback = 0 |
bool GRK_CALLCONV grk_compress | ( | grk_codec * | codecWrapper, |
grk_plugin_tile * | tile ) |
References codec, GrkCodec::getImpl(), and tile.
grk_codec *GRK_CALLCONV grk_compress_create | ( | GRK_CODEC_FORMAT | p_format, |
grk_stream * | stream ) |
References codec, grk::GRK_CODEC_J2K, grk::GRK_CODEC_JP2, and stream.
Referenced by grk_compress_init().
grk_codec *GRK_CALLCONV grk_compress_init | ( | grk_stream_params * | stream_params, |
grk_cparameters * | parameters, | ||
grk_image * | p_image ) |
References grk::_grk_stream_params::buf, grk::_grk_cparameters::cod_format, codec, grk::create_mem_stream(), grk::_grk_stream_params::file, GrkCodec::getImpl(), grk::GRK_CODEC_J2K, grk::GRK_CODEC_JP2, grk_compress_create(), grk_compress_start(), grk::GRK_ERROR(), grk::GRK_FMT_J2K, grk::GRK_FMT_JP2, grk::grk_object_unref(), grk_stream_create_file_stream(), grk::_grk_stream_params::len, and stream.
void GRK_CALLCONV grk_compress_set_default_params | ( | grk_cparameters * | parameters | ) |
References grk::_grk_cparameters::allocationByQuality, grk::_grk_cparameters::allocationByRateDistoration, grk::_grk_cparameters::cblockh_init, grk::_grk_cparameters::cblockw_init, grk::_grk_cparameters::cod_format, grk::_grk_cparameters::decod_format, grk::_grk_cparameters::deviceId, grk::_grk_cparameters::enableTilePartGeneration, 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::GRK_FMT_UNK, GRK_PROFILE_NONE, grk::_grk_cparameters::layer_rate, grk::_grk_cparameters::max_comp_size, grk::_grk_cparameters::numgbits, grk::_grk_cparameters::numlayers, grk::_grk_cparameters::numresolution, grk::_grk_cparameters::prog_order, grk::_grk_cparameters::repeats, grk::_grk_cparameters::roi_compno, grk::_grk_cparameters::rsiz, grk::_grk_cparameters::subsampling_dx, grk::_grk_cparameters::subsampling_dy, grk::_grk_cparameters::writePLT, and grk::_grk_cparameters::writeTLM.
|
static |
Start compressing image.
codec | compression codec |
References codec, and GrkCodec::getImpl().
Referenced by grk_compress_init().
bool GRK_CALLCONV grk_decompress | ( | grk_codec * | codecWrapper, |
grk_plugin_tile * | tile ) |
References codec, GrkCodec::getImpl(), and tile.
bool GRK_CALLCONV grk_decompress_buffer_detect_format | ( | uint8_t * | buffer, |
size_t | len, | ||
GRK_CODEC_FORMAT * | fmt ) |
References buffer, grk::GRK_CODEC_J2K, grk::GRK_CODEC_JP2, grk::GRK_CODEC_UNK, grk::GRK_ERROR(), J2K_CODESTREAM_MAGIC, JP2_RFC3745_MAGIC, and len.
grk_codec * grk_decompress_create | ( | grk_stream * | stream | ) |
References codec, grk::GRK_CODEC_J2K, grk::GRK_CODEC_UNK, grk::GRK_ERROR(), and stream.
Referenced by grk_decompress_create_from_buffer(), and grk_decompress_create_from_file().
|
static |
References buf, codec, grk::create_mem_stream(), grk_decompress_create(), grk::GRK_ERROR(), len, and stream.
Referenced by grk_decompress_init().
|
static |
References codec, grk::create_mapped_file_read_stream(), grk_decompress_create(), grk::GRK_ERROR(), grk::grk_object_unref(), and stream.
Referenced by grk_decompress_init().
bool GRK_CALLCONV grk_decompress_detect_format | ( | const char * | fileName, |
GRK_CODEC_FORMAT * | fmt ) |
References buf, and grk::grk_decompress_buffer_detect_format().
grk_image *GRK_CALLCONV grk_decompress_get_composited_image | ( | grk_codec * | codecWrapper | ) |
References codec, and GrkCodec::getImpl().
grk_image *GRK_CALLCONV grk_decompress_get_tile_image | ( | grk_codec * | codecWrapper, |
uint16_t | tileIndex ) |
References codec, and GrkCodec::getImpl().
grk_codec *GRK_CALLCONV grk_decompress_init | ( | grk_stream_params * | stream_params, |
grk_decompress_core_params * | core_params ) |
bool GRK_CALLCONV grk_decompress_read_header | ( | grk_codec * | codecWrapper, |
grk_header_info * | header_info ) |
References codec, GrkCodec::getImpl(), and header_info.
void GRK_CALLCONV grk_decompress_set_default_params | ( | grk_decompress_core_params * | parameters | ) |
bool GRK_CALLCONV grk_decompress_set_window | ( | grk_codec * | codecWrapper, |
float | start_x, | ||
float | start_y, | ||
float | end_x, | ||
float | end_y ) |
References codec, and GrkCodec::getImpl().
bool GRK_CALLCONV grk_decompress_tile | ( | grk_codec * | codecWrapper, |
uint16_t | tileIndex ) |
References codec, and GrkCodec::getImpl().
GRK_API void GRK_CALLCONV grk_deinitialize | ( | ) |
De-initialize library.
References grk::grk_plugin_cleanup(), and ExecSingleton::release().
void GRK_CALLCONV grk_dump_codec | ( | grk_codec * | codecWrapper, |
uint32_t | info_flag, | ||
FILE * | output_stream ) |
References codec, and GrkCodec::getImpl().
|
static |
References GRK_FSEEK, and GRK_FTELL.
Referenced by grk_stream_create_file_stream().
grk_image_meta *GRK_CALLCONV grk_image_meta_new | ( | void | ) |
Referenced by grk::grk::CodeStreamDecompress::CodeStreamDecompress().
grk_image *GRK_CALLCONV grk_image_new | ( | uint16_t | numcmpts, |
grk_image_comp * | cmptparms, | ||
GRK_COLOR_SPACE | clrspc ) |
bool GRK_CALLCONV grk_initialize | ( | const char * | pluginPath, |
uint32_t | numthreads ) |
Initialize library.
pluginPath | path to plugin |
numthreads | number of threads to use for compress/decompress |
References grk::grk_plugin_load(), ExecSingleton::instance(), is_plugin_initialized, and grk::_grk_plugin_load_info::pluginPath.
GRK_API grk_object *GRK_CALLCONV grk_object_ref | ( | grk_object * | obj | ) |
References obj, and grk::_grk_object::wrapper.
GRK_API void GRK_CALLCONV grk_object_unref | ( | grk_object * | obj | ) |
References obj, and grk::_grk_object::wrapper.
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 ) |
int32_t GRK_CALLCONV grk_plugin_batch_decompress | ( | void | ) |
Initiate batch decompress.
References func, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_batch_decode_method_name, and pluginLoaded.
void GRK_CALLCONV grk_plugin_cleanup | ( | void | ) |
Release plugin resources.
References grk::minpf_cleanup_plugin_manager(), and pluginLoaded.
int32_t GRK_CALLCONV grk_plugin_compress | ( | grk_cparameters * | compress_parameters, |
GRK_PLUGIN_COMPRESS_USER_CALLBACK | callback ) |
int32_t GRK_CALLCONV grk_plugin_decompress | ( | grk_decompress_parameters * | decompress_parameters, |
grk_plugin_decompress_callback | callback ) |
uint32_t GRK_CALLCONV grk_plugin_get_debug_state | ( | ) |
Get debug state of plugin.
References func, GRK_PLUGIN_STATE_NO_DEBUG, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_get_debug_state_method_name, and pluginLoaded.
GRK_API bool GRK_CALLCONV grk_plugin_init | ( | grk_plugin_init_info | initInfo | ) |
References func, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_init_method_name, and pluginLoaded.
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 ) |
int32_t grk_plugin_internal_decode_callback | ( | PluginDecodeCallbackInfo * | info | ) |
References grk::_grk_plugin_decompress_callback_info::cod_format, grk::_grk_plugin_decompress_callback_info::codec, grk::_grk_plugin_decompress_callback_info::decod_format, decodeCallback, grk::_grk_plugin_decompress_callback_info::decompress_flags, grk::_grk_plugin_decompress_callback_info::decompressor_parameters, grk::_grk_plugin_decompress_callback_info::header_info, grk::_grk_plugin_decompress_callback_info::image, grk::_grk_plugin_decompress_callback_info::init_decompressors_func, grk::_grk_plugin_decompress_callback_info::input_file_name, grk::_grk_plugin_decompress_callback_info::output_file_name, grk::_grk_plugin_decompress_callback_info::plugin_owns_image, and grk::_grk_plugin_decompress_callback_info::tile.
Referenced by grk_plugin_decompress(), and grk_plugin_init_batch_decompress().
void grk_plugin_internal_encode_callback | ( | plugin_encode_user_callback_info * | info | ) |
References grk::grk_plugin_compress_user_callback_info::compressor_parameters, grk::grk_plugin_compress_user_callback_info::image, grk::grk_plugin_compress_user_callback_info::input_file_name, grk::grk_plugin_compress_user_callback_info::output_file_name, grk::grk_plugin_compress_user_callback_info::outputFileNameIsRelative, grk::grk_plugin_compress_user_callback_info::tile, and userEncodeCallback.
Referenced by grk_plugin_batch_compress(), and grk_plugin_compress().
GRK_API bool GRK_CALLCONV grk_plugin_is_batch_complete | ( | void | ) |
Check if batch job is complete.
References funcPluginIsBatchComplete, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_is_batch_complete_method_name, and pluginLoaded.
bool GRK_CALLCONV grk_plugin_load | ( | grk_plugin_load_info | info | ) |
void GRK_CALLCONV grk_plugin_stop_batch_compress | ( | void | ) |
Stop batch compress.
References func, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_stop_batch_encode_method_name, and pluginLoaded.
void GRK_CALLCONV grk_plugin_stop_batch_decompress | ( | void | ) |
Stop batch decompress.
References func, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_stop_batch_decode_method_name, and pluginLoaded.
|
static |
References buffer.
Referenced by grk_stream_create_file_stream().
|
static |
References GRK_FSEEK.
Referenced by grk_stream_create_file_stream().
bool GRK_CALLCONV grk_set_MCT | ( | grk_cparameters * | parameters, |
float * | pEncodingMatrix, | ||
int32_t * | p_dc_shift, | ||
uint32_t | pNbComp ) |
GRK_API void GRK_CALLCONV grk_set_msg_handlers | ( | grk_msg_callback | info_callback, |
void * | info_user_data, | ||
grk_msg_callback | warn_callback, | ||
void * | warn_user_data, | ||
grk_msg_callback | error_callback, | ||
void * | error_user_data ) |
|
static |
Create stream from a file identified with its filename with a specific buffer size.
fname | the name of the file to stream |
buffer_size | size of the chunk used to stream |
is_read_stream | whether the stream is a read stream (true) or not (false) |
References buf, grk::grk_decompress_buffer_detect_format(), grk::GRK_ERROR(), grk_get_data_length_from_file(), grk_read_from_file(), grk_seek_in_file(), grk_stream_new(), grk::grk_stream_set_read_function(), grk::grk_stream_set_seek_function(), grk::grk_stream_set_user_data(), grk::grk_stream_set_user_data_length(), grk::grk_stream_set_write_function(), grk_write_to_file(), grkFree_file(), and stream.
Referenced by grk_compress_init().
|
static |
Referenced by grk_stream_create_file_stream().
void grk_stream_set_read_function | ( | grk_stream * | stream, |
grk_stream_read_fn | func ) |
References func, GROK_STREAM_STATUS_INPUT, and stream.
void grk_stream_set_seek_function | ( | grk_stream * | stream, |
grk_stream_seek_fn | func ) |
void grk_stream_set_user_data | ( | grk_stream * | stream, |
void * | p_data, | ||
grk_stream_free_user_data_fn | func ) |
void grk_stream_set_user_data_length | ( | grk_stream * | stream, |
uint64_t | data_length ) |
References stream.
void grk_stream_set_write_function | ( | grk_stream * | stream, |
grk_stream_write_fn | func ) |
References func, GROK_STREAM_STATUS_OUTPUT, and stream.
const char *GRK_CALLCONV grk_version | ( | void | ) |
Library version.
|
static |
References buffer.
Referenced by grk_stream_create_file_stream().
|
static |
Referenced by grk_stream_create_file_stream().
|
static |
Referenced by grk_plugin_load().
grk_plugin_decompress_callback decodeCallback = 0 |
PLUGIN_IS_BATCH_COMPLETE funcPluginIsBatchComplete = nullptr |
Referenced by grk_plugin_is_batch_complete().
|
static |
Referenced by grk_initialize().
|
static |
Referenced by grk_decompress_buffer_detect_format().
|
static |
Referenced by grk_decompress_buffer_detect_format().
|
static |
Referenced by grk_plugin_batch_decompress().
|
static |
Referenced by grk_plugin_batch_compress().
|
static |
Referenced by grk_plugin_decompress().
|
static |
Referenced by grk_plugin_compress().
|
static |
Referenced by grk_plugin_get_debug_state().
|
static |
Referenced by grk_plugin_init_batch_decompress().
|
static |
Referenced by grk_plugin_init().
|
static |
Referenced by grk_plugin_is_batch_complete().
|
static |
Referenced by grk_plugin_stop_batch_decompress().
|
static |
Referenced by grk_plugin_stop_batch_compress().
bool pluginLoaded = false |
Referenced by grk_plugin_batch_compress(), grk_plugin_batch_decompress(), grk_plugin_cleanup(), grk_plugin_compress(), grk_plugin_decompress(), grk_plugin_get_debug_state(), grk_plugin_init(), grk_plugin_init_batch_decompress(), grk_plugin_is_batch_complete(), grk_plugin_load(), grk_plugin_stop_batch_compress(), and grk_plugin_stop_batch_decompress().
GRK_PLUGIN_COMPRESS_USER_CALLBACK userEncodeCallback = 0 |
Referenced by grk_plugin_batch_compress(), grk_plugin_compress(), and grk_plugin_internal_encode_callback().