Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

BrushGradient Class Reference

Inherits Brush.

List of all members.


Detailed Description

A linear or radial gradient.


Public Member Functions

void center (float x, float y)
 Set the center of the gradient, subtracted from the sampling point.

void scale (float value)
 The sampling point is divided by this value after subtracting the center.

void add (float p, Color col)
 Add a point to the gradient.

void set (float p, Color col)
 Set a previously defined point on the gradient or add it if this point has not been defined.

Color eval (float x, float y)
 Evaluate the gradient.

Color at (float t)
 Sample the gradient at a given point.

void radial (bit value)
 Set radial gradient mode (true) or linear gradient mode (false).


Member Function Documentation

void BrushGradient.add float  p,
Color  col
 

Add a point to the gradient.

Nominally p should be between 0 and 1; however, it can be outside of that range. Colors are linearly interpolated between.

Color BrushGradient.at float  t  ) 
 

Sample the gradient at a given point.

If it is out-of-range, it returns the first or last sample point. Otherwise it linearly interpolates between the two nearest colors.

Color BrushGradient.eval float  x,
float  y
 

Evaluate the gradient.

This first applies the contortion, then subtracts the center and divides by scale. If the gradient is linear, then this calls at with the resultant y coordinate. If the gradient is radial, this calls at with the distance of x and y from (0, 0).

Reimplemented from Brush.


The documentation for this class was generated from the following file:
Generated on Thu Sep 4 13:12:51 2003 for dig by doxygen 1.3.2