diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-15 07:50:43 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-15 07:50:43 +0100 |
commit | 01a774064e13cebc9a75e44432226d845fa46f9a (patch) | |
tree | e817e8ad3d4fa2d4bb52f1ac543c9b932b40d657 /include | |
parent | 67781c58fef0f94ea234341cea8e7e13646bc4a2 (diff) | |
download | mupdf-01a774064e13cebc9a75e44432226d845fa46f9a.tar.xz |
render optimizations
Diffstat (limited to 'include')
-rw-r--r-- | include/fitz.h | 2 | ||||
-rw-r--r-- | include/fitz/colorspace.h | 7 | ||||
-rw-r--r-- | include/fitz/math.h | 8 | ||||
-rw-r--r-- | include/fitz/pixmap.h | 1 | ||||
-rw-r--r-- | include/fitz/render.h | 2 | ||||
-rw-r--r-- | include/fitz/sysdep.h | 7 |
6 files changed, 17 insertions, 10 deletions
diff --git a/include/fitz.h b/include/fitz.h index 48754391..2e2c69d1 100644 --- a/include/fitz.h +++ b/include/fitz.h @@ -19,8 +19,8 @@ #include "fitz/cmap.h" #include "fitz/font.h" -#include "fitz/colorspace.h" #include "fitz/pixmap.h" +#include "fitz/colorspace.h" #include "fitz/image.h" #include "fitz/tree.h" diff --git a/include/fitz/colorspace.h b/include/fitz/colorspace.h index 322b96c8..1d6c9a64 100644 --- a/include/fitz/colorspace.h +++ b/include/fitz/colorspace.h @@ -9,6 +9,8 @@ struct fz_colorspace_s int refs; char name[16]; int n; + void (*convpixmap)(fz_colorspace *ss, fz_pixmap *sp, fz_colorspace *ds, fz_pixmap *dp); + void (*convcolor)(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv); void (*toxyz)(fz_colorspace *, float *src, float *xyz); void (*fromxyz)(fz_colorspace *, float *xyz, float *dst); void (*drop)(fz_colorspace *); @@ -27,5 +29,10 @@ struct fz_colorcube_s fz_colorspace *fz_keepcolorspace(fz_colorspace *cs); void fz_dropcolorspace(fz_colorspace *cs); + void fz_convertcolor(fz_colorspace *srcs, float *srcv, fz_colorspace *dsts, float *dstv); +void fz_convertpixmap(fz_colorspace *srcs, fz_pixmap *srcv, fz_colorspace *dsts, fz_pixmap *dstv); + +void fz_stdconvcolor(fz_colorspace *srcs, float *srcv, fz_colorspace *dsts, float *dstv); +void fz_stdconvpixmap(fz_colorspace *srcs, fz_pixmap *srcv, fz_colorspace *dsts, fz_pixmap *dstv); diff --git a/include/fitz/math.h b/include/fitz/math.h index 30577691..b2f1bf24 100644 --- a/include/fitz/math.h +++ b/include/fitz/math.h @@ -1,24 +1,18 @@ /* multiply 8-bit fixpoint (0..1) so that 0*0==0 and 255*255==255 */ static inline unsigned char fz_mul255(unsigned char a, unsigned char b) { - return ((a + 1) * b) >> 8; + return (a * ((unsigned int)b + 1)) >> 8; } /* floor / ceil towards/from +/- inf */ static inline float fz_floor(float x) { return floor(x); -// if (x > 0) -// return floor(x); -// return ceil(x); } static inline float fz_ceil(float x) { return ceil(x); -// if (x > 0) -// return ceil(x); -// return floor(x); } /* divide and floor towards -inf */ diff --git a/include/fitz/pixmap.h b/include/fitz/pixmap.h index ea112405..ecd45270 100644 --- a/include/fitz/pixmap.h +++ b/include/fitz/pixmap.h @@ -18,7 +18,6 @@ void fz_debugpixmap(fz_pixmap *map); void fz_clearpixmap(fz_pixmap *map); void fz_droppixmap(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); diff --git a/include/fitz/render.h b/include/fitz/render.h index 9ff4b3f7..ac25a09d 100644 --- a/include/fitz/render.h +++ b/include/fitz/render.h @@ -15,7 +15,7 @@ struct fz_renderer_s unsigned char r, g, b; }; -fz_error *fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm); +fz_error *fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int gcmem); void fz_droprenderer(fz_renderer *gc); fz_error *fz_renderover(fz_renderer *gc, fz_overnode *over, fz_matrix ctm); diff --git a/include/fitz/sysdep.h b/include/fitz/sysdep.h index 7f7ddbca..3e0f3232 100644 --- a/include/fitz/sysdep.h +++ b/include/fitz/sysdep.h @@ -14,6 +14,13 @@ #include <errno.h> #include <fcntl.h> /* O_RDONLY & co */ +#ifdef _ISOC99_SOURCE +#elif __GNUC__ +#define restrict __restrict__ +#else +#define restrict +#endif + #ifdef WIN32 #define NEED_STRLCPY |