/src/serenity/Userland/Libraries/LibWeb/HTML/Canvas/CanvasImageData.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibWeb/HTML/ImageData.h> |
10 | | |
11 | | namespace Web::HTML { |
12 | | |
13 | | // https://html.spec.whatwg.org/multipage/canvas.html#canvasimagedata |
14 | | class CanvasImageData { |
15 | | public: |
16 | 0 | virtual ~CanvasImageData() = default; |
17 | | |
18 | | virtual WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> create_image_data(int width, int height, Optional<ImageDataSettings> const& settings = {}) const = 0; |
19 | | virtual WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> create_image_data(ImageData const&) const = 0; |
20 | | virtual WebIDL::ExceptionOr<JS::GCPtr<ImageData>> get_image_data(int x, int y, int width, int height, Optional<ImageDataSettings> const& settings = {}) const = 0; |
21 | | virtual void put_image_data(ImageData const&, float x, float y) = 0; |
22 | | |
23 | | protected: |
24 | 0 | CanvasImageData() = default; |
25 | | }; |
26 | | |
27 | | } |