summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
AgeCommit message (Collapse)Author
2017-04-27Clean up store debug printing.Tor Andersson
Replace fz_print_hash with fz_hash_for_each iterator. Use string formatting callback.
2017-04-27Include required system headers.Tor Andersson
2017-04-14Scan converter; API tweak.Robin Watts
Decide whether to dash or not in the scan converter, not the draw-device.
2017-04-13Scan converter; simplify API.Robin Watts
In all cases we reset the gel before populating it, so pull this out of the draw device into the population routines.
2017-04-13Scan converter; simplify API.Robin Watts
In all cases, we sort the gel before scan converting it. So just roll the sort call into the scan convert call.
2017-03-28Rejig fz_new_device to be fz_new_derived_device.Robin Watts
In keeping with the rest of the code.
2017-03-24Ensure fz_store_types are all static const.Robin Watts
2017-03-22Rename fz_putc/puts/printf to fz_write_*.Tor Andersson
Rename fz_write to fz_write_data. Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*. Be consistent in naming: fz_write_* calls write to fz_output. fz_append_* calls append to fz_buffer. Update documentation.
2017-02-20Add svg writer.Tor Andersson
Now mutool convert can write SVG documents.
2017-02-17Bug 697592: Fix double application of transform.Robin Watts
When falling back from glyph cache based rendering to direct rendering, we were applying the transform twice due to the handling of dev->transform introduced in commit ccaf716. Fixed here.
2017-01-17Fix typos.Sebastian Rasmussen
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-12-14Let pixmap colorspace conversion create new pixmap.Sebastian Rasmussen
This moves dropping the converted pixmap into fz_convert_pixmap(), which relieves every caller from doing so. Moreover resolution, position and interpolation are kept.
2016-11-14More API tweaks.Robin Watts
Move internal functions from public to private headers.
2016-11-10Add minimum line width configuration option.Robin Watts
2016-11-07Move fz_new_draw_device_with_options within file.Robin Watts
Move function definition to the bottom of the file. This keeps the debug/config #definery at the top of the file where it belongs.
2016-11-07Bug 697241: Fix blending through clips.Robin Watts
Non rectangular clips are currently handled by rendering to a 'isolated' background, and then plotting that through a mask. This runs into problems when the rendering needs to use non standard blend modes that need to access the background colors. Instead, copy the background to the new pixmap, render to that then plot that through the mask. This simplifies the painting code, because we now never have mismatched source and destination alphas.
2016-11-07Fix DUMP_GROUP_BLENDS debugging code.Robin Watts
fz_save_pixmap_as_png has changed signature since this was last used.
2016-10-26Don't use local function, use fz_option_eq().Sebastian Rasmussen
2016-10-18Drop scaled pixmap later in draw_fill_image_mask().Sebastian Rasmussen
Following the pattern in draw_fill_image().
2016-10-18Remove unused luminosity.Sebastian Rasmussen
2016-10-10Remove unused variable.Robin Watts
2016-10-10Bug 697075: Fix tile repeat calculations.Robin Watts
When calculating how many repeats of tiles are required, we need to allow for the fact that the bbox of the tile can be larger than the repeat step in PDF. The calculation to do this before was incorrectly being done using the scissor bbox, when it should have been the tile bbox.
2016-10-06Hide internals of fz_colorspaceRobin Watts
The implementation does not need to be in the public API.
2016-09-06Devices now handle colorspace being NULL as alpha-only.Sebastian Rasmussen
2016-07-13Fix knockout/mask interaction.Robin Watts
When we are rendering a knockout group, we set the knockout flag. Do NOT carry this forward into the renderings of any softmasks. This fixes Bug 696870 and 696872.
2016-07-08Separate close and drop functionality for devices and writers.Tor Andersson
Closing a device or writer may throw exceptions, but much of the foreign language bindings (JNI and JS) depend on drop to never throw an exception (exceptions in finalizers are bad).
2016-06-22Transform device call scissor rectangles by device matrix.Tor Andersson
2016-06-17Set pixmap resolution when creating pixmaps for draw device.Tor Andersson
2016-06-17Add separate X and Y resolution to draw device options.Tor Andersson
2016-06-17Add device space transform state to draw device.Tor Andersson
Allows us to remove the out parameter 'transform' from fz_begin_page.
2016-06-17Use 'size_t' instead of int as appropriate.Robin Watts
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
2016-06-16Add PNG output for mutool convert.Tor Andersson
2016-06-16Add fz_draw_options struct for use with draw device.Tor Andersson
2016-06-08Move to using size_t for all mallocs.Robin Watts
This has knock on effects in the store. fix
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-29Split draw-paint.c plotters out into separate functions.Robin Watts
Again, mainly so profiling works nicely.
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-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-04Make minimum line thickness dependent on AA level.Robin Watts
The PDF spec says that line thickness of 0 should mean "1 device pixel". We have been doing some dodgy logic where if the line thickness as scaled by the ctm is small (< 0.1f), make it at least 1 device pixel. This can mean that a line can not qualify for being thickened at 36dpi, but can be thickened at 24dpi. The thickened line at 24dpi is much thicker than the unthickened line at 36dpi, meaning that we get a noticable shift in rendering. Why do we do this strange logic? Well, presumably it's to avoid thin lines dropping out completely. We therefore move to some new logic. Firstly, we create a fudged 'aa_level' value, dependent on the antialias level. With AA level 0 (no antialiasing), this corresponds to 1 device pixel. For maximum AA level (8), this corresponds to 1/5 of a device pixel. Thus we should get 'continuous' results across different dpis.
2016-04-28Introduce tuning context.Robin Watts
For now, just use it for controlling image decoding and image scaling.
2016-04-28Partial image decode.Robin Watts
Update the core fz_get_pixmap_from_image code to allow fetching a subarea of a pixmap. We pass in the required subarea, together with the transformation matrix for the whole image. On return, we have a pixmap at least as big as was requested, and the transformation matrix is updated to map the supplied area to the correct place on the screen. The draw device is updated to use this as required. Everywhere else passes NULLs in, and so gets unchanged behaviour. The standard 'get_pixmap' function has been updated to decode just the required areas of the bitmaps. This means that banded rendering of pages will decode just the image subareas that are required for each band, limiting the memory use. The downside to this is that each band will redecode the image again to extract just the section we want. The image subareas are put into the fz_store in the same way as full images. Currently image areas in the store are only matched when they match exactly; subareas are not identified as being able to use existing images.
2016-04-27Add fz_close_device function.Tor Andersson
Garbage collected languages need a way to signal that they are done with a device other than freeing it. Call it implicitly on fz_drop_device; so take care not to call it again in case it has been explicitly called already.
2016-02-24Add optional scissor hint argument to text clipping functions.Tor Andersson
2016-02-24Clarify scissor argument to clip device functions.Tor Andersson
The scissor argument is an optional (potentially NULL) rectangle that can give hints to devices about the area that can be scissored. This is used by the draw device and display list device to minimize the size of temporary clip mask buffers. The scissor rectangle, if used, must have been transformed by the current transform matrix.
2016-02-22Drop const from fz_image.Tor Andersson
Image objects are immutable and opaque once constructed. Therefore there is no need for the const keyword.
2016-02-22Drop const from fz_shade.Tor Andersson
Shading objects are immutable and opaque once constructed. Therefore there is no need for the const keyword.
2016-01-21Drop const from fz_colorspace.Tor Andersson
It's an opaque immutable structure, that we don't expect to ever want to change after creation. Therefore the const keyword is not useful, and is only line noise.
2016-01-13Add lots of consts.Robin Watts
In general, we should use 'const fz_blah' in device calls whenever the callee should not alter the fz_blah. Push this through. This shows up various places where we fz_keep and fz_drop these const things. I've updated the fz_keep and fz_drops with appropriate casts to remove the consts. We may need to do the union dance to avoid the consts for some compilers, but will only do that if required. I think this is nicer overall, even allowing for the const<->no const problems.