Commit graph

1 commit

Author SHA1 Message Date
Andrei Volykhin
bcade589e7
imagebitmap: Crop bitmap data with formatting (#37397)
Follow the ImageBitmap specification and make cropping of the bitmap
data to the source rectangle with formatting:
https://html.spec.whatwg.org/multipage/#cropped-to-the-source-rectangle-with-formatting

For now the next functionality not implemented:
- image orientation support (such as EXIF metadata)
- color space conversion (image, blob)

The convertion from ResizeQuality to "image" FilterType:
 - pixelated/low/medium/high -> Nearest/Triangle/CatmullRom/Lanczos3

Other browsers use the following sample filtering:
 - chromium (skia): Nearest/Linear/Linear/CatmullRom
 - firefox (skia): Lanczos3

Testing: Improvements in the following WPT tests
 - html/canvas/element/manual/imagebitmap/*

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-16 12:09:04 +00:00