[trunk] Import patch from sumatrapdf team. This adds alpha handling. This patch changes ABI.
Update issue 225
This commit is contained in:
parent
820c04c679
commit
3da30304fc
@ -995,7 +995,12 @@ void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)
|
|||||||
for(i = 0; i < n; ++i)
|
for(i = 0; i < n; ++i)
|
||||||
{
|
{
|
||||||
/* WATCH: acn = asoc - 1 ! */
|
/* 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;
|
cn = info[i].cn;
|
||||||
acn = asoc - 1;
|
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[i].asoc = cn + 1;
|
||||||
info[acn].asoc = info[acn].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);
|
if(color->jp2_cdef->info) opj_free(color->jp2_cdef->info);
|
||||||
|
@ -538,6 +538,8 @@ typedef struct opj_image_comp {
|
|||||||
OPJ_UINT32 factor;
|
OPJ_UINT32 factor;
|
||||||
/** image component data */
|
/** image component data */
|
||||||
OPJ_INT32 *data;
|
OPJ_INT32 *data;
|
||||||
|
/** alpha channel */
|
||||||
|
OPJ_UINT16 alpha;
|
||||||
} opj_image_comp_t;
|
} opj_image_comp_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user