mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibWeb: Extract CanvasImageData class from CRC2D
This commit is contained in:
parent
270c60c5e8
commit
53b9f36413
4 changed files with 48 additions and 9 deletions
26
Userland/Libraries/LibWeb/HTML/Canvas/CanvasImageData.h
Normal file
26
Userland/Libraries/LibWeb/HTML/Canvas/CanvasImageData.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/ImageData.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawpath
|
||||
class CanvasImageData {
|
||||
public:
|
||||
virtual ~CanvasImageData() = default;
|
||||
|
||||
virtual RefPtr<ImageData> create_image_data(int width, int height) const = 0;
|
||||
virtual DOM::ExceptionOr<RefPtr<ImageData>> get_image_data(int x, int y, int width, int height) const = 0;
|
||||
virtual void put_image_data(ImageData const&, float x, float y) = 0;
|
||||
|
||||
protected:
|
||||
CanvasImageData() = default;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue