cairomm  1.16.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Cairo::SurfacePattern Class Reference

#include <cairomm/pattern.h>

Inheritance diagram for Cairo::SurfacePattern:
Inheritance graph
[legend]

Public Types

enum class  Filter {
  FAST = CAIRO_FILTER_FAST ,
  GOOD = CAIRO_FILTER_GOOD ,
  BEST = CAIRO_FILTER_BEST ,
  NEAREST = CAIRO_FILTER_NEAREST ,
  BILINEAR = CAIRO_FILTER_BILINEAR ,
  GAUSSIAN = CAIRO_FILTER_GAUSSIAN
}
 Filter is used to indicate what filtering should be applied when reading pixel values from patterns. More...
 
- Public Types inherited from Cairo::Pattern
enum class  Type {
  SOLID = CAIRO_PATTERN_TYPE_SOLID ,
  SURFACE = CAIRO_PATTERN_TYPE_SURFACE ,
  LINEAR = CAIRO_PATTERN_TYPE_LINEAR ,
  RADIAL = CAIRO_PATTERN_TYPE_RADIAL
}
 Type is used to describe the type of a given pattern. More...
 
enum class  Extend {
  NONE = CAIRO_EXTEND_NONE ,
  REPEAT = CAIRO_EXTEND_REPEAT ,
  REFLECT = CAIRO_EXTEND_REFLECT ,
  PAD = CAIRO_EXTEND_PAD
}
 Cairo::Extend is used to describe how pattern color/alpha will be determined for areas "outside" the pattern's natural area, (for example, outside the surface bounds or outside the gradient geometry). More...
 
typedef cairo_pattern_t cobject
 

Public Member Functions

 SurfacePattern (cairo_pattern_t *cobject, bool has_reference=false)
 Create a C++ wrapper for the C instance. More...
 
 ~SurfacePattern () override
 
void set_filter (Filter filter)
 Sets the filter to be used for resizing when using this pattern. More...
 
Filter get_filter () const
 Gets the current filter for a pattern. More...
 
RefPtr< const Surfaceget_surface () const
 Gets the surface associated with this pattern. More...
 
RefPtr< Surfaceget_surface ()
 
- Public Member Functions inherited from Cairo::Pattern
 Pattern (cairo_pattern_t *cobject, bool has_reference=false)
 Create a C++ wrapper for the C instance. More...
 
 Pattern (const Pattern &)=delete
 
Patternoperator= (const Pattern &)=delete
 
virtual ~Pattern ()
 
void set_matrix (const Matrix & matrix)
 Sets the pattern's transformation matrix to @matrix. 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...
 
Type 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...
 
cobjectcobj ()
 
const cobjectcobj () const
 
void reference () const
 
void unreference () const
 

Static Public Member Functions

static RefPtr< SurfacePatterncreate (const RefPtr< Surface > & surface)
 Create a new Cairo::Pattern for the given surface. More...
 

Protected Member Functions

 SurfacePattern (const RefPtr< Surface > & surface)
 
- Protected Member Functions inherited from Cairo::Pattern
 Pattern ()
 

Additional Inherited Members

- Protected Attributes inherited from Cairo::Pattern
cobjectm_cobject
 

Member Enumeration Documentation

◆ Filter

Filter is used to indicate what filtering should be applied when reading pixel values from patterns.

See Cairo::SurfacePattern::set_filter() for indicating the desired filter to be used with a particular pattern.

Enumerator
FAST 

A high-performance filter, with quality similar to Cairo::Patern::Filter::NEAREST.

GOOD 

A reasonable-performance filter, with quality similar to Cairo::BILINEAR.

BEST 

The highest-quality available, performance may not be suitable for interactive use.

NEAREST 

Nearest-neighbor filtering.

BILINEAR 

Linear interpolation in two dimensions.

GAUSSIAN 

This filter value is currently unimplemented, and should not be used in current code.

Constructor & Destructor Documentation

◆ SurfacePattern() [1/2]

Cairo::SurfacePattern::SurfacePattern ( const RefPtr< Surface > &  surface)
explicitprotected

◆ SurfacePattern() [2/2]

Cairo::SurfacePattern::SurfacePattern ( cairo_pattern_t *  cobject,
bool  has_reference = false 
)
explicit

Create a C++ wrapper for the C instance.

This C++ instance should then be given to a RefPtr.

Parameters
cobjectThe C instance.
has_referenceWhether we already have a reference. Otherwise, the constructor will take an extra reference.

◆ ~SurfacePattern()

Cairo::SurfacePattern::~SurfacePattern ( )
override

Member Function Documentation

◆ create()

static RefPtr<SurfacePattern> Cairo::SurfacePattern::create ( const RefPtr< Surface > &  surface)
static

Create a new Cairo::Pattern for the given surface.

◆ get_filter()

Filter Cairo::SurfacePattern::get_filter ( ) const

Gets the current filter for a pattern.

See Cairo::Filter for details on each filter.

◆ get_surface() [1/2]

RefPtr<Surface> Cairo::SurfacePattern::get_surface ( )

◆ get_surface() [2/2]

RefPtr<const Surface> Cairo::SurfacePattern::get_surface ( ) const

Gets the surface associated with this pattern.

Since
1.4

◆ set_filter()

void Cairo::SurfacePattern::set_filter ( Filter  filter)

Sets the filter to be used for resizing when using this pattern.

See Cairo::Filter for details on each filter.

Note that you might want to control filtering even when you do not have an explicit Cairo::Pattern object, (for example when using Cairo::Context::set_source_surface()). In these cases, it is convenient to use Cairo::Context::get_source() to get access to the pattern that cairo creates implicitly.

Parameters
filterCairo::Filter describing the filter to use for resizing the pattern

The documentation for this class was generated from the following file: