Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkLightingImageFilter Class Reference
Inheritance diagram for SkLightingImageFilter:
SkImageFilter SkFlattenable SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< SkImageFilterMakeDistantLitDiffuse (const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr)
 
static sk_sp< SkImageFilterMakePointLitDiffuse (const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr)
 
static sk_sp< SkImageFilterMakeSpotLitDiffuse (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< SkImageFilterMakeDistantLitSpecular (const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr)
 
static sk_sp< SkImageFilterMakePointLitSpecular (const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect *cropRect=nullptr)
 
static sk_sp< SkImageFilterMakeSpotLitSpecular (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 Public Member Functions inherited from SkImageFilter
static sk_sp< SkSpecialImage > DrawWithFP (GrContext *context, sk_sp< GrFragmentProcessor > fp, const SkIRect &bounds, const OutputProperties &outputProperties)
 
static sk_sp< SkImageFilterMakeMatrixFilter (const SkMatrix &matrix, SkFilterQuality quality, sk_sp< SkImageFilter > input)
 Return an imagefilter which transforms its input by the given matrix.
 
- Static Public Member Functions inherited from SkFlattenable
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
 
- Protected Member Functions inherited from SkImageFilter
 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 CropRectgetCropRectIfSet () 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< SkImageFiltermakeColorSpace (SkColorSpaceXformer *xformer) const
 Returns an image filter transformed into a new color space via the |xformer|.
 
virtual sk_sp< SkImageFilteronMakeColorSpace (SkColorSpaceXformer *) const =0
 
- Protected Member Functions inherited from SkRefCntBase
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

- Public Types inherited from SkImageFilter
enum  TileUsage { kPossible_TileUsage, kNever_TileUsage }
 
enum  MapDirection { kForward_MapDirection, kReverse_MapDirection }
 
- Public Types inherited from SkFlattenable
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 &)
 
- Public Member Functions inherited from SkImageFilter
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).
 
SkImageFiltergetInput (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< SkImageFiltermakeWithLocalMatrix (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...
 
- Public Member Functions inherited from SkFlattenable
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...
 
- Public Member Functions inherited from SkRefCntBase
 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 Protected Member Functions inherited from SkImageFilter
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...
 

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