9 m_NRows((img ? img->get_Height(): 0)),
10 m_NCols((img ? img->get_Width() : 0)),
17 .
HEXARG(img.data()).arg(interp).HEXARG(
this));
21 setInterval(Qt::XAxis, QwtInterval(0.0,
m_NCols));
22 setInterval(Qt::YAxis, QwtInterval(0.0,
m_NRows));
23 setInterval(Qt::ZAxis, range);
41 if (x < 0 || x >
m_NCols)
return 0;
42 if (y < 0 || y >
m_NRows)
return 0;
45 int ix = ((int) x), iy = ((int) y);
46 double dx = x-ix, dy = y-iy;
48 double f00 =
m_Data->getImageData((ix) , (iy));
49 double f10 =
m_Data->getImageData((ix+1) , (iy));
50 double f01 =
m_Data->getImageData((ix) , (iy+1));
51 double f11 =
m_Data->getImageData((ix+1) , (iy+1));
53 double f0 = f00*(1-dx)+f10*dx;
54 double f1 = f01*(1-dx)+f11*dx;
56 double f = f0*(1-dy)+f1*dy;
60 return m_Data->getImageData(((
int) qRound(x)) , ((
int) qRound(y)));
74 m_Range = QwtInterval(min, max);
76 setInterval(Qt::ZAxis,
m_Range);
102 QPointF r =
m_Data->percentileRange(lowpct, highpct);
104 res.setMinValue(r.x());
105 res.setMaxValue(r.y());
129 int maxx = 0, maxy = 0;
131 for (
int j=iy-rad; j<iy+rad; j++) {
132 for (
int i=ix-rad; i<ix+rad; i++) {
133 double val=
value(i,j);
136 max = val; maxx = i; maxy = j;
138 }
else if (val > max) {
139 max = val; maxx = i; maxy = j;
144 return QPointF(maxx, maxy);
qint64 qcepDebug(int cond)
void setDisplayedRange(double min, double max)
QwtInterval range() const
QwtInterval percentileRange(double lowpct, double highpct)
QcepImageDataBasePtr m_Data
double value(double x, double y) const
QPointF optimizePeakPosition(QPointF pt) const
virtual void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())=0
QcepApplication * g_Application
QSharedPointer< QcepImageDataBase > QcepImageDataBasePtr
QxrdRasterData(QcepImageDataBasePtr img=QcepImageDataBasePtr(), int interp=1, QwtInterval range=QwtInterval(0, 40000))
void setInterpolate(int interp)