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 
34 namespace Common {
35 class SeekableReadStream;
36 }
37 
38 namespace Graphics {
39 struct Surface;
40 }
41 
42 namespace Image {
43 
53 class BRCDecoder : public ImageDecoder {
54 public:
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 
64 private:
65  Graphics::Surface _surface;
66  Graphics::Palette _palette;
67  Graphics::PixelFormat _format;
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: image_decoder.h:53
Definition: brc.h:53
Definition: surface.h:67
const Graphics::Surface * getSurface() const override
Definition: brc.h:61
const Graphics::Palette & getPalette() const override
Definition: brc.h:62
Definition: pixelformat.h:138
Definition: stream.h:745
Definition: algorithm.h:29
Definition: formatinfo.h:28
Simple class for handling a palette data.
Definition: palette.h:55
Definition: movie_decoder.h:32