Chromium Code Reviews| Index: include/core/SkColorSpace.h |
| diff --git a/src/core/SkColorSpace.h b/include/core/SkColorSpace.h |
| similarity index 70% |
| rename from src/core/SkColorSpace.h |
| rename to include/core/SkColorSpace.h |
| index 299ffbca718abfd6ade4f5c7009c6dd6e8c537c1..12087f5e336d05b40cce498714d59996883d4554 100644 |
| --- a/src/core/SkColorSpace.h |
| +++ b/include/core/SkColorSpace.h |
| @@ -8,19 +8,6 @@ |
| #ifndef SkColorSpace_DEFINED |
| #define SkColorSpace_DEFINED |
| -// Some terms |
|
msarett
2016/05/20 15:36:07
I don't feel strongly about removing these comment
|
| -// |
| -// PCS : Profile Connection Space : where color number values have an absolute meaning. |
| -// Part of the work float is to convert colors to and from this space... |
| -// src_linear_unit_floats --> PCS --> PCS' --> dst_linear_unit_floats |
| -// |
| -// Some nice documents |
| -// |
| -// http://www.cambridgeincolour.com/tutorials/color-space-conversion.htm |
| -// https://www.w3.org/Graphics/Color/srgb |
| -// http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html |
| -// |
| - |
| #include "SkMatrix44.h" |
| #include "SkRefCnt.h" |
| #include "../private/SkTemplates.h" |
| @@ -32,6 +19,9 @@ struct SkGammas; |
| class SkColorSpace : public SkRefCnt { |
| public: |
| + /** |
| + * Common, named profiles that we can recognize. |
| + */ |
| enum Named { |
| kUnknown_Named, |
| kSRGB_Named, |
| @@ -39,21 +29,34 @@ public: |
| }; |
| /** |
| - * Given the src gamma and a transform from src gamut to D50_XYZ, return a SkColorSpace. |
| + * Create an SkColorSpace from the src gamma and a transform from src gamut to D50 XYZ. |
| */ |
| static sk_sp<SkColorSpace> NewRGB(float gammas[3], const SkMatrix44& toXYZD50); |
| + /** |
| + * Create a common, named SkColorSpace. |
| + */ |
| static sk_sp<SkColorSpace> NewNamed(Named); |
| + |
| + /** |
| + * Create an SkColorSpace from an ICC profile. |
| + */ |
| static sk_sp<SkColorSpace> NewICC(const void*, size_t); |
| /** |
| - * Used only by test code. |
| + * Used interally. |
| */ |
| SkGammas* gammas() const { return fGammas.get(); } |
| + /** |
| + * Returns the matrix used to transform src gamut to XYZ D50. |
| + */ |
| SkMatrix44 xyz() const { return fToXYZD50; } |
| + |
| + /** |
| + * Returns profile name or kUnknown if it does not match one of our known profiles. |
| + */ |
| Named named() const { return fNamed; } |
|
reed1
2016/05/20 21:10:44
do we need this guy?
msarett
2016/05/23 14:03:48
Not right now, I'm deleting it because no one is u
|
| - uint32_t uniqueID() const { return fUniqueID; } |
|
reed1
2016/05/20 21:10:44
Do we have an idea for the srgb-like query we're g
msarett
2016/05/23 14:03:48
Yeah I had an idea. I'll pull it in from another
|
| private: |
| @@ -72,8 +75,6 @@ private: |
| SkAutoTDelete<SkColorLookUpTable> fColorLUT; |
| sk_sp<SkGammas> fGammas; |
| const SkMatrix44 fToXYZD50; |
| - |
| - const uint32_t fUniqueID; |
| const Named fNamed; |
| }; |