MCPcopy Create free account
hub / github.com/ImageEngine/cortex / nearestTick

Method nearestTick

src/IECore/OversamplesCalculator.cpp:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88int OversamplesCalculator::nearestTick( int tick ) const
89{
90 int low, high;
91 float frame = ticksToFrames( tick );
92 tickInterval( frame, low, high );
93 if (( tick - low )*( tick-low ) < ( tick-high )*( tick-high ) )
94 {
95 return low;
96 }
97 else
98 {
99 return high;
100 }
101}
102
103float OversamplesCalculator::tickInterval( float frame, int &tickLow, int &tickHigh ) const
104{

Callers 1

testMethod · 0.95

Calls 1

tickIntervalFunction · 0.85

Tested by 1

testMethod · 0.76