1/*
2 * Copyright 2012 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkLightingImageFilter_DEFINED
9#define SkLightingImageFilter_DEFINED
10
11#include "include/core/SkColor.h"
12#include "include/core/SkImageFilter.h"
13
14struct SkPoint3;
15
16// DEPRECATED: Use include/effects/SkImageFilters::[Diffuse|Specular]Light[Distant|Point|Spot]
17class SK_API SkLightingImageFilter {
18public:
19 static sk_sp<SkImageFilter> MakeDistantLitDiffuse(const SkPoint3& direction,
20 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
21 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
22 static sk_sp<SkImageFilter> MakePointLitDiffuse(const SkPoint3& location,
23 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
24 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
25 static sk_sp<SkImageFilter> MakeSpotLitDiffuse(const SkPoint3& location,
26 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
27 SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
28 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
29 static sk_sp<SkImageFilter> MakeDistantLitSpecular(const SkPoint3& direction,
30 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
31 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
32 static sk_sp<SkImageFilter> MakePointLitSpecular(const SkPoint3& location,
33 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
34 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
35 static sk_sp<SkImageFilter> MakeSpotLitSpecular(const SkPoint3& location,
36 const SkPoint3& target, SkScalar specularExponent, SkScalar cutoffAngle,
37 SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess,
38 sk_sp<SkImageFilter> input, const SkImageFilter::CropRect* cropRect = nullptr);
39
40 static void RegisterFlattenables();
41
42private:
43 SkLightingImageFilter() = delete;
44};
45
46#endif
47