SkAlphaThresholdFilter.h 992 B

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