Skip to content

Commit

Permalink
Fix hue curve unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Walker <[email protected]>
  • Loading branch information
doug-walker committed Oct 26, 2024
1 parent fc2444f commit 9b1605c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/OpenColorIO/ops/fixedfunction/FixedFunctionOpCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ void applyHSYToRGB(const void * inImg, void * outImg, long numPixels, float min0
const float * in = (const float *)inImg;
float * out = (float *)outImg;

for(unsigned idx=0; idx<numPixels; ++idx)
for(long idx=0; idx<numPixels; ++idx)
{
float hue = in[0] - 1.f/6.f;
float sat = in[1];
Expand Down Expand Up @@ -1658,7 +1658,7 @@ void applyRGBToHSY(const void * inImg, void * outImg, long numPixels, float min0
const float loGain = 5.f;
const float satLo = distRgb * loGain;
const float maxLum = 0.01f;
const float minLum = maxLum * 0.1;
const float minLum = maxLum * 0.1f;
const float alpha = CLAMP( (luma - minLum) / (maxLum - minLum), 0.f, 1.f );
sat = satLo + alpha * (satHi - satLo);
sat *= 1.4f;
Expand Down
12 changes: 6 additions & 6 deletions tests/osl/FixedFunctionOp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSV_inv_custom)
m_data->m_threshold = 1e-6f;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LIN_fwd)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_LIN_fwd)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_LIN);
Expand All @@ -414,7 +414,7 @@ OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LIN_fwd)
m_data->m_relativeComparison = true;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LIN_inv)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_LIN_inv)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_LIN);
Expand All @@ -426,7 +426,7 @@ OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LIN_inv)
m_data->m_relativeComparison = true;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LOG_fwd)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_LOG_fwd)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_LOG);
Expand All @@ -438,7 +438,7 @@ OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LOG_fwd)
m_data->m_relativeComparison = true;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LOG_inv)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_LOG_inv)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_LOG);
Expand All @@ -450,7 +450,7 @@ OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_LOG_inv)
m_data->m_relativeComparison = true;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_VID_fwd)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_VID_fwd)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_VID);
Expand All @@ -462,7 +462,7 @@ OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_VID_fwd)
m_data->m_relativeComparison = true;
}

OCIO_ADD_GPU_TEST(FixedFunction, style_RGB_TO_HSY_VID_inv)
OCIO_OSL_TEST(FixedFunction, style_RGB_TO_HSY_VID_inv)
{
OCIO::FixedFunctionTransformRcPtr func =
OCIO::FixedFunctionTransform::Create(OCIO::FIXED_FUNCTION_RGB_TO_HSY_VID);
Expand Down

0 comments on commit 9b1605c

Please sign in to comment.