From 96cc776650a1845f4b3894c2311bee4d51d60f20 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 3 Jul 2018 15:07:25 +0200 Subject: Add fz_transform_page helper function. Create a matrix that transforms a page with resolution and rotation, and grid fits the resulting bounding box. --- include/mupdf/fitz/geometry.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/mupdf/fitz/geometry.h b/include/mupdf/fitz/geometry.h index 04abf5b9..0eb0f844 100644 --- a/include/mupdf/fitz/geometry.h +++ b/include/mupdf/fitz/geometry.h @@ -416,6 +416,14 @@ fz_matrix fz_translate(float tx, float ty); */ fz_matrix fz_pre_translate(fz_matrix m, float tx, float ty); +/* + fz_transform_page: Create transform matrix to draw page + at a given resolution and rotation. Adjusts the scaling + factors so that the page covers whole number of + pixels and adjust the page origin to be at 0,0. +*/ +fz_matrix fz_transform_page(fz_rect mediabox, float resolution, float rotate); + /* fz_invert_matrix: Create an inverse matrix. -- cgit v1.2.3