OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkColorMatrix_DEFINED | 8 #ifndef SkColorMatrix_DEFINED |
9 #define SkColorMatrix_DEFINED | 9 #define SkColorMatrix_DEFINED |
10 | 10 |
11 #include "SkScalar.h" | 11 #include "SkScalar.h" |
12 | 12 |
13 class SK_API SkColorMatrix { | 13 class SK_API SkColorMatrix { |
14 public: | 14 public: |
15 SkScalar fMat[20]; | 15 enum { |
| 16 kCount = 20 |
| 17 }; |
| 18 SkScalar fMat[kCount]; |
16 | 19 |
17 enum Elem { | 20 enum Elem { |
18 kR_Scale = 0, | 21 kR_Scale = 0, |
19 kG_Scale = 6, | 22 kG_Scale = 6, |
20 kB_Scale = 12, | 23 kB_Scale = 12, |
21 kA_Scale = 18, | 24 kA_Scale = 18, |
22 | 25 |
23 kR_Trans = 4, | 26 kR_Trans = 4, |
24 kG_Trans = 9, | 27 kG_Trans = 9, |
25 kB_Trans = 14, | 28 kB_Trans = 14, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); | 61 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); |
59 } | 62 } |
60 | 63 |
61 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } | 64 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } |
62 | 65 |
63 static bool NeedsClamping(const SkScalar[20]); | 66 static bool NeedsClamping(const SkScalar[20]); |
64 static void SetConcat(SkScalar result[20], const SkScalar outer[20], const S
kScalar inner[20]); | 67 static void SetConcat(SkScalar result[20], const SkScalar outer[20], const S
kScalar inner[20]); |
65 }; | 68 }; |
66 | 69 |
67 #endif | 70 #endif |
OLD | NEW |