diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox
index 263280594a..c9a113f461 100644
--- a/doc/dox/whatsnew.dox
+++ b/doc/dox/whatsnew.dox
@@ -38,6 +38,7 @@ Changes, compared to \ref page_whatsnew_V2019_11 "v2019.11" include:
improved/breaking change: extended styling system for graphs.
improved/breaking change: reworked graph Base-Classes (promoted several setters to slots, added Q_PROPERTY- and Q_ENUM-declarations...)
improved/breaking change: made more functions and function parameters const
+ improved/breaking change: image plots now manage CONST-data, not plain pointer arrays... This is OK, since the raw data is never owned nor modified by the plot, only referenced!.
bugfixed/improved: aspect ratio handling in JKQTPlotter.
new: added geometric plot objects JKQTPGeoArrow to draw arrows (aka lines with added line-end decorators, also extended JKQTPGeoLine, JKQTPGeoInfiniteLine, JKQTPGeoPolyLines to draw line-end decorator (aka arrows)
new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
diff --git a/lib/jkqtcommon/jkqtpbasicimagetools.cpp b/lib/jkqtcommon/jkqtpbasicimagetools.cpp
index 8fe0032b48..8277ae5f46 100644
--- a/lib/jkqtcommon/jkqtpbasicimagetools.cpp
+++ b/lib/jkqtcommon/jkqtpbasicimagetools.cpp
@@ -2986,7 +2986,7 @@ QString ModifierModeToString(const JKQTPMathImageModifierMode &mode) {
return "none";
}
-void JKQTPModifyImage(QImage &img, JKQTPMathImageModifierMode modifierMode, void *dataModifier, JKQTPMathImageDataType datatypeModifier, int Nx, int Ny, double internalModifierMin, double internalModifierMax)
+void JKQTPModifyImage(QImage &img, JKQTPMathImageModifierMode modifierMode, const void *dataModifier, JKQTPMathImageDataType datatypeModifier, int Nx, int Ny, double internalModifierMin, double internalModifierMax)
{
if (!dataModifier) return;
//getModifierMinMax(internalModifierMin, internalModifierMax);
@@ -3011,16 +3011,16 @@ void JKQTPModifyImage(QImage &img, JKQTPMathImageModifierMode modifierMode, void
}
//qDebug()<<"mod: "<(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::FloatArray: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::UInt8Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::UInt16Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::UInt32Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::UInt64Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::Int8Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::Int16Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::Int32Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
- case JKQTPMathImageDataType::Int64Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::DoubleArray: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::FloatArray: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::UInt8Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::UInt16Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::UInt32Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::UInt64Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::Int8Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::Int16Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::Int32Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
+ case JKQTPMathImageDataType::Int64Array: JKQTPImagePlot_array2RGBimage(static_cast(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
}
}
diff --git a/lib/jkqtcommon/jkqtpbasicimagetools.h b/lib/jkqtcommon/jkqtpbasicimagetools.h
index 04c0d4e3bc..6417e75dfe 100644
--- a/lib/jkqtcommon/jkqtpbasicimagetools.h
+++ b/lib/jkqtcommon/jkqtpbasicimagetools.h
@@ -549,7 +549,7 @@ inline QVector JKQTPImagePlot_BarrayToDVector(const bool* input, int N)
*/
template
-inline double JKQTPImagePlot_getImageMin(T* dbl, int width, int height)
+inline double JKQTPImagePlot_getImageMin(const T* dbl, int width, int height)
{
if (!dbl || width<=0 || height<=0)
return 0;
@@ -580,7 +580,7 @@ inline double JKQTPImagePlot_getImageMin(T* dbl, int width, int height)
*/
template
-inline double JKQTPImagePlot_getImageMax(T* dbl, int width, int height)
+inline double JKQTPImagePlot_getImageMax(const T* dbl, int width, int height)
{
if (!dbl || width<=0 || height<=0)
return 0;
@@ -623,7 +623,7 @@ inline double JKQTPImagePlot_getImageMax(T* dbl, int width, int height)
leave alpha as it is.
*/
template
-inline void JKQTPImagePlot_array2RGBimage(T* dbl_in, int width, int height, QImage &img, int channel, double minColor, double maxColor, JKQTPRGBMathImageRGBMode rgbMode=JKQTPRGBMathImageModeRGBMode, bool logScale=false, double logBase=10.0)
+inline void JKQTPImagePlot_array2RGBimage(const T* dbl_in, int width, int height, QImage &img, int channel, double minColor, double maxColor, JKQTPRGBMathImageRGBMode rgbMode=JKQTPRGBMathImageModeRGBMode, bool logScale=false, double logBase=10.0)
{
if (!dbl_in || width<=0 || height<=0)
return;
@@ -653,16 +653,18 @@ inline void JKQTPImagePlot_array2RGBimage(T* dbl_in, int width, int height, QIma
}
- T* dbl=dbl_in;
+ const T* dbl=dbl_in;
+ T* dbllog=nullptr;
if (logScale) {
double logB=log10(logBase);
- dbl=static_cast(malloc(width*height*sizeof(T)));
+ dbllog=static_cast(malloc(width*height*sizeof(T)));
//memcpy(dbl, dbl_in, width*height*sizeof(T));
for (int i=0; i0) {
- colChecksum=static_cast(qChecksum(reinterpret_cast(data), Nx*Ny* getSampleSize()));
+ colChecksum=static_cast(qChecksum(reinterpret_cast(data), Nx*Ny* getSampleSize()/sizeof(char)));
}
/*if (parent && parent->getDatastore() && imageColumn>=0) {
colChecksum=static_cast(parent->getDatastore()->getColumnChecksum(imageColumn));
diff --git a/lib/jkqtplotter/graphs/jkqtpimage.cpp b/lib/jkqtplotter/graphs/jkqtpimage.cpp
index c7ab058483..ad428389ae 100644
--- a/lib/jkqtplotter/graphs/jkqtpimage.cpp
+++ b/lib/jkqtplotter/graphs/jkqtpimage.cpp
@@ -132,62 +132,68 @@ void JKQTPImageBase::plotImage(JKQTPEnhancedPainter& painter, QImage& image, dou
}
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
- double xmin=parent->getXMin();
- double xmax=parent->getXMax();
- double ymin=parent->getYMin();
- double ymax=parent->getYMax();
- QPointF pp1=transform(xmin,ymax);
- QPointF pp2=transform(xmax,ymin);
- QRectF pr(pp1, pp2);
+ // determine full shown plot rectangle in pixel coordinates
+ const double xmin=parent->getXMin();
+ const double xmax=parent->getXMax();
+ const double ymin=parent->getYMin();
+ const double ymax=parent->getYMax();
+ QPointF pix_plot_topleft=transform(xmin,ymax);
+ QPointF pix_plot_bottomright=transform(xmax,ymin);
+ QRectF pix_plotrectangle(pix_plot_topleft, pix_plot_bottomright);
+ // these flags say, whether to mirror the image in one or the other direction, before plotting
bool mirrx=false;
bool mirry=false;
- QPointF p1=transform(x,y+height);
- QPointF p2=transform(x+width,y);
- if (p1.x()>p2.x()) {
- double tmp=p1.x();
- p1.setX(p2.x());
- p2.setX(tmp);
- tmp=pp1.x();
- pp1.setX(pp2.x());
- pp2.setX(tmp);
+ // determine pixel coordinates of image (x..x+width / y..y+width)
+ QPointF pix_topelft=transform(x,y+height);
+ QPointF pix_bottomright=transform(x+width,y);
+ if (pix_topelft.x()>pix_bottomright.x()) {
+ double tmp=pix_topelft.x();
+ pix_topelft.setX(pix_bottomright.x());
+ pix_bottomright.setX(tmp);
+ tmp=pix_plot_topleft.x();
+ pix_plot_topleft.setX(pix_plot_bottomright.x());
+ pix_plot_bottomright.setX(tmp);
mirrx=true;
}
- if (p1.y()>p2.y()) {
- double tmp=p1.y();
- p1.setY(p2.y());
- p2.setY(tmp);
- tmp=pp1.y();
- pp1.setY(pp2.y());
- pp2.setY(tmp);
+ if (pix_topelft.y()>pix_bottomright.y()) {
+ double tmp=pix_topelft.y();
+ pix_topelft.setY(pix_bottomright.y());
+ pix_bottomright.setY(tmp);
+ tmp=pix_plot_topleft.y();
+ pix_plot_topleft.setY(pix_plot_bottomright.y());
+ pix_plot_bottomright.setY(tmp);
mirry=true;
}
- QRectF r(p1, p2);
+ const QRectF pix_imagerect(pix_topelft, pix_bottomright);
if (image.width()>0 && image.height()>0 && !image.isNull()) {
- if (r.width()<2*pr.width() && r.height()<2*pr.height()) {
+ // now we determine, whether to directly draw the image (if its size is smaller than twice the plot rectangle,
+ // or not ...
+ if (pix_imagerect.width()<2.0*pix_plotrectangle.width() && pix_imagerect.height()<2.0*pix_plotrectangle.height()) {
//painter.drawImage(QRectF(p1.x(), p2.y(), fabs(p2.x()-p1.x()), fabs(p2.y()-p1.y())), image);
- painter.drawImage(QPointF(p1.x(), p1.y()), image.mirrored(mirrx, mirry).scaled(QSize(fabs(p2.x()-p1.x()), fabs(p2.y()-p1.y())), Qt::IgnoreAspectRatio, Qt::FastTransformation));
+ painter.drawImage(QPointF(pix_topelft.x(), pix_topelft.y()), image.mirrored(mirrx, mirry).scaled(QSize(fabs(pix_bottomright.x()-pix_topelft.x()), fabs(pix_bottomright.y()-pix_topelft.y())), Qt::IgnoreAspectRatio, Qt::FastTransformation));
//qDebug()<<"\nimage.size = "<(image.width());
- double pixheight=fabs(p2.y()-p1.y())/static_cast(image.height());
+ // ... if the image is much larger than the plot rectangle, we cut a potion from the image, before plotting
+ const double pixwidth=fabs(pix_bottomright.x()-pix_topelft.x())/static_cast(image.width());
+ const double pixheight=fabs(pix_bottomright.y()-pix_topelft.y())/static_cast(image.height());
//qDebug()<<"\nimage.size = "<trueColor=QColor("red");
}
-JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent):
+JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, const bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent):
JKQTPImageBase(x, y, width, height, parent)
{
actSaveImage=new QAction(tr("Save JKQTPOverlayImage ..."), this);
@@ -185,17 +185,17 @@ int JKQTPOverlayImage::getNy() const
return this->Ny;
}
-void JKQTPOverlayImage::setData(bool *__value)
+void JKQTPOverlayImage::setData(const bool *__value)
{
this->data = __value;
}
-bool *JKQTPOverlayImage::getData() const
+const bool *JKQTPOverlayImage::getData() const
{
return this->data;
}
-void JKQTPOverlayImage::setData(bool* data, int Nx, int Ny) {
+void JKQTPOverlayImage::setData(const bool *data, int Nx, int Ny) {
this->data=data;
this->Nx=Nx;
this->Ny=Ny;
@@ -365,15 +365,16 @@ int JKQTPColumnOverlayImageEnhanced::getImageColumn() const
return this->imageColumn;
}
void JKQTPColumnOverlayImageEnhanced::draw(JKQTPEnhancedPainter &painter) {
- double* d=parent->getDatastore()->getColumnPointer(imageColumn,0);
+ const double* d=parent->getDatastore()->getColumnPointer(imageColumn,0);
size_t imgSize=parent->getDatastore()->getRows(imageColumn);
- this->data=(bool*)malloc(imgSize*sizeof(bool));
+ bool* locData=static_cast(malloc(imgSize*sizeof(bool)));
+ this->data=locData;
this->Ny= static_cast(imgSize/this->Nx);
for (size_t i=0; i in row-major data-ordering */
QVector getDataAsDoubleVector() const;
protected:
/** \brief points to the data array, holding the image */
- bool* data;
+ const bool* data;
/** \brief width of the data array data in pt */
int Nx;
/** \brief height of the data array data in pt */
diff --git a/lib/jkqtplotter/graphs/jkqtpimagergb.cpp b/lib/jkqtplotter/graphs/jkqtpimagergb.cpp
index 36d285906a..ca1ccf47b9 100644
--- a/lib/jkqtplotter/graphs/jkqtpimagergb.cpp
+++ b/lib/jkqtplotter/graphs/jkqtpimagergb.cpp
@@ -121,14 +121,14 @@ void JKQTPRGBMathImage::initObject()
-JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, void* data, int Nx, int Ny, JKQTBasePlotter *parent):
+JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent)
{
initObject();
}
-JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, void* data, int Nx, int Ny, JKQTPlotter *parent):
+JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTPlotter *parent):
JKQTPRGBMathImage(x, y, width, height, datatype, data, Nx, Ny, parent->getPlotter())
{
}
@@ -261,7 +261,7 @@ void JKQTPRGBMathImage::getOutsideSize(JKQTPEnhancedPainter& painter, int& leftS
struct RGBOutsizeData {
double internalDataMin;
double internalDataMax;
- void* data;
+ const void* data;
JKQTPVerticalIndependentAxis* colorBarRightAxis;
JKQTPHorizontalIndependentAxis* colorBarTopAxis;
QString name;
@@ -490,12 +490,12 @@ void JKQTPRGBMathImage::getDataMinMax(double& imin, double& imax) {
}
}
-void JKQTPRGBMathImage::setDataR(void *__value)
+void JKQTPRGBMathImage::setDataR(const void *__value)
{
setData(__value);
}
-void *JKQTPRGBMathImage::getDataR() const
+const void *JKQTPRGBMathImage::getDataR() const
{
return getData();
}
@@ -510,12 +510,12 @@ JKQTPMathImageDataType JKQTPRGBMathImage::getDatatypeR() const
return getDatatype();
}
-void JKQTPRGBMathImage::setDataG(void *__value)
+void JKQTPRGBMathImage::setDataG(const void *__value)
{
this->dataG = __value;
}
-void *JKQTPRGBMathImage::getDataG() const
+const void *JKQTPRGBMathImage::getDataG() const
{
return this->dataG;
}
@@ -530,12 +530,12 @@ JKQTPMathImageDataType JKQTPRGBMathImage::getDatatypeG() const
return this->datatypeG;
}
-void JKQTPRGBMathImage::setDataB(void *__value)
+void JKQTPRGBMathImage::setDataB(const void *__value)
{
this->dataB = __value;
}
-void *JKQTPRGBMathImage::getDataB() const
+const void *JKQTPRGBMathImage::getDataB() const
{
return this->dataB;
}
@@ -909,44 +909,44 @@ void JKQTPRGBMathImage::getDataMinMaxG(double& imin, double& imax) {
if (!dataG) return;
switch(datatype) {
case JKQTPMathImageDataType::DoubleArray:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::FloatArray:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt8Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt16Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt32Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt64Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::Int8Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::Int16Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::Int32Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
case JKQTPMathImageDataType::Int64Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataG), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataG), Nx, Ny);
break;
}
} else {
@@ -962,44 +962,44 @@ void JKQTPRGBMathImage::getDataMinMaxB(double& imin, double& imax) {
if (!dataG) return;
switch(datatype) {
case JKQTPMathImageDataType::DoubleArray:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::FloatArray:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt8Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt16Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt32Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::UInt64Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::Int8Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::Int16Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::Int32Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
case JKQTPMathImageDataType::Int64Array:
- imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
- imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
+ imin= JKQTPImagePlot_getImageMin(static_cast(dataB), Nx, Ny);
+ imax= JKQTPImagePlot_getImageMax(static_cast(dataB), Nx, Ny);
break;
}
} else {
@@ -1011,7 +1011,7 @@ void JKQTPRGBMathImage::getDataMinMaxB(double& imin, double& imax) {
double JKQTPRGBMathImage::getValueAt(double x, double y, int channel)
{
ensureImageData();
- void* dd=data;
+ const void* dd=data;
if (channel==0) dd=data;
if (channel==1) dd=dataG;
if (channel==2) dd=dataB;
@@ -1019,16 +1019,16 @@ double JKQTPRGBMathImage::getValueAt(double x, double y, int channel)
int yy=static_cast(trunc((y-this->y)/height*Ny));
if (xx>=0 && xx=0 && yy((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::FloatArray: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::UInt8Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::UInt16Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::UInt32Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::UInt64Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::Int8Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::Int16Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::Int32Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
- case JKQTPMathImageDataType::Int64Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::DoubleArray: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::FloatArray: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::UInt8Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::UInt16Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::UInt32Array: return static_cast((static_cast(dd))[yy*Nx+xx]); break;
+ case JKQTPMathImageDataType::UInt64Array: return static_cast