Gnash
0.8.10
|
#include <FillStyle.h>
Public Types | |
enum | Type { LINEAR, RADIAL } |
The type of GradientFill. More... | |
enum | SpreadMode { PAD, REPEAT, REFLECT } |
enum | InterpolationMode { RGB, LINEAR_RGB } |
typedef std::vector < GradientRecord > | GradientRecords |
Public Member Functions | |
GradientFill (Type t, const SWFMatrix &m, const GradientRecords &=GradientRecords()) | |
Construct a GradientFill. | |
Type | type () const |
const SWFMatrix & | matrix () 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) |
const GradientRecords & | getRecords () const |
size_t | recordCount () const |
Get the number of records in this GradientFill. | |
const GradientRecord & | record (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 |
InterpolationMode | interpolation |
A GradientFill.
typedef std::vector<GradientRecord> gnash::GradientFill::GradientRecords |
The type of GradientFill.
A Radial fill is a gradient fill with a focal point.
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.
References assert.
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::renderer::openvg::StyleHandler::operator()(), gnash::StyleHandler::addFocalGradient(), and gnash::readFills().
const GradientRecords& gnash::GradientFill::getRecords | ( | ) | const [inline] |
Referenced by gnash::renderer::openvg::StyleHandler::operator()().
const SWFMatrix& gnash::GradientFill::matrix | ( | ) | const [inline] |
Referenced by setLerp(), gnash::renderer::openvg::StyleHandler::operator()(), and gnash::AddStyles::operator()().
const GradientRecord& gnash::GradientFill::record | ( | size_t | i | ) | const [inline] |
Query the GradientRecord at the specified index.
There are recordCount() records.
References assert, and gnash::key::i.
Referenced by setLerp().
size_t gnash::GradientFill::recordCount | ( | ) | const [inline] |
Get the number of records in this GradientFill.
Referenced by setLerp().
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.
References gnash::key::d.
Referenced by gnash::readFills().
void gnash::GradientFill::setLerp | ( | const GradientFill & | a, |
const GradientFill & | b, | ||
double | ratio | ||
) |
Set this fill to a lerp of two other GradientFills.
References assert, type(), recordCount(), gnash::key::i, gnash::key::e, record(), gnash::frnd(), gnash::GradientRecord::ratio, gnash::lerp(), gnash::GradientRecord::color, gnash::SWFMatrix::set_lerp(), and matrix().
void gnash::GradientFill::setRecords | ( | const GradientRecords & | recs | ) | [inline] |
References assert.
Referenced by gnash::readFills().
Type gnash::GradientFill::type | ( | ) | const [inline] |
Referenced by setLerp(), and gnash::renderer::openvg::StyleHandler::operator()().
Referenced by gnash::readFills().