diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-06-29 16:46:17 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-07-05 15:32:34 +0200 |
commit | ea7403b4c172338dfe7f371302f82859921e60af (patch) | |
tree | 4a3fbf8ea35cb53fcbf395f096cf61ffda7b40be /include | |
parent | 4a99615a609eec2b84bb2341d74fac46a5998137 (diff) | |
download | mupdf-ea7403b4c172338dfe7f371302f82859921e60af.tar.xz |
Pass matrices by value: device and document interface.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/device.h | 72 | ||||
-rw-r--r-- | include/mupdf/fitz/display-list.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/document.h | 10 | ||||
-rw-r--r-- | include/mupdf/fitz/font.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/geometry.h | 6 | ||||
-rw-r--r-- | include/mupdf/fitz/glyph-cache.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/image.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/pixmap.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/shade.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/text.h | 7 | ||||
-rw-r--r-- | include/mupdf/fitz/util.h | 10 | ||||
-rw-r--r-- | include/mupdf/pdf/annot.h | 4 | ||||
-rw-r--r-- | include/mupdf/pdf/font.h | 2 | ||||
-rw-r--r-- | include/mupdf/pdf/interpret.h | 6 | ||||
-rw-r--r-- | include/mupdf/pdf/output-pdf.h | 2 | ||||
-rw-r--r-- | include/mupdf/pdf/page.h | 6 |
16 files changed, 71 insertions, 66 deletions
diff --git a/include/mupdf/fitz/device.h b/include/mupdf/fitz/device.h index 132668c1..334c8553 100644 --- a/include/mupdf/fitz/device.h +++ b/include/mupdf/fitz/device.h @@ -86,21 +86,21 @@ struct fz_device_s void (*close_device)(fz_context *, fz_device *); void (*drop_device)(fz_context *, fz_device *); - void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, const 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 *, const 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, const fz_matrix *, const fz_rect *scissor); - void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, const fz_matrix *, const fz_rect *scissor); - - void (*fill_text)(fz_context *, fz_device *, const fz_text *, const 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 *, const fz_matrix *, fz_colorspace *, const float *color, float alpha, const fz_color_params *); - void (*clip_text)(fz_context *, fz_device *, const fz_text *, const fz_matrix *, const fz_rect *scissor); - void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, const fz_matrix *, const fz_rect *scissor); - void (*ignore_text)(fz_context *, fz_device *, const fz_text *, const fz_matrix *); - - void (*fill_shade)(fz_context *, fz_device *, fz_shade *shd, const fz_matrix *ctm, float alpha, const fz_color_params *color_params); - void (*fill_image)(fz_context *, fz_device *, fz_image *img, const fz_matrix *ctm, float alpha, const fz_color_params *color_params); - void (*fill_image_mask)(fz_context *, fz_device *, fz_image *img, const 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, const fz_matrix *ctm, const fz_rect *scissor); + 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 (*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 (*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 (*pop_clip)(fz_context *, fz_device *); @@ -109,7 +109,7 @@ struct fz_device_s void (*begin_group)(fz_context *, fz_device *, const fz_rect *, 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, const fz_matrix *ctm, int id); + int (*begin_tile)(fz_context *, fz_device *, const fz_rect *area, const 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); @@ -128,26 +128,26 @@ struct fz_device_s fz_device_container_stack *container; }; -void fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const 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, const 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, const 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, const fz_matrix *ctm, const fz_rect *scissor); -void fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const 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, const 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, const 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, const fz_matrix *ctm, const fz_rect *scissor); -void fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm); +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_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_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, const fz_matrix *ctm, float alpha, const fz_color_params *color_params); -void fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const 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, const 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, const fz_matrix *ctm, const fz_rect *scissor); +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_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_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, const 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, const fz_matrix *ctm, int id); +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_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); @@ -326,7 +326,7 @@ enum transform: Transform from user space in points to device space in pixels. */ -fz_device *fz_new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest); +fz_device *fz_new_draw_device(fz_context *ctx, fz_matrix transform, fz_pixmap *dest); /* fz_new_draw_device_with_bbox: Create a device to draw on a pixmap. @@ -342,7 +342,7 @@ fz_device *fz_new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pi clip: Bounding box to restrict any marking operations of the draw device. */ -fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_irect *clip); +fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip); /* fz_new_draw_device_with_proof: Create a device to draw on a pixmap. @@ -358,7 +358,7 @@ fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, const fz_matrix *transf proof_cs: Intermediate color space to map though when mapping to color space defined by pixmap. */ -fz_device *fz_new_draw_device_with_proof(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, fz_colorspace *proof_cs); +fz_device *fz_new_draw_device_with_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, fz_colorspace *proof_cs); /* fz_new_draw_device_with_bbox_proof: Create a device to draw on a pixmap. @@ -376,9 +376,9 @@ fz_device *fz_new_draw_device_with_proof(fz_context *ctx, const fz_matrix *trans proof_cs: Color space to render to prior to mapping to color space defined by pixmap. */ -fz_device *fz_new_draw_device_with_bbox_proof(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs); +fz_device *fz_new_draw_device_with_bbox_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs); -fz_device *fz_new_draw_device_type3(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest); +fz_device *fz_new_draw_device_type3(fz_context *ctx, fz_matrix transform, fz_pixmap *dest); /* struct fz_draw_options: Options for creating a pixmap and draw device. diff --git a/include/mupdf/fitz/display-list.h b/include/mupdf/fitz/display-list.h index 02bb4e4a..bcc229fe 100644 --- a/include/mupdf/fitz/display-list.h +++ b/include/mupdf/fitz/display-list.h @@ -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, const 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, const fz_rect *area, fz_cookie *cookie); /* fz_keep_display_list: Keep a reference to a display list. diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h index 9920a054..f0d114ae 100644 --- a/include/mupdf/fitz/document.h +++ b/include/mupdf/fitz/document.h @@ -134,7 +134,7 @@ typedef fz_rect (fz_page_bound_page_fn)(fz_context *ctx, fz_page *page); contents of a page. See fz_run_page_contents for more information. */ -typedef void (fz_page_run_page_contents_fn)(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +typedef void (fz_page_run_page_contents_fn)(fz_context *ctx, fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie); /* fz_page_load_links_fn: Type for a function to load the links @@ -187,7 +187,7 @@ typedef int (fz_page_uses_overprint_fn)(fz_context *ctx, fz_page *page); typedef void (fz_annot_drop_fn)(fz_context *ctx, fz_annot *annot); typedef fz_annot *(fz_annot_next_fn)(fz_context *ctx, fz_annot *annot); typedef fz_rect (fz_annot_bound_fn)(fz_context *ctx, fz_annot *annot); -typedef void (fz_annot_run_fn)(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +typedef void (fz_annot_run_fn)(fz_context *ctx, fz_annot *annot, fz_device *dev, fz_matrix transform, fz_cookie *cookie); /* Structure definition is public so other classes can @@ -490,7 +490,7 @@ fz_rect fz_bound_page(fz_context *ctx, fz_page *page); fields inside cookie are continually updated while the page is rendering. */ -void fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +void fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie); /* fz_run_page_contents: Run a page through a device. Just the main @@ -512,7 +512,7 @@ void fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix fields inside cookie are continually updated while the page is rendering. */ -void fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +void fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie); /* fz_run_annot: Run an annotation through a device. @@ -535,7 +535,7 @@ void fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fields inside cookie are continually updated while the page is rendering. */ -void fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie); +void fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, fz_matrix transform, fz_cookie *cookie); /* fz_keep_page: Keep a reference to a loaded page. diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h index 13c2bf65..b05fa478 100644 --- a/include/mupdf/fitz/font.h +++ b/include/mupdf/fitz/font.h @@ -496,7 +496,7 @@ int fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid); dev: The device to render onto. */ -void fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, struct fz_device_s *dev); +void fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, struct fz_device_s *dev); /* fz_decouple_type3_font: Internal function to remove the diff --git a/include/mupdf/fitz/geometry.h b/include/mupdf/fitz/geometry.h index f44b4f6c..04abf5b9 100644 --- a/include/mupdf/fitz/geometry.h +++ b/include/mupdf/fitz/geometry.h @@ -273,6 +273,12 @@ static inline fz_matrix fz_make_matrix(float a, float b, float c, float d, float return m; } +static inline int fz_is_identity(fz_matrix m) +{ + return m.a == 1 && m.b == 0 && m.c == 0 && m.d == 1 && m.e == 0 && m.f == 0; +} + + /* fz_concat: Multiply two matrices. diff --git a/include/mupdf/fitz/glyph-cache.h b/include/mupdf/fitz/glyph-cache.h index 2a86213b..caedf117 100644 --- a/include/mupdf/fitz/glyph-cache.h +++ b/include/mupdf/fitz/glyph-cache.h @@ -8,7 +8,7 @@ void fz_purge_glyph_cache(fz_context *ctx); fz_pixmap *fz_render_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_irect *scissor, int aa); -void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nested_depth, fz_default_colorspaces *def_cs); +void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, int nested_depth, fz_default_colorspaces *def_cs); void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nested_depth); void fz_dump_glyph_cache_stats(fz_context *ctx); float fz_subpixel_adjust(fz_context *ctx, fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf); diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h index dcf27362..8c5e7d62 100644 --- a/include/mupdf/fitz/image.h +++ b/include/mupdf/fitz/image.h @@ -44,7 +44,7 @@ typedef struct fz_pixmap_image_s fz_pixmap_image; Returns a non NULL pixmap pointer. May throw exceptions. */ -fz_pixmap *fz_get_pixmap_from_image(fz_context *ctx, fz_image *image, const fz_irect *subarea, fz_matrix *trans, int *w, int *h); +fz_pixmap *fz_get_pixmap_from_image(fz_context *ctx, fz_image *image, const fz_irect *subarea, fz_matrix *ctm, int *w, int *h); /* fz_drop_image: Drop a reference to an image. diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h index 18e01790..82659d5c 100644 --- a/include/mupdf/fitz/pixmap.h +++ b/include/mupdf/fitz/pixmap.h @@ -386,7 +386,7 @@ fz_irect fz_pixmap_bbox_no_ctx(const fz_pixmap *src); void fz_decode_tile(fz_context *ctx, fz_pixmap *pix, const float *decode); void fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int maxval); -void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * FZ_RESTRICT src, int n, int depth, size_t stride, int scale); +void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale); /* fz_pixmap_converter: Color convert a pixmap. The passing of default_cs is needed due to the base cs of the image possibly diff --git a/include/mupdf/fitz/shade.h b/include/mupdf/fitz/shade.h index 7b821a34..d6cf3c9e 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, const 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, const fz_irect *bbox, const fz_overprint *op); /* * Handy routine for processing mesh based shades diff --git a/include/mupdf/fitz/text.h b/include/mupdf/fitz/text.h index cce357ae..33dbe2f3 100644 --- a/include/mupdf/fitz/text.h +++ b/include/mupdf/fitz/text.h @@ -122,8 +122,7 @@ void fz_show_glyph(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix trm, font: The font the string should be added in. - trm: The transform to use. Will be updated according - to the advance of the string on exit. + trm: The transform to use. s: The utf-8 string to add. @@ -137,9 +136,9 @@ void fz_show_glyph(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix trm, language: The language in use (if known, 0 otherwise) (e.g. FZ_LANG_zh_Hans). - Throws exception on failure to allocate. + Returns the transform updated with the advance width of the string. */ -void fz_show_string(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix *trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language); +fz_matrix fz_show_string(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language); /* fz_bound_text: Find the bounds of a given text object. diff --git a/include/mupdf/fitz/util.h b/include/mupdf/fitz/util.h index 05119fd5..1335cf86 100644 --- a/include/mupdf/fitz/util.h +++ b/include/mupdf/fitz/util.h @@ -20,20 +20,20 @@ fz_display_list *fz_new_display_list_from_annot(fz_context *ctx, fz_annot *annot /* fz_new_pixmap_from_page: Render the page to a pixmap using the transform and colorspace. */ -fz_pixmap *fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz_matrix *ctm, fz_colorspace *cs, int alpha); -fz_pixmap *fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha); -fz_pixmap *fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_matrix *ctm, fz_colorspace *cs, int alpha); +fz_pixmap *fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, fz_matrix ctm, fz_colorspace *cs, int alpha); +fz_pixmap *fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha); +fz_pixmap *fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, fz_matrix ctm, fz_colorspace *cs, int alpha); /* fz_new_pixmap_from_page_contents: Render the page contents without annotations. */ -fz_pixmap *fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha); +fz_pixmap *fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha); /* fz_new_pixmap_from_annot: Render an annotation suitable for blending on top of the opaque pixmap returned by fz_new_pixmap_from_page_contents. */ -fz_pixmap *fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_colorspace *cs, int alpha); +fz_pixmap *fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, fz_matrix ctm, fz_colorspace *cs, int alpha); /* fz_new_stext_page_from_page: Extract structured text from a page. diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index 1e9361fd..5a97c4d5 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -106,7 +106,7 @@ int pdf_annot_type(fz_context *ctx, pdf_annot *annot); ctm: A transformation matrix applied to the objects on the page, e.g. to scale or rotate the page contents as desired. */ -void pdf_run_annot(fz_context *ctx, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie); +void pdf_run_annot(fz_context *ctx, pdf_annot *annot, fz_device *dev, fz_matrix ctm, fz_cookie *cookie); struct pdf_annot_s { @@ -130,7 +130,7 @@ pdf_obj *pdf_lookup_name(fz_context *ctx, pdf_document *doc, pdf_obj *which, pdf pdf_obj *pdf_load_name_tree(fz_context *ctx, pdf_document *doc, pdf_obj *which); int pdf_resolve_link(fz_context *ctx, pdf_document *doc, const char *uri, float *xp, float *yp); -fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, int pagenum, const fz_matrix *page_ctm); +fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, int pagenum, fz_matrix page_ctm); fz_matrix pdf_annot_transform(fz_context *ctx, pdf_annot *annot); void pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots); diff --git a/include/mupdf/pdf/font.h b/include/mupdf/pdf/font.h index ad0ca6b5..373b2b1b 100644 --- a/include/mupdf/pdf/font.h +++ b/include/mupdf/pdf/font.h @@ -128,7 +128,7 @@ void pdf_print_font(fz_context *ctx, fz_output *out, pdf_font_desc *fontdesc); fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, size_t len, fz_rect *rect); float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, size_t len, float room, size_t *count); -void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nested_depth, fz_default_colorspaces *default_cs); +void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm, void *gstate, int nested_depth, fz_default_colorspaces *default_cs); pdf_obj *pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font, int encoding); pdf_obj *pdf_add_cid_font(fz_context *ctx, pdf_document *doc, fz_font *font); diff --git a/include/mupdf/pdf/interpret.h b/include/mupdf/pdf/interpret.h index 4854caac..554ce4c7 100644 --- a/include/mupdf/pdf/interpret.h +++ b/include/mupdf/pdf/interpret.h @@ -184,7 +184,7 @@ struct pdf_csi_s 0 for an initial call, and will be incremented in nested calls due to Type 3 fonts. */ -pdf_processor *pdf_new_run_processor(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, const char *usage, pdf_gstate *gstate, int nested, fz_default_colorspaces *default_cs); +pdf_processor *pdf_new_run_processor(fz_context *ctx, fz_device *dev, fz_matrix ctm, const char *usage, pdf_gstate *gstate, int nested, fz_default_colorspaces *default_cs); /* pdf_new_buffer_processor: Create a buffer processor. This @@ -246,9 +246,9 @@ pdf_processor *pdf_new_output_processor(fz_context *ctx, fz_output *out, int ahx */ pdf_processor *pdf_new_filter_processor(fz_context *ctx, pdf_document *doc, pdf_processor *chain, pdf_obj *old_res, pdf_obj *new_res); -typedef int (pdf_text_filter_fn)(fz_context *ctx, void *opaque, int *ucsbuf, int ucslen, fz_matrix *trm, fz_rect *bbox); +typedef int (pdf_text_filter_fn)(fz_context *ctx, void *opaque, int *ucsbuf, int ucslen, fz_matrix trm, fz_rect bbox); -typedef void (pdf_after_text_object_fn)(fz_context *ctx, void *opaque, pdf_document *doc, pdf_processor *chain, const fz_matrix *ctm); +typedef void (pdf_after_text_object_fn)(fz_context *ctx, void *opaque, pdf_document *doc, pdf_processor *chain, fz_matrix ctm); /* pdf_new_filter_processor_with_text_filter: Create a filter diff --git a/include/mupdf/pdf/output-pdf.h b/include/mupdf/pdf/output-pdf.h index 6742c2e1..d223b45e 100644 --- a/include/mupdf/pdf/output-pdf.h +++ b/include/mupdf/pdf/output-pdf.h @@ -10,7 +10,7 @@ a reference to a stream). Callers should take care to ensure that it 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, const fz_matrix *topctm, +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); void pdf_localise_page_resources(fz_context *ctx, pdf_document *doc); diff --git a/include/mupdf/pdf/page.h b/include/mupdf/pdf/page.h index 25043b1d..3effd52b 100644 --- a/include/mupdf/pdf/page.h +++ b/include/mupdf/pdf/page.h @@ -70,7 +70,7 @@ fz_rect pdf_bound_page(fz_context *ctx, pdf_page *page); ctm: A transformation matrix applied to the objects on the page, e.g. to scale or rotate the page contents as desired. */ -void pdf_run_page(fz_context *ctx, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie); +void pdf_run_page(fz_context *ctx, pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie); /* pdf_run_page_with_usage: Interpret a loaded page and render it on a device. @@ -88,7 +88,7 @@ void pdf_run_page(fz_context *ctx, pdf_page *page, fz_device *dev, const fz_matr cookie: A pointer to an optional fz_cookie structure that can be used to track progress, collect errors etc. */ -void pdf_run_page_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, const char *usage, fz_cookie *cookie); +void pdf_run_page_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_device *dev, fz_matrix ctm, const char *usage, fz_cookie *cookie); /* pdf_run_page_contents: Interpret a loaded page and render it on a device. @@ -101,7 +101,7 @@ void pdf_run_page_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, ctm: A transformation matrix applied to the objects on the page, e.g. to scale or rotate the page contents as desired. */ -void pdf_run_page_contents(fz_context *ctx, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie); +void pdf_run_page_contents(fz_context *ctx, pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie); /* pdf_page_contents_process_fn: A function used for processing the |