@@ -56,7 +56,7 @@ struct PointDistribution::Tile
5656template <typename DensityFunction, typename PointFunction>
5757struct PointDistribution ::DensityThresholdedEmitter
5858{
59- DensityThresholdedEmitter ( DensityFunction &densitySampler, PointFunction &pointEmitter )
59+ DensityThresholdedEmitter ( DensityFunction && densitySampler, PointFunction & &pointEmitter )
6060 : m_densitySampler( densitySampler ), m_pointEmitter( pointEmitter )
6161 {
6262 }
@@ -77,14 +77,14 @@ struct PointDistribution::DensityThresholdedEmitter
7777};
7878
7979template <typename DensityFunction, typename PointFunction>
80- void PointDistribution::operator () ( const Imath::Box2f &bounds, float density, DensityFunction &densitySampler, PointFunction &pointEmitter ) const
80+ void PointDistribution::operator () ( const Imath::Box2f &bounds, float density, DensityFunction && densitySampler, PointFunction & &pointEmitter ) const
8181{
8282 DensityThresholdedEmitter<DensityFunction, PointFunction> thresholdedEmitter ( densitySampler, pointEmitter );
8383 (*this )( bounds, density, thresholdedEmitter );
8484}
8585
8686template <typename PointFunction>
87- void PointDistribution::operator () ( const Imath::Box2f &bounds, float density, PointFunction &pointEmitter ) const
87+ void PointDistribution::operator () ( const Imath::Box2f &bounds, float density, PointFunction && pointEmitter ) const
8888{
8989 Imath::Box2i bi;
9090 bi.min .x = fastFloatFloor ( bounds.min .x );
@@ -117,7 +117,7 @@ void PointDistribution::operator () ( const Imath::Box2f &bounds, float density,
117117}
118118
119119template <typename PointFunction>
120- void PointDistribution::processTile ( const Tile &tile, const Imath::V2f &bottomLeft, const Imath::Box2f &bounds, float density, PointFunction &pointEmitter ) const
120+ void PointDistribution::processTile ( const Tile &tile, const Imath::V2f &bottomLeft, const Imath::Box2f &bounds, float density, PointFunction && pointEmitter ) const
121121{
122122 unsigned potentialPoints = std::min ( tile.points .size (), (size_t )density );
123123 float factor = 1 .0f / density;
@@ -136,7 +136,7 @@ void PointDistribution::processTile( const Tile &tile, const Imath::V2f &bottomL
136136}
137137
138138template <typename PointFunction>
139- void PointDistribution::recurseTile ( const Tile &tile, const Imath::V2f &bottomLeft, unsigned level, const Imath::Box2f &bounds, float density, PointFunction &pointEmitter ) const
139+ void PointDistribution::recurseTile ( const Tile &tile, const Imath::V2f &bottomLeft, unsigned level, const Imath::Box2f &bounds, float density, PointFunction && pointEmitter ) const
140140{
141141 float tileSize = 1 .0f / powf ( (float )m_numSubTiles, (float )level );
142142
0 commit comments