Gnash  0.8.10
Public Types | Public Member Functions
gnash::renderer::openvg::OpenVGBitmap Class Reference

#include <OpenVGBitmap.h>

Inheritance diagram for gnash::renderer::openvg::OpenVGBitmap:
gnash::CachedBitmap gnash::ref_counted

List of all members.

Public Types

enum  bitmap_wrap_mode { WRAP_REPEAT, WRAP_FILL, WRAP_PAD, WRAP_REFLECT }
 Set line and fill styles for mesh & line_strip rendering. More...

Public Member Functions

 OpenVGBitmap (VGPaint paint)
 OpenVGBitmap (CachedBitmap *bitmap, VGPaint vgpaint)
 OpenVGBitmap (image::GnashImage *im, VGPaint vgpaint)
 ~OpenVGBitmap ()
void dispose ()
 Free the memory associated with this CachedBitmap.
bool disposed () const
 Whether the CachedBitmap has been disposed.
image::GnashImageimage ()
 Return a GnashImage for manipulation.
VGPaint & vgimage ()
VGPaint getFillPaint () const
int getWidth ()
int getHeight ()
boost::uint8_t * getData () const
OpenVGBitmapcreateRadialBitmap (float x0, float y0, float x1, float y1, float radial, const SWFCxForm &cx, const GradientFill::GradientRecords &records, VGPaint paint)
OpenVGBitmapcreateLinearBitmap (float x0, float y0, float x1, float y1, const SWFCxForm &cx, const GradientFill::GradientRecords &records, const VGPaint paint)
OpenVGBitmapapplyPatternBitmap (const gnash::SWFMatrix &matrix, bitmap_wrap_mode mode, CachedBitmap *bitmap, VGPaint paint)

Detailed Description

This class is the OpenVG specific representation of a Gnash Cached Bitmap.


Member Enumeration Documentation

Set line and fill styles for mesh & line_strip rendering.

Enumerator:
WRAP_REPEAT 
WRAP_FILL 
WRAP_PAD 
WRAP_REFLECT 

Constructor & Destructor Documentation

gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap ( VGPaint  paint)
Parameters:
vgpaintthe VG paint context
gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap ( CachedBitmap bitmap,
VGPaint  vgpaint 
)
gnash::renderer::openvg::OpenVGBitmap::OpenVGBitmap ( image::GnashImage image,
VGPaint  vgpaint 
)

Construct a new bitmap

Parameters:
Apointer to a GnashImage
vgpaintthe VG paint context
Note:
This is usually only called by createCachedBitmap() when a bitmap is loaded from a swf file. As the renderer isn't initialized yet, only the GnashImage is cached.
gnash::renderer::openvg::OpenVGBitmap::~OpenVGBitmap ( )

Member Function Documentation

OpenVGBitmap * gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap ( const gnash::SWFMatrix mat,
bitmap_wrap_mode  mode,
CachedBitmap bitmap,
VGPaint  paint 
)
OpenVGBitmap * gnash::renderer::openvg::OpenVGBitmap::createLinearBitmap ( float  x0,
float  y0,
float  x1,
float  y1,
const SWFCxForm cxform,
const GradientFill::GradientRecords records,
const VGPaint  paint 
)

Create a linear gradient and paint it to the context

Parameters:
x0The X coordinate of the origin point
y0The Y coordinate of the origin point
x1The X coordinate of the opposite corner point
y1The Y coordinate of the opposite corner point
incolorThe base color of the gradient
paintThe VG paint context
Returns:
A pointer to the new Bitmap
Note:
A Linear Gradient Bitmap uses two points, x0,y0 and x1,y1 in the paint coordinate system. The gradient starts at x0,y0 and goes to x1,y1. If x1 and y1 are outside the boundaries of the shape, then the gradient gets clipped at the boundary instead of x1,y1.

References GNASH_REPORT_FUNCTION, gnash::key::j, gnash::key::i, gnash::key::c, gnash::SWFCxForm::transform(), color, gnash::rgba::m_r, gnash::rgba::m_g, gnash::rgba::m_b, and gnash::rgba::m_a.

Referenced by gnash::renderer::openvg::StyleHandler::operator()().

OpenVGBitmap * gnash::renderer::openvg::OpenVGBitmap::createRadialBitmap ( float  cx,
float  cy,
float  fx,
float  fy,
float  radial,
const SWFCxForm cx,
const GradientFill::GradientRecords records,
VGPaint  paint 
)

Create a radial gradient and paint it to the context

Parameters:
x0The X coordinate of the origin point
y0The Y coordinate of the origin point
x1The X coordinate of the opposite corner point
y1The Y coordinate of the opposite corner point
incolorThe base color of the gradient
paintThe VG paint context
Returns:
A pointer to the new Bitmap
Note:
OpenVG supports creating linear and gradient fills in hardware, so we want to use that instead of the existing way of calculating the gradient in software.

References GNASH_REPORT_FUNCTION, gnash::key::j, gnash::key::i, gnash::key::c, gnash::rgba::m_r, gnash::rgba::m_g, gnash::rgba::m_b, and gnash::rgba::m_a.

Referenced by gnash::renderer::openvg::StyleHandler::operator()().

void gnash::renderer::openvg::OpenVGBitmap::dispose ( ) [inline, virtual]

Free the memory associated with this CachedBitmap.

This allows ActionScript a little bit of control over memory.

Implements gnash::CachedBitmap.

bool gnash::renderer::openvg::OpenVGBitmap::disposed ( ) const [inline, virtual]

Whether the CachedBitmap has been disposed.

A disposed CachedBitmap has no data and should not be rendered.

Implements gnash::CachedBitmap.

Referenced by image().

boost::uint8_t* gnash::renderer::openvg::OpenVGBitmap::getData ( ) const [inline]
VGPaint gnash::renderer::openvg::OpenVGBitmap::getFillPaint ( ) const [inline]
int gnash::renderer::openvg::OpenVGBitmap::getHeight ( ) [inline]
int gnash::renderer::openvg::OpenVGBitmap::getWidth ( ) [inline]
image::GnashImage& gnash::renderer::openvg::OpenVGBitmap::image ( ) [inline, virtual]

Return a GnashImage for manipulation.

The changes to the data must be cached before the next rendering.

Implements gnash::CachedBitmap.

References assert, and disposed().

Referenced by OpenVGBitmap(), and applyPatternBitmap().

VGPaint& gnash::renderer::openvg::OpenVGBitmap::vgimage ( ) [inline]

The documentation for this class was generated from the following files: