Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13a20a27 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't clamp when converting to XYZ"

parents e52d9e2a 597cd600
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -99,11 +99,10 @@ public:
    /**
     * Converts the supplied RGB value to XYZ. The input RGB value
     * is decoded using this color space's electro-optical function
     * before being converted to XYZ. The returned result is clamped
     * by this color space's clamping function.
     * before being converted to XYZ.
     */
    constexpr float3 rgbToXYZ(const float3& rgb) const noexcept {
        return apply(mRGBtoXYZ * toLinear(rgb), mClamper);
        return mRGBtoXYZ * toLinear(rgb);
    }

    constexpr const std::string& getName() const noexcept {
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ TEST_F(ColorSpaceTest, TransferFunctions) {

TEST_F(ColorSpaceTest, Clamping) {
    // Pick a color outside of sRGB
    float3 c(ColorSpace::DCIP3().rgbToXYZ(float3{0, 1, 0}));
    float3 c(ColorSpace::BT2020().rgbToXYZ(float3{0, 1, 0}));

    // The color will be clamped
    float3 sRGB(ColorSpace::sRGB().xyzToRGB(c));