summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/fitz/image.h2
-rw-r--r--include/fitz/pixmap.h22
2 files changed, 16 insertions, 8 deletions
diff --git a/include/fitz/image.h b/include/fitz/image.h
index 0ff954c5..ea3ebaa9 100644
--- a/include/fitz/image.h
+++ b/include/fitz/image.h
@@ -1,5 +1,7 @@
typedef struct fz_image_s fz_image;
+/* loadtile will fill a pixmap with the pixel samples. non-premultiplied alpha. */
+
struct fz_image_s
{
fz_error* (*loadtile)(fz_image*,fz_pixmap*);
diff --git a/include/fitz/pixmap.h b/include/fitz/pixmap.h
index 7b8bfb1e..508a304b 100644
--- a/include/fitz/pixmap.h
+++ b/include/fitz/pixmap.h
@@ -1,19 +1,25 @@
+/*
+pixmaps have n components per pixel. the first is always alpha.
+premultiplied alpha when rendering, but non-premultiplied for colorspace
+conversions and rescaling.
+*/
+
typedef struct fz_pixmap_s fz_pixmap;
+typedef unsigned char fz_sample;
struct fz_pixmap_s
{
- fz_colorspace *cs;
- int x, y, w, h;
- int n, a;
- int stride;
- unsigned char *samples;
+ int x, y, w, h, n;
+ fz_sample *samples;
};
-fz_error *fz_newpixmap(fz_pixmap **mapp, fz_colorspace *cs, int x, int y, int w, int h, int n, int a);
+fz_error *fz_newpixmap(fz_pixmap **mapp, int x, int y, int w, int h, int n);
void fz_debugpixmap(fz_pixmap *map);
-void fz_freepixmap(fz_pixmap *map);
void fz_clearpixmap(fz_pixmap *map);
-void fz_convertpixmap(fz_pixmap *src, fz_pixmap *dst);
+void fz_freepixmap(fz_pixmap *map);
+
+fz_error *fz_convertpixmap(fz_pixmap **dstp, fz_pixmap *src, fz_colorspace *srcs, fz_colorspace *dsts);
+fz_error *fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom);
void fz_blendover(fz_pixmap *src, fz_pixmap *dst);
void fz_blendmask(fz_pixmap *dst, fz_pixmap *color, fz_pixmap *shape);