Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GNASH_IMAGE_GIF_H
00022 #define GNASH_IMAGE_GIF_H
00023
00024 #include <memory>
00025
00026 #include "dsodefs.h"
00027 #include "GnashImage.h"
00028 #include <boost/scoped_array.hpp>
00029 #include <boost/shared_ptr.hpp>
00030
00031 extern "C" {
00032 #include <gif_lib.h>
00033 }
00034
00035
00036 namespace gnash { class IOChannel; }
00037
00038 namespace gnash {
00039 namespace image {
00040
00041 class GifInput : public Input
00042 {
00043
00044 public:
00045
00047
00051 GifInput(boost::shared_ptr<IOChannel> in);
00052
00053 ~GifInput();
00054
00056 void read();
00057
00059
00061 size_t getHeight() const;
00062
00064
00066 size_t getWidth() const;
00067
00069
00071 size_t getComponents() const { return 3; }
00072
00074
00078 void readScanline(unsigned char* rgb_data);
00079
00080
00082
00084 DSOEXPORT static std::auto_ptr<Input> create(
00085 boost::shared_ptr<IOChannel> in)
00086 {
00087 std::auto_ptr<Input> ret ( new GifInput(in) );
00088 if ( ret.get() ) ret->read();
00089 return ret;
00090 }
00091
00092 private:
00093
00095 void init();
00096
00097
00098 GifFileType* _gif;
00099
00100
00101 size_t _currentRow;
00102
00103 typedef boost::scoped_array<GifPixelType> PixelRow;
00104
00105
00106 boost::scoped_array<PixelRow> _gifData;
00107
00108
00109
00110 };
00111
00112 }
00113 }
00114
00115
00116 #endif