opj_codec.h
Go to the documentation of this file.
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPJ_CODEC_H
#define OPJ_CODEC_H
typedef struct opj_codec_private {
union {
struct opj_decompression {
OPJ_BOOL(*opj_read_header)(struct opj_stream_private * cio,
void * p_codec,
opj_image_t **p_image,
struct opj_event_mgr * p_manager);
OPJ_BOOL(*opj_decode)(void * p_codec,
struct opj_stream_private * p_cio,
opj_image_t * p_image,
struct opj_event_mgr * p_manager);
OPJ_BOOL(*opj_read_tile_header)(void * p_codec,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0,
OPJ_INT32 * p_tile_y0,
OPJ_INT32 * p_tile_x1,
OPJ_INT32 * p_tile_y1,
OPJ_UINT32 * p_nb_comps,
OPJ_BOOL * p_should_go_on,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL(*opj_decode_tile_data)(void * p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL(* opj_end_decompress)(void *p_codec,
struct opj_stream_private * cio,
struct opj_event_mgr * p_manager);
void (*opj_destroy)(void * p_codec);
void (*opj_setup_decoder)(void * p_codec, opj_dparameters_t * p_param);
void (*opj_decoder_set_strict_mode)(void * p_codec, OPJ_BOOL strict);
OPJ_BOOL(*opj_set_decode_area)(void * p_codec,
opj_image_t * p_image,
OPJ_INT32 p_start_x,
OPJ_INT32 p_end_x,
OPJ_INT32 p_start_y,
OPJ_INT32 p_end_y,
struct opj_event_mgr * p_manager);
OPJ_BOOL(*opj_get_decoded_tile)(void *p_codec,
opj_stream_private_t * p_cio,
opj_image_t *p_image,
struct opj_event_mgr * p_manager,
OPJ_UINT32 tile_index);
OPJ_BOOL(*opj_set_decoded_resolution_factor)(void * p_codec,
OPJ_UINT32 res_factor,
opj_event_mgr_t * p_manager);
OPJ_BOOL(*opj_set_decoded_components)(void * p_codec,
OPJ_UINT32 num_comps,
const OPJ_UINT32* comps_indices,
opj_event_mgr_t * p_manager);
} m_decompression;
struct opj_compression {
OPJ_BOOL(* opj_start_compress)(void *p_codec,
struct opj_stream_private * cio,
struct opj_image * p_image,
struct opj_event_mgr * p_manager);
OPJ_BOOL(* opj_encode)(void * p_codec,
struct opj_stream_private *p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL(* opj_write_tile)(void * p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL(* opj_end_compress)(void * p_codec,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
void (* opj_destroy)(void * p_codec);
OPJ_BOOL(* opj_setup_encoder)(void * p_codec,
opj_cparameters_t * p_param,
struct opj_image * p_image,
struct opj_event_mgr * p_manager);
OPJ_BOOL(* opj_encoder_set_extra_options)(void * p_codec,
const char* const* p_options,
struct opj_event_mgr * p_manager);
} m_compression;
} m_codec_data;
void * m_codec;
opj_event_mgr_t m_event_mgr;
OPJ_BOOL is_decompressor;
void (*opj_dump_codec)(void * p_codec, OPJ_INT32 info_flag,
FILE* output_stream);
opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);
OPJ_BOOL(*opj_set_threads)(void * p_codec, OPJ_UINT32 num_threads);
}
opj_codec_private_t;
#endif /* OPJ_CODEC_H */
opj_stream_private_t
struct opj_stream_private opj_stream_private_t
Byte input-output stream.
opj_event_mgr_t
struct opj_event_mgr opj_event_mgr_t
Message handler object used for.
opj_dparameters_t
struct opj_dparameters opj_dparameters_t
Decompression parameters.
OPJ_BYTE
unsigned char OPJ_BYTE
Definition openjpeg.h:123
OPJ_INT32
int32_t OPJ_INT32
Definition openjpeg.h:131
OPJ_UINT32
uint32_t OPJ_UINT32
Definition openjpeg.h:132
opj_cparameters_t
struct opj_cparameters opj_cparameters_t
Compression parameters.
opj_codestream_info_v2_t
struct opj_codestream_info_v2 opj_codestream_info_v2_t
Information structure about the codestream (FIXME should be expand and enhance).
opj_image_t
struct opj_image opj_image_t
Defines image data and characteristics.
OPJ_BOOL
int OPJ_BOOL
Definition openjpeg.h:116
opj_codestream_index_t
struct opj_codestream_index opj_codestream_index_t
Index structure of the codestream (FIXME should be expand and enhance).
opj_codec_private_t
struct opj_codec_private opj_codec_private_t
Main codec handler used for compression or decompression.
opj_codec_private
Main codec handler used for compression or decompression.
Definition opj_codec.h:42
opj_codec_private::opj_setup_decoder
void(* opj_setup_decoder)(void *p_codec, opj_dparameters_t *p_param)
Setup decoder function handler.
Definition opj_codec.h:91
opj_codec_private::opj_set_threads
OPJ_BOOL(* opj_set_threads)(void *p_codec, OPJ_UINT32 num_threads)
Set number of threads.
Definition opj_codec.h:173
opj_codec_private::is_decompressor
OPJ_BOOL is_decompressor
Flag to indicate if the codec is used to decode or encode.
Definition opj_codec.h:166
opj_codec_private::opj_start_compress
OPJ_BOOL(* opj_start_compress)(void *p_codec, struct opj_stream_private *cio, struct opj_image *p_image, struct opj_event_mgr *p_manager)
Definition opj_codec.h:128
opj_codec_private::opj_destroy
void(* opj_destroy)(void *p_codec)
Codec destroy function handler.
Definition opj_codec.h:88
opj_codec_private::opj_get_decoded_tile
OPJ_BOOL(* opj_get_decoded_tile)(void *p_codec, opj_stream_private_t *p_cio, opj_image_t *p_image, struct opj_event_mgr *p_manager, OPJ_UINT32 tile_index)
Get tile function.
Definition opj_codec.h:106
opj_codec_private::opj_set_decoded_resolution_factor
OPJ_BOOL(* opj_set_decoded_resolution_factor)(void *p_codec, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Set the decoded resolution factor.
Definition opj_codec.h:113
opj_codec_private::m_codec
void * m_codec
FIXME DOC.
Definition opj_codec.h:162
opj_codec_private::m_compression
struct opj_codec_private::@250164175107064043247226102350224131174124002123::opj_compression m_compression
opj_codec_private::opj_decode
OPJ_BOOL(* opj_decode)(void *p_codec, struct opj_stream_private *p_cio, opj_image_t *p_image, struct opj_event_mgr *p_manager)
Decoding function.
Definition opj_codec.h:56
opj_codec_private::opj_encoder_set_extra_options
OPJ_BOOL(* opj_encoder_set_extra_options)(void *p_codec, const char *const *p_options, struct opj_event_mgr *p_manager)
Definition opj_codec.h:155
opj_codec_private::m_decompression
struct opj_codec_private::@250164175107064043247226102350224131174124002123::opj_decompression m_decompression
opj_codec_private::opj_read_header
OPJ_BOOL(* opj_read_header)(struct opj_stream_private *cio, void *p_codec, opj_image_t **p_image, struct opj_event_mgr *p_manager)
Main header reading function handler.
Definition opj_codec.h:50
opj_codec_private::opj_encode
OPJ_BOOL(* opj_encode)(void *p_codec, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition opj_codec.h:133
opj_codec_private::opj_end_decompress
OPJ_BOOL(* opj_end_decompress)(void *p_codec, struct opj_stream_private *cio, struct opj_event_mgr *p_manager)
Reading function used after codestream if necessary.
Definition opj_codec.h:83
opj_codec_private::opj_end_compress
OPJ_BOOL(* opj_end_compress)(void *p_codec, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition opj_codec.h:144
opj_codec_private::m_event_mgr
opj_event_mgr_t m_event_mgr
Event handler.
Definition opj_codec.h:164
opj_codec_private::opj_write_tile
OPJ_BOOL(* opj_write_tile)(void *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition opj_codec.h:137
opj_codec_private::opj_dump_codec
void(* opj_dump_codec)(void *p_codec, OPJ_INT32 info_flag, FILE *output_stream)
Definition opj_codec.h:167
opj_codec_private::opj_decode_tile_data
OPJ_BOOL(* opj_decode_tile_data)(void *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
FIXME DOC.
Definition opj_codec.h:75
opj_codec_private::opj_decoder_set_strict_mode
void(* opj_decoder_set_strict_mode)(void *p_codec, OPJ_BOOL strict)
Strict mode function handler.
Definition opj_codec.h:94
opj_codec_private::opj_set_decoded_components
OPJ_BOOL(* opj_set_decoded_components)(void *p_codec, OPJ_UINT32 num_comps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Set the decoded components.
Definition opj_codec.h:118
opj_codec_private::m_codec_data
union opj_codec_private::@250164175107064043247226102350224131174124002123 m_codec_data
FIXME DOC.
opj_codec_private::opj_read_tile_header
OPJ_BOOL(* opj_read_tile_header)(void *p_codec, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_should_go_on, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
FIXME DOC.
Definition opj_codec.h:62
opj_codec_private::opj_set_decode_area
OPJ_BOOL(* opj_set_decode_area)(void *p_codec, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_end_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_y, struct opj_event_mgr *p_manager)
Set decode area function handler.
Definition opj_codec.h:97
opj_codec_private::opj_setup_encoder
OPJ_BOOL(* opj_setup_encoder)(void *p_codec, opj_cparameters_t *p_param, struct opj_image *p_image, struct opj_event_mgr *p_manager)
Definition opj_codec.h:150
opj_event_mgr
Message handler object used for.
Definition event.h:50
opj_image
Defines image data and characteristics.
Definition openjpeg.h:713
opj_stream_private
Byte input-output stream.
Definition cio.h:81