xref: /haiku/src/servers/app/RenderingBuffer.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 // RenderingBuffer.h
2 
3 #ifndef RENDERING_BUFFER_H
4 #define RENDERING_BUFFER_H
5 
6 #include <GraphicsDefs.h>
7 #include "IntRect.h"
8 
9 class RenderingBuffer {
10  public:
11 								RenderingBuffer() {}
12 	virtual						~RenderingBuffer() {}
13 
14 	virtual	status_t			InitCheck() const = 0;
15 
16 	virtual	color_space			ColorSpace() const = 0;
17 	virtual	void*				Bits() const = 0;
18 	virtual	uint32				BytesPerRow() const = 0;
19 	// the *count* of the pixels per line
20 	virtual	uint32				Width() const = 0;
21 	// the *count* of lines
22 	virtual	uint32				Height() const = 0;
23 
24 	inline	uint32				BitsLength() const
25 									{ return Height() * BytesPerRow(); }
26 
27 	inline	IntRect				Bounds() const
28 									{ return IntRect(0, 0, Width() - 1,
29 										Height() - 1); }
30 };
31 
32 #endif // RENDERING_BUFFER_H
33