27 #ifndef QPRASTERPLOT_H_
28 #define QPRASTERPLOT_H_
36 #include <qwt_color_map.h>
37 #include <qwt_plot_spectrogram.h>
42 class QPRasterMap :
public QwtColorMap {
45 QPRasterMap(
bool isARGB =
false);
51 QwtColorMap*
copy()
const;
54 QRgb rgb(
const QwtDoubleInterval& interval,
double value)
const;
57 unsigned char colorIndex(
const QwtDoubleInterval& intv,
double val)
const;
60 void setIsARGB(
bool argb);
69 class QPRasterPlot :
public QPPlotItem,
public RasterPlot,
70 public QwtPlotSpectrogram {
81 QPRasterPlot(PlotRasterDataPtr
data,
82 PlotRasterData::Format format = PlotRasterData::RGB32,
86 QPRasterPlot(
const RasterPlot&
copy);
104 unsigned int drawCount()
const;
117 QwtDoubleRect boundingRect()
const;
119 #if QWT_VERSION < 0x060000
121 QWidget* legendItem()
const;
127 void dataChanged() { itemChanged(); }
130 bool linesShown()
const;
133 void setLinesShown(
bool show =
true);
139 void setLine(
const PlotLine& line);
145 PlotRasterDataPtr rasterData()
const;
148 PlotRasterData::Format dataFormat()
const;
151 void setDataFormat(PlotRasterData::Format f);
166 std::vector<double> contourLines()
const;
169 void setContourLines(
const std::vector<double>& lines);
178 #if QWT_VERSION >= 0x060000
179 void draw_(QPainter* painter,
const QwtScaleMap& xMap,
180 const QwtScaleMap& yMap,
const QRectF& canvasRect,
181 unsigned int drawIndex,
unsigned int drawCount)
const;
183 void draw_(QPainter* painter,
const QwtScaleMap& xMap,
184 const QwtScaleMap& yMap,
const QRect& canvasRect,
185 unsigned int drawIndex,
unsigned int drawCount)
const;
192 #if QWT_VERSION >= 0x060000
193 QwtLinearColorMap* m_spectMap;
194 QPRasterMap* m_rasterMap;
196 QRectF totalArea()
const;
199 QwtLinearColorMap m_spectMap;
200 QPRasterMap m_rasterMap;
204 QRect totalArea()
const;
210 static QImage::Format format(PlotRasterData::Format f) {
212 case PlotRasterData::RGB32:
return QImage::Format_RGB32;
213 case PlotRasterData::ARGB32:
return QImage::Format_ARGB32;
215 default:
return QImage::Format_Invalid;
218 static PlotRasterData::Format format(QImage::Format f) {
220 case QImage::Format_RGB32:
return PlotRasterData::RGB32;
221 case QImage::Format_ARGB32:
return PlotRasterData::ARGB32;
223 default:
return PlotRasterData::SPECTROGRAM;
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
casacore::CountedPtr< PlotLine > PlotLinePtr
void show(const variant &v)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
virtual void setYRange(double from, double to)=0
Sets the range of y.
Origin
casacore::Data for raster plots, which can be thought of as three-dimensional.
virtual void setXRange(double from, double to)=0
Sets the range of x.
casacore::String m_format
Tracker text format.
String: the storage and methods of handling collections of characters.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual void setLine(const PlotLine &line)=0
Sets the plot lines to the given line.