diff options
author | 2014-01-06 23:41:14 +0000 | |
---|---|---|
committer | 2014-01-06 23:41:14 +0000 | |
commit | 40eb3c100095c8573ddfdc553794b3182d7b18d1 (patch) | |
tree | 1281db57bbea49e8d4c3198af170a64156b8646e /include | |
parent | f6c8aeb1749be4b313dcf96f51152f01ffa325a0 (diff) |
Add AlphaThreshold filter.
This is based on the Bitmap Alpha Threshold filter, and will be used by Chromium
to implement the window shape API.
R=bsalomon@chromium.org, wez@chromium.org, bsalomon@google.com, reed@google.com
Author: zork@chromium.org
Review URL: https://codereview.chromium.org/115633002
git-svn-id: http://skia.googlecode.com/svn/trunk@12935 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/effects/SkAlphaThresholdFilter.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/effects/SkAlphaThresholdFilter.h b/include/effects/SkAlphaThresholdFilter.h new file mode 100644 index 0000000000..23af56fc54 --- /dev/null +++ b/include/effects/SkAlphaThresholdFilter.h @@ -0,0 +1,26 @@ +/* + * 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 SkAlphaThresholdFilter_DEFINED +#define SkAlphaThresholdFilter_DEFINED + +#include "SkRegion.h" +#include "SkImageFilter.h" + +class SK_API SkAlphaThresholdFilter { +public: + /** + * Creates an image filter that samples a region. If the sample is inside the + * region the alpha of the image is boosted up to a threshold value. If it is + * outside the region then the alpha is decreased to the threshold value. + * The 0,0 point of the region corresponds to the upper left corner of the + * source image. + */ + static SkImageFilter* Create(const SkRegion& region, SkScalar innerThreshold, SkScalar outerThreshold); +}; + +#endif |