diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index 6586c7018..92c20415d 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -1177,6 +1177,32 @@ static OPJ_BOOL opj_j2k_read_cbd(opj_j2k_t *p_j2k, OPJ_UINT32 p_header_size, opj_event_mgr_t * p_manager); +/** + * Reads a CAP marker (extended capabilities definition). Empty implementation. + * Found in HTJ2K files + * + * @param p_header_data the data contained in the CAP box. + * @param p_j2k the jpeg2000 codec. + * @param p_header_size the size of the data contained in the CAP marker. + * @param p_manager the user event manager. +*/ +static OPJ_BOOL opj_j2k_read_cap(opj_j2k_t *p_j2k, + OPJ_BYTE * p_header_data, + OPJ_UINT32 p_header_size, + opj_event_mgr_t * p_manager); + +/** + * Reads a CPF marker (corresponding profile). Empty implementation. Found in HTJ2K files + * @param p_header_data the data contained in the CPF box. + * @param p_j2k the jpeg2000 codec. + * @param p_header_size the size of the data contained in the CPF marker. + * @param p_manager the user event manager. +*/ +static OPJ_BOOL opj_j2k_read_cpf(opj_j2k_t *p_j2k, + OPJ_BYTE * p_header_data, + OPJ_UINT32 p_header_size, + opj_event_mgr_t * p_manager); + /** * Writes COC marker for each component. @@ -1399,6 +1425,8 @@ static const opj_dec_memory_marker_handler_t j2k_memory_marker_handler_tab [] = {J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_com}, {J2K_MS_MCT, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mct}, {J2K_MS_CBD, J2K_STATE_MH, opj_j2k_read_cbd}, + {J2K_MS_CAP, J2K_STATE_MH, opj_j2k_read_cap}, + {J2K_MS_CPF, J2K_STATE_MH, opj_j2k_read_cpf}, {J2K_MS_MCC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mcc}, {J2K_MS_MCO, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mco}, #ifdef USE_JPWL @@ -6594,6 +6622,60 @@ static OPJ_BOOL opj_j2k_read_cbd(opj_j2k_t *p_j2k, return OPJ_TRUE; } +/** + * Reads a CAP marker (extended capabilities definition). Empty implementation. + * Found in HTJ2K files. + * + * @param p_header_data the data contained in the CAP box. + * @param p_j2k the jpeg2000 codec. + * @param p_header_size the size of the data contained in the CAP marker. + * @param p_manager the user event manager. +*/ +static OPJ_BOOL opj_j2k_read_cap(opj_j2k_t *p_j2k, + OPJ_BYTE * p_header_data, + OPJ_UINT32 p_header_size, + opj_event_mgr_t * p_manager + ) +{ + /* preconditions */ + assert(p_header_data != 00); + assert(p_j2k != 00); + assert(p_manager != 00); + + (void)p_j2k; + (void)p_header_data; + (void)p_header_size; + (void)p_manager; + + return OPJ_TRUE; +} + +/** + * Reads a CPF marker (corresponding profile). Empty implementation. Found in HTJ2K files + * @param p_header_data the data contained in the CPF box. + * @param p_j2k the jpeg2000 codec. + * @param p_header_size the size of the data contained in the CPF marker. + * @param p_manager the user event manager. +*/ +static OPJ_BOOL opj_j2k_read_cpf(opj_j2k_t *p_j2k, + OPJ_BYTE * p_header_data, + OPJ_UINT32 p_header_size, + opj_event_mgr_t * p_manager + ) +{ + /* preconditions */ + assert(p_header_data != 00); + assert(p_j2k != 00); + assert(p_manager != 00); + + (void)p_j2k; + (void)p_header_data; + (void)p_header_size; + (void)p_manager; + + return OPJ_TRUE; +} + /* ----------------------------------------------------------------------- */ /* J2K / JPT decoder interface */ /* ----------------------------------------------------------------------- */ diff --git a/src/lib/openjp2/j2k.h b/src/lib/openjp2/j2k.h index 51e7c23e6..2b08e8407 100644 --- a/src/lib/openjp2/j2k.h +++ b/src/lib/openjp2/j2k.h @@ -73,9 +73,11 @@ The functions in J2K.C have for goal to read/write the several parts of the code #define J2K_MS_SOT 0xff90 /**< SOT marker value */ #define J2K_MS_SOD 0xff93 /**< SOD marker value */ #define J2K_MS_EOC 0xffd9 /**< EOC marker value */ +#define J2K_MS_CAP 0xff50 /**< CAP marker value */ #define J2K_MS_SIZ 0xff51 /**< SIZ marker value */ #define J2K_MS_COD 0xff52 /**< COD marker value */ #define J2K_MS_COC 0xff53 /**< COC marker value */ +#define J2K_MS_CPF 0xff59 /**< CPF marker value */ #define J2K_MS_RGN 0xff5e /**< RGN marker value */ #define J2K_MS_QCD 0xff5c /**< QCD marker value */ #define J2K_MS_QCC 0xff5d /**< QCC marker value */