Picasso API  2.2
Typedefs | Enumerations | Functions
Gradient
Graphic Functions

Typedefs

typedef enum _ps_gradient_spread ps_gradient_spread
 Fill type of outside the gradient area.

Enumerations

enum  _ps_gradient_spread { GRADIENT_SPREAD_PAD, GRADIENT_SPREAD_REPEAT, GRADIENT_SPREAD_REFLECT }
 Fill type of outside the gradient area. More...

Functions

PEXPORT ps_gradient *PICAPI ps_gradient_create_linear (ps_gradient_spread spread, const ps_point *start, const ps_point *end)
 Create a new gradient that varies along the line defined by provided starting and ending points.
PEXPORT ps_gradient *PICAPI ps_gradient_create_radial (ps_gradient_spread spread, const ps_point *start, float sradius, const ps_point *end, float eradius)
 Create a new gradient that varies along the area defined by provided starting and ending circles.
PEXPORT ps_gradient *PICAPI ps_gradient_create_conic (ps_gradient_spread spread, const ps_point *origin, float sangle)
 Create a new gradient that varies along the area defined by provided concentric circles.
PEXPORT void PICAPI ps_gradient_transform (ps_gradient *gradient, const ps_matrix *matrix)
 Transform the gradient object.
PEXPORT ps_gradient *PICAPI ps_gradient_ref (ps_gradient *gradient)
 Increases the reference count of the gradient by 1.
PEXPORT void PICAPI ps_gradient_unref (ps_gradient *gradient)
 Decrements the reference count for the gradient object. If the reference count on the gradient falls to 0, the gradient is freed.
PEXPORT void PICAPI ps_gradient_add_color_stop (ps_gradient *gradient, float offset, const ps_color *color)
 Add a color stop to a gradient. The offset specifies the location along the gradient's control vector.
PEXPORT void PICAPI ps_gradient_clear_color_stops (ps_gradient *gradient)
 Clear color stops from gradient's control vector.

Enumeration Type Documentation

Fill type of outside the gradient area.

Enumerator:
GRADIENT_SPREAD_PAD 

Spread pad, the area is filled with closest stop color.

GRADIENT_SPREAD_REPEAT 

Spread repeat, the gradient is repeated outside the area.

GRADIENT_SPREAD_REFLECT 

Spread reflect, the gradient is reflected outside the area.

Definition at line 972 of file picasso.h.


Function Documentation

void ps_gradient_add_color_stop ( ps_gradient gradient,
float  offset,
const ps_color color 
)

Add a color stop to a gradient. The offset specifies the location along the gradient's control vector.

Parameters:
gradientPointer to an existing gradient object.
offsetAn offset position in control vector (range 0 ~ 1).
colorColor for the stop.
See also:
ps_gradient_clear_color_stops

Clear color stops from gradient's control vector.

Parameters:
gradientPointer to an existing gradient object.
See also:
ps_gradient_add_color_stop
ps_gradient * ps_gradient_create_conic ( ps_gradient_spread  spread,
const ps_point origin,
float  sangle 
)

Create a new gradient that varies along the area defined by provided concentric circles.

Parameters:
spreadThe spread type of the gradient.
originThe center point of conic, of the required gradient.
sangleThe angle, int radians, which the first color.
Returns:
If the function succeeds, the return value is the pointer to a new gradient object. If the function fails, the return value is NULL.
Note:
Conic Gradient support reflect and pad mode only, paramter spread repeat will be supposed pad. To get extended error information, call ps_last_status.
See also:
ps_gradient_create_linear, ps_gradient_create_radial, ps_gradient_ref, ps_gradient_unref
ps_gradient * ps_gradient_create_linear ( ps_gradient_spread  spread,
const ps_point start,
const ps_point end 
)

Create a new gradient that varies along the line defined by provided starting and ending points.

Parameters:
spreadThe spread type of the gradient.
startThe starting point , of the required gradient.
endThe ending point, of the required gradient.
Returns:
If the function succeeds, the return value is the pointer to a new gradient object. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_gradient_create_radial, ps_gradient_create_conic, ps_gradient_ref, ps_gradient_unref
ps_gradient * ps_gradient_create_radial ( ps_gradient_spread  spread,
const ps_point start,
float  sradius,
const ps_point end,
float  eradius 
)

Create a new gradient that varies along the area defined by provided starting and ending circles.

Parameters:
spreadThe spread type of the gradient.
startThe center point of the starting circle, of the required gradient.
sradiusThe radius of the starting circle, of the required gradient.
endThe center point of the ending circle, of the required gradient.
eradiusThe radius of the ending circle, of the required gradient.
Returns:
If the function succeeds, the return value is the pointer to a new gradient object. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_gradient_create_linear, ps_gradient_create_conic, ps_gradient_ref, ps_gradient_unref

Increases the reference count of the gradient by 1.

Parameters:
gradientPointer to an existing gradient object.
Returns:
If the function succeeds, the return value is the pointer to the gradient object. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_gradient_create_linear, ps_gradient_create_radial, ps_gradient_create_conic, ps_gradient_unref
void ps_gradient_transform ( ps_gradient gradient,
const ps_matrix matrix 
)

Transform the gradient object.

Parameters:
gradientPointer to an existing gradient object.
matrixPointer to an existing matrix object.
See also:
ps_gradient_create_linear, ps_gradient_create_radial, ps_gradient_create_conic, ps_gradient_ref, ps_gradient_unref
void ps_gradient_unref ( ps_gradient gradient)

Decrements the reference count for the gradient object. If the reference count on the gradient falls to 0, the gradient is freed.

Parameters:
gradientPointer to an existing gradient object.
See also:
ps_gradient_create_linear, ps_gradient_create_radial, ps_gradient_create_conic, ps_gradient_ref