1
/* ScummVM - Graphic Adventure Engine
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.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
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.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
#include "common/scummsys.h"
30
#include "common/ptr.h"
31
#include "common/rational.h"
32
#include "common/iff_container.h"
34
#include "graphics/iff.h"
37
class SeekableReadStream;
53
LBMLoader(Common::SeekableReadStream &stream);
55
bool loadHeader (Graphics::BMHD &header);
56
bool loadPalette(byte *palette);
57
bool loadImage (byte *image);
60
Common::IFFParser _parser;
64
Graphics::ILBMDecoder _decoder;
69
bool callbackHeader (Common::IFFChunk &chunk);
70
bool callbackPalette(Common::IFFChunk &chunk);
71
bool callbackImage (Common::IFFChunk &chunk);
76
/** An iterator over a surface's image data, automatically handles different color depths. */
79
Pixel(byte *vidMem, uint8 bpp, byte *min, byte *max);
82
Pixel operator++(int x);
85
Pixel operator--(int x);
87
Pixel &operator+=(int x);
88
Pixel &operator-=(int x);
101
/** A const iterator over a surface's image data, automatically handles different color depths. */
104
ConstPixel(const byte *vidMem, uint8 bpp, const byte *min, const byte *max);
106
ConstPixel &operator++();
107
ConstPixel operator++(int x);
109
ConstPixel &operator--();
110
ConstPixel operator--(int x);
112
ConstPixel &operator+=(int x);
113
ConstPixel &operator-=(int x);
117
bool isValid() const;
121
const byte *_min, *_max;
127
Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem = 0);
130
uint16 getWidth () const;
131
uint16 getHeight() const;
132
uint8 getBPP () const;
134
byte *getData(uint16 x = 0, uint16 y = 0);
135
const byte *getData(uint16 x = 0, uint16 y = 0) const;
137
void resize(uint16 width, uint16 height);
139
void setBPP(uint8 bpp);
141
Pixel get(uint16 x = 0, uint16 y = 0);
142
ConstPixel get(uint16 x = 0, uint16 y = 0) const;
144
void blit(const Surface &from, int16 left, int16 top, int16 right, int16 bottom,
145
int16 x, int16 y, int32 transp = -1);
146
void blit(const Surface &from, int16 x, int16 y, int32 transp = -1);
147
void blit(const Surface &from, int32 transp = -1);
149
void blitScaled(const Surface &from, int16 left, int16 top, int16 right, int16 bottom,
150
int16 x, int16 y, Common::Rational scale, int32 transp = -1);
151
void blitScaled(const Surface &from, int16 x, int16 y, Common::Rational scale, int32 transp = -1);
152
void blitScaled(const Surface &from, Common::Rational scale, int32 transp = -1);
154
void fillRect(uint16 left, uint16 top, uint16 right, uint16 bottom, uint32 color);
155
void fill(uint32 color);
158
void shadeRect(uint16 left, uint16 top, uint16 right, uint16 bottom,
159
uint32 color, uint8 strength);
161
void putPixel(uint16 x, uint16 y, uint32 color);
162
void drawLine(uint16 x0, uint16 y0, uint16 x1, uint16 y1, uint32 color);
163
void drawCircle(uint16 x0, uint16 y0, uint16 radius, uint32 color, int16 pattern = 0);
165
void blitToScreen(uint16 left, uint16 top, uint16 right, uint16 bottom, uint16 x, uint16 y) const;
167
bool loadImage(Common::SeekableReadStream &stream);
168
bool loadImage(Common::SeekableReadStream &stream, ImageType type);
170
static ImageType identifyImage(Common::SeekableReadStream &stream);
180
static bool clipBlitRect(int16 &left, int16 &top, int16 &right, int16 &bottom, int16 &x, int16 &y,
181
uint16 dWidth, uint16 dHeight, uint16 sWidth, uint16 sHeight);
183
bool loadTGA (Common::SeekableReadStream &stream);
184
bool loadLBM (Common::SeekableReadStream &stream);
185
bool loadBRC (Common::SeekableReadStream &stream);
186
bool loadBMP (Common::SeekableReadStream &stream);
187
bool loadJPEG(Common::SeekableReadStream &stream);
190
typedef Common::SharedPtr<Surface> SurfacePtr;
192
} // End of namespace Gob
194
#endif // GOB_SURFACE_H