gfx/skia/trunk/include/effects/SkArithmeticMode.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/effects/SkArithmeticMode.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +/*
     1.5 + * Copyright 2011 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef SkArithmeticMode_DEFINED
    1.12 +#define SkArithmeticMode_DEFINED
    1.13 +
    1.14 +#include "SkFlattenable.h"
    1.15 +#include "SkScalar.h"
    1.16 +
    1.17 +class SkXfermode;
    1.18 +
    1.19 +class SK_API SkArithmeticMode {
    1.20 +public:
    1.21 +    /**
    1.22 +     *  result = clamp[k1 * src * dst + k2 * src + k3 * dst + k4]
    1.23 +     *
    1.24 +     *  src and dst are treated as being [0.0 .. 1.0]. The polynomial is
    1.25 +     *  evaluated on their unpremultiplied components.
    1.26 +     *
    1.27 +     *  k1=k2=k3=0, k4=1.0 results in returning opaque white
    1.28 +     *  k1=k3=k4=0, k2=1.0 results in returning the src
    1.29 +     *  k1=k2=k4=0, k3=1.0 results in returning the dst
    1.30 +     */
    1.31 +    static SkXfermode* Create(SkScalar k1, SkScalar k2,
    1.32 +                              SkScalar k3, SkScalar k4);
    1.33 +
    1.34 +    SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
    1.35 +
    1.36 +private:
    1.37 +    SkArithmeticMode(); // can't be instantiated
    1.38 +};
    1.39 +
    1.40 +#endif

mercurial