Skia
2DGraphicsLibrary
|
Static Public Member Functions | |
static sk_sp< SkImageFilter > | MakeDistantLitDiffuse (const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
static sk_sp< SkImageFilter > | MakePointLitDiffuse (const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
static sk_sp< SkImageFilter > | MakeSpotLitDiffuse (const SkPoint3 &location, const SkPoint3 &target, SkScalar specularExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
static sk_sp< SkImageFilter > | MakeDistantLitSpecular (const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
static sk_sp< SkImageFilter > | MakePointLitSpecular (const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
static sk_sp< SkImageFilter > | MakeSpotLitSpecular (const SkPoint3 &location, const SkPoint3 &target, SkScalar specularExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr) |
![]() | |
static sk_sp< SkSpecialImage > | DrawWithFP (GrContext *context, sk_sp< GrFragmentProcessor > fp, const SkIRect &bounds, const OutputProperties &outputProperties) |
static sk_sp< SkImageFilter > | MakeMatrixFilter (const SkMatrix &matrix, SkFilterQuality quality, sk_sp< SkImageFilter > input) |
Return an imagefilter which transforms its input by the given matrix. | |
![]() | |
static Factory | NameToFactory (const char name[]) |
static const char * | FactoryToName (Factory) |
static bool | NameToType (const char name[], Type *type) |
static void | Register (const char name[], Factory, Type) |
Protected Member Functions | |
SkLightingImageFilter (sk_sp< SkImageFilterLight > light, SkScalar surfaceScale, sk_sp< SkImageFilter > input, const CropRect *cropRect) | |
void | flatten (SkWriteBuffer &) const override |
Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()). | |
const SkImageFilterLight * | light () const |
SkScalar | surfaceScale () const |
bool | affectsTransparentBlack () const override |
![]() | |
SkImageFilter (sk_sp< SkImageFilter > const *inputs, int inputCount, const CropRect *cropRect) | |
SkImageFilter (int inputCount, SkReadBuffer &rb) | |
Constructs a new SkImageFilter read from an SkReadBuffer object. More... | |
const CropRect * | getCropRectIfSet () const |
virtual sk_sp< SkSpecialImage > | onFilterImage (SkSpecialImage *src, const Context &, SkIPoint *offset) const =0 |
This is the virtual which should be overridden by the derived class to perform image filtering. More... | |
virtual SkIRect | onFilterBounds (const SkIRect &, const SkMatrix &, MapDirection) const |
This function recurses into its inputs with the given rect (first argument), calls filterBounds() with the given map direction on each, and returns the union of those results. More... | |
virtual SkIRect | onFilterNodeBounds (const SkIRect &, const SkMatrix &, MapDirection) const |
Performs a forwards or reverse mapping of the given rect to accommodate this filter's margin requirements. More... | |
sk_sp< SkSpecialImage > | filterInput (int index, SkSpecialImage *src, const Context &, SkIPoint *offset) const |
virtual bool | onIsColorFilterNode (SkColorFilter **) const |
Return true (and return a ref'd colorfilter) if this node in the DAG is just a colorfilter w/o CropRect constraints. | |
virtual bool | onCanHandleComplexCTM () const |
Override this to describe the behavior of your subclass - as a leaf node. More... | |
bool | applyCropRect (const Context &, const SkIRect &srcBounds, SkIRect *dstBounds) const |
Given a "srcBounds" rect, computes destination bounds for this filter. More... | |
sk_sp< SkSpecialImage > | applyCropRect (const Context &, SkSpecialImage *src, SkIPoint *srcOffset, SkIRect *bounds) const |
A variant of the above call which takes the original source bitmap and source offset. More... | |
Context | mapContext (const Context &ctx) const |
Creates a modified Context for use when recursing up the image filter DAG. More... | |
sk_sp< SkImageFilter > | makeColorSpace (SkColorSpaceXformer *xformer) const |
Returns an image filter transformed into a new color space via the |xformer|. | |
virtual sk_sp< SkImageFilter > | onMakeColorSpace (SkColorSpaceXformer *) const =0 |
![]() | |
void | internal_dispose_restore_refcnt_to_1 () const |
Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More... | |
Private Types | |
typedef SkImageFilter | INHERITED |
Private Attributes | |
sk_sp< SkImageFilterLight > | fLight |
SkScalar | fSurfaceScale |
Additional Inherited Members | |
![]() | |
enum | TileUsage { kPossible_TileUsage, kNever_TileUsage } |
enum | MapDirection { kForward_MapDirection, kReverse_MapDirection } |
![]() | |
enum | Type { kSkColorFilter_Type, kSkDrawable_Type, kSkDrawLooper_Type, kSkImageFilter_Type, kSkMaskFilter_Type, kSkPathEffect_Type, kSkPixelRef_Type, kSkRasterizer_Type, kSkShaderBase_Type, kSkUnused_Type, kSkUnused_Xfermode_Type, kSkNormalSource_Type } |
typedef sk_sp< SkFlattenable >(* | Factory )(SkReadBuffer &) |
![]() | |
sk_sp< SkSpecialImage > | filterImage (SkSpecialImage *src, const Context &, SkIPoint *offset) const |
Request a new filtered image to be created from the src image. More... | |
SkIRect | filterBounds (const SkIRect &src, const SkMatrix &ctm, MapDirection=kReverse_MapDirection) const |
Map a device-space rect recursively forward or backward through the filter DAG. More... | |
bool | 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. More... | |
bool | asColorFilter (SkColorFilter **filterPtr) const |
bool | asAColorFilter (SkColorFilter **filterPtr) const |
Returns true (and optionally returns a ref'd filter) if this imagefilter can be completely replaced by the returned colorfilter. More... | |
int | countInputs () const |
Returns the number of inputs this filter will accept (some inputs can be NULL). | |
SkImageFilter * | getInput (int i) const |
Returns the input filter at a given index, or NULL if no input is connected. More... | |
bool | cropRectIsSet () const |
Returns whether any edges of the crop rect have been set. More... | |
CropRect | getCropRect () const |
virtual SkRect | computeFastBounds (const SkRect &) const |
bool | canComputeFastBounds () const |
sk_sp< SkImageFilter > | makeWithLocalMatrix (const SkMatrix &) const |
If this filter can be represented by another filter + a localMatrix, return that filter, else return null. | |
bool | canHandleComplexCTM () const |
ImageFilters can natively handle scaling and translate components in the CTM. More... | |
![]() | |
virtual Factory | getFactory () const =0 |
Implement this to return a factory function pointer that can be called to recreate your class given a buffer (previously written to by your override of flatten(). | |
virtual const char * | getTypeName () const |
Returns the name of the object's class. More... | |
![]() | |
SkRefCntBase () | |
Default construct, initializing the reference count to 1. | |
virtual | ~SkRefCntBase () |
Destruct, asserting that the reference count is 1. | |
int32_t | getRefCnt () const |
Return the reference count. More... | |
void | validate () const |
bool | unique () const |
May return true if the caller is the only owner. More... | |
void | ref () const |
Increment the reference count. More... | |
void | unref () const |
Decrement the reference count. More... | |
![]() | |
static sk_sp< SkSpecialImage > | ImageToColorSpace (SkSpecialImage *src, const OutputProperties &) |
Returns a version of the passed-in image (possibly the original), that is in a colorspace with the same gamut as the one from the OutputProperties. More... | |