[trunk] add the support of the flag ignore_pclr_cmap_cdef into the V2 jp2 functions (but not for box reading); no tests modified

This commit is contained in:
Mickael Savinaud 2012-08-09 14:28:35 +00:00
parent 4397b675cb
commit 8e5070f469
2 changed files with 31 additions and 32 deletions

View File

@ -1776,6 +1776,8 @@ opj_bool jp2_decode_v2( opj_jp2_v2_t *jp2,
return OPJ_FALSE; return OPJ_FALSE;
} }
if (!jp2->ignore_pclr_cmap_cdef){
/* Set Image Color Space */ /* Set Image Color Space */
if (jp2->enumcs == 16) if (jp2->enumcs == 16)
p_image->color_space = CLRSPC_SRGB; p_image->color_space = CLRSPC_SRGB;
@ -1804,6 +1806,7 @@ opj_bool jp2_decode_v2( opj_jp2_v2_t *jp2,
p_image->icc_profile_len = jp2->color.icc_profile_len; p_image->icc_profile_len = jp2->color.icc_profile_len;
jp2->color.icc_profile_buf = NULL; jp2->color.icc_profile_buf = NULL;
} }
}
return OPJ_TRUE; return OPJ_TRUE;
} }
@ -2319,12 +2322,6 @@ void jp2_destroy_decompress(opj_jp2_t *jp2) {
} }
} }
void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters) {
/* setup the J2K codec */
j2k_setup_decoder(jp2->j2k, parameters);
/* further JP2 initializations go here */
jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
}
void jp2_setup_decoder_v2(opj_jp2_v2_t *jp2, opj_dparameters_t *parameters) void jp2_setup_decoder_v2(opj_jp2_v2_t *jp2, opj_dparameters_t *parameters)
{ {
@ -2333,6 +2330,7 @@ void jp2_setup_decoder_v2(opj_jp2_v2_t *jp2, opj_dparameters_t *parameters)
/* further JP2 initializations go here */ /* further JP2 initializations go here */
jp2->color.jp2_has_colr = 0; jp2->color.jp2_has_colr = 0;
jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
} }

View File

@ -215,6 +215,7 @@ typedef struct opj_jp2_v2
opj_jp2_color_t color; opj_jp2_color_t color;
opj_bool ignore_pclr_cmap_cdef;
} }
opj_jp2_v2_t; opj_jp2_v2_t;