summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-29 17:26:27 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-05 15:32:34 +0200
commitf40106ac6b7367292432ee7af61608548d490e8c (patch)
tree3b20165e215e76e3cca40e370e73482d9efdc8fc /include
parentea7403b4c172338dfe7f371302f82859921e60af (diff)
downloadmupdf-f40106ac6b7367292432ee7af61608548d490e8c.tar.xz
Pass rects by value: device and document interface.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/device.h38
-rw-r--r--include/mupdf/fitz/display-list.h4
-rw-r--r--include/mupdf/fitz/font.h2
-rw-r--r--include/mupdf/fitz/shade.h2
-rw-r--r--include/mupdf/fitz/writer.h4
-rw-r--r--include/mupdf/pdf/document.h2
-rw-r--r--include/mupdf/pdf/output-pdf.h2
7 files changed, 27 insertions, 27 deletions
diff --git a/include/mupdf/fitz/device.h b/include/mupdf/fitz/device.h
index 334c8553..1c01b46f 100644
--- a/include/mupdf/fitz/device.h
+++ b/include/mupdf/fitz/device.h
@@ -88,28 +88,28 @@ struct fz_device_s
void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
void (*stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
- void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , const fz_rect *scissor);
- void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , const fz_rect *scissor);
+ void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix , fz_rect scissor);
+ void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix , fz_rect scissor);
void (*fill_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
void (*stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , fz_colorspace *, const float *color, float alpha, const fz_color_params *);
- void (*clip_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , const fz_rect *scissor);
- void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , const fz_rect *scissor);
+ void (*clip_text)(fz_context *, fz_device *, const fz_text *, fz_matrix , fz_rect scissor);
+ void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix , fz_rect scissor);
void (*ignore_text)(fz_context *, fz_device *, const fz_text *, fz_matrix );
void (*fill_shade)(fz_context *, fz_device *, fz_shade *shd, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void (*fill_image)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void (*fill_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_colorspace *, const float *color, float alpha, const fz_color_params *color_params);
- void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, const fz_rect *scissor);
+ void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_rect scissor);
void (*pop_clip)(fz_context *, fz_device *);
- void (*begin_mask)(fz_context *, fz_device *, const fz_rect *, int luminosity, fz_colorspace *, const float *bc, const fz_color_params *);
+ void (*begin_mask)(fz_context *, fz_device *, fz_rect area, int luminosity, fz_colorspace *, const float *bc, const fz_color_params *);
void (*end_mask)(fz_context *, fz_device *);
- void (*begin_group)(fz_context *, fz_device *, const fz_rect *, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
+ void (*begin_group)(fz_context *, fz_device *, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void (*end_group)(fz_context *, fz_device *);
- int (*begin_tile)(fz_context *, fz_device *, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id);
+ int (*begin_tile)(fz_context *, fz_device *, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void (*end_tile)(fz_context *, fz_device *);
void (*render_flags)(fz_context *, fz_device *, int set, int clear);
@@ -130,24 +130,24 @@ struct fz_device_s
void fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
void fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, const fz_rect *scissor);
-void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor);
+void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor);
+void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
void fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, const fz_rect *scissor);
-void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, const fz_rect *scissor);
+void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor);
+void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm);
void fz_pop_clip(fz_context *ctx, fz_device *dev);
void fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, const fz_color_params *color_params);
void fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, const fz_color_params *color_params);
-void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, const fz_rect *scissor);
-void fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params);
+void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor);
+void fz_begin_mask(fz_context *ctx, fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, const fz_color_params *color_params);
void fz_end_mask(fz_context *ctx, fz_device *dev);
-void fz_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
+void fz_begin_group(fz_context *ctx, fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void fz_end_group(fz_context *ctx, fz_device *dev);
-void fz_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm);
-int fz_begin_tile_id(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, fz_matrix ctm, int id);
+void fz_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
+int fz_begin_tile_id(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void fz_end_tile(fz_context *ctx, fz_device *dev);
void fz_render_flags(fz_context *ctx, fz_device *dev, int set, int clear);
void fz_set_default_colorspaces(fz_context *ctx, fz_device *dev, fz_default_colorspaces *default_cs);
@@ -190,7 +190,7 @@ void fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints);
/*
Find current scissor region as tracked by the device.
*/
-const fz_rect *fz_device_current_scissor(fz_context *ctx, fz_device *dev);
+fz_rect fz_device_current_scissor(fz_context *ctx, fz_device *dev);
enum
{
@@ -412,6 +412,6 @@ fz_draw_options *fz_parse_draw_options(fz_context *ctx, fz_draw_options *options
mediabox: The bounds of the page in points.
pixmap: An out parameter containing the newly created pixmap.
*/
-fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, const fz_rect *mediabox, fz_pixmap **pixmap);
+fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, fz_rect mediabox, fz_pixmap **pixmap);
#endif
diff --git a/include/mupdf/fitz/display-list.h b/include/mupdf/fitz/display-list.h
index bcc229fe..d277d40a 100644
--- a/include/mupdf/fitz/display-list.h
+++ b/include/mupdf/fitz/display-list.h
@@ -61,7 +61,7 @@ fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);
for example scaling and rotation, see fz_scale, fz_rotate and
fz_concat. Set to fz_identity if no transformation is desired.
- area: Only the part of the contents of the display list
+ scissor: Only the part of the contents of the display list
visible within this area will be considered when the list is
run through the device. This does not imply for tile objects
contained in the display list.
@@ -73,7 +73,7 @@ fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);
progress information back to the caller. The fields inside
cookie are continually updated while the page is being run.
*/
-void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix ctm, const fz_rect *area, fz_cookie *cookie);
+void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, fz_matrix ctm, fz_rect scissor, fz_cookie *cookie);
/*
fz_keep_display_list: Keep a reference to a display list.
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index b05fa478..aaa02552 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -151,7 +151,7 @@ int fz_font_is_monospaced(fz_context *ctx, fz_font *font);
Returns a pointer to the font bbox (or NULL if the
font is NULL).
*/
-fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font);
+fz_rect fz_font_bbox(fz_context *ctx, fz_font *font);
/*
fz_load_system_font_fn: Type for user supplied system font loading hook.
diff --git a/include/mupdf/fitz/shade.h b/include/mupdf/fitz/shade.h
index d6cf3c9e..98f7ad22 100644
--- a/include/mupdf/fitz/shade.h
+++ b/include/mupdf/fitz/shade.h
@@ -136,7 +136,7 @@ fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm);
op: NULL, or pointer to overprint bitmap.
*/
-void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, const fz_irect *bbox, const fz_overprint *op);
+void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, const fz_color_params *color_params, fz_irect bbox, const fz_overprint *op);
/*
* Handy routine for processing mesh based shades
diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h
index 1ce51645..6850d06d 100644
--- a/include/mupdf/fitz/writer.h
+++ b/include/mupdf/fitz/writer.h
@@ -17,7 +17,7 @@ typedef struct fz_document_writer_s fz_document_writer;
Returns a fz_device to write page contents to.
*/
-typedef fz_device *(fz_document_writer_begin_page_fn)(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
+typedef fz_device *(fz_document_writer_begin_page_fn)(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox);
/*
fz_document_writer_end_page_fn: Function type to end the
@@ -119,7 +119,7 @@ fz_document_writer *fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path,
Returns a fz_device to write page contents to.
*/
-fz_device *fz_begin_page(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
+fz_device *fz_begin_page(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox);
/*
fz_end_page: Called to end the process of writing a page to a
diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h
index 4ca9a3a8..e2dd580a 100644
--- a/include/mupdf/pdf/document.h
+++ b/include/mupdf/pdf/document.h
@@ -796,7 +796,7 @@ pdf_obj *pdf_graft_mapped_object(fz_context *ctx, pdf_graft_map *map, pdf_obj *o
pcontents: Pointer to a place to put the created
contents buffer.
*/
-fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, pdf_obj **presources, fz_buffer **pcontents);
+fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, fz_rect mediabox, pdf_obj **presources, fz_buffer **pcontents);
/*
pdf_add_page: Create a pdf_obj within a document that
diff --git a/include/mupdf/pdf/output-pdf.h b/include/mupdf/pdf/output-pdf.h
index d223b45e..3d3c6568 100644
--- a/include/mupdf/pdf/output-pdf.h
+++ b/include/mupdf/pdf/output-pdf.h
@@ -11,7 +11,7 @@
is not an array, and that is it not shared with other objects/pages.
*/
fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topctm,
- const fz_rect *mediabox, pdf_obj *resources, fz_buffer *contents);
+ fz_rect mediabox, pdf_obj *resources, fz_buffer *contents);
void pdf_localise_page_resources(fz_context *ctx, pdf_document *doc);