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 #ifndef BACKEND_RENDER_HANDLER_AGG_BITMAP_H
00020 #define BACKEND_RENDER_HANDLER_AGG_BITMAP_H
00021
00022 #include <boost/scoped_ptr.hpp>
00023
00024
00025
00026 namespace gnash {
00027
00028 class agg_bitmap_info : public CachedBitmap
00029 {
00030 public:
00031
00032 agg_bitmap_info(std::auto_ptr<GnashImage> im)
00033 :
00034 _image(im.release()),
00035 _bpp(_image->type() == GNASH_IMAGE_RGB ? 24 : 32)
00036 {
00037 }
00038
00039 virtual GnashImage& image() {
00040 assert(!disposed());
00041 return *_image;
00042 }
00043
00044 virtual void dispose() {
00045 _image.reset();
00046 }
00047
00048 virtual bool disposed() const {
00049 return !_image.get();
00050 }
00051
00052 int get_width() const { return _image->width(); }
00053 int get_height() const { return _image->height(); }
00054 int get_bpp() const { return _bpp; }
00055 int get_rowlen() const { return _image->stride(); }
00056 boost::uint8_t* get_data() const { return _image->begin(); }
00057
00058 private:
00059
00060 boost::scoped_ptr<GnashImage> _image;
00061
00062 int _bpp;
00063
00064 };
00065
00066
00067 }
00068
00069 #endif // BACKEND_RENDER_HANDLER_AGG_BITMAP_H