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 SkAlphaThresholdFilter_DEFINED
9#define SkAlphaThresholdFilter_DEFINED
10
11#include "SkImageFilter.h"
12
13class SkRegion;
14
15class SK_API SkAlphaThresholdFilter {
16public:
17    /**
18     * Creates an image filter that samples a region. If the sample is inside the
19     * region the alpha of the image is boosted up to a threshold value. If it is
20     * outside the region then the alpha is decreased to the threshold value.
21     * The 0,0 point of the region corresponds to the upper left corner of the
22     * source image.
23     */
24    static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin,
25                                     SkScalar outerMax, sk_sp<SkImageFilter> input,
26                                     const SkImageFilter::CropRect* cropRect = nullptr);
27
28
29    SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
30};
31
32#endif
33