blob: b0d01938f9de24d14e63bcd044596bbdd23aad31 [file] [log] [blame]
Brian Salomon89cb8212017-01-09 10:48:23 -05001/*
2 * Copyright 2016 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 SkArithmeticImageFilter_DEFINED
9#define SkArithmeticImageFilter_DEFINED
10
11#include "SkImageFilter.h"
12
Ethan Nicholasce008112018-08-30 09:19:50 -040013struct ArithmeticFPInputs {
Ethan Nicholas545aa932018-08-31 11:21:16 -040014 ArithmeticFPInputs() {
15 memset(this, 0, sizeof(*this));
16 }
17
Ethan Nicholasce008112018-08-30 09:19:50 -040018 float k[4];
19 bool enforcePMColor;
20};
21
Brian Salomon89cb8212017-01-09 10:48:23 -050022class SK_API SkArithmeticImageFilter {
23public:
24 static sk_sp<SkImageFilter> Make(float k1, float k2, float k3, float k4, bool enforcePMColor,
25 sk_sp<SkImageFilter> background,
26 sk_sp<SkImageFilter> foreground,
27 const SkImageFilter::CropRect* cropRect);
Brian Salomon89cb8212017-01-09 10:48:23 -050028
Cary Clark4dc5a452018-05-21 11:56:57 -040029 static void InitializeFlattenables();
Brian Salomon89cb8212017-01-09 10:48:23 -050030
31private:
32 SkArithmeticImageFilter(); // can't instantiate
33};
34
35#endif