cairomm
1.14.2
|
Cairo::Pattern is the paint with which cairo draws. More...
#include <cairomm/pattern.h>
Public Types | |
typedef cairo_pattern_t | cobject |
Public Member Functions | |
Pattern (cairo_pattern_t*cobject, bool has_reference=false) | |
Create a C++ wrapper for the C instance. More... | |
Pattern (const Pattern&)=delete | |
Pattern& | operator= (const Pattern&)=delete |
virtual | ~Pattern () |
void | set_matrix (const Matrix& matrix) |
Sets the pattern's transformation matrix to . More... | |
void | get_matrix (Matrix& matrix) const |
Returns the pattern's transformation matrix. More... | |
Matrix | get_matrix () const |
Returns the pattern's transformation matrix. More... | |
void | set_matrix (const cairo_matrix_t& matrix) |
void | get_matrix (cairo_matrix_t& matrix) const |
PatternType | get_type () const |
Returns the type of the pattern. More... | |
void | set_extend (Extend extend) |
Sets the mode to be used for drawing outside the area of a pattern. More... | |
Extend | get_extend () const |
Gets the current extend mode See Cairo::Extend for details on the semantics of each extend strategy. More... | |
cobject* | cobj () |
const cobject* | cobj () const |
void | reference () const |
void | unreference () const |
Protected Member Functions | |
Pattern () | |
Protected Attributes | |
cobject* | m_cobject |
Cairo::Pattern is the paint with which cairo draws.
The primary use of patterns is as the source for all cairo drawing operations, although they can also be used as masks, that is, as the brush too.
This is a reference-counted object that should be used via Cairo::RefPtr.
typedef cairo_pattern_t Cairo::Pattern::cobject |
|
explicit |
Create a C++ wrapper for the C instance.
This C++ instance should then be given to a RefPtr.
cobject | The C instance. |
has_reference | Whether we already have a reference. Otherwise, the constructor will take an extra reference. |
|
delete |
|
virtual |
|
protected |
|
inline |
|
inline |
Extend Cairo::Pattern::get_extend | ( | ) | const |
Gets the current extend mode See Cairo::Extend for details on the semantics of each extend strategy.
void Cairo::Pattern::get_matrix | ( | Matrix& | matrix | ) | const |
Returns the pattern's transformation matrix.
Matrix Cairo::Pattern::get_matrix | ( | ) | const |
Returns the pattern's transformation matrix.
void Cairo::Pattern::get_matrix | ( | cairo_matrix_t& | matrix | ) | const |
PatternType Cairo::Pattern::get_type | ( | ) | const |
Returns the type of the pattern.
void Cairo::Pattern::reference | ( | ) | const |
void Cairo::Pattern::set_extend | ( | Extend | extend | ) |
Sets the mode to be used for drawing outside the area of a pattern.
See Cairo::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.
Cairo::Extend | describing how the area outsize of the pattern will be drawn |
void Cairo::Pattern::set_matrix | ( | const Matrix& | matrix | ) |
Sets the pattern's transformation matrix to .
This matrix is a transformation from user space to pattern space.
When a pattern is first created it always has the identity matrix for its transformation matrix, which means that pattern space is initially identical to user space.
Important: Please note that the direction of this transformation matrix is from user space to pattern space. This means that if you imagine the flow from a pattern to user space (and on to device space), then coordinates in that flow will be transformed by the inverse of the pattern matrix.
For example, if you want to make a pattern appear twice as large as it does by default the correct code to use is:
Meanwhile, using values of 2.0 rather than 0.5 in the code above would cause the pattern to appear at half of its default size.
Also, please note the discussion of the user-space locking semantics of set_source().
void Cairo::Pattern::set_matrix | ( | const cairo_matrix_t& | matrix | ) |
void Cairo::Pattern::unreference | ( | ) | const |
|
protected |