#ifndef FEDisplacementMap_h
#define FEDisplacementMap_h
#include "platform/graphics/filters/Filter.h"
#include "platform/graphics/filters/FilterEffect.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
enum ChannelSelectorType {
CHANNEL_UNKNOWN = 0,
CHANNEL_R = 1,
CHANNEL_G = 2,
CHANNEL_B = 3,
CHANNEL_A = 4
};
class PLATFORM_EXPORT FEDisplacementMap : public FilterEffect {
public:
static PassRefPtr<FEDisplacementMap> create(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
ChannelSelectorType xChannelSelector() const;
bool setXChannelSelector(const ChannelSelectorType);
ChannelSelectorType yChannelSelector() const;
bool setYChannelSelector(const ChannelSelectorType);
float scale() const;
bool setScale(float);
virtual void setResultColorSpace(ColorSpace) OVERRIDE;
virtual void transformResultColorSpace(FilterEffect*, const int) OVERRIDE;
virtual FloatRect mapPaintRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
virtual TextStream& externalRepresentation(TextStream&, int indention) const OVERRIDE;
private:
FEDisplacementMap(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
virtual void applySoftware() OVERRIDE;
virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
ChannelSelectorType m_xChannelSelector;
ChannelSelectorType m_yChannelSelector;
float m_scale;
};
}
#endif