Gnash
0.8.11dev
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
librender
agg
Renderer_agg_bitmap.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3
// Free Software Foundation, Inc
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19
#ifndef BACKEND_RENDER_HANDLER_AGG_BITMAP_H
20
#define BACKEND_RENDER_HANDLER_AGG_BITMAP_H
21
22
#include <boost/scoped_ptr.hpp>
23
#include <memory>
24
#include <boost/cstdint.hpp>
25
26
#include "
GnashImage.h
"
27
#include "
CachedBitmap.h
"
28
29
namespace
gnash {
30
31
class
agg_bitmap_info
:
public
CachedBitmap
32
{
33
public
:
34
35
agg_bitmap_info
(std::auto_ptr<image::GnashImage> im)
36
:
37
_image(im.release()),
38
_bpp(_image->
type
() ==
image
::
TYPE_RGB
? 24 : 32)
39
{
40
}
41
42
image::GnashImage
&
image
() {
43
assert
(!
disposed
());
44
return
*_image;
45
}
46
47
void
dispose
() {
48
_image.reset();
49
}
50
51
bool
disposed
()
const
{
52
return
!_image.get();
53
}
54
55
int
get_width
()
const
{
return
_image->width(); }
56
int
get_height
()
const
{
return
_image->height(); }
57
int
get_bpp
()
const
{
return
_bpp; }
58
int
get_rowlen
()
const
{
return
_image->stride(); }
59
boost::uint8_t*
get_data
()
const
{
return
_image->begin(); }
60
61
private
:
62
63
boost::scoped_ptr<image::GnashImage> _image;
64
65
int
_bpp;
66
67
};
68
69
70
}
// namespace gnash
71
72
#endif // BACKEND_RENDER_HANDLER_AGG_BITMAP_H
Generated on Mon Jul 16 2012 04:05:34 for Gnash by
1.8.1.1