summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx
AgeCommit message (Collapse)Author
2020-06-02LibGfx: Fix debug-printing colorsSergey Bugaev
The operator has to live in the namespace Gfx.
2020-06-02LibGfx: Templatize some of the scanline unpacking codeAndreas Kling
2020-06-02LibGfx: Consolidate some types in the PNG decoderAndreas Kling
2020-06-01LibGfx: Add ImageDecoder factory overload for ByteBuffersAndreas Kling
2020-05-30LibGfx: Use a bit of constexpr in ColorAndreas Kling
This avoids a bunch of strlen()'s when we're parsing web colors.
2020-05-29Meta: Add a script check the presence of "#pragma once" in header filesEmanuele Torre
.. 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.
2020-05-26AK: Rename FileSystemPath -> LexicalPathSergey Bugaev
And move canonicalized_path() to a static method on LexicalPath. This is to make it clear that FileSystemPath/canonicalized_path() only perform *lexical* canonicalization.
2020-05-24LibGfx: Add Painter::fill_ellipse()Sergey Bugaev
2020-05-21LibGfx: Font, extend fonts to 384 character to support LatinExtendedAHüseyin ASLITÜRK
2020-05-21LibGfx: Painter, extend fonts to 384 character to support LatinExtendedAHüseyin ASLITÜRK
Replace codepoint variable type from char to u32.
2020-05-17LibGfx: Add UTF-32 version of the text painting code pathsAndreas Kling
There's a large amount of code duplication here right now, which will need to be reduced.
2020-05-17LibGfx: Let's make it Font::width(Utf32View)Andreas Kling
2020-05-17LibGfx: Add Font::width(u32* codepoints, size_t)Andreas Kling
This allows you to measure the width of a UTF-32 sequence.
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-12LibGfx+IPCCompiler: Add IPC encoders for Color and ShareableBitmapAndreas Kling
2020-05-12LibIPC+LibGfx: Templatize IPC encoding as well as decodingAndreas Kling
Now most classes dictate how they are serialized and deserialized when transmitted across LibIPC sockets. This also makes the IPC compiler a bit simpler. :^)
2020-05-11LibGfx: Eliminate conditional branch in ditherBen Wiederhake
In theory, this should make dithering a teensy bit faster.
2020-05-10LibGfx: Add support for dashed linesLinus Groh
Non-configurable for now.
2020-05-10LibGfx: Make buttons slightly chunkier on the top/left sideAndreas Kling
2020-05-10LibGfx: Replace 'bool dotted' with a LineStyle::{Solid,Dotted} enumLinus Groh
Just a bool is insufficient as we'll have to support dashed lines as well.
2020-05-10LibGfx: Fix dotted lines with thickness > 1Linus Groh
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.
2020-05-10LibGUI+LibGfx: Paint scollbar tracks with a dithered patternAndreas Kling
Instead of a solid color, we now paint the track/gutter of scrollbars using a 2-color dither pattern for a pleasant millennium feel. :^)
2020-05-09LibGfx: Fix build with FILL_PATH_DEBUG enabledLinus Groh
2020-05-09LibGfx: Add Path::close_all_subpaths()AnotherTest
Unlike Path::close() which closes only the last subpath (if possible), this closure mechanism closes _all_ available subpaths.
2020-05-09LibGfx: Implement GIFImageDecoderPlugin animation methodsPeter Nelson
GIFImageDecoderPlugin now lazily decodes GIF frames as they are requested.
2020-05-09LibGfx: Optimise LZWDecoderPeter Nelson
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.
2020-05-09LibGfx: Add support for animated images to ImageDecoder{Plugin}Peter Nelson
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.
2020-05-09LibGfx: Add new methods to Font to avoid embedded values in FontEditorHüseyin ASLITÜRK
2020-05-08LibGfx: Revert #2154 and properly handle simple polygonsAnotherTest
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.
2020-05-08LibGfx: Handle filling complex shapes betterAnotherTest
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.
2020-05-06Misc: Replace "String(string_view)" with "string_view.to_string()"Linus Groh
StringView::to_string() was added in 917ccb1 but not actually used anywhere yet.
2020-05-06LibGfx: Implement filling pathsAnotherTest
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 :^)
2020-05-05LibGfx: Add missing FloatRect function implementationsAndreas Kling
These are just clones of the Rect equivalents.
2020-05-05LibGfx: Add a naive "rgba(r,g,b,a)" color parserAndreas Kling
It's not very whitespace tolerant but it works.
2020-05-05LibWeb: Add canvas.quadraticCurveTo()AnotherTest
Also adds a test, and removes debug spam :tm:
2020-05-05LibGfx: Add Painter::draw_quadratic_bezier_curve()AnotherTest
Also adds a QuadraticBezierCurveTo mode to Gfx::Path
2020-05-02LibGfx: Decode paletted and grayscale images with 1/2/4 bit depthLepkoQQ
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.
2020-04-30AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macrosAndreas Kling
It's tedious to write (and look at) [[gnu::always_inline]] etc. :^)
2020-04-29LibGfx: Add Color::to_string_without_alpha()Andreas Kling
This simply returns an "#rrggbb" string and ignores the alpha value.
2020-04-26LibGfx: PNGLoader support for grayscale images with alpha.LepkoQQ
2020-04-26LibGfx: PNGLoader support for grayscale images with 8/16bpp.LepkoQQ
2020-04-26LibGUI: Create thumnail for gif filesHüseyin ASLITÜRK
2020-04-25LibGfx: Fix crash on decoding small gifsPeter Nelson
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.
2020-04-25LibGfx: Don't proceed with GIF format sniffing if stream read failsAndreas Kling
2020-04-25LibGfx: Remove unnecessary castsPeter Nelson
2020-04-25LibGfx: Minor changes to adhere to code style guidelinesPeter Nelson
2020-04-25LibGfx: Remove debug outputPeter Nelson
2020-04-25LibGfx: Use content sniffing to choose which ImageDecoder plugin to usePeter Nelson
2020-04-25LibGfx: Add a sniff method to ImageDecoder and implement for GIF and PNGPeter Nelson
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.
2020-04-25LibGfx: Extract GIF header decoding into separate functionPeter Nelson