8 #ifndef SkLightingImageFilter_DEFINED
9 #define SkLightingImageFilter_DEFINED
11 #include "SkImageFilter.h"
15 class SkImageFilterLight;
21 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
24 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
27 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
28 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
31 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
34 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
37 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
38 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
42 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
44 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
46 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
48 return MakeDistantLitDiffuse(direction, lightColor, surfaceScale, kd,
49 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
52 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
54 return MakePointLitDiffuse(location, lightColor, surfaceScale, kd,
55 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
58 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
59 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
61 return MakeSpotLitDiffuse(location, target, specularExponent, cutoffAngle,
62 lightColor, surfaceScale, kd,
63 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
66 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
68 return MakeDistantLitSpecular(direction, lightColor, surfaceScale, ks, shininess,
69 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
72 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
74 return MakePointLitSpecular(location, lightColor, surfaceScale, ks, shininess,
75 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
78 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
79 SkColor lightColor, SkScalar surfaceScale, SkScalar ks,
81 return MakeSpotLitSpecular(location, target, specularExponent, cutoffAngle,
82 lightColor, surfaceScale, ks, shininess,
83 sk_ref_sp<SkImageFilter>(input), cropRect).
release();
89 SkScalar surfaceScale,
93 const SkImageFilterLight* light()
const {
return fLight.get(); }
94 SkScalar surfaceScale()
const {
return fSurfaceScale; }
95 bool affectsTransparentBlack()
const override {
return true; }
99 SkScalar fSurfaceScale;
T *SK_WARN_UNUSED_RESULT release()
Return the bare pointer, and set the internal object pointer to nullptr.
Definition: SkRefCnt.h:363
Definition: SkLightingImageFilter.h:18
Definition: SkImageFilter.h:55
Definition: SkPoint3.h:13
void flatten(SkWriteBuffer &) const override
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
Definition: SkRefCnt.h:135
Base class for image filters.
Definition: SkImageFilter.h:35
uint32_t SkColor
32 bit ARGB color value, not premultiplied.
Definition: SkColor.h:28
Definition: SkWriteBuffer.h:26
Types and macros for colors.