diff options
Diffstat (limited to 'fitz/res_pixmap.c')
-rw-r--r-- | fitz/res_pixmap.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index e70d084d..b37b7a3e 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -97,6 +97,24 @@ fz_clearpixmapwithcolor(fz_pixmap *pix, int value) } } +void +fz_premultiplypixmap(fz_pixmap *pix) +{ + unsigned char *s = pix->samples; + unsigned char a; + int k, x, y; + for (y = 0; y < pix->h; y++) + { + for (x = 0; x < pix->w; x++) + { + a = s[pix->n - 1]; + for (k = 0; k < pix->n - 1; k++) + s[k] = fz_mul255(s[k], a); + s += pix->n; + } + } +} + fz_bbox fz_boundpixmap(fz_pixmap *pix) { |