ScummVM API documentation
brc.h
Go to the documentation of this file.
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
28#ifndef IMAGE_BRC_H
29#define IMAGE_BRC_H
30
31#include "graphics/surface.h"
32#include "image/image_decoder.h"
33
34namespace Common {
35class SeekableReadStream;
36}
37
38namespace Graphics {
39struct Surface;
40}
41
42namespace Image {
43
53class BRCDecoder : public ImageDecoder {
54public:
55 BRCDecoder();
56 ~BRCDecoder() override;
57
58 // ImageDecoder API
59 void destroy() override;
60 bool loadStream(Common::SeekableReadStream &stream) override;
61 const Graphics::Surface *getSurface() const override { return &_surface; }
62 const Graphics::Palette &getPalette() const override { return _palette; }
63
64private:
65 Graphics::Surface _surface;
66 Graphics::Palette _palette;
68 void loadBRCData(Common::SeekableReadStream &stream, uint32 nbrOfChunks, bool firstChunkIsRLE);
69 void loadBRCDataColumnWise(Common::SeekableReadStream &stream, uint32 nbrOfChunks, bool firstChunkIsRLE);
70
71 void readRawChunk(Common::SeekableReadStream &stream, uint16 *&dest);
72 void readRLEChunk(Common::SeekableReadStream &stream, uint16 *&dest);
73 void readRawChunkColumnWise(Common::SeekableReadStream &stream, uint16 *&dest, uint16 *&destColumnStart, uint32 &remainingHeight);
74 void readRLEChunkColumnWise(Common::SeekableReadStream &stream, uint16 *&dest, uint16 *&destColumnStart, uint32 &remainingHeight);
75};
76
77} // End of namespace Image
78
79#endif
Definition: stream.h:745
Simple class for handling a palette data.
Definition: palette.h:61
Definition: brc.h:53
Definition: image_decoder.h:53
void destroy() override
bool loadStream(Common::SeekableReadStream &stream) override
const Graphics::Palette & getPalette() const override
Definition: brc.h:62
const Graphics::Surface * getSurface() const override
Definition: brc.h:61
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: pixelformat.h:138
Definition: surface.h:67