1/*
2 * Copyright 2013 Google Inc.
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 SkDisplacementMapEffect_DEFINED
9#define SkDisplacementMapEffect_DEFINED
10
11#include "include/core/SkImageFilter.h"
12
13enum class SkColorChannel;
14
15// DEPRECATED: Use include/effects/SkImageFilters::DisplacementMap
16class SK_API SkDisplacementMapEffect {
17public:
18
19 // DEPRECATED - Use SkColorChannel instead.
20 enum ChannelSelectorType {
21 kUnknown_ChannelSelectorType,
22 kR_ChannelSelectorType,
23 kG_ChannelSelectorType,
24 kB_ChannelSelectorType,
25 kA_ChannelSelectorType,
26
27 kLast_ChannelSelectorType = kA_ChannelSelectorType
28 };
29
30 static sk_sp<SkImageFilter> Make(ChannelSelectorType xChannelSelector,
31 ChannelSelectorType yChannelSelector,
32 SkScalar scale,
33 sk_sp<SkImageFilter> displacement,
34 sk_sp<SkImageFilter> color,
35 const SkImageFilter::CropRect* cropRect = nullptr);
36 static sk_sp<SkImageFilter> Make(SkColorChannel xChannelSelector,
37 SkColorChannel yChannelSelector,
38 SkScalar scale,
39 sk_sp<SkImageFilter> displacement,
40 sk_sp<SkImageFilter> color,
41 const SkImageFilter::CropRect* cropRect = nullptr);
42
43 static void RegisterFlattenables();
44
45private:
46 SkDisplacementMapEffect() = delete;
47};
48
49#endif
50