diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-03-15 10:23:20 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-03-15 10:23:20 +0000 |
| commit | 3a78e8010d0f1e206355d660a21f23898cf5fbc0 (patch) | |
| tree | 2e7b4399ca60a8acc2054df8dbfb01615a4def36 /libopenjpeg/openjpeg.h | |
| parent | d9940f416b56ae68b558e9086328f69a6b519736 (diff) | |
[trunk] modify image_to_j2k and the lib to support functionalities given by the v2 alpha branch
Diffstat (limited to 'libopenjpeg/openjpeg.h')
| -rw-r--r-- | libopenjpeg/openjpeg.h | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/libopenjpeg/openjpeg.h b/libopenjpeg/openjpeg.h index b5772263..909dbf47 100644 --- a/libopenjpeg/openjpeg.h +++ b/libopenjpeg/openjpeg.h @@ -173,7 +173,8 @@ typedef OPJ_INT64 OPJ_OFF_T; typedef enum RSIZ_CAPABILITIES { STD_RSIZ = 0, /** Standard JPEG2000 profile*/ CINEMA2K = 3, /** Profile name for a 2K image*/ - CINEMA4K = 4 /** Profile name for a 4K image*/ + CINEMA4K = 4, /** Profile name for a 4K image*/ + MCT = 0x8100 } OPJ_RSIZ_CAPABILITIES; /** @@ -425,6 +426,9 @@ typedef struct opj_cparameters { char tcp_mct; /** Enable JPIP indexing*/ opj_bool jpip_on; + /** Naive implementation of MCT restricted to a single reversible array based encoding without offset concerning all the components. */ + void * mct_data; + } opj_cparameters_t; #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001 @@ -1399,6 +1403,15 @@ Creates a J2K/JP2 compression structure @return Returns a handle to a compressor if successful, returns NULL otherwise */ OPJ_API opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format); + +/** +Creates a J2K/JP2 compression structure +@param format Coder to select +@return Returns a handle to a compressor if successful, returns NULL otherwise +*/ +OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress_v2(OPJ_CODEC_FORMAT format); + + /** Destroy a compressor handle @param cinfo compressor handle to destroy @@ -1433,6 +1446,32 @@ Setup the encoder parameters using the current image and using user parameters. @param image Input filled image */ OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image); + +/** +Setup the encoder parameters using the current image and using user parameters. +@param cinfo Compressor handle +@param parameters Compression parameters +@param image Input filled image +*/ +OPJ_API opj_bool OPJ_CALLCONV opj_setup_encoder_v2(opj_codec_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image); + + +opj_bool OPJ_CALLCONV opj_start_compress ( opj_codec_t *p_codec, + opj_image_t * p_image, + opj_stream_t *p_cio); + +opj_bool OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,opj_stream_t *p_cio); + +/** +Encode an image into a JPEG-2000 codestream +@param cinfo compressor handle +@param cio Output buffer stream +@param image Image to encode +@param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci() +@return Returns true if successful, returns false otherwise +*/ +OPJ_API opj_bool OPJ_CALLCONV opj_encode_v2(opj_codec_t *cinfo, opj_stream_t * cio); + /** Encode an image into a JPEG-2000 codestream 3@param cinfo compressor handle @@ -1537,6 +1576,26 @@ OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(opj_codec_t *p_cod OPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index(opj_codec_t *p_codec); +/* +========================================================== + new functions +========================================================== +*/ + +/** + * Sets the MCT matrix to use. + * + * @param parameters the parameters to change. + * @param pEncodingMatrix the encoding matrix. + * @param p_dc_shift the dc shift coefficients to use. + * @param pNbComp the number of components of the image. + * + * @return true if the parameters could be set. + */ +OPJ_API opj_bool OPJ_CALLCONV opj_set_MCT( opj_cparameters_t *parameters, + OPJ_FLOAT32 * pEncodingMatrix, + OPJ_INT32 * p_dc_shift, + OPJ_UINT32 pNbComp); |
