aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/skcms/skcms.h
diff options
context:
space:
mode:
authorGravatar skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>2018-04-23 18:57:32 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-23 19:20:10 +0000
commit3315f7e9c635a3277e8457c77cb9813aae8db5dc (patch)
tree25169e434275d114cf1a10096a89ce5b3b4d2249 /third_party/skcms/skcms.h
parent9ad12134c90eabd920012772ab63b90ad3636ec0 (diff)
Roll skia/third_party/skcms fe14a6a..e8bc226 (1 commits)
https://skia.googlesource.com/skcms.git/+log/fe14a6a..e8bc226 2018-04-23 mtklein@chromium.org skcms_OptimizeForSpeed() The AutoRoll server is located here: https://skcms-skia-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary. TBR=stani@google.com Change-Id: Ib0c40a1dc5314ee6ca18da6ddac9895977c12bdc Reviewed-on: https://skia-review.googlesource.com/123072 Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Diffstat (limited to 'third_party/skcms/skcms.h')
-rw-r--r--third_party/skcms/skcms.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/third_party/skcms/skcms.h b/third_party/skcms/skcms.h
index 08779a40e6..9c25b1d538 100644
--- a/third_party/skcms/skcms.h
+++ b/third_party/skcms/skcms.h
@@ -73,6 +73,12 @@ typedef struct skcms_A2B {
skcms_Curve output_curves[3];
} skcms_A2B;
+// A specialized approximation for transfer functions with gamma between 1 and 3.
+// f(x) = sign(x) * (A|x|^3 + B|x|^2 + (1-A-B)|x|)
+typedef struct skcms_TF13 {
+ float A,B;
+} skcms_TF13;
+
typedef struct skcms_ICCProfile {
const uint8_t* buffer;
@@ -97,6 +103,10 @@ typedef struct skcms_ICCProfile {
// and has_A2B to true.
bool has_A2B;
skcms_A2B A2B;
+
+ // If has_trc, we may be able to approximate the curves more efficiently.
+ bool has_tf13[3];
+ skcms_TF13 tf13[3];
} skcms_ICCProfile;
// The sRGB color profile is so commonly used that we offer a canonical skcms_ICCProfile for it.
@@ -114,15 +124,13 @@ bool skcms_ApproximatelyEqualProfiles(const skcms_ICCProfile* A, const skcms_ICC
// will be used.
bool skcms_Parse(const void*, size_t, skcms_ICCProfile*);
+// skcms_Parse() creates a profile that directs skcms_Transform() to favor accuracy.
+// If you want to trade a little accuracy for a big speedup, call skcms_OptimizeForSpeed().
+void skcms_OptimizeForSpeed(skcms_ICCProfile*);
+
bool skcms_ApproximateCurve(const skcms_Curve* curve, skcms_TransferFunction* approx,
float* max_error);
-// A specialized approximation for transfer functions with gamma between 1 and 3.
-// f(x) = Ax^3 + Bx^2 + (1-A-B)x
-typedef struct skcms_TF13 {
- float A,B;
-} skcms_TF13;
-
bool skcms_ApproximateCurve13(const skcms_Curve* curve, skcms_TF13* approx, float* max_error);
// What is the best single transfer function to use for the given profile? Note that there is