diff options
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 |