diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fitz.h | 1 | ||||
-rw-r--r-- | include/fitz/shade.h | 15 | ||||
-rw-r--r-- | include/fitz/tree.h | 14 | ||||
-rw-r--r-- | include/mupdf/content.h | 5 | ||||
-rw-r--r-- | include/mupdf/rsrc.h | 2 | ||||
-rw-r--r-- | include/mupdf/xref.h | 1 |
6 files changed, 36 insertions, 2 deletions
diff --git a/include/fitz.h b/include/fitz.h index 2e2c69d1..4aa56011 100644 --- a/include/fitz.h +++ b/include/fitz.h @@ -22,6 +22,7 @@ #include "fitz/pixmap.h" #include "fitz/colorspace.h" #include "fitz/image.h" +#include "fitz/shade.h" #include "fitz/tree.h" #include "fitz/path.h" diff --git a/include/fitz/shade.h b/include/fitz/shade.h new file mode 100644 index 00000000..7641f609 --- /dev/null +++ b/include/fitz/shade.h @@ -0,0 +1,15 @@ +typedef struct fz_shade_s fz_shade; + +struct fz_shade_s +{ + int refs; + fz_colorspace *cs; + // ... +}; + +fz_shade *fz_keepshade(fz_shade *shade); +void fz_dropshade(fz_shade *shade); + +fz_rect fz_boundshade(fz_shade *shade, fz_matrix ctm); +fz_error *fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *dsts, fz_pixmap *dstp, int over); + diff --git a/include/fitz/tree.h b/include/fitz/tree.h index 57175619..15e4bcf1 100644 --- a/include/fitz/tree.h +++ b/include/fitz/tree.h @@ -15,7 +15,12 @@ void fz_droptree(fz_tree *tree); fz_rect fz_boundtree(fz_tree *tree, fz_matrix ctm); void fz_debugtree(fz_tree *tree); -void fz_insertnode(fz_node *parent, fz_node *child); +void fz_insertnodefirst(fz_node *parent, fz_node *child); +void fz_insertnodelast(fz_node *parent, fz_node *child); +void fz_insertnodeafter(fz_node *prev, fz_node *child); +void fz_removenode(fz_node *child); + +fz_error *fz_optimizetree(fz_tree *tree); /* node types */ @@ -133,6 +138,12 @@ struct fz_imagenode_s fz_image *image; }; +struct fz_shadenode_s +{ + fz_node super; + fz_shade *shade; +}; + /* common to all nodes */ void fz_initnode(fz_node *node, fz_nodekind kind); fz_rect fz_boundnode(fz_node *node, fz_matrix ctm); @@ -155,6 +166,7 @@ int fz_ismetanode(fz_node *node); fz_error *fz_newlinknode(fz_node **nodep, fz_tree *subtree); fz_error *fz_newcolornode(fz_node **nodep, fz_colorspace *cs, int n, float *v); fz_error *fz_newimagenode(fz_node **nodep, fz_image *image); +fz_error *fz_newshadenode(fz_node **nodep, fz_shade *shade); int fz_islinknode(fz_node *node); int fz_iscolornode(fz_node *node); diff --git a/include/mupdf/content.h b/include/mupdf/content.h index f891c3c7..b6eefae9 100644 --- a/include/mupdf/content.h +++ b/include/mupdf/content.h @@ -18,7 +18,8 @@ enum PDF_MCOLOR, PDF_MLAB, PDF_MINDEXED, - PDF_MPATTERN + PDF_MPATTERN, + PDF_MSHADE }; struct pdf_material_s @@ -28,6 +29,7 @@ struct pdf_material_s float v[32]; pdf_indexed *indexed; pdf_pattern *pattern; + fz_shade *shade; }; struct pdf_gstate_s @@ -87,6 +89,7 @@ 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_setpattern(pdf_csi *csi, int what, pdf_pattern *pat, float *v); +fz_error *pdf_setshade(pdf_csi *csi, int what, fz_shade *shade); fz_error *pdf_buildstrokepath(pdf_gstate *gs, fz_pathnode *path); fz_error *pdf_buildfillpath(pdf_gstate *gs, fz_pathnode *path, int evenodd); diff --git a/include/mupdf/rsrc.h b/include/mupdf/rsrc.h index 91deb38d..371661a0 100644 --- a/include/mupdf/rsrc.h +++ b/include/mupdf/rsrc.h @@ -66,6 +66,8 @@ struct pdf_pattern_s fz_error *pdf_loadpattern(pdf_pattern **patp, pdf_xref *xref, fz_obj *obj, fz_obj *ref); void pdf_droppattern(pdf_pattern *pat); +fz_error *pdf_loadshade(fz_shade **shadep, pdf_xref *xref, fz_obj *obj, fz_obj *ref); + /* * XObject */ diff --git a/include/mupdf/xref.h b/include/mupdf/xref.h index e189ba6a..f1cf79c0 100644 --- a/include/mupdf/xref.h +++ b/include/mupdf/xref.h @@ -24,6 +24,7 @@ struct pdf_xref_s pdf_rsrc *rimage; pdf_rsrc *rxobject; pdf_rsrc *rpattern; + pdf_rsrc *rshade; pdf_rsrc *rcolorspace; }; |