ScummVM API documentation
cel_decoder.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 PINK_CEL_DECODER_H
23 #define PINK_CEL_DECODER_H
24 
25 #include "video/flic_decoder.h"
26 
27 namespace Pink {
28 
30 public:
31  bool loadStream(Common::SeekableReadStream *stream) override;
32 
33  uint16 getTransparentColourIndex() const;
34 
35  Common::Point getCenter() const;
36  const Graphics::Surface *getCurrentFrame() const;
37  void skipFrame();
38 
39  void setEndOfTrack();
40 
41 protected:
42  class CelVideoTrack : public FlicVideoTrack {
43  public:
44  CelVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, bool skipHeader = false);
45  void readHeader() override;
46 
47  uint16 getTransparentColourIndex() const;
48 
49  // Hack. Pink needs so that Track needed an update after lastFrame delay ends
50  void setEndOfTrack() { _curFrame = _frameCount; }
51  bool endOfTrack() const override { return getCurFrame() >= getFrameCount(); }
52 
53  Common::Point getCenter() const;
54  const Graphics::Surface *getCurrentFrame() const;
55 
56  void skipFrame();
57 
58  bool rewind() override;
59 
60  private:
61  const Graphics::Surface *decodeNextFrame() override;
62  void readPrefixChunk();
63 
64  Common::Point _center;
65  byte _transparentColourIndex;
66  };
67 };
68 
69 }
70 
71 #endif
Definition: flic_decoder.h:61
Definition: cel_decoder.h:42
Definition: surface.h:67
int getCurFrame() const
Definition: stream.h:745
Definition: archive.h:35
Definition: flic_decoder.h:49
uint32 getFrameCount() const
Definition: rect.h:45
Definition: cel_decoder.h:29
bool loadStream(Common::SeekableReadStream *stream) override