ScummVM API documentation
dither.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef IMAGE_CODECS_DITHER_H
23#define IMAGE_CODECS_DITHER_H
24
25#include "image/codecs/codec.h"
26
27#include "common/types.h"
28#include "graphics/palette.h"
29
30namespace Image {
31
32class DitherCodec : public Codec {
33public:
34 DitherCodec(Codec *codec, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
35 virtual ~DitherCodec() override;
36
38
40 bool setOutputPixelFormat(const Graphics::PixelFormat &format) override;
41 bool containsPalette() const override;
42 const byte *getPalette() override;
43 bool hasDirtyPalette() const override;
44 bool canDither(DitherType type) const override;
45 void setDither(DitherType type, const byte *palette) override;
46 void setCodecAccuracy(CodecAccuracy accuracy) override;
47
51 void setPalette(const byte *palette) { _srcPalette = palette; }
52
56 static byte *createQuickTimeDitherTable(const byte *palette, uint colorCount);
57
58private:
59 DisposeAfterUse::Flag _disposeAfterUse;
60 Codec *_codec;
61 const byte *_srcPalette;
62
63 Graphics::Surface *_ditherFrame;
64 Graphics::Palette _forcedDitherPalette;
65 byte *_ditherTable;
66 bool _dirtyPalette;
67};
68
69} // End of namespace Image
70
71#endif
Definition: stream.h:745
Simple class for handling a palette data.
Definition: palette.h:61
Definition: codec.h:57
DitherType
Definition: codec.h:65
Definition: dither.h:32
void setPalette(const byte *palette)
Definition: dither.h:51
Graphics::PixelFormat getPixelFormat() const override
void setDither(DitherType type, const byte *palette) override
bool setOutputPixelFormat(const Graphics::PixelFormat &format) override
bool canDither(DitherType type) const override
bool hasDirtyPalette() const override
const Graphics::Surface * decodeFrame(Common::SeekableReadStream &stream) override
void setCodecAccuracy(CodecAccuracy accuracy) override
bool containsPalette() const override
static byte * createQuickTimeDitherTable(const byte *palette, uint colorCount)
const byte * getPalette() override
Definition: pixelformat.h:138
Definition: surface.h:67