mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:02:45 +00:00 
			
		
		
		
	 f970578cd4
			
		
	
	
		f970578cd4
		
	
	
	
	
		
			
			ImageLoader was not the right name for this, as there is no loading happening, only decoding. :^)
		
			
				
	
	
		
			21 lines
		
	
	
	
		
			542 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
	
		
			542 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <LibDraw/GraphicsBitmap.h>
 | |
| #include <LibDraw/ImageDecoder.h>
 | |
| 
 | |
| RefPtr<GraphicsBitmap> load_png(const StringView& path);
 | |
| RefPtr<GraphicsBitmap> load_png_from_memory(const u8*, size_t);
 | |
| 
 | |
| struct PNGLoadingContext;
 | |
| 
 | |
| class PNGImageDecoderPlugin final : public ImageDecoderPlugin {
 | |
| public:
 | |
|     virtual ~PNGImageDecoderPlugin() override;
 | |
|     PNGImageDecoderPlugin(const u8*, size_t);
 | |
| 
 | |
|     virtual Size size() override;
 | |
|     virtual RefPtr<GraphicsBitmap> bitmap() override;
 | |
| 
 | |
| private:
 | |
|     OwnPtr<PNGLoadingContext> m_context;
 | |
| };
 |