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
00040 class GifImageInput : public ImageInput
00041 {
00042
00043 public:
00044
00046
00050 GifImageInput(boost::shared_ptr<IOChannel> in);
00051
00052 ~GifImageInput();
00053
00055 void read();
00056
00058
00060 size_t getHeight() const;
00061
00063
00065 size_t getWidth() const;
00066
00068
00070 size_t getComponents() const { return 3; }
00071
00073
00077 void readScanline(unsigned char* rgb_data);
00078
00079
00081
00083 DSOEXPORT static std::auto_ptr<ImageInput> create(
00084 boost::shared_ptr<IOChannel> in)
00085 {
00086 std::auto_ptr<ImageInput> ret ( new GifImageInput(in) );
00087 if ( ret.get() ) ret->read();
00088 return ret;
00089 }
00090
00091 private:
00092
00094 void init();
00095
00096
00097 GifFileType* _gif;
00098
00099
00100 size_t _currentRow;
00101
00102 typedef boost::scoped_array<GifPixelType> PixelRow;
00103
00104
00105 boost::scoped_array<PixelRow> _gifData;
00106
00107
00108
00109 };
00110
00111 }
00112
00113
00114 #endif