MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / floatToSample

Function floatToSample

PIK/PIK.cpp:650–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648
649template<class PIX, int maxValue>
650static PIX
651floatToSample(float value)
652{
653 if (maxValue == 1) {
654 return PIX(value);
655 }
656 if (value <= 0) {
657 return 0;
658 } else if (value >= 1.) {
659 return maxValue;
660 }
661
662 return PIX(value * maxValue + 0.5f);
663}
664
665template<class PIX, int maxValue>
666static PIX

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected