aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorSpacePriv.h
diff options
context:
space:
mode:
authorGravatar Ravi Mistry <rmistry@google.com>2016-12-17 01:26:51 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-17 01:27:10 +0000
commiteb733fbf56538838a36814c75cd03f917462cb22 (patch)
tree2ac19e158200809964bffad6d5ca1794c84c4d8f /src/core/SkColorSpacePriv.h
parent2ee084e73056b0ad76b721017f576168b7306da3 (diff)
Revert "WIP: Skia support library for ICC tasks"
This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab. Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds. Example tasks: * https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10 * https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10 Original change's description: > WIP: Skia support library for ICC tasks > > As a starting point, this would be mostly trivial to implement using > SkColorSpace. > > This also would give us the flexibility to begin to move all of > the ICC related code from SkColorSpace to SkICC. > > What are the advantages of moving this away from SkColorSpace? > (1) A long term goal (once Chrome uses SkCodec), might be to > move SkColorSpace::MakeICC() out of the public API. That way, > we can guarantee that we can draw to/from *any* SkColorSpace. > (2) Keeps SkColorSpace separate from ICC-specific representations > like SkColorSpaceTransferFn etc. > > BUG=skia: > > Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165 > Reviewed-on: https://skia-review.googlesource.com/5676 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856 Reviewed-on: https://skia-review.googlesource.com/6232 Commit-Queue: Ravi Mistry <rmistry@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'src/core/SkColorSpacePriv.h')
-rw-r--r--src/core/SkColorSpacePriv.h51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/core/SkColorSpacePriv.h b/src/core/SkColorSpacePriv.h
index 32981ae875..73038738ff 100644
--- a/src/core/SkColorSpacePriv.h
+++ b/src/core/SkColorSpacePriv.h
@@ -5,22 +5,14 @@
* found in the LICENSE file.
*/
-#include <math.h>
-
#define SkColorSpacePrintf(...)
static inline bool color_space_almost_equal(float a, float b) {
return SkTAbs(a - b) < 0.01f;
}
-static inline float add_epsilon(float v) {
- return v + FLT_MIN;
-}
-
static inline bool is_zero_to_one(float v) {
- // Because we allow a value just barely larger than 1, the client can use an
- // entirely linear transfer function.
- return (0.0f <= v) && (v <= add_epsilon(1.0f));
+ return (0.0f <= v) && (v <= 1.0f);
}
static inline bool is_valid_transfer_fn(const SkColorSpaceTransferFn& coeffs) {
@@ -92,44 +84,3 @@ static inline bool is_almost_2dot2(const SkColorSpaceTransferFn& coeffs) {
color_space_almost_equal(0.0f, coeffs.fF) &&
color_space_almost_equal(2.2f, coeffs.fG);
}
-
-static inline void value_to_parametric(SkColorSpaceTransferFn* coeffs, float exponent) {
- coeffs->fA = 1.0f;
- coeffs->fB = 0.0f;
- coeffs->fC = 0.0f;
- coeffs->fD = 0.0f;
- coeffs->fE = 0.0f;
- coeffs->fF = 0.0f;
- coeffs->fG = exponent;
-}
-
-static inline bool named_to_parametric(SkColorSpaceTransferFn* coeffs,
- SkGammaNamed gammaNamed) {
- switch (gammaNamed) {
- case kSRGB_SkGammaNamed:
- coeffs->fA = 1.0f / 1.055f;
- coeffs->fB = 0.055f / 1.055f;
- coeffs->fC = 0.0f;
- coeffs->fD = 0.04045f;
- coeffs->fE = 1.0f / 12.92f;
- coeffs->fF = 0.0f;
- coeffs->fG = 2.4f;
- return true;
- case k2Dot2Curve_SkGammaNamed:
- value_to_parametric(coeffs, 2.2f);
- return true;
- case kLinear_SkGammaNamed:
- coeffs->fA = 0.0f;
- coeffs->fB = 0.0f;
- coeffs->fC = 0.0f;
- // Make sure that we use the linear segment of the transfer function even
- // when the x-value is 1.0f.
- coeffs->fD = add_epsilon(1.0f);
- coeffs->fE = 1.0f;
- coeffs->fF = 0.0f;
- coeffs->fG = 0.0f;
- return true;
- default:
- return false;
- }
-}