ScummVM API documentation
codec.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_CODEC_H
23#define IMAGE_CODECS_CODEC_H
24
25#include "graphics/surface.h"
26#include "graphics/pixelformat.h"
27
28#include "image/codec-options.h"
29
30namespace Common {
31class SeekableReadStream;
32}
33
34namespace Image {
35
57class Codec {
58public:
59 Codec() {}
60 virtual ~Codec() {}
61
68
71
74 };
75
83
89
94 virtual bool setOutputPixelFormat(const Graphics::PixelFormat &format) { return format == getPixelFormat(); }
95
99 virtual bool containsPalette() const { return false; }
100
104 virtual const byte *getPalette() { return 0; }
105
109 virtual bool hasDirtyPalette() const { return false; }
110
114 virtual bool canDither(DitherType type) const { return false; }
115
119 virtual void setDither(DitherType type, const byte *palette) {}
120
124 virtual void setCodecAccuracy(CodecAccuracy accuracy) {}
125
130};
131
135Codec *createBitmapCodec(uint32 tag, uint32 streamTag, int width, int height, int bitsPerPixel);
136
140Codec *createQuickTimeCodec(uint32 tag, int width, int height, int bitsPerPixel);
141
142} // End of namespace Image
143
144#endif
Definition: stream.h:745
Definition: codec.h:57
virtual bool canDither(DitherType type) const
Definition: codec.h:114
virtual bool hasDirtyPalette() const
Definition: codec.h:109
DitherType
Definition: codec.h:65
@ kDitherTypeUnknown
Definition: codec.h:67
@ kDitherTypeQT
Definition: codec.h:73
@ kDitherTypeVFW
Definition: codec.h:70
virtual bool setOutputPixelFormat(const Graphics::PixelFormat &format)
Definition: codec.h:94
virtual Graphics::PixelFormat getPixelFormat() const =0
virtual const byte * getPalette()
Definition: codec.h:104
virtual bool containsPalette() const
Definition: codec.h:99
virtual const Graphics::Surface * decodeFrame(Common::SeekableReadStream &stream)=0
virtual void setCodecAccuracy(CodecAccuracy accuracy)
Definition: codec.h:124
static Graphics::PixelFormat getDefaultYUVFormat()
virtual void setDither(DitherType type, const byte *palette)
Definition: codec.h:119
Definition: algorithm.h:29
Definition: pixelformat.h:138
Definition: surface.h:67