Name
cpattern:SetFilter -- set filter
Synopsis
cpattern:SetFilter(filter)
Function
Sets the filter to be used for resizing when using this pattern. The filter parameter can be set to one of the following constants:

#CAIRO_FILTER_FAST
A high-performance filter, with quality similar to #CAIRO_FILTER_NEAREST.
#CAIRO_FILTER_GOOD
A reasonable-performance filter, with quality similar to #CAIRO_FILTER_BILINEAR.
#CAIRO_FILTER_BEST
The highest-quality available, performance may not be suitable for interactive use.
#CAIRO_FILTER_NEAREST
Nearest-neighbor filtering.
#CAIRO_FILTER_BILINEAR
Linear interpolation in two dimensions.
#CAIRO_FILTER_GAUSSIAN
This filter value is currently unimplemented, and should not be used in current code.

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

 
ctx:SetSourceSurface(image, x, y)
pat = ctx:GetSource()
pat:SetFilter(#CAIRO_FILTER_NEAREST)

Inputs
filter
filter to use for resizing the pattern

Show TOC