30 #include <boost/format.hpp> 33 #include <qwt/qwt_plot_grid.h> 34 #include <qwt/qwt_scale_engine.h> 35 #include <qwt/qwt_scale_widget.h> 36 #include <qwt/qwt_color_map.h> 50 : QwtLinearColorMap(Qt::black, Qt::red, QwtColorMap::RGB)
53 addColorStop(1.0, Qt::red);
54 addColorStop(0.75, Qt::yellow);
56 addColorStop(0.25, Qt::cyan);
57 addColorStop(0.0, Qt::blue);
60 addColorStop(1.0, Qt::white);
61 addColorStop(0.84, Qt::red);
62 addColorStop(0.67, Qt::yellow);
63 addColorStop(0.5, Qt::green);
64 addColorStop(0.33, Qt::cyan);
65 addColorStop(0.16, Qt::blue);
66 addColorStop(0.0, Qt::black);
76 rescan_required =
false;
84 QwtPlotSpectrogram::setData(dp);
88 rescan_required =
true;
93 const QwtScaleMap &xMap,
const QwtScaleMap &yMap,
94 const QRectF &area,
const QSize &imageSize )
const 96 const QwtColorMap * cmap_p = colorMap();
98 if ( imageSize.isEmpty() || data_p == NULL
104 const QwtInterval intensityRange = data_p->interval( Qt::ZAxis );
105 if ( !intensityRange.isValid() )
108 QImage::Format format = ( cmap_p->format() == QwtColorMap::RGB )
109 ? QImage::Format_ARGB32 : QImage::Format_Indexed8;
111 data_p->initRaster(area, imageSize);
113 QImage image( imageSize, format );
114 if(rescan_required || (lastSize != imageSize)) {
115 rescan_required =
false;
116 const QRect tile( 0, 0, image.width(), image.height() );
117 renderTile( xMap, yMap, tile, &image );
118 lastSize = imageSize;
122 uchar * to_start = image.bits();
123 uchar * from_start = saved_image.scanLine(1);
124 memcpy(to_start, from_start, image.byteCount() - image.bytesPerLine());
126 const QRect tile( 0, image.height()-1, image.width(), 1);
127 renderTile( xMap, yMap, tile, &image );
153 sgram->setRenderThreadCount(1);
165 setAxisScale(QwtPlot::yRight,
wfall_data->interval(Qt::ZAxis).minValue(),
167 enableAxis(QwtPlot::yRight,
true);
168 enableAxis(QwtPlot::yLeft,
false);
175 sgram->setDisplayMode(QwtPlotSpectrogram::ImageMode,
true);
176 sgram->setDefaultContourPen(QPen(Qt::black, 0));
179 connect(
picker_p, SIGNAL(selected(
const QPointF&)), SLOT(
pickPoint(
const QPointF&)));
271 const QwtInterval z_interval =
wfall_data->interval(Qt::ZAxis);
274 setAxisScale(QwtPlot::yRight, z_interval.minValue(),
275 z_interval.maxValue());
WFColorMap(MapSelector sel=C5)
void setFreqCenter(double cf, bool check_boundary=false)
QImage renderImage(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &area, const QSize &imageSize) const
void setFreqSpan(double fs, bool check_boundary=false)
void setFreqStep(double cf, double st)
void setMarkerOffset(double lo, double hi)
void setDynamicRange(double drange)
double correctCenterFreq(double cfreq)
FreqScaleDraw * freq_scale_p
void updateData(double cf, float *y)
void setMarkers(double lo, double hi)
void setRefLevel(int rlvl)
void pickPoint(const QPointF &pos)
QwtScaleWidget * right_axis
virtual void updateData(double cfreq, float *spect)
void setDynamicRange(double drange)
void setData(QwtRasterData *dp)
void setFreqMarker(double freq)
double spectrum_input_span
void setRefLevel(double reflvl)