| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-10 05:36:32 +01:00
										 |  |  | #include "Color.h"
 | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | #include "Size.h"
 | 
					
						
							|  |  |  | #include <AK/Retainable.h>
 | 
					
						
							|  |  |  | #include <AK/RetainPtr.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-13 00:27:25 +01:00
										 |  |  | class Region; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | class GraphicsBitmap : public Retainable<GraphicsBitmap> { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     static RetainPtr<GraphicsBitmap> create(const Size&); | 
					
						
							| 
									
										
										
										
											2019-01-10 05:36:32 +01:00
										 |  |  |     static RetainPtr<GraphicsBitmap> create_wrapper(const Size&, RGBA32*); | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  |     ~GraphicsBitmap(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-10 05:36:32 +01:00
										 |  |  |     RGBA32* scanline(int y); | 
					
						
							| 
									
										
										
										
											2019-01-12 06:39:34 +01:00
										 |  |  |     const RGBA32* scanline(int y) const; | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Size size() const { return m_size; } | 
					
						
							|  |  |  |     int width() const { return m_size.width(); } | 
					
						
							|  |  |  |     int height() const { return m_size.height(); } | 
					
						
							| 
									
										
										
										
											2019-01-12 21:45:45 +01:00
										 |  |  |     size_t pitch() const { return m_pitch; } | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     explicit GraphicsBitmap(const Size&); | 
					
						
							| 
									
										
										
										
											2019-01-10 05:36:32 +01:00
										 |  |  |     GraphicsBitmap(const Size&, RGBA32*); | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Size m_size; | 
					
						
							| 
									
										
										
										
											2019-01-10 05:36:32 +01:00
										 |  |  |     RGBA32* m_data { nullptr }; | 
					
						
							| 
									
										
										
										
											2019-01-12 21:29:05 +01:00
										 |  |  |     size_t m_pitch { 0 }; | 
					
						
							| 
									
										
										
										
											2019-01-13 00:27:25 +01:00
										 |  |  | #ifdef SERENITY
 | 
					
						
							|  |  |  |     Region* m_region { nullptr }; | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2019-01-09 03:51:34 +01:00
										 |  |  |     bool m_owned { false }; | 
					
						
							| 
									
										
										
										
											2019-01-09 02:06:04 +01:00
										 |  |  | }; |