mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:02:45 +00:00 
			
		
		
		
	 ad04d7ac9b
			
		
	
	
		ad04d7ac9b
		
	
	
	
	
		
			
			This is a concept fully defined in the Web IDL spec and doesn't belong in the DOM directory/namespace - not even DOMException, despite the name :^)
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			655 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			655 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * 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 JS::GCPtr<ImageData> create_image_data(int width, int height) const = 0;
 | |
|     virtual WebIDL::ExceptionOr<JS::GCPtr<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;
 | |
| };
 | |
| 
 | |
| }
 |