OLD | NEW |
(Empty) | |
| 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 SkColorSpace_XYZ_DEFINED |
| 9 #define SkColorSpace_XYZ_DEFINED |
| 10 |
| 11 #include "SkColorSpace_Base.h" |
| 12 #include "SkData.h" |
| 13 #include "SkOnce.h" |
| 14 |
| 15 class SkColorSpace_XYZ : public SkColorSpace_Base { |
| 16 public: |
| 17 const SkMatrix44* toXYZD50() const override { return &fToXYZD50; } |
| 18 |
| 19 const SkMatrix44* fromXYZD50() const override; |
| 20 |
| 21 bool onGammaCloseToSRGB() const override; |
| 22 |
| 23 bool onGammaIsLinear() const override; |
| 24 |
| 25 Type type() const override { return Type::kXYZ; } |
| 26 |
| 27 sk_sp<SkColorSpace> makeLinearGamma(); |
| 28 |
| 29 SkGammaNamed gammaNamed() const { return fGammaNamed; } |
| 30 |
| 31 const SkGammas* gammas() const { return fGammas.get(); } |
| 32 |
| 33 void toDstGammaTables(const uint8_t* tables[3], sk_sp<SkData>* storage, int
numTables) const; |
| 34 |
| 35 private: |
| 36 SkColorSpace_XYZ(SkGammaNamed gammaNamed, const SkMatrix44& toXYZ); |
| 37 |
| 38 SkColorSpace_XYZ(SkGammaNamed gammaNamed, sk_sp<SkGammas> gammas, |
| 39 const SkMatrix44& toXYZ, sk_sp<SkData> profileData); |
| 40 |
| 41 const SkGammaNamed fGammaNamed; |
| 42 sk_sp<SkGammas> fGammas; |
| 43 const SkMatrix44 fToXYZD50; |
| 44 |
| 45 mutable SkMatrix44 fFromXYZD50; |
| 46 mutable SkOnce fFromXYZOnce; |
| 47 |
| 48 mutable sk_sp<SkData> fDstStorage; |
| 49 mutable const uint8_t* fToDstGammaTables[3]; |
| 50 mutable SkOnce fToDstGammaOnce; |
| 51 |
| 52 friend class SkColorSpace; |
| 53 friend class SkColorSpace_Base; |
| 54 friend class ColorSpaceXformTest; |
| 55 typedef SkColorSpace_Base INHERITED; |
| 56 }; |
| 57 |
| 58 #endif |
OLD | NEW |