Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 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 SkColorSpace_DEFINED | 8 #ifndef SkColorSpace_DEFINED |
| 9 #define SkColorSpace_DEFINED | 9 #define SkColorSpace_DEFINED |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 | 28 |
| 29 void dump() const; | 29 void dump() const; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 struct SkFloat3x3 { | 32 struct SkFloat3x3 { |
| 33 float fMat[9]; | 33 float fMat[9]; |
| 34 | 34 |
| 35 void dump() const; | 35 void dump() const; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 struct SkColorLUT { | |
|
scroggo
2016/04/27 20:18:46
LookUpTable?
msarett
2016/04/27 21:17:58
sgtm
| |
| 39 static const uint8_t kMaxChannels = 16; | |
| 40 | |
| 41 uint8_t fInputChannels; | |
| 42 uint8_t fOutputChannels; | |
| 43 uint8_t fGridPoints[kMaxChannels]; | |
| 44 std::unique_ptr<float[]> fTable; | |
|
scroggo
2016/04/27 20:18:46
Are we already switching to unique_ptr?
msarett
2016/04/27 21:17:58
Is there a skia pointer that would work equally we
scroggo
2016/04/28 12:16:02
I know Ben was trying to convince us to switch fro
| |
| 45 | |
| 46 SkColorLUT() {} | |
|
scroggo
2016/04/27 20:18:46
Can you rely on the generated version? On the othe
msarett
2016/04/27 21:17:58
I added this constructor in order to make this fie
scroggo
2016/04/28 12:16:02
sgtm
| |
| 47 }; | |
| 48 | |
| 38 struct SkPM4f; | 49 struct SkPM4f; |
| 39 void SkApply3x3ToPM4f(const SkFloat3x3&, const SkPM4f src[], SkPM4f dst[], int c ount); | 50 void SkApply3x3ToPM4f(const SkFloat3x3&, const SkPM4f src[], SkPM4f dst[], int c ount); |
| 40 | 51 |
| 41 class SkColorSpace : public SkRefCnt { | 52 class SkColorSpace : public SkRefCnt { |
| 42 public: | 53 public: |
| 43 enum Named { | 54 enum Named { |
| 44 kUnknown_Named, | 55 kUnknown_Named, |
| 45 kDevice_Named, | 56 kDevice_Named, |
| 46 kSRGB_Named, | 57 kSRGB_Named, |
| 47 }; | 58 }; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 68 | 79 |
| 69 /** | 80 /** |
| 70 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB | 81 * Given a src and dst colorspace, return the 3x3 matrix that will convert src_linear_RGB |
| 71 * values into dst_linear_RGB values. | 82 * values into dst_linear_RGB values. |
| 72 */ | 83 */ |
| 73 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result); | 84 static Result Concat(const SkColorSpace* src, const SkColorSpace* dst, SkFlo at3x3* result); |
| 74 | 85 |
| 75 static void Test(); | 86 static void Test(); |
| 76 void dump() const; | 87 void dump() const; |
| 77 | 88 |
| 78 protected: | 89 private: |
| 79 SkColorSpace(const SkFloat3x3& toXYZ, const SkFloat3& gamma, Named); | 90 SkColorSpace(const SkFloat3& gamma, const SkFloat3x3& toXYZ, Named); |
|
msarett
2016/04/27 18:56:45
Reversed the order here to match the new construct
scroggo
2016/04/27 20:18:46
sgtm
| |
| 80 | 91 |
| 81 private: | 92 SkColorSpace(SkColorLUT colorLUT, const SkFloat3& gamma, const SkFloat3x3& t oXYZ, |
| 93 const SkFloat3& toXYZOffset); | |
| 94 | |
| 95 const SkColorLUT fColorLUT; | |
| 96 const SkFloat3 fGamma; | |
| 82 const SkFloat3x3 fToXYZD50; | 97 const SkFloat3x3 fToXYZD50; |
| 83 const SkFloat3 fGamma; | 98 const SkFloat3 fToXYZOffset; |
| 99 | |
| 84 const uint32_t fUniqueID; | 100 const uint32_t fUniqueID; |
| 85 const Named fNamed; | 101 const Named fNamed; |
| 86 }; | 102 }; |
| 87 | 103 |
| 88 #endif | 104 #endif |
| OLD | NEW |