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 SkScalar fMat[20]; |
16 | 16 |
17 enum Elem { | 17 enum Elem { |
18 kR_Scale = 0, | 18 kR_Scale = 0, |
19 kG_Scale = 6, | 19 kG_Scale = 6, |
20 kB_Scale = 12, | 20 kB_Scale = 12, |
21 kA_Scale = 18, | 21 kA_Scale = 18, |
22 | 22 |
23 kR_Trans = 4, | 23 kR_Trans = 4, |
24 kG_Trans = 9, | 24 kG_Trans = 9, |
25 kB_Trans = 14, | 25 kB_Trans = 14, |
26 kA_Trans = 19, | 26 kA_Trans = 19, |
27 }; | 27 }; |
28 | 28 |
29 void setIdentity(); | 29 void setIdentity(); |
30 void setScale(SkScalar rScale, SkScalar gScale, SkScalar bScale, | 30 void setScale(SkScalar rScale, SkScalar gScale, SkScalar bScale, |
31 SkScalar aScale = SK_Scalar1); | 31 SkScalar aScale = SK_Scalar1); |
32 void preScale(SkScalar rScale, SkScalar gScale, SkScalar bScale, | 32 void preScale(SkScalar rScale, SkScalar gScale, SkScalar bScale, |
(...skipping 22 matching lines...) Expand all Loading... |
55 void setYUV2RGB(); | 55 void setYUV2RGB(); |
56 | 56 |
57 bool operator==(const SkColorMatrix& other) const { | 57 bool operator==(const SkColorMatrix& other) const { |
58 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); | 58 return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); |
59 } | 59 } |
60 | 60 |
61 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } | 61 bool operator!=(const SkColorMatrix& other) const { return !((*this) == othe
r); } |
62 }; | 62 }; |
63 | 63 |
64 #endif | 64 #endif |
OLD | NEW |