Mercurial > hg > svgui
comparison layer/SliceLayer.cpp @ 860:4a5d144bd5d0 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 16:36:21 +0100 |
parents | 312b92ffb04e |
children | 12ab113ca2b1 |
comparison
equal
deleted
inserted
replaced
842:8432d2551fb2 | 860:4a5d144bd5d0 |
---|---|
394 ++divisor; | 394 ++divisor; |
395 } | 395 } |
396 | 396 |
397 float max = 0.f; | 397 float max = 0.f; |
398 for (int bin = 0; bin < mh; ++bin) { | 398 for (int bin = 0; bin < mh; ++bin) { |
399 if (m_samplingMode == SampleMean) m_values[bin] /= divisor; | 399 if (m_samplingMode == SampleMean && divisor > 0) { |
400 m_values[bin] /= divisor; | |
401 } | |
400 if (m_values[bin] > max) max = m_values[bin]; | 402 if (m_values[bin] > max) max = m_values[bin]; |
401 } | 403 } |
402 if (max != 0.f && m_normalize) { | 404 if (max != 0.f && m_normalize) { |
403 for (int bin = 0; bin < mh; ++bin) { | 405 for (int bin = 0; bin < mh; ++bin) { |
404 m_values[bin] /= max; | 406 m_values[bin] /= max; |