Flutter Engine
The Flutter Engine
|
#include <SkImageFilter.h>
Public Types | |
enum | MapDirection { kForward_MapDirection , kReverse_MapDirection } |
Public Types inherited from SkFlattenable | |
enum | Type { kSkColorFilter_Type , kSkBlender_Type , kSkDrawable_Type , kSkDrawLooper_Type , kSkImageFilter_Type , kSkMaskFilter_Type , kSkPathEffect_Type , kSkShader_Type } |
typedef sk_sp< SkFlattenable >(* | Factory) (SkReadBuffer &) |
Public Member Functions | |
SkIRect | filterBounds (const SkIRect &src, const SkMatrix &ctm, MapDirection, const SkIRect *inputRect=nullptr) const |
bool | isColorFilterNode (SkColorFilter **filterPtr) const |
bool | asColorFilter (SkColorFilter **filterPtr) const |
bool | asAColorFilter (SkColorFilter **filterPtr) const |
int | countInputs () const |
const SkImageFilter * | getInput (int i) const |
virtual SkRect | computeFastBounds (const SkRect &bounds) const |
bool | canComputeFastBounds () const |
sk_sp< SkImageFilter > | makeWithLocalMatrix (const SkMatrix &matrix) const |
Public Member Functions inherited from SkFlattenable | |
SkFlattenable () | |
virtual Factory | getFactory () const =0 |
virtual const char * | getTypeName () const =0 |
virtual void | flatten (SkWriteBuffer &) const |
virtual Type | getFlattenableType () const =0 |
sk_sp< SkData > | serialize (const SkSerialProcs *=nullptr) const |
size_t | serialize (void *memory, size_t memory_size, const SkSerialProcs *=nullptr) const |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
virtual | ~SkRefCntBase () |
bool | unique () const |
void | ref () const |
void | unref () const |
Static Public Member Functions | |
static sk_sp< SkImageFilter > | Deserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr) |
Static Public Member Functions inherited from SkFlattenable | |
static Factory | NameToFactory (const char name[]) |
static const char * | FactoryToName (Factory) |
static void | Register (const char name[], Factory) |
static sk_sp< SkFlattenable > | Deserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr) |
Protected Member Functions | |
sk_sp< SkImageFilter > | refMe () const |
Friends | |
class | SkImageFilter_Base |
Base class for image filters. If one is installed in the paint, then all drawing occurs as usual, but it is as if the drawing happened into an offscreen (before the xfermode is applied). This offscreen bitmap will then be handed to the imagefilter, who in turn creates a new bitmap which is what will finally be drawn to the device (using the original xfermode).
The local space of image filters matches the local space of the drawn geometry. For instance if there is rotation on the canvas, the blur will be computed along those rotated axes and not in the device space. In order to achieve this result, the actual drawing of the geometry may happen in an unrotated coordinate system so that the filtered image can be computed more easily, and then it will be post transformed to match what would have been produced if the geometry were drawn with the total canvas matrix to begin with.
Definition at line 35 of file SkImageFilter.h.
Enumerator | |
---|---|
kForward_MapDirection | |
kReverse_MapDirection |
Definition at line 37 of file SkImageFilter.h.
bool SkImageFilter::asAColorFilter | ( | SkColorFilter ** | filterPtr | ) | const |
Returns true (and optionally returns a ref'd filter) if this imagefilter can be completely replaced by the returned colorfilter. i.e. the two effects will affect drawing in the same way.
Definition at line 118 of file SkImageFilter.cpp.
|
inline |
Definition at line 67 of file SkImageFilter.h.
bool SkImageFilter::canComputeFastBounds | ( | ) | const |
Definition at line 98 of file SkImageFilter.cpp.
Reimplemented in SkLocalMatrixImageFilter, and SkRuntimeImageFilter.
Definition at line 82 of file SkImageFilter.cpp.
int SkImageFilter::countInputs | ( | ) | const |
Returns the number of inputs this filter will accept (some inputs can be NULL).
Definition at line 46 of file SkImageFilter.cpp.
|
inlinestatic |
Definition at line 101 of file SkImageFilter.h.
SkIRect SkImageFilter::filterBounds | ( | const SkIRect & | src, |
const SkMatrix & | ctm, | ||
MapDirection | direction, | ||
const SkIRect * | inputRect = nullptr |
||
) | const |
Map a device-space rect recursively forward or backward through the filter DAG. kForward_MapDirection is used to determine which pixels of the destination canvas a source image rect would touch after filtering. kReverse_MapDirection is used to determine which rect of the source image would be required to fill the given rect (typically, clip bounds). Used for clipping and temp-buffer allocations, so the result need not be exact, but should never be smaller than the real answer. The default implementation recursively unions all input bounds, or returns the source rect if no inputs.
In kReverse mode, 'inputRect' is the device-space bounds of the input pixels. In kForward mode it should always be null. If 'inputRect' is null in kReverse mode the resulting answer may be incorrect.
Definition at line 61 of file SkImageFilter.cpp.
const SkImageFilter * SkImageFilter::getInput | ( | int | i | ) | const |
Returns the input filter at a given index, or NULL if no input is connected. The indices used are filter-specific.
Definition at line 52 of file SkImageFilter.cpp.
bool SkImageFilter::isColorFilterNode | ( | SkColorFilter ** | filterPtr | ) | const |
Returns whether this image filter is a color filter and puts the color filter into the "filterPtr" parameter if it can. Does nothing otherwise. If this returns false, then the filterPtr is unchanged. If this returns true, then if filterPtr is not null, it must be set to a ref'd colorfitler (i.e. it may not be set to NULL).
Definition at line 57 of file SkImageFilter.cpp.
sk_sp< SkImageFilter > SkImageFilter::makeWithLocalMatrix | ( | const SkMatrix & | matrix | ) | const |
If this filter can be represented by another filter + a localMatrix, return that filter, else return null.
Definition at line 130 of file SkImageFilter.cpp.
|
inlineprotected |
Definition at line 109 of file SkImageFilter.h.
|
friend |
Definition at line 114 of file SkImageFilter.h.