blob: 884efff389439a30ee60b4308db89c392aeecf1c [file] [log] [blame]
commit-bot@chromium.org40eb3c12014-01-06 23:41:14 +00001/*
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
commit-bot@chromium.org40eb3c12014-01-06 23:41:14 +000011#include "SkImageFilter.h"
robertphillipsf7142e72016-04-18 07:20:05 -070012
13class SkRegion;
commit-bot@chromium.org40eb3c12014-01-06 23:41:14 +000014
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 */
robertphillipsf6242042016-04-01 10:34:43 -070024 static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin,
robertphillipsaf9b8c82016-04-12 11:02:25 -070025 SkScalar outerMax, sk_sp<SkImageFilter> input,
26 const SkImageFilter::CropRect* cropRect = nullptr);
robertphillipsf6242042016-04-01 10:34:43 -070027
28
Cary Clark4dc5a452018-05-21 11:56:57 -040029 static void InitializeFlattenables();
commit-bot@chromium.org40eb3c12014-01-06 23:41:14 +000030};
31
32#endif