Public Types | Public Member Functions | Public Attributes

gnash::GradientFill Class Reference

A GradientFill. More...

#include <FillStyle.h>

Collaboration diagram for gnash::GradientFill:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Type { LINEAR, RADIAL }
 

The type of GradientFill.

More...
enum  SpreadMode { PAD, REPEAT, REFLECT }
typedef std::vector
< GradientRecord
GradientRecords

Public Member Functions

 GradientFill (Type t, const SWFMatrix &m, const GradientRecords &=GradientRecords())
 Construct a GradientFill.
Type type () const
const SWFMatrixmatrix () const
void setLerp (const GradientFill &a, const GradientFill &b, double ratio)
 Set this fill to a lerp of two other GradientFills.
void setRecords (const GradientRecords &recs)
size_t recordCount () const
 Get the number of records in this GradientFill.
const GradientRecordrecord (size_t i) const
 Query the GradientRecord at the specified index.
void setFocalPoint (double d)
 Set the focal point.
double focalPoint () const
 Get the focal point of this GradientFill.

Public Attributes

SpreadMode spreadMode
SWF::InterpolationMode interpolation

Detailed Description

A GradientFill.

TODO: clean this up!


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
PAD 
REPEAT 
REFLECT 

The type of GradientFill.

A Focal fill is a gradient fill with a focal point.

Enumerator:
LINEAR 
RADIAL 

Constructor & Destructor Documentation

gnash::GradientFill::GradientFill ( Type  t,
const SWFMatrix m,
const GradientRecords recs = GradientRecords() 
)

Construct a GradientFill.

Optionally the records can be passed here. The actual matrix of the gradient depends on the type; the constructor handles this, and users should just pass the user matrix.


Member Function Documentation

double gnash::GradientFill::focalPoint (  )  const [inline]

Get the focal point of this GradientFill.

If the focal point is 0.0, it is a simple radial fill.

Referenced by gnash::StyleHandler::addFocalGradient().

const SWFMatrix& gnash::GradientFill::matrix (  )  const [inline]
const GradientRecord& gnash::GradientFill::record ( size_t  i  )  const [inline]

Query the GradientRecord at the specified index.

There are recordCount() records.

size_t gnash::GradientFill::recordCount (  )  const [inline]

Get the number of records in this GradientFill.

void gnash::GradientFill::setFocalPoint ( double  d  ) 

Set the focal point.

Value will be clamped to the range -1..1; callers don't need to check.

void gnash::GradientFill::setLerp ( const GradientFill a,
const GradientFill b,
double  ratio 
)

Set this fill to a lerp of two other GradientFills.

void gnash::GradientFill::setRecords ( const GradientRecords recs  )  [inline]
Type gnash::GradientFill::type (  )  const [inline]

Member Data Documentation


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