// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
TEST(OpsinImageTest, VerifyZero) { // Test that black color (zero energy) is 0,0,0 in xyb. float x; float y; float b;
LinearSrgbToOpsin(0, 0, 0, &x, &y, &b);
EXPECT_NEAR(0, x, 1e-9);
EXPECT_NEAR(0, y, 1e-7);
EXPECT_NEAR(0, b, 1e-7);
}
TEST(OpsinImageTest, VerifyGray) { // Test that grayscale colors have a fixed y/b ratio and x==0. for (size_t i = 1; i < 255; i++) { float x; float y; float b;
LinearSrgbToOpsin(i / 255., i / 255., i / 255., &x, &y, &b);
EXPECT_NEAR(0, x, 1e-6);
EXPECT_NEAR(jxl::cms::kYToBRatio, b / y, 3e-5);
}
}
} // namespace
} // namespace jxl
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.