skia2/include/effects/SkBlenders.h
Mike Reed 26ea975e6c Arithmetic blender
... to aid in removing special ArithmeticImageFilter.

Can we use something like this to reimpl the ArithmeticImageFilter
--> BlenderImageFilter?

I see some special checking in filterBounds for ArithIF -- is that
required? Is that generalizable for any BlenderImageFilter?
If we can generalize blend[er]imagefilter, let's just move this
logic into Chrome -- no need for Arithmetic to appear in Skia
in any form!

Re: https://skia-review.googlesource.com/c/skia/+/424436

Change-Id: Ifa0ff2fa25de6385f6f60505e73ecc28463a80b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424417
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-08 17:06:17 +00:00

28 lines
693 B
C++

/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBlenders_DEFINED
#define SkBlenders_DEFINED
#include "include/core/SkBlender.h"
class SK_API SkBlenders {
public:
/**
* Create a blender that implements the following:
* k1 * src * dst + k2 * src + k3 * dst + k4
* @param k1, k2, k3, k4 The four coefficients.
* @param enforcePMColor If true, the RGB channels will be clamped to the calculated alpha.
*/
static sk_sp<SkBlender> Arithmetic(float k1, float k2, float k3, float k4, bool enforcePremul);
private:
SkBlenders() = delete;
};
#endif