Age | Commit message (Collapse) | Author |
|
The operator has to live in the namespace Gfx.
|
|
|
|
|
|
|
|
This avoids a bunch of strlen()'s when we're parsing web colors.
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
|
|
|
|
Replace codepoint variable type from char to u32.
|
|
There's a large amount of code duplication here right now, which will
need to be reduced.
|
|
|
|
This allows you to measure the width of a UTF-32 sequence.
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|
|
|
|
Now most classes dictate how they are serialized and deserialized when
transmitted across LibIPC sockets. This also makes the IPC compiler
a bit simpler. :^)
|
|
In theory, this should make dithering a teensy bit faster.
|
|
Non-configurable for now.
|
|
|
|
Just a bool is insufficient as we'll have to support dashed lines as well.
|
|
If we just skip every second pixel, we still get a solid line if each
"pixel" is wider than 1!
Now we skip the same amount of pixels as the line is thick.
|
|
Instead of a solid color, we now paint the track/gutter of scrollbars
using a 2-color dither pattern for a pleasant millennium feel. :^)
|
|
|
|
Unlike Path::close() which closes only the last subpath (if possible),
this closure mechanism closes _all_ available subpaths.
|
|
GIFImageDecoderPlugin now lazily decodes GIF frames as they are
requested.
|
|
Various optimisations to speed up LZWDecoder
- Take advantage of the fact that we add new codes in the order they are
discovered so no need to store the code as part of a separate
CodeTableEntry structure. Instead we store directly store vectors of
colors and the code is the index into the vector.
- Cache current table capacity to avoid calling pow2 every time.
- Prevent some unnecessary vector copies by returning by reference from
get_output.
|
|
Adds methods to determine whether an image is animated, how many times
the animation loops, the number of frames, and to get individual frames.
Implements stubs of these methods for PNGImageDecoderPlugin and
GIFImageDecoderPlugin.
|
|
|
|
The existing scanline method works just fine, and only needs the points
to be available as floats.
This commit reverts the complex polygon mitigation, and instead fixes
the rasterization process to avoid generating complex polygons because
of precision issues.
|
|
This allows the painter to render filled complex shapes better, by
constructing a path graph for (interesting) intersecting lines and
omitting lines from the containing segments if they are detected
to take no part in defining the edges of a shape.
This approach would still fail if there are multiple logical shapes
that are confined to the collection of lines.
For instance, two polygons intersecting each other in a way that one
vertex of polygon A ends up inside polygon B.
we would detect that polygon A's edges are part of the shape
(technically correct) even though they are not a part of polygon B at
all.
|
|
StringView::to_string() was added in 917ccb1 but not actually used
anywhere yet.
|
|
There are some imperfections with intersecting edges (because the main
algorithm used is scanline, and that is not geared towards drawing
complex shapes), however, it behaves mostly fine for normal use :^)
|
|
These are just clones of the Rect equivalents.
|
|
It's not very whitespace tolerant but it works.
|
|
Also adds a test, and removes debug spam :tm:
|
|
Also adds a QuadraticBezierCurveTo mode to Gfx::Path
|
|
When dealing with png data that has less than 8 bits per pixel, round
up to the next byte when allocating per row buffers and streamers. This
fixes decoding odd sized PNGs with less than 8 bits per pixel.
Also added a test page with some odd sized palleted PNGs.
|
|
It's tedious to write (and look at) [[gnu::always_inline]] etc. :^)
|
|
This simply returns an "#rrggbb" string and ignores the alpha value.
|
|
|
|
|
|
|
|
The LZW decode step will now copy and pad LZW data out to 4 bytes if there are
less than 4 bytes remaining in the buffer. This means it will now also work when
the total size of the LZW image data is less than 4 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
The sniff method is intended to be used for content sniffing. It should be a
cheap test to rapidly rule out whether a candidate image can be successfully
decoded. For the GIF and PNG implementations it simply attempts to decode the
image header, returning true if successful and false if not.
|
|
|