diff options
Diffstat (limited to 'third_party/libopenjpeg20/opj_codec.h')
-rw-r--r-- | third_party/libopenjpeg20/opj_codec.h | 169 |
1 files changed, 85 insertions, 84 deletions
diff --git a/third_party/libopenjpeg20/opj_codec.h b/third_party/libopenjpeg20/opj_codec.h index 6bd791fa7a..2dbeac9635 100644 --- a/third_party/libopenjpeg20/opj_codec.h +++ b/third_party/libopenjpeg20/opj_codec.h @@ -1,6 +1,6 @@ /* - * 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 + * 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. * @@ -29,8 +29,8 @@ * 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 +#ifndef OPJ_CODEC_H +#define OPJ_CODEC_H /** @file opj_codec.h */ @@ -39,113 +39,110 @@ /** * Main codec handler used for compression or decompression. */ -typedef struct opj_codec_private -{ +typedef struct opj_codec_private { /** FIXME DOC */ - union - { + union { /** * Decompression handler. */ - struct opj_decompression - { + struct opj_decompression { /** Main header reading function handler */ - 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_read_header)(struct opj_stream_private * cio, + void * p_codec, + opj_image_t **p_image, + struct opj_event_mgr * p_manager); /** Decoding function */ - 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_decode)(void * p_codec, + struct opj_stream_private * p_cio, + opj_image_t * p_image, + struct opj_event_mgr * p_manager); /** FIXME DOC */ - 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_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 */ - 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_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); /** Reading function used after codestream if necessary */ - OPJ_BOOL (* opj_end_decompress) ( void *p_codec, - struct opj_stream_private * 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); /** Codec destroy function handler */ - void (*opj_destroy) (void * p_codec); + void (*opj_destroy)(void * p_codec); /** Setup decoder function handler */ - void (*opj_setup_decoder) ( void * p_codec, opj_dparameters_t * p_param); + void (*opj_setup_decoder)(void * p_codec, opj_dparameters_t * p_param); /** Set decode area function handler */ - 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_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); /** Get tile function */ - 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_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); /** Set the decoded resolution factor */ - 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_resolution_factor)(void * p_codec, + OPJ_UINT32 res_factor, + opj_event_mgr_t * p_manager); + } m_decompression; /** * Compression handler. FIXME DOC */ - 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_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_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); } m_compression; } m_codec_data; /** FIXME DOC*/ @@ -154,12 +151,16 @@ typedef struct opj_codec_private opj_event_mgr_t m_event_mgr; /** Flag to indicate if the codec is used to decode or encode*/ OPJ_BOOL is_decompressor; - void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream); + 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); + + /** Set number of threads */ + OPJ_BOOL(*opj_set_threads)(void * p_codec, OPJ_UINT32 num_threads); } opj_codec_private_t; -#endif /* __OPJ_CODEC_H */ +#endif /* OPJ_CODEC_H */ |