• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

Renderer_agg_bitmap.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
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 // This include file used only to make Renderer_agg more readable.
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 } // namespace gnash
00068 
00069 #endif // BACKEND_RENDER_HANDLER_AGG_BITMAP_H 

Generated on Thu Sep 30 2010 14:35:02 for Gnash by  doxygen 1.7.1