[trunk] Import patch from sumatrapdf team. This adds alpha handling. This patch changes ABI.

Update issue 225
This commit is contained in:
Mathieu Malaterre 2014-02-26 11:03:55 +00:00
parent 820c04c679
commit 3da30304fc
2 changed files with 10 additions and 1 deletions

View File

@ -995,7 +995,12 @@ void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)
for(i = 0; i < n; ++i)
{
/* WATCH: acn = asoc - 1 ! */
if((asoc = info[i].asoc) == 0) continue;
if((asoc = info[i].asoc) == 0)
{
if (i < image->numcomps)
image->comps[i].alpha = info[i].typ;
continue;
}
cn = info[i].cn;
acn = asoc - 1;
@ -1011,6 +1016,8 @@ void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)
info[i].asoc = cn + 1;
info[acn].asoc = info[acn].cn + 1;
}
image->comps[cn].alpha = info[i].typ;
}
if(color->jp2_cdef->info) opj_free(color->jp2_cdef->info);

View File

@ -538,6 +538,8 @@ typedef struct opj_image_comp {
OPJ_UINT32 factor;
/** image component data */
OPJ_INT32 *data;
/** alpha channel */
OPJ_UINT16 alpha;
} opj_image_comp_t;
/**