mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:52:43 +00:00 
			
		
		
		
	LibWeb: Generate ImageData bindings from IDL :^)
This commit is contained in:
		
							parent
							
								
									b959d06ace
								
							
						
					
					
						commit
						dd29ff884f
					
				
					 7 changed files with 46 additions and 162 deletions
				
			
		|  | @ -38,7 +38,6 @@ RefPtr<ImageData> ImageData::create_with_size(JS::GlobalObject& global_object, i | |||
|     if (width > 16384 || height > 16384) | ||||
|         return nullptr; | ||||
| 
 | ||||
| 
 | ||||
|     dbg() << "Creating ImageData with " << width << "x" << height; | ||||
| 
 | ||||
|     auto* data = JS::Uint8ClampedArray::create(global_object, width * height * 4); | ||||
|  | @ -63,12 +62,12 @@ ImageData::~ImageData() | |||
| { | ||||
| } | ||||
| 
 | ||||
| int ImageData::width() const | ||||
| unsigned ImageData::width() const | ||||
| { | ||||
|     return m_bitmap->width(); | ||||
| } | ||||
| 
 | ||||
| int ImageData::height() const | ||||
| unsigned ImageData::height() const | ||||
| { | ||||
|     return m_bitmap->height(); | ||||
| } | ||||
|  |  | |||
|  | @ -42,8 +42,8 @@ public: | |||
| 
 | ||||
|     ~ImageData(); | ||||
| 
 | ||||
|     int width() const; | ||||
|     int height() const; | ||||
|     unsigned width() const; | ||||
|     unsigned height() const; | ||||
| 
 | ||||
|     Gfx::Bitmap& bitmap() { return m_bitmap; } | ||||
|     const Gfx::Bitmap& bitmap() const { return m_bitmap; } | ||||
|  |  | |||
							
								
								
									
										7
									
								
								Libraries/LibWeb/DOM/ImageData.idl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Libraries/LibWeb/DOM/ImageData.idl
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| interface ImageData { | ||||
| 
 | ||||
|     readonly attribute unsigned long width; | ||||
|     readonly attribute unsigned long height; | ||||
|     readonly attribute Uint8ClampedArray data; | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling