Remove full support for colour maps
Gets rid of a loooot of code and complexity.
Colour map clients are still supported through an
automatically generated map, but we lose the ability to
develop a client or server that uses colour maps
internally.
diff --git a/common/rfb/PixelBuffer.cxx b/common/rfb/PixelBuffer.cxx
index 9d151b9..3ed3a92 100644
--- a/common/rfb/PixelBuffer.cxx
+++ b/common/rfb/PixelBuffer.cxx
@@ -33,16 +33,15 @@
// -=- Generic pixel buffer class
-PixelBuffer::PixelBuffer(const PixelFormat& pf, int w, int h, ColourMap* cm)
- : format(pf), width_(w), height_(h), colourmap(cm) {}
-PixelBuffer::PixelBuffer() : width_(0), height_(0), colourmap(0) {}
+PixelBuffer::PixelBuffer(const PixelFormat& pf, int w, int h)
+ : format(pf), width_(w), height_(h) {}
+PixelBuffer::PixelBuffer() : width_(0), height_(0) {}
PixelBuffer::~PixelBuffer() {}
void PixelBuffer::setPF(const PixelFormat &pf) {format = pf;}
const PixelFormat& PixelBuffer::getPF() const {return format;}
-ColourMap* PixelBuffer::getColourMap() const {return colourmap;}
void
@@ -117,8 +116,8 @@
FullFramePixelBuffer::FullFramePixelBuffer(const PixelFormat& pf, int w, int h,
- rdr::U8* data_, ColourMap* cm)
- : PixelBuffer(pf, w, h, cm), data(data_)
+ rdr::U8* data_)
+ : PixelBuffer(pf, w, h), data(data_)
{
// Called again to configure the fill function
setPF(pf);
@@ -314,20 +313,19 @@
// Automatically allocates enough space for the specified format & area
ManagedPixelBuffer::ManagedPixelBuffer()
- : datasize(0), own_colourmap(false)
+ : datasize(0)
{
checkDataSize();
};
ManagedPixelBuffer::ManagedPixelBuffer(const PixelFormat& pf, int w, int h)
- : FullFramePixelBuffer(pf, w, h, 0, 0), datasize(0), own_colourmap(false)
+ : FullFramePixelBuffer(pf, w, h, 0), datasize(0)
{
checkDataSize();
};
ManagedPixelBuffer::~ManagedPixelBuffer() {
if (data) delete [] data;
- if (colourmap && own_colourmap) delete colourmap;
};
@@ -341,13 +339,6 @@
};
-void
-ManagedPixelBuffer::setColourMap(ColourMap* cm, bool own_cm) {
- if (colourmap && own_colourmap) delete colourmap;
- colourmap = cm;
- own_colourmap = own_cm;
-}
-
inline void
ManagedPixelBuffer::checkDataSize() {
unsigned long new_datasize = width_ * height_ * (format.bpp/8);