diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-03-07 13:48:29 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-07 14:42:08 +0200 |
commit | 65ad3224e920deecb91a3c28e15341c8584a372c (patch) | |
tree | c648b16a21a3690cb6219c740986786df33ab7fa /common/rfb/TightEncoder.h | |
parent | d704e4ae77724abca7835f53390dacbfe1b09f9f (diff) | |
download | tigervnc-65ad3224e920deecb91a3c28e15341c8584a372c.tar.gz tigervnc-65ad3224e920deecb91a3c28e15341c8584a372c.zip |
Consolidate the different palette handler implementations
Diffstat (limited to 'common/rfb/TightEncoder.h')
-rw-r--r-- | common/rfb/TightEncoder.h | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/common/rfb/TightEncoder.h b/common/rfb/TightEncoder.h index e2fa96e8..a876b6f6 100644 --- a/common/rfb/TightEncoder.h +++ b/common/rfb/TightEncoder.h @@ -23,6 +23,7 @@ #include <rdr/ZlibOutStream.h> #include <rfb/Encoder.h> #include <rfb/JpegCompressor.h> +#include <rfb/Palette.h> // FIXME: Check if specifying extern "C" is really necessary. #include <stdio.h> @@ -45,28 +46,6 @@ namespace rfb { }; // - // C-style structures to store palette entries and compression paramentes. - // Such code probably should be converted into C++ classes. - // - - struct TIGHT_COLOR_LIST { - TIGHT_COLOR_LIST *next; - int idx; - rdr::U32 rgb; - }; - - struct TIGHT_PALETTE_ENTRY { - TIGHT_COLOR_LIST *listNode; - int numPixels; - }; - - struct TIGHT_PALETTE { - TIGHT_PALETTE_ENTRY entry[256]; - TIGHT_COLOR_LIST *hash[256]; - TIGHT_COLOR_LIST list[256]; - }; - - // // Compression level stuff. The following array contains various // encoder parameters for each of 10 compression levels (0..9). // Last three parameters correspond to JPEG quality levels (0..9). @@ -99,9 +78,6 @@ namespace rfb { rdr::ZlibOutStream *zos, int zlibLevel, rdr::OutStream *os); - int paletteInsert(rdr::U32 rgb, int numPixels, int bpp); - void paletteReset(void); - void fastFillPalette8(const rdr::U8 *data, int stride, const Rect &r); void fastFillPalette16(const rdr::U16 *data, int stride, const Rect &r); void fastFillPalette32(const rdr::U32 *data, int stride, const Rect &r); @@ -149,9 +125,8 @@ namespace rfb { PixelFormat serverpf, clientpf; bool pack24; - int palMaxColors, palNumColors; - rdr::U32 monoBackground, monoForeground; - TIGHT_PALETTE palette; + int palMaxColors; + Palette palette; static const int defaultCompressLevel; static const TIGHT_CONF conf[]; |