diff options
author | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-31 14:45:10 -0400 |
commit | e5296ebf8dd09f603499b1894a33865ec71bb28f (patch) | |
tree | d7de032efd54dfdb3159cbc778a0c9ce8cd8aa91 /image/codecs/cinepak.h | |
parent | 673537bad93f0b440172a0cc263ebf19cc95ffc0 (diff) | |
parent | 141ff4d08dc24b6bb17098bd71801e2a58e6a38f (diff) | |
download | scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.gz scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.tar.bz2 scummvm-rg350-e5296ebf8dd09f603499b1894a33865ec71bb28f.zip |
Merge branch 'master' into phantom
Diffstat (limited to 'image/codecs/cinepak.h')
-rw-r--r-- | image/codecs/cinepak.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/image/codecs/cinepak.h b/image/codecs/cinepak.h index e9cd437730..dc8172ea0f 100644 --- a/image/codecs/cinepak.h +++ b/image/codecs/cinepak.h @@ -46,6 +46,7 @@ struct CinepakStrip { uint16 length; Common::Rect rect; CinepakCodebook v1_codebook[256], v4_codebook[256]; + byte v1_dither[256 * 4 * 4 * 4], v4_dither[256 * 4 * 4 * 4]; }; struct CinepakFrame { @@ -72,14 +73,31 @@ public: const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream); Graphics::PixelFormat getPixelFormat() const { return _pixelFormat; } + bool containsPalette() const { return _ditherPalette != 0; } + const byte *getPalette() { _dirtyPalette = false; return _ditherPalette; } + bool hasDirtyPalette() const { return _dirtyPalette; } + bool canDither(DitherType type) const; + void setDither(DitherType type, const byte *palette); + private: CinepakFrame _curFrame; int32 _y; + int _bitsPerPixel; Graphics::PixelFormat _pixelFormat; byte *_clipTable, *_clipTableBuf; + byte *_ditherPalette; + bool _dirtyPalette; + byte *_rgbLookup; + byte *_colorMap; + DitherType _ditherType; + void loadCodebook(Common::SeekableReadStream &stream, uint16 strip, byte codebookType, byte chunkID, uint32 chunkSize); void decodeVectors(Common::SeekableReadStream &stream, uint16 strip, byte chunkID, uint32 chunkSize); + + byte findNearestRGB(int index) const; + void ditherVectors(Common::SeekableReadStream &stream, uint16 strip, byte chunkID, uint32 chunkSize); + void ditherCodebookQT(uint16 strip, byte codebookType, uint16 codebookIndex); }; } // End of namespace Image |