Skip to content

Commit

Permalink
Changing from std::clamp to Imath::clamp
Browse files Browse the repository at this point in the history
Signed-off-by: Megha S <[email protected]>
  • Loading branch information
MeghaS94 committed Dec 8, 2023
1 parent 8ca895f commit f2ca931
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/src/previewImageExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ unsigned char
gamma (float x)
{
x = pow (5.5555f * max (0.f, x), 0.4545f) * 84.66f;
return (unsigned char) std::clamp (x, 0.f, 255.f);
return (unsigned char) Imath::clamp (x, 0.f, 255.f);
}
// [end gamma]

Expand Down Expand Up @@ -60,7 +60,7 @@ makePreviewImage (
outPixel.r = gamma (inPixel.r);
outPixel.g = gamma (inPixel.g);
outPixel.b = gamma (inPixel.b);
outPixel.a = static_cast<int> (std::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
outPixel.a = static_cast<int> (Imath::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/src/writeRgbaWithPreview2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ writeRgbaWithPreview2 (const char fileName[], int width, int height)
outPixel.r = gamma (inPixel.r);
outPixel.g = gamma (inPixel.g);
outPixel.b = gamma (inPixel.b);
outPixel.a = int (std::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
outPixel.a = int (Imath::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
}
}
}
Expand Down

0 comments on commit f2ca931

Please sign in to comment.