diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-01-30 13:54:39 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-01-30 14:13:01 +0100 |
commit | 594c64f744862b993bcad12e05217f3d43e7d547 (patch) | |
tree | 5328ba05eb7c360c25bdc1849604839ce8d99762 /doc | |
parent | 29f09279714f4f9b81d9b5488072860142f86f24 (diff) | |
download | mupdf-594c64f744862b993bcad12e05217f3d43e7d547.tar.xz |
Introduce fz_irect where the old fz_bbox was useful.
Inside the renderer we often deal with integer sized areas, for
pixmaps and scissoring regions. Use a new fz_irect type in these
places.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/example.c | 5 | ||||
-rw-r--r-- | doc/multi-threaded.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/example.c b/doc/example.c index b834e3ff..d1e4798f 100644 --- a/doc/example.c +++ b/doc/example.c @@ -41,8 +41,8 @@ render(char *filename, int pagenumber, int zoom, int rotation) // Take the page bounds and transform them by the same matrix that // we will use to render the page. - fz_rect bbox = fz_bound_page(doc, page); - bbox = fz_transform_rect(transform, rect); + fz_rect bounds = fz_bound_page(doc, page); + bounds = fz_transform_rect(transform, rect); // Create a blank pixmap to hold the result of rendering. The // pixmap bounds used here are the same as the transformed page @@ -50,6 +50,7 @@ render(char *filename, int pagenumber, int zoom, int rotation) // space has the origin at the top left corner and the x axis // extends to the right and the y axis extends down. + fz_irect bbox = fz_round_rect(bounds); fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 0xff); diff --git a/doc/multi-threaded.c b/doc/multi-threaded.c index b54beb81..af4bab97 100644 --- a/doc/multi-threaded.c +++ b/doc/multi-threaded.c @@ -201,7 +201,7 @@ int main(int argc, char **argv) // Create a white pixmap using the correct dimensions. - fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); + fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, fz_round_rect(bbox)); fz_clear_pixmap_with_value(ctx, pix, 0xff); // Populate the data structure to be sent to the |