1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

LibGfx: Implement box sampling image scaling

Box sampling is a scaling algorithm that averages all the pixels that
form the source for the target pixel. For example, if you would resize a
9x9 image to 3x3, each target pixel would encompass a 3x3 pixel area in
the source image.

Box sampling is a near perfect scaling algorithm for downscaling. When
upscaling with this algorithm, the result is similar to nearest neighbor
or smooth pixels.
This commit is contained in:
Jelle Raaijmakers 2023-05-19 00:26:34 +02:00 committed by Andreas Kling
parent 31fa449538
commit 6242d8e023
2 changed files with 75 additions and 0 deletions

View file

@ -45,6 +45,7 @@ public:
NearestNeighbor,
SmoothPixels,
BilinearBlend,
BoxSampling,
None,
};