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 bool IsGraphicsMemory() const = 0; 17 18 virtual color_space ColorSpace() const = 0; 19 virtual void* Bits() const = 0; 20 virtual uint32 BytesPerRow() const = 0; 21 // the *count* of the pixels per line 22 virtual uint32 Width() const = 0; 23 // the *count* of lines 24 virtual uint32 Height() const = 0; 25 26 inline uint32 BitsLength() const 27 { return Height() * BytesPerRow(); } 28 29 inline IntRect Bounds() const 30 { return IntRect(0, 0, Width() - 1, 31 Height() - 1); } 32 }; 33 34 #endif // RENDERING_BUFFER_H 35