ScummVM API documentation
formatinfo.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 COMMON_FORMATS_FORMATINFO_H
23#define COMMON_FORMATS_FORMATINFO_H
24
25#include "common/str.h"
26#include "image/bmp.h"
27
28namespace Graphics {
29
30struct Surface;
31
32} // End of namespace Graphics
33
34namespace Common {
35
36namespace FormatInfo {
37
38enum Lossiness {
39 kLossinessUnknown,
40
41 kLossinessLossless,
42 kLossinessLossy,
43 kLossinessEither,
44};
45
46
50enum FormatSupportLevel {
51 kFormatSupportLevelNone,
52 kFormatSupportLevelAvoid,
53 kFormatSupportLevelDefault,
54 kFormatSupportLevelSupported,
55 kFormatSupportLevelPreferred,
56};
57
58enum FormatID {
59 kFormatUnknown,
60
61 // Image formats
62 kBMP, kFirstImageFormat = kBMP,
63 kPNG,
64 kJPEG,
65 kPICT, // Macintosh PICT
66
67 // Binary formats
68 kUntypedBinary, kFirstBinaryFormat = kUntypedBinary,
69
70 // End of list
71 kCount,
72
73 kLastImageFormat = kFirstBinaryFormat - 1,
74 kLastBinaryFormat = kCount - 1,
75};
76
79
80 Lossiness _lossiness;
81 bool _supportAlpha;
82 bool _supportPalette;
83 uint _maxBitDepth;
84};
85
88
89 uint8 _qualityLevel;
90};
91
92typedef bool (*ImageSaveCallback_t)(Common::WriteStream &stream, const Graphics::Surface &surf, const byte *palette, const ImageSaveProperties &saveProperties);
93
101const char *getFormatExtension(Common::FormatInfo::FormatID format, bool limitTo3Characters);
102
103Common::U32String getFormatSaveDescription(Common::FormatInfo::FormatID format);
104
105ImageSaveCallback_t getImageSaveFunction(FormatID format);
106
107
108bool getImageFormatCharacteristics(FormatID format, ImageFormatCharacteristics &outCharacteristics);
109
113FormatSupportLevel getFormatSupportLevel(Common::FormatInfo::FormatID format);
114
115} // End of namespace FormatInfo
116
117} // End of namespace Common
118
119#endif
Definition: ustr.h:57
Definition: stream.h:77
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: formatinfo.h:86
Definition: surface.h:67