#include #include namespace icl{ using namespace utils; using namespace core; void FoldMap::clear() { m.fill(initialValue); } FoldMap::FoldMap(const utils::Size &resolution, float initialValue): m(resolution,1),initialValue(initialValue){ clear(); } void FoldMap::draw_fold(const utils::Point32f &a, const utils::Point32f &b, float value){ LineSampler ls; LineSampler::Result r = ls.sample(Point(a.x * (m.getWidth()-1), a.y * (m.getHeight()-1)), Point(b.x * (m.getWidth()-1), b.y * (m.getHeight()-1)) ); Channel32f c = m[0]; for(int i=0;i= 0){ if(cc < min){ min = cc; } }else{ if(cc > maxNeg){ anyNeg = true; maxNeg = cc; } } } if(min>=1){ if(anyNeg) return maxNeg; else return 1; }else{ return min; } } }