comparison layer/Colour3DPlotLayer.cpp @ 468:762e96217900

* make compression optional in editable dense 3d model, and some tweaks
author Chris Cannam
date Fri, 23 Jan 2009 14:00:29 +0000
parents 76a47146f1f6
children 9863f9a36cc2
comparison
equal deleted inserted replaced
467:76a47146f1f6 468:762e96217900
674 674
675 DenseThreeDimensionalModel::Column 675 DenseThreeDimensionalModel::Column
676 Colour3DPlotLayer::getColumn(size_t col) const 676 Colour3DPlotLayer::getColumn(size_t col) const
677 { 677 {
678 DenseThreeDimensionalModel::Column values = m_model->getColumn(col); 678 DenseThreeDimensionalModel::Column values = m_model->getColumn(col);
679 while (values.size() < m_model->getHeight()) values.push_back(0.f);
679 if (!m_normalizeColumns) return values; 680 if (!m_normalizeColumns) return values;
680 681
681 float colMax = 0.f, colMin = 0.f; 682 float colMax = 0.f, colMin = 0.f;
682 float min = 0.f, max = 0.f; 683 float min = 0.f, max = 0.f;
683 684
695 float value = values.at(y); 696 float value = values.at(y);
696 float norm = (value - colMin) / (colMax - colMin); 697 float norm = (value - colMin) / (colMax - colMin);
697 float newvalue = min + (max - min) * norm; 698 float newvalue = min + (max - min) * norm;
698 699
699 if (value != newvalue) values[y] = newvalue; 700 if (value != newvalue) values[y] = newvalue;
700 } 701 }
702
703 return values;
701 } 704 }
702 705
703 void 706 void
704 Colour3DPlotLayer::fillCache(size_t firstBin, size_t lastBin) const 707 Colour3DPlotLayer::fillCache(size_t firstBin, size_t lastBin) const
705 { 708 {