2013-01-15 15:40:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkDisplacementMapEffect_DEFINED
|
|
|
|
#define SkDisplacementMapEffect_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkImageFilter.h"
|
2013-01-15 15:40:19 +00:00
|
|
|
|
2019-07-26 15:16:00 +00:00
|
|
|
enum class SkColorChannel;
|
|
|
|
|
2019-08-01 20:02:27 +00:00
|
|
|
// DEPRECATED: Use include/effects/SkImageFilters::DisplacementMap
|
2019-07-30 14:03:16 +00:00
|
|
|
class SK_API SkDisplacementMapEffect {
|
2013-01-15 15:40:19 +00:00
|
|
|
public:
|
2019-07-26 15:16:00 +00:00
|
|
|
|
|
|
|
// DEPRECATED - Use SkColorChannel instead.
|
2013-01-15 15:40:19 +00:00
|
|
|
enum ChannelSelectorType {
|
|
|
|
kUnknown_ChannelSelectorType,
|
|
|
|
kR_ChannelSelectorType,
|
|
|
|
kG_ChannelSelectorType,
|
|
|
|
kB_ChannelSelectorType,
|
2018-01-24 19:39:38 +00:00
|
|
|
kA_ChannelSelectorType,
|
|
|
|
|
|
|
|
kLast_ChannelSelectorType = kA_ChannelSelectorType
|
2013-01-15 15:40:19 +00:00
|
|
|
};
|
|
|
|
|
2016-04-15 14:17:36 +00:00
|
|
|
static sk_sp<SkImageFilter> Make(ChannelSelectorType xChannelSelector,
|
|
|
|
ChannelSelectorType yChannelSelector,
|
|
|
|
SkScalar scale,
|
|
|
|
sk_sp<SkImageFilter> displacement,
|
|
|
|
sk_sp<SkImageFilter> color,
|
2019-07-30 14:03:16 +00:00
|
|
|
const SkImageFilter::CropRect* cropRect = nullptr);
|
2019-07-26 15:16:00 +00:00
|
|
|
static sk_sp<SkImageFilter> Make(SkColorChannel xChannelSelector,
|
|
|
|
SkColorChannel yChannelSelector,
|
|
|
|
SkScalar scale,
|
|
|
|
sk_sp<SkImageFilter> displacement,
|
|
|
|
sk_sp<SkImageFilter> color,
|
2019-07-30 14:03:16 +00:00
|
|
|
const SkImageFilter::CropRect* cropRect = nullptr);
|
2014-02-05 17:51:22 +00:00
|
|
|
|
2019-07-30 14:03:16 +00:00
|
|
|
static void RegisterFlattenables();
|
2014-03-10 10:51:58 +00:00
|
|
|
|
2013-01-15 15:40:19 +00:00
|
|
|
private:
|
2019-07-30 14:03:16 +00:00
|
|
|
SkDisplacementMapEffect() = delete;
|
2013-01-15 15:40:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|