Skip to content
Snippets Groups Projects
Commit e9e32eba authored by Sacha Percot-Tétu's avatar Sacha Percot-Tétu
Browse files

Corrected a bug in PointOp

parent 0bd3241d
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@
#include "ImageListBox.h"
#include "Widgets/ImageWidgets/StandardImageWindow.h"
#include "Widgets/ImageWidgets/DoubleImageWindow.h"
#include <Converter.h>
#include "../Tools.h"
......@@ -214,7 +215,7 @@ void PointOp::operator()(const ImageWindow* currentWnd, vector<ImageWindow*>& wn
if(dblResult) {
const DoubleImageWindow* currentDblWnd = dynamic_cast<const DoubleImageWindow*>(currentWnd);
const Image_t<double>* image = currentDblWnd ? currentDblWnd->getImage() : NULL;
const Image_t<double>* image = currentDblWnd ? Converter<Image_t<double> >::convert(*currentDblWnd->getImage()) : Converter<Image_t<double> >::convert(*currentWnd->getDisplayImage());
unsigned int maxWidth = image->getWidth();
unsigned int maxHeight = image->getHeight();
......@@ -318,7 +319,14 @@ void PointOp::operator()(const ImageWindow* currentWnd, vector<ImageWindow*>& wn
}
}
this->outDoubleImage(resImg, "", currentDblWnd->isNormalized(), currentDblWnd->isLogScaled());
if(currentDblWnd) {
this->outDoubleImage(resImg, "", currentDblWnd->isNormalized(), currentDblWnd->isLogScaled());
}
else {
this->outDoubleImage(resImg, "", false, false);
}
delete image;
}
else {
const Image* image = dynamic_cast<const StandardImageWindow*>(currentWnd)->getImage();
......@@ -396,6 +404,6 @@ bool PointOp::needCurrentImg() const {
return true;
}
bool PointOp::isValidImgWnd(const genericinterface::ImageWindow*) const {
return true;
bool PointOp::isValidImgWnd(const genericinterface::ImageWindow* imgWnd) const {
return imgWnd != NULL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment