summaryrefslogtreecommitdiff
path: root/source/fitz/draw-affine.c
AgeCommit message (Collapse)Author
2016-06-14Fix typos in various parts of the code.Sebastian Rasmussen
2016-05-30Fix some "defined but not used" when FZ_PLOTTERS_RGB is 0.Robin Watts
2016-05-30Ensure that we can use FZ_PLOTTERS_N instead of FZ_PLOTTERS_RGB.Robin Watts
2016-05-30Add config.h include file.Robin Watts
Introduce FZ_PLOTTER defines to set which defines we required. Add FZ_ENABLE define to set which document handlers are built by default.
2016-05-29Tweak plotter code slightly for speed.Robin Watts
Use do {} while(--w) rather than while(w--) {} as this safes a test each time around the loop.
2016-05-27Improve speed of fz_paint_affine_N_near and friends.Robin Watts
For the common cases, avoid the loop.
2016-05-27Rejig draw-affine.c for improved profiling.Robin Watts
Profilers can't identify which of the switch arms we are in for the inlined function calls, so rejig the code so that each of these is a separate function. In theory this code should be faster too, as the function 'lookup' is only done one rather than once per line, but I don't expect this to make a huge difference.
2016-05-27Add facility to track usage of functions.Robin Watts
Use this for plotters so we can see which ones are being used in any given build. Build with -DTRACK_USAGE to enable.
2016-05-26Optimisations in draw-affine for 0 alpha pixels.Robin Watts
2016-05-26Cope better when asked to plot alpha only pixmaps.Robin Watts
Converting a pixmap to an alpha only pixmap means "just keep the alpha". If there IS no alpha, then a solid alpha is assumed.
2016-05-24Fix plotters; alpha being dropped.Robin Watts
In the absence of the source image having an alpha plane, we were dropping the constant alpha during linear interpolated plotting.
2016-05-24Fix optimisation in fz_paint_affine_N_nearRobin Watts
Only do int to int copying if we have an int to copy from. Also, when copying int to int, copy int32_t to int32_t to make us more future proof.
2016-05-24Sprinkle some consts and restricts in plotters.Robin Watts
Try and help C avoid pointer aliasing issues. Some of this may not help at all. None of it should hurt though.
2016-05-24fz_pixmap revamp: add stride and make alpha optionalRobin Watts
fz_pixmaps now have an explicit stride value. By default no change from before, but code all copes with extra gaps at the end of the line. The alpha data in fz_pixmaps is no longer compulsory. mudraw: use rgb not rgba (ppmraw), cmyk not cmyka (pkmraw). Update halftone code to not expect alpha plane. Update PNG writing to cope with alpha less input. Also hide repeated params within the png output context. ARM code needs updating.
2016-05-23Bug 696795: Proper fix.Robin Watts
When affine plotting with linear interpolation, we need to perform different calculations for the texture and for the edge of the shape. The edge of the shape needs to be calculated in exactly the same way as for non-linear interpolated shapes. The 'texture' position needs to be offset by 1/2 a texture unit in each direction so that the 'pure' color is given in the middle of the texture cells image, not in the top left corner. To achieve these aims, we actually offset the u/v positions by 1/2 (32768, given the fixed point we are using) and adjust for this in the boundary tests. I have a test file that shows this working, which I will attach to the bug, and add to the regression suite.
2016-05-20Remove voodoo from draw-affine.Robin Watts
We had some code in draw-affine that we didn't really understand. Change this for some code that seems more plausible. The voodoo code was showing up problems with the plotter rework (don't really know why), but the non-voodoo code seems happier.
2016-03-25Add optimised cmyk image plotters.Robin Watts
2015-09-14Remove unused functions.Tor Andersson
2015-07-20Improve Grid fitting of images for .gproof files.Robin Watts
By default in MuPDF, when we render an axis aligned image, we 'gridfit' it. This is a heuristic used to improve the rendering of tiled images, and avoid the background showing through on the antialiased edges. The general algorithm we use is to expand any image outwards so that it completely covers any pixels that it touches any part of. This is 'safe' in that we never cause any pixels to not be covered that should otherwise be so, and is important when we have images that are aligned with (say) line art rectangles. For gproof files though, this gives nasty results - because we have multiple images tiled across the page all exactly abutting, in most cases the edges will not be on exact integer coordinates. This means we expand both images and 1 (destination) pixel is lost. This severely hurts the rendering (in particular on text based pages). We therefore introduce a new type of grid fitting, where we simply align the edges of images to the closest integer pixel. This is safe because we know that neighbouring images will be adjusted identically and edges will stay coincident. We enable/disable this behaviour through a new device flag, and make the gproof interpreter set/clear this flag when generating the page - thus normal rendering is unaffected. We *could* have just poked the dev->flags fields directly, but that would require magic in the display list device to check for them being set/unset and to poke the dev->flags fields on playback, so instead we introduce a new fz_render_flags function (that calls a device function) to set/unset flags. The other attraction of this is that if we ever have devices that 'filter', we can neatly handle passing flag changes on with those. Currently the display list implementation only copes with set/clear of the FZ_DEVFLAG_GRIDFIT_AS_TILED option. We only readily have 6 bits available to us, so we'll just extend this as required if we add new render flags.
2014-07-01Remove some trailing space.Matt Holgate
2013-09-30Disable image interpolation with a hint.Robin Watts
Set the hint in mudraw when AA bits is set to 0.
2013-08-26Optimise fz_paint_affine_near and similar fnsRobin Watts
This is the single largest hotspot in J11_acrobat.pdf on the pi, by a massive margin. J12_acrobat.pdf hits fz_paint_affine_g2rgb too.
2013-06-20Rearrange source files.Tor Andersson