summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-05 23:12:58 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-05 23:12:58 (GMT)
commit723b756011282f288c7bfb9288d53133ec989c42 (patch)
tree9a3810b8a4960007d6572b57b6c14ddb71bcc298
parentb2c8887e2f408c4dedf20b1f1b4e7cda468ce59a (diff)
Autostretch fixes
-rw-r--r--kstars/fitsviewer/fitsdata.cpp3
-rw-r--r--kstars/fitsviewer/fitsview.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 4c3d060..1eb967e 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -1470,6 +1470,9 @@ void FITSData::applyFilter(FITSScale type, uint8_t *image, float *min, float *ma
{
dataMin = stats.mean[0] - stats.stddev[0];
dataMax = stats.mean[0] + stats.stddev[0] * 3;
+
+ //dataMin = stats.min[0] + stats.stddev[0];
+ //dataMax = stats.mean[0]*2;
//dataMin = 0;
//dataMax = pow(2, stats.bitpix) - 1;
}
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index d76781b..0fafd39 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -493,6 +493,9 @@ bool FITSView::loadFITS (const QString &inFilename , bool silent)
delete (image_data);
image_data = NULL;
+ filterStack.clear();
+ filterStack.push(FITS_NONE);
+
image_data = new FITSData(mode);
if (setBayerParams)
@@ -677,8 +680,8 @@ template<typename T> int FITSView::rescale(FITSZoom type)
for (int i = 0; i < image_width; i++)
{
- val = buffer[j * image_width + i];
- scanLine[i]= (val * bscale + bzero);
+ val = buffer[j * image_width + i] * bscale + bzero;
+ scanLine[i]= qBound(0.0, val, 255.0);
}
}
}