Age | Commit message (Collapse) | Author |
|
|
|
As fz_drop_*()/fz_free() all must handle NULL.
|
|
Following the pattern in draw_fill_image().
|
|
|
|
|
|
In preparation for YCbCr support, rename some functions
and make variable names more generic. Also remove fz_
prefix from static functions.
|
|
|
|
|
|
The existing fix for bug 697161 introduced in commit
651c9f1d93c81c84deaf76debec0a30e54a67d7e was broken
as frames would be constrained to the image size - 1.
Now we decompress all available data, not suggesting
an uncompressed size, but still checking the size after
the uncomprsseion.
|
|
|
|
* Handle multiple calls to fz_drop_colorspace_context() and
fz_drop_font_context().
* Allow missing context in call to fz_drop_aa_context()
and fz_drop_glyph_cache_context().
* Only drop font context objects when dropping the last reference.
* Avoid unnecessary NULL checks.
|
|
|
|
|
|
|
|
|
|
|
|
Commit c2acdba7e9b72e18afdd3aa8dfdf66088b1ea1be mistakenly inverted
the interpretation of samples for both both binary and ascii b/w PNM
images when, at the time, there was only a mistake for ascii images.
|
|
|
|
|
|
|
|
|
|
Also add simple ycc to rgb conversion (stolen from Sebastian's
code).
|
|
This function calls png_from_pixmap, an auxiliary function to do
the work. This was done deliberately to allow us to make the
optimisation of dropping the pixmap early if it is not required.
This keeps the memory use down in the case when a color conversion
is required.
Sadly, I never appear to have made the trivial change to actually
use it in this mode. Do that now.
|
|
When caching the cmyk values used to generate a given
rgb value, it is best to cache the values before processing.
|
|
|
|
If e.g. an 18 x 11 PNG image used 1 bit depth and a single component
the source data fed to fz_unpack_tile() would have padding bits at the
end of each line of whole bytes, because 18 bits is not a multiple of 8.
The optimized 1 component versions of fz_unpack_tile() for a bit depth
of 1 deliberately read the padding when doing the table lookups, knowing
that this does not matter because of the construction of the table.
Valgrind is incapable of understanding this, so we provide some extra
masking (used only in PACIFY_VALGRIND builds) that explicitly mask
off the invalid bits.
|
|
Fixes memory leaks when parsing throws exceptions and saves a lot of
tiny mallocs for objects that have common life times.
|
|
Code MUST pass a non-null context to all functions.
Checking ctx for null and failing silently is no more useful
than segfaulting.
fz_keep_imp and fz_drop_imp handle NULL pointers safely, so
the NULL checks for this can also be dropped at the same time.
|
|
Keep to our naming conventions.
|
|
We have various functions that, for different image formats,
write a header, then a band, then (sometimes) a trailer.
Push them all through a single interface.
This change also fixes potential problems caused by the trailer
writing being an implicit destructor, which can cause problems
in cleanup code if the trailer writing throws an error.
|
|
|
|
This avoids us having to check the entire array each time, and
makes the next commit simpler.
|
|
|
|
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.
|
|
This relieves all document formats from reimplementing opening a
fz_stream unless the format wants to do something more than just
opening the raw file.
|
|
|
|
Intended as a fix for bug 697123, but the problem turns out to
be something else entirely. Nonetheless, this is worth having.
|
|
Slightly revised blending, making use of the fact that we can
no longer overflow due to ma + masa <= 0x100.
|
|
|
|
As part of the blending calculations, we do:
dst = src * mask_alpha + dst * (1-mask_alpha.src_alpha)
We calculate mask_alpha as ma, and 1-mask_alpha.src_alpha as masa.
In full accuracy, we should never have ma + masa >= 1.
Unfortunately, with the formulation used in the painters at the
moment, we can. We therefore rejig the calculations slightly.
|
|
Used for the file from bug 697122. Makes a small improvement
overall. (31.3s to 31s for a cutdown file).
The equivalent code using 64bit operations is slower.
|
|
|
|
If we have a source alpha, and it's 0, then nothing to paint.
|
|
|
|
Better name as not all shadings are meshes.
|
|
|
|
|
|
New Devanagari serif font, several other updated fonts.
|
|
font->name can never be NULL as it is an array.
|
|
The implementation does not need to be in the public API.
|