| 104 | } |
| 105 | |
| 106 | void HueCurveLin(OCIOGPUTest & test, OCIO::TransformDirection dir, bool dynamic) |
| 107 | { |
| 108 | // All curves are non-identities. |
| 109 | auto hh = OCIO::GradingBSplineCurve::Create( |
| 110 | { {0.05f, 0.15f}, {0.2f, 0.3f}, {0.35f, 0.4f}, {0.45f, 0.45f}, {0.6f, 0.7f}, {0.8f, 0.85f} }, |
| 111 | OCIO::HUE_HUE); |
| 112 | auto hs = OCIO::GradingBSplineCurve::Create( |
| 113 | { {-0.1f, 1.2f}, {0.2f, 0.7f}, {0.4f, 1.5f}, {0.5f, 0.5f}, {0.6f, 1.4f}, {0.8f, 0.7f} }, |
| 114 | OCIO::HUE_SAT); |
| 115 | auto hl = OCIO::GradingBSplineCurve::Create( |
| 116 | { {0.1f, 1.5f}, {0.2f, 0.7f}, {0.4f, 1.4f}, {0.5f, 0.8f}, {0.8f, 0.5f} }, |
| 117 | OCIO::HUE_LUM); |
| 118 | auto ss = OCIO::GradingBSplineCurve::Create( |
| 119 | { {0.f, 0.1f}, {0.5f, 0.45f}, {1.f, 1.1f} }, |
| 120 | OCIO::SAT_SAT); |
| 121 | auto hfx = OCIO::GradingBSplineCurve::Create( |
| 122 | { {0.2f, 0.05f}, {0.4f, -0.09f}, {0.6f, -0.2f}, { 0.8f, 0.05f}, {0.99f, -0.02f} }, |
| 123 | OCIO::HUE_FX); |
| 124 | // Adjust these two, relative to previous test, to work in f-stops. |
| 125 | auto ll = OCIO::GradingBSplineCurve::Create( |
| 126 | { {-8.f, -7.f}, {-2.f, -3.f}, {2.f, 3.5f}, {8.f, 7.f} }, |
| 127 | OCIO::LUM_LUM); |
| 128 | auto ls = OCIO::GradingBSplineCurve::Create( |
| 129 | { {-6.f, 0.9f}, {-3.f, 0.95f}, {0.f, 1.1f}, {2.f, 1.f}, {4.f, 0.6f}, {6.f, 0.55f} }, |
| 130 | OCIO::LUM_SAT); |
| 131 | // Adjusted this one, relative to above, to avoid some artifacts due to high sat boost. |
| 132 | auto sl = OCIO::GradingBSplineCurve::Create( |
| 133 | { {0.f, 1.2f}, {0.6f, 0.8f}, {0.9f, 1.05f}, {1.f, 1.1f} }, |
| 134 | OCIO::SAT_LUM); |
| 135 | |
| 136 | auto curve = OCIO::GradingHueCurve::Create(hh, hs, hl, ls, ss, ll, sl, hfx); |
| 137 | auto hc = OCIO::GradingHueCurveTransform::Create(OCIO::GRADING_LIN); |
| 138 | if(!hc.get()) |
| 139 | { |
| 140 | throw OCIO::Exception("Cannot create GradingHueCurveTransform."); |
| 141 | } |
| 142 | hc->setValue(curve); |
| 143 | hc->setDirection(dir); |
| 144 | if (dynamic) |
| 145 | { |
| 146 | hc->makeDynamic(); |
| 147 | } |
| 148 | |
| 149 | test.setProcessor(hc); |
| 150 | |
| 151 | // Set up a grid of RGBA custom values. |
| 152 | const int lut_size = 21; |
| 153 | OCIOGPUTest::CustomValues values; |
| 154 | // Choose values so that there is a grid point at 0. |
| 155 | GenerateIdentityLut3D(values, lut_size, -0.075f, 1.425f); |
| 156 | test.setCustomValues(values); |
| 157 | |
| 158 | // This test produces some large linear values due to the sat boost, needs a large tolerance. |
| 159 | // Metal is worse than GLSL. |
| 160 | test.setErrorThreshold(4e-4f); |
| 161 | test.setExpectedMinimalValue(1.0f); |
| 162 | test.setRelativeComparison(true); |
| 163 | } |
no test coverage detected