diff options
| author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-02-26 11:03:55 +0000 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-02-26 11:03:55 +0000 |
| commit | 3da30304fc1225ab55ab7c5e791870fec1b0b3c3 (patch) | |
| tree | 506228277ccaeab95a2e2d233e11411c4068f480 /src/lib/openjp2/jp2.c | |
| parent | 820c04c6799ea38aacd4e5d637073e6ab1ec643c (diff) | |
[trunk] Import patch from sumatrapdf team. This adds alpha handling. This patch changes ABI.
Update issue 225
Diffstat (limited to 'src/lib/openjp2/jp2.c')
| -rw-r--r-- | src/lib/openjp2/jp2.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index d3f7515b..9dde2e97 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -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); |
