diff options
author | skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> | 2018-05-02 20:11:46 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-02 20:32:48 +0000 |
commit | 908ad22437a5926e7f417dfeb4446722c8dd57dc (patch) | |
tree | b31cf9011c4eb4d07002bd73e6d8421b061d9907 /third_party/skcms/src | |
parent | baf9e05233fa2c5694cb62c70be76483dd023a7b (diff) |
Roll skia/third_party/skcms baef14c..aee343c (1 commits)
https://skia.googlesource.com/skcms.git/+log/baef14c..aee343c
2018-05-02 brianosman@google.com Remove skcms_EnsureUsableAsDestination*
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.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=brianosman@google.com
Change-Id: Id25529fc96b68f69dc7baa346d3583710963ddbf
Reviewed-on: https://skia-review.googlesource.com/125390
Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Diffstat (limited to 'third_party/skcms/src')
-rw-r--r-- | third_party/skcms/src/Transform.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/third_party/skcms/src/Transform.c b/third_party/skcms/src/Transform.c index ae26e71804..33b8438655 100644 --- a/third_party/skcms/src/Transform.c +++ b/third_party/skcms/src/Transform.c @@ -622,39 +622,6 @@ static void assert_usable_as_destination(const skcms_ICCProfile* profile) { #endif } -void skcms_EnsureUsableAsDestination(skcms_ICCProfile* profile, const skcms_ICCProfile* fallback) { - assert_usable_as_destination(fallback); - - skcms_Matrix3x3 fromXYZD50; - if (!profile->has_toXYZD50 || !skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) { - profile->toXYZD50 = fallback->toXYZD50; - } - - for (int i = 0; i < 3; i++) { - skcms_TransferFunction inv; - if (profile->has_trc && profile->trc[i].table_entries == 0 - && skcms_TransferFunction_invert(&profile->trc[i].parametric, &inv)) { - continue; - } - - // Note there's a little gap here that we could fill by allowing fitting - // parametric curves to non-invertible parametric curves. - - float max_error; - skcms_TransferFunction tf = fallback->trc[i].parametric; - // Parametric curves from skcms_ApproximateCurve() are guaranteed to be invertible. - // If approximation fails, tf will still hold fallback's parametric TRC curve. - (void)skcms_ApproximateCurve(&profile->trc[i], &tf, &max_error); - profile->trc[i].table_entries = 0; - profile->trc[i].parametric = tf; - } - - profile->has_toXYZD50 = true; - profile->has_trc = true; - - assert_usable_as_destination(profile); -} - static float max_roundtrip_error(const skcms_TransferFunction* inv_tf, const skcms_Curve* curve) { int N = curve->table_entries ? (int)curve->table_entries : 256; const float x_scale = 1.0f / (N - 1); @@ -667,37 +634,6 @@ static float max_roundtrip_error(const skcms_TransferFunction* inv_tf, const skc return err; } -void skcms_EnsureUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile, - const skcms_ICCProfile* fallback) { - // Operate on a copy of profile, so we can choose the best TF for the original curves - skcms_ICCProfile result = *profile; - skcms_EnsureUsableAsDestination(&result, fallback); - - int best_tf = 0; - float min_max_error = INFINITY_; - const skcms_ICCProfile* ref = profile->has_trc ? profile : fallback; - for (int i = 0; i < 3; i++) { - skcms_TransferFunction inv; - skcms_TransferFunction_invert(&result.trc[i].parametric, &inv); - - float err = 0; - for (int j = 0; j < 3; ++j) { - err = fmaxf_(err, max_roundtrip_error(&inv, &ref->trc[j])); - } - if (min_max_error > err) { - min_max_error = err; - best_tf = i; - } - } - - for (int i = 0; i < 3; i++) { - result.trc[i].parametric = result.trc[best_tf].parametric; - } - - *profile = result; - assert_usable_as_destination(profile); -} - bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile) { skcms_Matrix3x3 fromXYZD50; if (!profile->has_trc || !profile->has_toXYZD50 |