Class RadialGradient

A radial gradient.

Use the this(Point!double c0, double radius0, Point!double c1, double radius1) constructor to create an instance.

Inherits from

Constructors

Name Description
this Create a RadialGradient from a existing cairo_pattern_t*. RadialGradient is a garbage collected class. It will call cairo_pattern_destroy when it gets collected by the GC or when dispose() is called.
this Creates a new radial gradient pattern between the two circles defined by (c0, radius0) and (c1, radius1). Before using the gradient pattern, a number of color stops should be defined using Pattern.addColorStopRGB() or Pattern.addColorStopRGBA().

Properties

Name Type Description
matrix [get, set] Matrix Convenience property
type [get] cairo_pattern_type_t Convenience property

Methods

Name Description
getRadialCircles Gets the gradient endpoint circles for a radial gradient, each specified as a center coordinate and a radius.
addColorStopRGB Adds an opaque color stop to a gradient pattern. The offset specifies the location along the gradient's control vector. For example, a LinearGradient's control vector is from (x0,y0) to (x1,y1) while a RadialGradient's control vector is from any point on the start circle to the corresponding point on the end circle.
addColorStopRGBA Adds a translucent color stop to a gradient pattern. The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.
createFromNative The createFromNative method for the Pattern classes. See https://github.com/jpf91/cairoD/wiki/Memory-Management#createFromNative for more information.
filter Convenience property
getColorStopCount Gets the number of color stops specified in the given gradient pattern.
getColorStopRGBA Gets the color and offset information at the given index for a gradient pattern. Values of index are 0 to 1 less than the number returned by getColorStopCount().
getExtend Gets the current extend mode for a pattern. See Extend for details on the semantics of each extend strategy.
getFilter Gets the current filter for a pattern. See Filter for details on each filter.
getMatrix Returns the pattern's transformation matrix.
getType This function returns the C type of a pattern. See PatternType for available types.
setExtend Sets the mode to be used for drawing outside the area of a pattern. See Extend for details on the semantics of each extend strategy. The default extend mode is CAIRO_EXTEND_NONE for surface patterns and CAIRO_EXTEND_PAD for gradient patterns.
setFilter Sets the filter to be used for resizing when using this pattern. See Filter for details on each filter.
setMatrix Sets the pattern's transformation matrix to matrix. This matrix is a transformation from user space to pattern space.
checkError Method for use in subclasses. Calls cairo_pattern_status(nativePointer) and throws an exception if the status isn't CAIRO_STATUS_SUCCESS

Aliases

Name Description
colorStopCount Convenience alias

Templates

Name Description
CairoCountedClass!(cairo_pattern_t*, "cairo_pattern_")

Authors

Johannes Pfau cairoD
Andrej Mitrovic cairoD
cairo team cairo

Copyright

License

cairoD wrapper/bindings Boost License 1.0
cairo LGPL 2.1 / MPL 1.1