Age | Commit message (Collapse) | Author |
|
This allows you to specify a luminosity range, all pixels that fall
outside this range are set to black, the others are untouched.
|
|
With this BitmapMixer one can draw one Bitmap onto another with
different modes.
For now the only supported mixing methods implemented are Add and
Lightest (which is very naive).
|
|
1268b39ba introduced template specialization when reading/writing
to/from the bitmap that increased the speed of the filter.
To keep that while supporting more than one BitmapFormat, the
appropriate {get,set}_pixel<>() functions are detemined and stored in
Function<>s.
|
|
Enable the warning project-wide. It catches when a non-virtual method
creates an overload set with a virtual method. This might cause
surprising overload resolution depending on how the method is invoked.
|
|
This commit removes the IsTitleCenter property and replaces it with
the TitleAlignment property that supports "Left", "Right" & "Center".
|
|
draw_line with thickness already supports scaling so that verify isn't
needed anymore. This fixes a scaling chrash introduced in 8a1d77f.
|
|
This commit adds support the following properties to theming:
Flags:
- IsTitleCenter: true if the title should be centered.
Metrics:
- BorderThickness: The border width.
- BorderRadius: The border corner radius.
|
|
|
|
This defines `Matrix3x3`, `FloatMatrix3x3` and `DoubleMatrix3x3`
mirroring `Matrix4x4`. Since we will need matrix multiplication with a
`Vector3` for LibGL's normalization, we also add that `*` operator.
|
|
Implement a mechanism that allows us to alter colors so that they
mimic those a colorblind person would see. From the color we can then
alter the colors for the whole preview so we can simulate everything
in the theme including icons/decorations.
This filter is also available as a Filter in LibGfx so it can be
reused in multiple other places.
The color simulation algorithm is based on this one
https://github.com/MaPePeR/jsColorblindSimulator publicly available.
|
|
Instead of asserting this edge case, bail out instead.
Found by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42653
|
|
This was found by OSS Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42188
|
|
I accidentally skipped this part of the spec in the QOI decoder:
> The alpha value remains unchanged from the previous pixel.
This led to incorrect rendering of some images with transparency,
visible in form of a horizontal line of non-transparent pixels (that
shouldn't exist), e.g. for the following chunk sequence:
- QOI_OP_RGBA with alpha = 0
- QOI_OP_RGB
- QOI_OP_RUN
The QOI_OP_RGB should 'inherit' the alpha value of the previous
QOI_OP_RGBA chunk, instead of always setting it to 255.
I'm unsure why the encoder added the QOI_OP_RGB chunk to the specific
image where the bug was noticed in the first place - they effectively
both had fully transparent color values.
|
|
In order to reduce our reliance on __builtin_{ffs, clz, ctz, popcount},
this commit removes all calls to these functions and replaces them with
the equivalent functions in AK/BuiltinWrappers.h.
|
|
What the component which did the actual decoding is called is not
relevant for the error, and would be rather distracting once we show
decoding error messages e.g. in ImageViewer (instead of just silently
failing).
Also makes them more consistent as many already don't include it - a
mistake which is now turned into a feature :^)
|
|
The spec had its first stable release today, so I figured we should
support it as well!
As usual, by using the regular LibGfx image decoder plugin architecture,
we immediately get support for it everywhere: ImageViewer, FileManager
thumbnails, PixelPaint, and (with a small change in the subsequent
commit) even the Browser :^)
|
|
This should fix one of the OSS Fuzz crashes that occurs during
TTF file format parsing.
See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37263
|
|
And make them more self-documenting. Previously these constraints
were duplicated across multiple files.
|
|
GlyphBitmaps are considered present if they have a width greater
than zero. This adds a counterpart method for raw (unmasked) glyphs
and makes intent more explicit throughout FontEditor.
|
|
Gfx::Color implements an IPC::[en|de]code function, but we did not
actually link against LibIPC to resolve the needed Symbols for that and
were relying on LibGui or others to link against it for us.
Having this linkage is unfortunate, but static inlining the functions in
question is sadly not possible, due needed includes leading the IPC
pipeline to initialize multiple times then, which leads to a compilation
error.
|
|
This is required when trying to use a Painter from lagom, due to
/res/font not being present
|
|
This allows us to use TRY() in decoding helpers, leading to a nice
reduction in line count.
|
|
Now indexes by total bytes per glyph to account for changes made
to row's pointer type in 3ca00c8. Fixes glyphs not showing and
saving correctly in FontEditor.
|
|
|
|
MappedFile is strictly a userspace thing, so it doesn't belong in AK
(which is supposed to be user/kernel agnostic.)
|
|
|
|
|
|
|
|
This is a first step towards better error propagation from image codecs.
|
|
To encourage proper support for multi-frame images throughout the
system, get rid of the single-frame convenience bitmap() API.
|
|
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
|
|
... and bring it back to try_load_from_file().
Prior to this change, changing the scaling option to x2 in the Display
Settings resulted in the following crash:
WindowServer(15:15): ASSERTION FAILED: bitmap->width() % scale_factor
== 0 ./Userland/Libraries/LibGfx/Bitmap.cpp:126
That was caused by two minor overlooked yaks:
- First, Bitmap::try_load_from_fd_and_close() tried to respect your
scale factor.
While requesting a bitmap from file can make a switcheroo to give you
a higher resolution bitmap, doing the same when you already have an fd
might violate the unveil agreement.
... but, it didn't do that.
It read bitmaps from requested fds, but also pretended all system
bitmaps in /res/ are the HiDPI ones when you enabled that mode.
- d85d741c59 used this function to deduplicate try_load_from_file().
It actually made this bug a lot easier to replicate!
Closes #10920
|
|
There are no more clients of these APIs, now that everyone has been made
to use ImageDecoderPlugin objects instead.
|
|
This was being transitively included from Deflate.h on SerenityOS builds
but not on Lagom builds.
|
|
|
|
Before this patch, both Bitmap and ImageDecoder had logic for guessing
which image codec to use for a chunk of data. Bitmap now defers to
ImageDecoder so that we only have to do this in one place.
There's room for improvement in the ImageDecoder heuristic, but that's
outside the scope of this change.
|
|
We had a bunch of old unused wrapper functions for each image codec that
would load a supported image with a given path. Nobody actually used
them, so let's just get rid of load_png(), load_gif(), etc.
|
|
|
|
|
|
Same as Vector, ByteBuffer now also signals allocation failure by
returning an ENOMEM Error instead of a bool, allowing us to use the
TRY() and MUST() patterns.
|
|
Preparation for using Error.h from Vector.h. This required moving some
things out of line.
|
|
|
|
Replace Result<T, E> with ErrorOr<T> and propagate the error to callers.
|
|
|
|
Another one that was used in a fajillion places.
|
|
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
|
|
|
|
This can share logic with try_load_from_fd_and_close(), we just need to
open the file first. :^)
|
|
This also allows us to get rid of the ShareableBitmap(Bitmap)
constructor which was easy to misuse. Everyone now uses Bitmap's
to_shareable_bitmap() helper instead.
|
|
|