opj_image_t *image = 00;
image = (opj_image_t*) opj_malloc(sizeof(opj_image_t));
- if
- (image)
+ if (image)
{
memset(image,0,sizeof(opj_image_t));
+
image->color_space = clrspc;
image->numcomps = numcmpts;
+
/* allocate memory for the per-component information */
image->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t));
- if
- (!image->comps)
- {
+ if (!image->comps) {
opj_image_destroy(image);
return 00;
}
memset(image->comps,0,image->numcomps * sizeof(opj_image_comp_t));
+
/* create the individual image components */
for(compno = 0; compno < numcmpts; compno++) {
opj_image_comp_t *comp = &image->comps[compno];
comp->data = 0;
}
}
+
return image;
}
{
if (p_codec && p_stream && p_data) {
opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
- opj_stream_private_t * l_cio = (opj_stream_private_t *) p_stream;
+ opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;
if (l_codec->is_decompressor) {
return OPJ_FALSE;
p_tile_index,
p_data,
p_data_size,
- l_cio,
+ l_stream,
&(l_codec->m_event_mgr) );
}