comparison layer/Colour3DPlotLayer.cpp @ 514:4ba0476ebbb6

* Activity log updates * Update range lists in play source when a new model is added * Fill cache with empty background in colour 3d plot
author Chris Cannam
date Fri, 27 Feb 2009 13:33:16 +0000
parents f8b98f63f200
children 43bd47468005
comparison
equal deleted inserted replaced
513:1341e95eeae9 514:4ba0476ebbb6
794 794
795 if (!m_cache) { 795 if (!m_cache) {
796 m_cache = new QImage 796 m_cache = new QImage
797 (cacheWidth, cacheHeight, QImage::Format_Indexed8); 797 (cacheWidth, cacheHeight, QImage::Format_Indexed8);
798 m_cache->setNumColors(256); 798 m_cache->setNumColors(256);
799 m_cache->fill(0);
799 if (!m_normalizeVisibleArea) { 800 if (!m_normalizeVisibleArea) {
800 m_peaksCache = new QImage 801 m_peaksCache = new QImage
801 (cacheWidth / m_peakResolution + 1, cacheHeight, 802 (cacheWidth / m_peakResolution + 1, cacheHeight,
802 QImage::Format_Indexed8); 803 QImage::Format_Indexed8);
803 m_peaksCache->setNumColors(256); 804 m_peaksCache->setNumColors(256);
805 m_peaksCache->fill(0);
804 } else if (m_peaksCache) { 806 } else if (m_peaksCache) {
805 delete m_peaksCache; 807 delete m_peaksCache;
806 m_peaksCache = 0; 808 m_peaksCache = 0;
807 } 809 }
808 m_cacheValidStart = 0; 810 m_cacheValidStart = 0;
878 m_peaksCache->setColor 880 m_peaksCache->setColor
879 (index, qRgb(colour.red(), colour.green(), colour.blue())); 881 (index, qRgb(colour.red(), colour.green(), colour.blue()));
880 } 882 }
881 } 883 }
882 884
883 // m_cache->fill(0);
884
885 float visibleMax = 0.f, visibleMin = 0.f; 885 float visibleMax = 0.f, visibleMin = 0.f;
886 886
887 if (normalizeVisible) { 887 if (normalizeVisible) {
888 888
889 for (size_t c = fillStart; c <= fillEnd; ++c) { 889 for (size_t c = fillStart; c <= fillEnd; ++c) {
984 } 984 }
985 985
986 void 986 void
987 Colour3DPlotLayer::paint(View *v, QPainter &paint, QRect rect) const 987 Colour3DPlotLayer::paint(View *v, QPainter &paint, QRect rect) const
988 { 988 {
989 /*
989 if (m_model) { 990 if (m_model) {
990 std::cerr << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << std::endl; 991 std::cerr << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << std::endl;
991 } 992 }
992 993 */
993 Profiler profiler("Colour3DPlotLayer::paint"); 994 Profiler profiler("Colour3DPlotLayer::paint");
994 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 995 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
995 std::cerr << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << std::endl; 996 std::cerr << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << std::endl;
996 #endif 997 #endif
997 998