From 93701ab27b4d50f5d27da43f34d432e1963ce337 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 26 Jul 2011 16:09:55 +0100 Subject: Fix bug 692354: Horizontal white lines in images. The problem is due to abutting images showing gaps between them. These gaps are due to a combination of rounding errors, and anti-aliasing effects on the edge of images. The solution is to selectively 'grid fit' images. If an image is part of a type 3 font, we do NOT want to grid fit it, as this is where the sub pixel positioning makes a huge difference. If an image is displayed with alpha, then we don't want to grid fit it (as grid fitting will tend to make the edges of images overlap by 1 pixel, and will hence produce nasty effects). Otherwise, we will grid fit; Grid fit in this sense is where we expand an image to completely fill the pixel grid that it touches (i.e. the extents for the image are expanded to pixel boundaries; no half full pixels are left around the edges). The only real change of note here is in how we detect that we are in a type 3 charproc; we add a new draw device creation function that we call in the type3 charproc case that sets a flag that the drawing functions can check. --- fitz/fitz.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fitz/fitz.h') diff --git a/fitz/fitz.h b/fitz/fitz.h index 028c6325..7fe8b297 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -627,6 +627,7 @@ fz_pixmap *fz_alpha_from_gray(fz_pixmap *gray, int luminosity); fz_bbox fz_bound_pixmap(fz_pixmap *pix); fz_pixmap *fz_scale_pixmap(fz_pixmap *src, float x, float y, float w, float h); +fz_pixmap *fz_scale_pixmap_gridfit(fz_pixmap *src, float x, float y, float w, float h, int gridfit); fz_error fz_write_pnm(fz_pixmap *pixmap, char *filename); fz_error fz_write_pam(fz_pixmap *pixmap, char *filename, int savealpha); @@ -1010,6 +1011,7 @@ void fz_free_device(fz_device *dev); fz_device *fz_new_trace_device(void); fz_device *fz_new_bbox_device(fz_bbox *bboxp); fz_device *fz_new_draw_device(fz_glyph_cache *cache, fz_pixmap *dest); +fz_device *fz_new_draw_device_type3(fz_glyph_cache *cache, fz_pixmap *dest); /* * Text extraction device -- cgit v1.2.3