Grok
7.6.2
|
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include "ojph_block_encoder.h"
#include "ojph_block_decoder.h"
#include "grk_includes.h"
Classes | |
struct | grk_codec_private |
Main codec handler used for compression or decompression. More... | |
Functions | |
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... | |
bool GRK_CALLCONV | grk_set_info_handler (grk_msg_callback p_callback, void *p_user_data) |
Set info handler. More... | |
bool GRK_CALLCONV | grk_set_warning_handler (grk_msg_callback p_callback, void *p_user_data) |
Set warning handler. More... | |
bool GRK_CALLCONV | grk_set_error_handler (grk_msg_callback p_callback, void *p_user_data) |
Set error handler. More... | |
static size_t | grk_read_from_file (void *p_buffer, size_t nb_bytes, FILE *p_file) |
static uint64_t | grk_get_data_length_from_file (FILE *p_file) |
static size_t | grk_write_to_file (void *p_buffer, size_t nb_bytes, FILE *p_file) |
static bool | grk_seek_in_file (int64_t nb_bytes, FILE *p_user_data) |
const char *GRK_CALLCONV | grk_version (void) |
library version More... | |
grk_image *GRK_CALLCONV | grk_image_create (uint16_t numcmpts, grk_image_cmptparm *cmptparms, GRK_COLOR_SPACE clrspc, bool allocData) |
Create image. More... | |
void GRK_CALLCONV | grk_image_destroy (grk_image *image) |
Deallocate all resources associated with an image. More... | |
grk_codec GRK_CALLCONV | grk_create_decompress (GRK_CODEC_FORMAT p_format, grk_stream *stream) |
Create J2K/JP2 decompression structure. More... | |
void GRK_CALLCONV | grk_set_default_decompress_params (grk_dparameters *parameters) |
Initialize decompress parameters with default values. More... | |
bool GRK_CALLCONV | grk_init_decompress (grk_codec p_codec, grk_dparameters *parameters) |
Set up the decompressor with decompress parameters. More... | |
bool GRK_CALLCONV | grk_read_header (grk_codec p_codec, grk_header_info *header_info, grk_image **p_image) |
Decompress JPEG 2000 header. More... | |
bool GRK_CALLCONV | grk_decompress (grk_codec p_codec, grk_plugin_tile *tile, grk_image *p_image) |
Decompress image from a JPEG 2000 code stream. More... | |
bool GRK_CALLCONV | grk_set_decompress_window (grk_codec p_codec, grk_image *p_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... | |
bool GRK_CALLCONV | grk_decompress_tile (grk_codec p_codec, grk_image *p_image, uint16_t tile_index) |
Decompress a specific tile. More... | |
grk_codec GRK_CALLCONV | grk_create_compress (GRK_CODEC_FORMAT p_format, grk_stream *stream) |
Creates a J2K/JP2 compression structure. More... | |
void GRK_CALLCONV | grk_set_default_compress_params (grk_cparameters *parameters) |
Set compressing parameters to default values, that means : More... | |
bool GRK_CALLCONV | grk_init_compress (grk_codec p_codec, grk_cparameters *parameters, grk_image *p_image) |
Set up the compressor parameters using the current image and user parameters. More... | |
bool GRK_CALLCONV | grk_start_compress (grk_codec p_codec) |
Start compressing current image. More... | |
bool GRK_CALLCONV | grk_compress (grk_codec p_codec) |
Encode an image into a JPEG 2000 code stream. More... | |
bool GRK_CALLCONV | grk_compress_with_plugin (grk_codec p_info, grk_plugin_tile *tile) |
Encode an image into a JPEG 2000 code stream using plugin. More... | |
bool GRK_CALLCONV | grk_end_compress (grk_codec p_codec) |
End to compress the current image. More... | |
bool GRK_CALLCONV | grk_end_decompress (grk_codec p_codec) |
End decompression. More... | |
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... | |
bool GRK_CALLCONV | grk_compress_tile (grk_codec p_codec, uint16_t tile_index, uint8_t *p_data, uint64_t data_size) |
Compress uncompressed data stored in a buffer. More... | |
void GRK_CALLCONV | grk_destroy_codec (grk_codec p_codec) |
Destroy codec. More... | |
void GRK_CALLCONV | grk_dump_codec (grk_codec p_codec, uint32_t info_flag, FILE *output_stream) |
Dump codec information to file. More... | |
grk_codestream_info_v2 *GRK_CALLCONV | grk_get_cstr_info (grk_codec p_codec) |
Get code stream information from codec. More... | |
void GRK_CALLCONV | grk_destroy_cstr_info (grk_codestream_info_v2 **cstr_info) |
Destroy Codestream information after compression or decompression. More... | |
grk_codestream_index *GRK_CALLCONV | grk_get_cstr_index (grk_codec p_codec) |
Get the code stream index from the codec. More... | |
void GRK_CALLCONV | grk_destroy_cstr_index (grk_codestream_index **p_cstr_index) |
Destroy code stream index. More... | |
static void | grk_free_file (void *p_user_data) |
grk_stream *GRK_CALLCONV | grk_stream_create_file_stream (const char *fname, size_t p_size, bool is_read_stream) |
Create stream from a file identified with its filename with a specific buffer size. More... | |
GRK_API size_t GRK_CALLCONV | grk_stream_get_write_mem_stream_length (grk_stream *stream) |
Get length of memory stream. More... | |
grk_stream *GRK_CALLCONV | grk_stream_create_mem_stream (uint8_t *buf, size_t len, bool ownsBuffer, bool is_read_stream) |
Create stream from buffer. More... | |
grk_stream *GRK_CALLCONV | grk_stream_create_mapped_file_stream (const char *fname, bool read_stream) |
Create mapped file stream. More... | |
void GRK_CALLCONV | grk_image_all_components_data_free (grk_image *image) |
Deallocate all component data for an image. More... | |
void GRK_CALLCONV | grk_image_single_component_data_free (grk_image_comp *comp) |
Deallocate data for single image component. More... | |
static const char * | get_path_separator () |
bool GRK_CALLCONV | grk_plugin_load (grk_plugin_load_info info) |
Load plugin. More... | |
uint32_t GRK_CALLCONV | grk_plugin_get_debug_state () |
Get debug state of plugin. More... | |
void GRK_CALLCONV | grk_plugin_cleanup (void) |
Release plugin resources. More... | |
GRK_API bool GRK_CALLCONV | grk_plugin_init (grk_plugin_init_info initInfo) |
Initialize plugin. More... | |
void | grk_plugin_internal_encode_callback (plugin_encode_user_callback_info *info) |
int32_t GRK_CALLCONV | grk_plugin_compress (grk_cparameters *compress_parameters, GRK_PLUGIN_COMPRESS_USER_CALLBACK callback) |
Compress with plugin. More... | |
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... | |
void GRK_CALLCONV | grk_plugin_stop_batch_compress (void) |
Stop batch compress. More... | |
int32_t | grk_plugin_internal_decode_callback (PluginDecodeCallbackInfo *info) |
int32_t GRK_CALLCONV | grk_plugin_decompress (grk_decompress_parameters *decompress_parameters, grk_plugin_decompress_callback callback) |
Decompress with plugin. More... | |
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... | |
int32_t GRK_CALLCONV | grk_plugin_batch_decompress (void) |
Batch decompress. More... | |
void GRK_CALLCONV | grk_plugin_stop_batch_decompress (void) |
Stop batch decompress. More... | |
Variables | |
static bool | is_plugin_initialized = false |
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 |
static const char * | plugin_is_batch_complete_method_name |
static const char * | plugin_decode_method_name = "plugin_decompress" |
static const char * | plugin_init_batch_decode_method_name |
static const char * | plugin_batch_decode_method_name = "plugin_batch_decompress" |
static const char * | plugin_stop_batch_decode_method_name |
bool | pluginLoaded = false |
GRK_PLUGIN_COMPRESS_USER_CALLBACK | userEncodeCallback = 0 |
PLUGIN_IS_BATCH_COMPLETE | funcPluginIsBatchComplete = nullptr |
grk_plugin_decompress_callback | decodeCallback = 0 |
|
static |
Referenced by grk_plugin_load().
bool GRK_CALLCONV grk_compress | ( | grk_codec | codec | ) |
Encode an image into a JPEG 2000 code stream.
codec | compressor handle |
References grk_compress_with_plugin().
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.
codec | JPEG 2000 code stream |
tile_index | the index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence. |
data | pointer to the data to write. Data is arranged in planar sequence, data_comp0, data_comp1 etc, The data should NOT BE INTERLEAVED. |
data_size | this 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. |
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.
codec | compressor handle |
tile | plugin tile |
Referenced by grk_compress().
grk_codec GRK_CALLCONV grk_create_compress | ( | GRK_CODEC_FORMAT | format, |
grk_stream * | stream | ||
) |
Creates a J2K/JP2 compression structure.
format | Coder to select |
stream | the JPEG 2000 stream. |
References grk::grk_calloc(), GRK_CODEC_J2K, GRK_CODEC_JP2, GRK_CODEC_UNKNOWN, and grk::grk_free().
grk_codec GRK_CALLCONV grk_create_decompress | ( | GRK_CODEC_FORMAT | format, |
grk_stream * | stream | ||
) |
Create J2K/JP2 decompression structure.
format | JPEG 2000 format |
stream | JPEG 2000 stream. |
References grk::grk_calloc(), GRK_CODEC_J2K, GRK_CODEC_JP2, GRK_CODEC_UNKNOWN, and grk::grk_free().
bool GRK_CALLCONV grk_decompress | ( | grk_codec | p_decompressor, |
grk_plugin_tile * | tile, | ||
grk_image * | image | ||
) |
Decompress image from a JPEG 2000 code stream.
p_decompressor | decompressor handle |
tile | tile struct from plugin |
image | the decompressed image |
bool GRK_CALLCONV grk_decompress_tile | ( | grk_codec | codec, |
grk_image * | image, | ||
uint16_t | tile_index | ||
) |
Decompress a specific tile.
codec | JPEG 2000 code stream |
image | output image |
tile_index | index of the tile to be decompressed |
GRK_API void GRK_CALLCONV grk_deinitialize | ( | ) |
De-initialize library.
References grk_plugin_cleanup(), and ThreadPool::release().
Referenced by main().
void GRK_CALLCONV grk_destroy_codec | ( | grk_codec | codec | ) |
void GRK_CALLCONV grk_destroy_cstr_index | ( | grk_codestream_index ** | p_cstr_index | ) |
Destroy code stream index.
p_cstr_index | code stream index |
References grk::j2k_destroy_cstr_index().
void GRK_CALLCONV grk_destroy_cstr_info | ( | grk_codestream_info_v2 ** | cstr_info | ) |
Destroy Codestream information after compression or decompression.
cstr_info | Codestream information structure |
References grk::grk_free().
Referenced by grk::j2k_get_cstr_info().
void GRK_CALLCONV grk_dump_codec | ( | grk_codec | codec, |
uint32_t | info_flag, | ||
FILE * | output_stream | ||
) |
Dump codec information to file.
codec | JPEG 2000 code stream. |
info_flag | type of information dump. |
output_stream | output stream where dump the information get from the codec. |
bool GRK_CALLCONV grk_end_compress | ( | grk_codec | codec | ) |
End to compress the current image.
codec | Compressor handle |
bool GRK_CALLCONV grk_end_decompress | ( | grk_codec | codec | ) |
End decompression.
codec | JPEG 2000 code stream |
|
static |
Referenced by grk_stream_create_file_stream().
grk_codestream_index* GRK_CALLCONV grk_get_cstr_index | ( | grk_codec | codec | ) |
Get the code stream index from the codec.
codec | JPEG 2000 code stream. |
grk_codestream_info_v2* GRK_CALLCONV grk_get_cstr_info | ( | grk_codec | codec | ) |
Get code stream information from codec.
codec | JPEG 2000 code stream |
|
static |
References GROK_FSEEK, and GROK_FTELL.
Referenced by grk_stream_create_file_stream().
void GRK_CALLCONV grk_image_all_components_data_free | ( | grk_image * | image | ) |
Deallocate all component data for an image.
image | image |
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* GRK_CALLCONV grk_image_create | ( | uint16_t | numcmpts, |
grk_image_cmptparm * | cmptparms, | ||
GRK_COLOR_SPACE | clrspc, | ||
bool | allocData | ||
) |
Create image.
numcmpts | number of components |
cmptparms | component parameters |
clrspc | image color space |
allocData | true if data is to be allocated, otherwise false |
References _grk_image_comptparm::dx, _grk_image_comptparm::dy, grk::grk_calloc(), GRK_COMPONENT_ASSOC_COLOUR_1, GRK_COMPONENT_ASSOC_COLOUR_2, GRK_COMPONENT_ASSOC_COLOUR_3, GRK_COMPONENT_ASSOC_UNASSOCIATED, GRK_COMPONENT_TYPE_COLOUR, GRK_COMPONENT_TYPE_UNSPECIFIED, grk::GRK_ERROR(), grk_image_destroy(), grk::grk_image_single_component_data_alloc(), _grk_image_comptparm::h, _grk_image_comptparm::prec, _grk_image_comptparm::sgnd, _grk_image_comptparm::w, _grk_image_comptparm::x0, and _grk_image_comptparm::y0.
void GRK_CALLCONV grk_image_destroy | ( | grk_image * | image | ) |
Deallocate all resources associated with an image.
image | image |
References _grk_image::color, _grk_image::comps, grk::FileFormat::free_color(), grk::grk_free(), grk_image_all_components_data_free(), _grk_image::iptc_buf, and _grk_image::xmp_buf.
Referenced by grk::CodeStream::decompress_tile(), grk_image_create(), and grk::CodeStream::~CodeStream().
void GRK_CALLCONV grk_image_single_component_data_free | ( | grk_image_comp * | image | ) |
Deallocate data for single image component.
image | image |
References _grk_image_comp::data, grk::grk_aligned_free(), and _grk_image_comp::owns_data.
Referenced by grk_image_all_components_data_free(), grk::grk_image_single_component_data_alloc(), grk::jp2_apply_palette_clr(), and grk::transfer_image_data().
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.
codec | JPEG 2000 code stream |
parameters | compression parameters |
image | input image |
bool GRK_CALLCONV grk_init_decompress | ( | grk_codec | codec, |
grk_dparameters * | parameters | ||
) |
Set up the decompressor with decompress parameters.
codec | decompressor handler |
parameters | decompression parameters |
bool GRK_CALLCONV grk_initialize | ( | const char * | plugin_path, |
uint32_t | numthreads | ||
) |
Initialize library.
plugin_path | path to plugin |
numthreads | number 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().
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.
input_dir | directory holding input images |
output_dir | directory holding compressed output images |
compress_parameters | compress parameters |
callback | callback |
References grk_plugin_internal_encode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_batch_encode_method_name, pluginLoaded, and userEncodeCallback.
int32_t GRK_CALLCONV grk_plugin_batch_decompress | ( | void | ) |
Batch decompress.
References 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.
Referenced by grk_deinitialize().
int32_t GRK_CALLCONV grk_plugin_compress | ( | grk_cparameters * | compress_parameters, |
GRK_PLUGIN_COMPRESS_USER_CALLBACK | callback | ||
) |
Compress with plugin.
compress_parameters | compress parameters |
callback | callback |
References grk_plugin_internal_encode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_encode_method_name, pluginLoaded, and userEncodeCallback.
int32_t GRK_CALLCONV grk_plugin_decompress | ( | grk_decompress_parameters * | decompress_parameters, |
grk_plugin_decompress_callback | callback | ||
) |
Decompress with plugin.
decompress_parameters | decompress parameters |
callback | callback |
References decodeCallback, grk_plugin_internal_decode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_decode_method_name, and pluginLoaded.
uint32_t GRK_CALLCONV grk_plugin_get_debug_state | ( | ) |
Get debug state of plugin.
References GRK_PLUGIN_STATE_NO_DEBUG, grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_get_debug_state_method_name, and pluginLoaded.
Referenced by grk::compress_synch_with_plugin(), grk::TileProcessor::do_compress(), grk::PrecinctImpl::init(), grk::TileProcessor::init(), grk::TileProcessor::pcrd_bisect_feasible(), grk::TileProcessor::pcrd_bisect_simple(), and grk::tile_equals().
GRK_API bool GRK_CALLCONV grk_plugin_init | ( | grk_plugin_init_info | initInfo | ) |
Initialize plugin.
References 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 | ||
) |
Initialize batch decompress.
input_dir | input directory holding compressed images |
output_dir | output directory holding decompressed images |
decompress_parameters | decompress parameters |
callback | callback |
References decodeCallback, grk_plugin_internal_decode_callback(), grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_init_batch_decode_method_name, and pluginLoaded.
int32_t grk_plugin_internal_decode_callback | ( | PluginDecodeCallbackInfo * | info | ) |
References _grk_plugin_decompress_callback_info::cod_format, _grk_plugin_decompress_callback_info::decod_format, decodeCallback, _grk_plugin_decompress_callback_info::decompress_flags, _grk_plugin_decompress_callback_info::decompressor_parameters, _grk_plugin_decompress_callback_info::header_info, _grk_plugin_decompress_callback_info::image, ojph::info, _grk_plugin_decompress_callback_info::init_decompressors_func, _grk_plugin_decompress_callback_info::input_file_name, _grk_plugin_decompress_callback_info::l_codec, _grk_plugin_decompress_callback_info::l_stream, _grk_plugin_decompress_callback_info::output_file_name, _grk_plugin_decompress_callback_info::plugin_owns_image, and _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_plugin_compress_user_callback_info::compressor_parameters, grk_plugin_compress_user_callback_info::image, ojph::info, grk_plugin_compress_user_callback_info::input_file_name, grk_plugin_compress_user_callback_info::output_file_name, grk_plugin_compress_user_callback_info::outputFileNameIsRelative, 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 | ) |
Load plugin.
info | plugin loading info |
References get_path_separator(), ojph::info, grk::minpf_cleanup_plugin_manager(), grk::minpf_get_dynamic_library_extension(), grk::minpf_load_from_path(), and pluginLoaded.
Referenced by grk_initialize().
void GRK_CALLCONV grk_plugin_stop_batch_compress | ( | void | ) |
Stop batch compress.
References 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 grk::minpf_get_plugin_manager(), grk::minpf_get_symbol(), plugin_stop_batch_decode_method_name, and pluginLoaded.
|
static |
Referenced by grk_stream_create_file_stream().
bool GRK_CALLCONV grk_read_header | ( | grk_codec | codec, |
grk_header_info * | header_info, | ||
grk_image ** | image | ||
) |
Decompress JPEG 2000 header.
codec | JPEG 2000 code stream to read. |
header_info | information read from JPEG 2000 header. |
image | the image structure initialized with the characteristics of encoded image. |
|
static |
References GROK_FSEEK.
Referenced by grk_stream_create_file_stream().
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.
codec | JPEG 2000 code stream. |
image | image created by grk_read_header |
start_x | left position of the rectangle to decompress (in image coordinates). |
end_x | the right position of the rectangle to decompress (in image coordinates). |
start_y | up position of the rectangle to decompress (in image coordinates). |
end_y | bottom position of the rectangle to decompress (in image coordinates). |
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 | Compression 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.
void GRK_CALLCONV grk_set_default_decompress_params | ( | grk_dparameters * | parameters | ) |
Initialize decompress parameters with default values.
parameters | decompression parameters |
bool GRK_CALLCONV grk_set_error_handler | ( | grk_msg_callback | p_callback, |
void * | user_data | ||
) |
Set error handler.
p_callback | the callback function which will be used |
user_data | client object where will be returned the message |
References grk::logger::error_handler, grk::logger::m_error_data, and grk::logger::m_logger.
bool GRK_CALLCONV grk_set_info_handler | ( | grk_msg_callback | p_callback, |
void * | user_data | ||
) |
Set info handler.
p_callback | the callback function which will be used |
user_data | client object where will be returned the message |
References grk::logger::info_handler, grk::logger::m_info_data, and grk::logger::m_logger.
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 | the parameters to change. |
pEncodingMatrix | the compressing matrix. |
p_dc_shift | the dc shift coefficients to use. |
pNbComp | the number of components of the image. |
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.
bool GRK_CALLCONV grk_set_warning_handler | ( | grk_msg_callback | p_callback, |
void * | user_data | ||
) |
Set warning handler.
p_callback | the callback function which will be used |
user_data | client object where will be returned the message |
References grk::logger::m_logger, grk::logger::m_warning_data, and grk::logger::warning_handler.
bool GRK_CALLCONV grk_start_compress | ( | grk_codec | codec | ) |
Start compressing current image.
codec | Compressor handle |
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.
fname | the filename 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 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* GRK_CALLCONV grk_stream_create_mapped_file_stream | ( | const char * | fname, |
bool | read_stream | ||
) |
Create mapped file stream.
fname | file name |
read_stream | true if this is a read stream, otherwise false |
References grk::create_mapped_file_read_stream(), and grk::create_mapped_file_write_stream().
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.
buf | buffer |
buffer_len | length of buffer |
ownsBuffer | if true, library will delete[] buffer. Otherwise, it is the caller's responsibility to delete the buffer |
is_read_stream | whether the stream is a read stream (true) or not (false) |
References grk::create_mem_stream().
GRK_API size_t GRK_CALLCONV grk_stream_get_write_mem_stream_length | ( | grk_stream * | stream | ) |
Get length of memory stream.
stream | memory stream |
References grk::get_mem_stream_offset().
const char* GRK_CALLCONV grk_version | ( | void | ) |
library version
Referenced by grk::CodeStream::init_compress(), and main().
|
static |
Referenced by grk_stream_create_file_stream().
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_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().