rdr::U8* data_, ColourMap* cm)
: PixelBuffer(pf, w, h, cm), data(data_)
{
+ // Called again to configure the fill function
+ setPF(pf);
+}
+
+FullFramePixelBuffer::FullFramePixelBuffer() : data(0) {}
+
+FullFramePixelBuffer::~FullFramePixelBuffer() {}
+
+
+void FullFramePixelBuffer::setPF(const PixelFormat &pf) {
+ // We have this as a separate method for ManagedPixelBuffer's
+ // sake. Direct users of FullFramePixelBuffer aren't allowed
+ // to call it.
+
+ PixelBuffer::setPF(pf);
+
switch(pf.bpp) {
case 8:
fillRectFn = fillRect8;
}
}
-FullFramePixelBuffer::FullFramePixelBuffer() : data(0) {}
-
-FullFramePixelBuffer::~FullFramePixelBuffer() {}
-
int FullFramePixelBuffer::getStride() const { return width(); }
void
ManagedPixelBuffer::setPF(const PixelFormat &pf) {
- format = pf; checkDataSize();
+ FullFramePixelBuffer::setPF(pf); checkDataSize();
};
void
ManagedPixelBuffer::setSize(int w, int h) {
//
// Set/get pixel format & colourmap
+ protected:
+ // Only for subclasses that support changing parameters
virtual void setPF(const PixelFormat &pf);
+ public:
virtual const PixelFormat &getPF() const;
virtual ColourMap* getColourMap() const;
rdr::U8* data_, ColourMap* cm);
virtual ~FullFramePixelBuffer();
+ protected:
+ virtual void setPF(const PixelFormat &pf);
+
+ public:
// - Get the number of pixels per row in the actual pixel buffer data area
// This may in some cases NOT be the same as width().
virtual int getStride() const;