comparison layer/Colour3DPlotLayer.h @ 197:6b023411087b

* Work on harmonising colour and scale ranges between types of layer * Add normalize options to colour 3d plot layer
author Chris Cannam
date Thu, 01 Feb 2007 14:31:28 +0000
parents 57c2350a8c40
children 34bbbcb3c01f
comparison
equal deleted inserted replaced
196:22c99c8aa1e0 197:6b023411087b
77 virtual int getPropertyRangeAndValue(const PropertyName &, 77 virtual int getPropertyRangeAndValue(const PropertyName &,
78 int *min, int *max) const; 78 int *min, int *max) const;
79 virtual QString getPropertyValueLabel(const PropertyName &, 79 virtual QString getPropertyValueLabel(const PropertyName &,
80 int value) const; 80 int value) const;
81 virtual void setProperty(const PropertyName &, int value); 81 virtual void setProperty(const PropertyName &, int value);
82 82 virtual void setProperties(const QXmlAttributes &);
83 void setProperties(const QXmlAttributes &) { }
84 83
85 //!!! harmonize with spectrogram 84 enum ColourScale { LinearScale, LogScale, PlusMinusOneScale };
86 enum ColourScale { LinearScale, AbsoluteScale, MeterScale, dBScale };
87 85
88 void setColourScale(ColourScale); 86 void setColourScale(ColourScale);
89 ColourScale getColourScale() const { return m_colourScale; } 87 ColourScale getColourScale() const { return m_colourScale; }
90 88
89 void setColourMap(int map);
90 int getColourMap() const;
91
92 void setNormalizeColumns(bool n);
93 bool getNormalizeColumns() const;
94
95 void setNormalizeVisibleArea(bool n);
96 bool getNormalizeVisibleArea() const;
97
91 virtual const Model *getSliceableModel() const { return m_model; } 98 virtual const Model *getSliceableModel() const { return m_model; }
99
100 virtual QString toXmlString(QString indent = "",
101 QString extraAttributes = "") const;
92 102
93 protected slots: 103 protected slots:
94 void cacheInvalid(); 104 void cacheInvalid();
95 void cacheInvalid(size_t startFrame, size_t endFrame); 105 void cacheInvalid(size_t startFrame, size_t endFrame);
96 106
97 protected: 107 protected:
98 const DenseThreeDimensionalModel *m_model; // I do not own this 108 const DenseThreeDimensionalModel *m_model; // I do not own this
99 109
100 mutable QImage *m_cache; 110 mutable QImage *m_cache;
111 mutable size_t m_cacheStart;
101 112
102 ColourScale m_colourScale; 113 ColourScale m_colourScale;
114 int m_colourMap;
115 bool m_normalizeColumns;
116 bool m_normalizeVisibleArea;
117
118 void getColumn(size_t col, DenseThreeDimensionalModel::Column &) const;
103 119
104 virtual int getColourScaleWidth(QPainter &) const; 120 virtual int getColourScaleWidth(QPainter &) const;
121 virtual void fillCache(size_t firstBin, size_t lastBin) const;
105 virtual void paintDense(View *v, QPainter &paint, QRect rect) const; 122 virtual void paintDense(View *v, QPainter &paint, QRect rect) const;
106 }; 123 };
107 124
108 #endif 125 #endif