| 197 | } |
| 198 | |
| 199 | void gaussianFilter( FloatGrid& grid, int width, int iters, ProgressCallback cb /*= {} */ ) |
| 200 | { |
| 201 | if ( !grid ) |
| 202 | return; |
| 203 | // just grows to 100% |
| 204 | // first grows fast, then slower |
| 205 | ProgressCallback dummyProgressCb; |
| 206 | float i = 1.0f; |
| 207 | if ( cb ) |
| 208 | dummyProgressCb = [&] ( float )->bool |
| 209 | { |
| 210 | i += 1e-4f; |
| 211 | return cb( 1.0f - 1.0f / std::sqrt( i ) ); |
| 212 | }; |
| 213 | ProgressInterrupter interrupter( dummyProgressCb ); |
| 214 | |
| 215 | auto filter = openvdb::tools::Filter<openvdb::FloatGrid, openvdb::FloatGrid::ValueConverter<float>::Type, ProgressInterrupter>( ovdb( *grid ), &interrupter ); |
| 216 | filter.gaussian( width, iters ); |
| 217 | } |
| 218 | |
| 219 | FloatGrid gaussianFiltered( const FloatGrid& grid, int width, int iters, ProgressCallback cb /*= {} */ ) |
| 220 | { |
no outgoing calls
no test coverage detected