diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-10-29 06:54:34 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-10-29 06:54:34 +0200 |
commit | 082f865c4e16e525076a86df5da2a1b03da293bb (patch) | |
tree | 5a02a83f78db8a5f16d9ce3d61b007c609f9fb6a /include | |
parent | 1ff59583f5a758ee99984e011525395dfb416611 (diff) | |
download | mupdf-082f865c4e16e525076a86df5da2a1b03da293bb.tar.xz |
fill/stroke material struct. flatten indexed colorspace.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/content.h | 37 | ||||
-rw-r--r-- | include/mupdf/rsrc.h | 11 |
2 files changed, 44 insertions, 4 deletions
diff --git a/include/mupdf/content.h b/include/mupdf/content.h index b57a4d96..a7bfac22 100644 --- a/include/mupdf/content.h +++ b/include/mupdf/content.h @@ -2,9 +2,37 @@ * content stream parsing */ +typedef struct pdf_material_s pdf_material; typedef struct pdf_gstate_s pdf_gstate; typedef struct pdf_csi_s pdf_csi; +enum +{ + PDF_MFILL, + PDF_MSTROKE +}; + +enum +{ + PDF_MNONE, + PDF_MCOLOR, + PDF_MLAB, + PDF_MINDEXED, + PDF_MTILE, + PDF_MSHADE +}; + +struct pdf_material_s +{ + int kind; + fz_colorspace *cs; + float v[32]; + pdf_indexed *indexed; + // lookup + // tile + // shade +}; + struct pdf_gstate_s { /* path stroking */ @@ -17,10 +45,8 @@ struct pdf_gstate_s float dashlist[32]; /* materials */ - fz_colorspace *strokecs; - float stroke[32]; - fz_colorspace *fillcs; - float fill[32]; + pdf_material stroke; + pdf_material fill; /* text state */ float charspace; @@ -58,6 +84,9 @@ struct pdf_csi_s /* build.c */ void pdf_initgstate(pdf_gstate *gs); +fz_error *pdf_setcolorspace(pdf_csi *csi, int what, fz_colorspace *cs); +fz_error *pdf_setcolor(pdf_csi *csi, int what, float *v); + fz_error *pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path); fz_error *pdf_buildfillpath(pdf_gstate *gs, fz_pathnode *path, int evenodd); fz_error *pdf_addfillshape(pdf_gstate *gs, fz_node *shape); diff --git a/include/mupdf/rsrc.h b/include/mupdf/rsrc.h index 4b656910..0fb28cf0 100644 --- a/include/mupdf/rsrc.h +++ b/include/mupdf/rsrc.h @@ -28,6 +28,16 @@ void pdf_freefunction(pdf_function *func); * ColorSpace */ +typedef struct pdf_indexed_s pdf_indexed; + +struct pdf_indexed_s +{ + fz_colorspace super; /* hmmm... */ + fz_colorspace *base; + int high; + unsigned char *lookup; +}; + extern fz_colorspace *pdf_devicegray; extern fz_colorspace *pdf_devicergb; extern fz_colorspace *pdf_devicecmyk; @@ -61,6 +71,7 @@ struct pdf_image_s { fz_image super; fz_image *mask; /* explicit mask with subimage */ + pdf_indexed *indexed; float decode[32]; int bpc; int stride; |