1 // RenderingBuffer.h 2 3 #ifndef RENDERING_BUFFER_H 4 #define RENDERING_BUFFER_H 5 6 #include <GraphicsDefs.h> 7 #include <Rect.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 BRect Bounds() const 28 { return BRect(0.0, 0.0, 29 Width() - 1, 30 Height() - 1); } 31 }; 32 33 #endif // RENDERING_BUFFER_H 34