mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb/HTML: Implement ImageData initialization closer to spec
This commit is contained in:
parent
569ebeb6a4
commit
715bf0de2c
Notes:
github-actions[bot]
2025-03-05 11:36:24 +00:00
Author: https://github.com/LucasChollet
Commit: 715bf0de2c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3709
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 57 additions and 22 deletions
|
@ -39,13 +39,18 @@ public:
|
|||
JS::Uint8ClampedArray* data();
|
||||
const JS::Uint8ClampedArray* data() const;
|
||||
|
||||
Bindings::PredefinedColorSpace color_space() const { return m_color_space; }
|
||||
|
||||
private:
|
||||
ImageData(JS::Realm&, NonnullRefPtr<Gfx::Bitmap>, GC::Ref<JS::Uint8ClampedArray>);
|
||||
[[nodiscard]] static WebIDL::ExceptionOr<GC::Ref<ImageData>> initialize(JS::Realm&, u32 rows, u32 pixels_per_row, Optional<ImageDataSettings> const&, GC::Ptr<JS::Uint8ClampedArray> = {}, Optional<Bindings::PredefinedColorSpace> = {});
|
||||
|
||||
ImageData(JS::Realm&, NonnullRefPtr<Gfx::Bitmap>, GC::Ref<JS::Uint8ClampedArray>, Bindings::PredefinedColorSpace);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
NonnullRefPtr<Gfx::Bitmap> m_bitmap;
|
||||
Bindings::PredefinedColorSpace m_color_space;
|
||||
GC::Ref<JS::Uint8ClampedArray> m_data;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue