1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-31 15:32:46 +00:00
serenity/Userland/Libraries/LibGfx
Sam Atkins 1c807410cd LibGfx: Add optional bilinear filtering to draw_scaled_bitmap()
The algorithm is quite simple: You grab a 2x2 area of pixels around the
point you want from the source bitmap, and then linearly interpolate
between them based on how far they are from that point.

This works well when scaling up images, and moderately well when scaling
down - small details may get skipped over. The way GPUs solve this is
with mipmaps, which is not something I want to get into right now. (And
increases the memory usage per bitmap by 50%.)

I have not focused on performance, but this does reuse much of the
existing fixed-point calculation, and uses constexpr so that the
performance for nearest-neighbor should be the same as it was
previously.
2021-09-20 22:18:20 +02:00
..
Filters LibGfx: Move FastBoxBlurFilter to its own .cpp file 2021-09-17 13:20:18 +02:00
TrueTypeFont LibGfx: Extend Unicode support for BitmapFonts 2021-09-19 00:58:59 +02:00
AffineTransform.cpp Everywhere: Don't promote float to double where not needed 2021-07-08 10:11:00 +02:00
AffineTransform.h LibGfx: Add some helper methods to AffineTransform 2021-05-02 22:48:06 +02:00
AntiAliasingPainter.cpp LibGfx: Implement cubic bezier curves by splitting them to subcurves 2021-09-18 02:12:38 +04:30
AntiAliasingPainter.h LibGfx: Implement cubic bezier curves by splitting them to subcurves 2021-09-18 02:12:38 +04:30
Bitmap.cpp LibGfx: Add method to load bitmap from fd 2021-09-09 02:34:29 +02:00
Bitmap.h LibGfx: Add method to load bitmap from fd 2021-09-09 02:34:29 +02:00
BitmapFont.cpp LibGfx: Extend Unicode support for BitmapFonts 2021-09-19 00:58:59 +02:00
BitmapFont.h LibGfx: Extend Unicode support for BitmapFonts 2021-09-19 00:58:59 +02:00
BMPLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
BMPLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
BMPWriter.cpp Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
BMPWriter.h LibGfx/BMPWriter: Add support for V3 & V4 DIB headers 2021-07-05 00:43:00 +02:00
CharacterBitmap.cpp AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
CharacterBitmap.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ClassicStylePainter.cpp LibGUI+LibGfx: Make scrollbar buttons a little bit thicker 2021-08-31 01:35:08 +02:00
ClassicStylePainter.h LibGUI+LibGfx: Highlight currently active tab button with accent color 2021-07-28 20:25:14 +02:00
ClassicWindowTheme.cpp LibGfx: Remove Gfx::FontDatabase::default_bold_font() 2021-05-20 20:55:29 +02:00
ClassicWindowTheme.h LibGfx: Fix classic theme frame transparency check 2021-07-05 12:29:14 +02:00
CMakeLists.txt LibGfx: Start a very basic anti-aliased Painter implementation 2021-09-18 02:12:38 +04:30
Color.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Color.h LibGfx: Use default instead of an empty constructor/destructor 2021-09-16 17:17:13 +02:00
CursorParams.cpp WindowServer+LibGfx: Move CursorParams to LibGfx 2021-08-23 01:41:53 +02:00
CursorParams.h WindowServer+LibGfx: Move CursorParams to LibGfx 2021-08-23 01:41:53 +02:00
DDSLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
DDSLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
DisjointRectSet.cpp LibGfx: Unify Rect, Point, and Size 2021-05-02 22:48:06 +02:00
DisjointRectSet.h WindowServer: Add basic virtual desktop support 2021-07-03 12:27:23 +02:00
Emoji.cpp LibGfx: Use "try_" prefix for static factory functions 2021-07-21 18:02:15 +02:00
Emoji.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FillPathImplementation.h LibWeb: Use Gfx::AntiAliasingPainter to draw SVG paths 2021-09-18 02:12:38 +04:30
Font.h LibGfx: Extend Unicode support for BitmapFonts 2021-09-19 00:58:59 +02:00
FontDatabase.cpp LibGfx: Make FontDatabase cache store fonts in NonnullRefPtr 2021-09-04 20:30:56 +02:00
FontDatabase.h LibGfx+WindowServer: Have WindowServer broadcast system font settings 2021-05-21 20:15:51 +02:00
Forward.h LibGfx: Add a Line class and a Rect<T>::RelativeLocation class 2021-06-20 14:57:26 +02:00
Gamma.h LibGfx: Remove ancient unused NO_FPU macros 2021-08-18 11:35:51 +02:00
GIFLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
GIFLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
ICOLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
ICOLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
ImageDecoder.cpp LibGfx: Remove Gfx::ImageDecoder::bitmap() in favor of frame(index) 2021-07-27 01:29:50 +02:00
ImageDecoder.h LibGfx: Remove Gfx::ImageDecoder::bitmap() in favor of frame(index) 2021-07-27 01:29:50 +02:00
JPGLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
JPGLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
Line.h Everywhere: Use AK/Math.h if applicable 2021-07-19 16:34:21 +04:30
Matrix.h LibGfx/Matrix: Add inverse() and friends 2021-05-24 00:33:18 +01:00
Matrix4x4.h Everywhere: Use AK/Math.h if applicable 2021-07-19 16:34:21 +04:30
Orientation.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Painter.cpp LibGfx: Add optional bilinear filtering to draw_scaled_bitmap() 2021-09-20 22:18:20 +02:00
Painter.h LibGfx: Add optional bilinear filtering to draw_scaled_bitmap() 2021-09-20 22:18:20 +02:00
Palette.cpp AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
Palette.h LibGfx+Base: Add a themable "Accent" color role 2021-07-28 20:21:52 +02:00
Path.cpp LibGfx: Implement cubic bezier curves by splitting them to subcurves 2021-09-18 02:12:38 +04:30
Path.h LibGfx: Implement cubic bezier curves by splitting them to subcurves 2021-09-18 02:12:38 +04:30
PBMLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PBMLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PGMLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PGMLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PNGLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PNGLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PNGWriter.cpp Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
PNGWriter.h LibGfx: Store the size of the chunk from start in PNGWriter 2021-07-14 13:37:18 +02:00
Point.cpp LibGfx+PixelPaint: Add Point::end_point_for_aspect_ratio method 2021-09-17 11:54:13 +02:00
Point.h LibGfx: Add Point<T>::to_rounded<U>() 2021-09-18 12:21:42 +02:00
PortableImageLoaderCommon.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PPMLoader.cpp LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
PPMLoader.h LibGfx: Move common loader functionality to load from memory functions 2021-09-09 02:34:29 +02:00
Rect.cpp LibGfx: Add a Line class and a Rect<T>::RelativeLocation class 2021-06-20 14:57:26 +02:00
Rect.h LibGfx: Add per-side overloads of Rect::inflate() and ::shrink() 2021-09-19 22:53:35 +02:00
ShareableBitmap.cpp LibGfx: Use "try_" prefix for static factory functions 2021-07-21 18:02:15 +02:00
ShareableBitmap.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Size.cpp LibGfx: Add a bunch of [[nodiscard]] to Size 2021-06-16 21:53:10 +02:00
Size.h LibGfx: Add a bunch of [[nodiscard]] to Size 2021-06-16 21:53:10 +02:00
StandardCursor.h Cursors: Add new Magnifying glass cursor 2021-09-04 03:35:23 +02:00
Streamer.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
StylePainter.cpp LibGUI+LibGfx: Highlight currently active tab button with accent color 2021-07-28 20:25:14 +02:00
StylePainter.h LibGUI+LibGfx: Make scrollbar buttons a little bit thicker 2021-08-31 01:35:08 +02:00
SystemTheme.cpp LibGfx: Enumerate metric theme roles 2021-09-16 16:52:55 +02:00
SystemTheme.h LibGfx: Add support for enumerating by Metric and Path roles 2021-09-16 16:52:55 +02:00
TextAlignment.h LibGfx: Add missing TextAlignment::BottomLeft 2021-05-21 08:04:31 +02:00
TextAttributes.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TextDirection.cpp Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
TextDirection.h Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
TextElision.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TextLayout.cpp LibGfx: Take the glyph spacing into account when building a line 2021-07-27 23:47:00 +02:00
TextLayout.h Userland: Move text wrapping/elision into the new TextLayout :^) 2021-07-26 21:14:39 +04:30
TextWrapping.h Userland: Move text wrapping/elision into the new TextLayout :^) 2021-07-26 21:14:39 +04:30
Triangle.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Triangle.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Typeface.cpp LibGfx: Use move to avoid unnecessary ref/unref of network device RefPtr 2021-09-16 17:17:13 +02:00
Typeface.h LibGfx: Mark Typeface::get_font() const, because it is const 2021-08-18 10:32:32 +02:00
Vector2.h Everywhere: Use AK/Math.h if applicable 2021-07-19 16:34:21 +04:30
Vector3.h Everywhere: Use AK/Math.h if applicable 2021-07-19 16:34:21 +04:30
Vector4.h Everywhere: Use AK/Math.h if applicable 2021-07-19 16:34:21 +04:30
WindowTheme.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
WindowTheme.h WindowServer+LibGfx: Automatic "modified" markers in window titles 2021-05-01 19:42:29 +02:00