numcomps = 3 + has_alpha;
color_space = CLRSPC_SRGB;
+/*#define USETILEMODE*/
for(j = 0; j < numcomps; j++)
{
if(parameters->cp_cinema)
cmptparm[j].dy = subsampling_dy;
cmptparm[j].w = w;
cmptparm[j].h = h;
+#ifdef USETILEMODE
+ cmptparm[j].x0 = 0;
+ cmptparm[j].y0 = 0;
+#endif
}
+#ifdef USETILEMODE
+ image = opj_image_tile_create(numcomps,&cmptparm[0],color_space);
+#else
image = opj_image_create(numcomps, &cmptparm[0], color_space);
+#endif
if(!image)
{
{
if(index < imgsize)
{
+#ifndef USETILEMODE
image->comps[0].data[index] = dat8[i+0];/* R */
image->comps[1].data[index] = dat8[i+1];/* G */
image->comps[2].data[index] = dat8[i+2];/* B */
if(has_alpha)
image->comps[3].data[index] = dat8[i+3];
+#endif
if(parameters->cp_cinema)
{
/* Rounding 8 to 12 bits
*/
+#ifndef USETILEMODE
image->comps[0].data[index] = image->comps[0].data[index] << 4 ;
image->comps[1].data[index] = image->comps[1].data[index] << 4 ;
image->comps[2].data[index] = image->comps[2].data[index] << 4 ;
if(has_alpha)
image->comps[3].data[index] = image->comps[3].data[index] << 4 ;
+#endif
}
index++;
}/*if(index*/
cmptparm[j].w = w;
cmptparm[j].h = h;
}
+#ifdef USETILEMODE
+ image = opj_image_tile_create(numcomps,&cmptparm[0],color_space);
+#else
image = opj_image_create(numcomps, &cmptparm[0], color_space);
+#endif
if(!image)
{