ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

flic_decoder.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef VIDEO_FLICDECODER_H
00024 #define VIDEO_FLICDECODER_H
00025 
00026 #include "video/video_decoder.h"
00027 #include "common/list.h"
00028 #include "common/rect.h"
00029 
00030 namespace Common {
00031 class SeekableReadStream;
00032 }
00033 
00034 namespace Graphics {
00035 struct PixelFormat;
00036 struct Surface;
00037 }
00038 
00039 namespace Video {
00040 
00049 class FlicDecoder : public VideoDecoder {
00050 public:
00051     FlicDecoder();
00052     virtual ~FlicDecoder();
00053 
00054     virtual bool loadStream(Common::SeekableReadStream *stream);
00055 
00056     const Common::List<Common::Rect> *getDirtyRects() const;
00057     void clearDirtyRects();
00058     void copyDirtyRectsToBuffer(uint8 *dst, uint pitch);
00059 
00060 protected:
00061     class FlicVideoTrack : public VideoTrack {
00062     public:
00063         FlicVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, bool skipHeader = false);
00064         ~FlicVideoTrack();
00065 
00066         virtual void readHeader();
00067 
00068         bool endOfTrack() const;
00069         virtual bool isRewindable() const { return true; }
00070         virtual bool rewind();
00071 
00072         uint16 getWidth() const;
00073         uint16 getHeight() const;
00074         Graphics::PixelFormat getPixelFormat() const;
00075         int getCurFrame() const { return _curFrame; }
00076         int getFrameCount() const { return _frameCount; }
00077         uint32 getNextFrameStartTime() const { return _nextFrameStartTime; }
00078         virtual const Graphics::Surface *decodeNextFrame();
00079         virtual void handleFrame();
00080         const byte *getPalette() const { _dirtyPalette = false; return _palette; }
00081         bool hasDirtyPalette() const { return _dirtyPalette; }
00082 
00083         const Common::List<Common::Rect> *getDirtyRects() const { return &_dirtyRects; }
00084         void clearDirtyRects() { _dirtyRects.clear(); }
00085         void copyDirtyRectsToBuffer(uint8 *dst, uint pitch);
00086 
00087     protected:
00088         Common::SeekableReadStream *_fileStream;
00089         Graphics::Surface *_surface;
00090 
00091         int _curFrame;
00092         bool _atRingFrame;
00093 
00094         uint32 _offsetFrame1;
00095         uint32 _offsetFrame2;
00096         byte *_palette;
00097         mutable bool _dirtyPalette;
00098 
00099         uint32 _frameCount;
00100         uint32 _frameDelay, _startFrameDelay;
00101         uint32 _nextFrameStartTime;
00102 
00103         Common::List<Common::Rect> _dirtyRects;
00104 
00105         void copyFrame(uint8 *data);
00106         void decodeByteRun(uint8 *data);
00107         void decodeDeltaFLC(uint8 *data);
00108         void unpackPalette(uint8 *mem);
00109     };
00110 };
00111 
00112 } // End of namespace Video
00113 
00114 #endif


Generated on Sat Mar 16 2019 05:01:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge