started work on making RT not clip the image at intermediate stages

This commit is contained in:
Alberto Griggio
2018-02-09 21:25:39 +01:00
parent ee4546e16f
commit 08846264c7
13 changed files with 435 additions and 218 deletions

View File

@@ -137,4 +137,20 @@ constexpr std::uint8_t uint16ToUint8Rounded(std::uint16_t i)
return ((i + 128) - ((i + 128) >> 8)) >> 8;
}
template <typename T>
constexpr bool OOG(const T &val, const T &high=T(MAXVAL))
{
return (val > high);
}
template <typename T>
void setUnlessOOG(T &out, const T &val)
{
if (!OOG(out)) {
out = val;
}
}
}