1 /* 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 13 struct ArithmeticFPInputs { ArithmeticFPInputsArithmeticFPInputs14 ArithmeticFPInputs() { 15 memset(this, 0, sizeof(*this)); 16 } 17 18 float k[4]; 19 bool enforcePMColor; 20 }; 21 22 class SK_API SkArithmeticImageFilter { 23 public: 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); 28 29 static void RegisterFlattenables(); 30 31 private: 32 SkArithmeticImageFilter(); // can't instantiate 33 }; 34 35 #endif 36