From 138d03e5624d405ad5cf4319ebab2210f8ce2672 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 7 Nov 2018 17:11:59 -0500 Subject: add mask range --- tksao/frame/fitsdata.C | 30 ------------------------------ tksao/frame/fitsdata.h | 6 ------ tksao/frame/fitsimage.h | 3 --- tksao/frame/frame.C | 2 +- 4 files changed, 1 insertion(+), 40 deletions(-) diff --git a/tksao/frame/fitsdata.C b/tksao/frame/fitsdata.C index f566731..f4483df 100644 --- a/tksao/frame/fitsdata.C +++ b/tksao/frame/fitsdata.C @@ -1651,36 +1651,6 @@ template <> double FitsDatam::getValueDouble(const Vector& v) return NAN; } -// getValueMask - -template int FitsDatam::getValueMask(const Vector& v) -{ - Vector r = v; - long x = (long)r[0]; - long y = (long)r[1]; - - if (x >= 0 && x < width_ && y >= 0 && y < height_) - return data_[y*width_ + x] ? 1 : 0; - else - return 0; -} - -template int FitsDatam::getValueMask(double xx, double yy) -{ - long x = (long)xx; - long y = (long)yy; - - if (x >= 0 && x < width_ && y >= 0 && y < height_) - return data_[y*width_ + x] ? 1 : 0; - else - return 0; -} - -template int FitsDatam::getValueMask(long i) -{ - return data_[i] ? 1 : 0; -} - // bin template void FitsDatam::hist(double* arr, int length, double mn, diff --git a/tksao/frame/fitsdata.h b/tksao/frame/fitsdata.h index e18d57f..b324e57 100644 --- a/tksao/frame/fitsdata.h +++ b/tksao/frame/fitsdata.h @@ -106,12 +106,9 @@ public: virtual const char* getValue(const Vector&) =0; virtual float getValueFloat(const Vector&) =0; virtual double getValueDouble(const Vector&) =0; - virtual int getValueMask(const Vector&) =0; - virtual int getValueMask(double,double) =0; virtual float getValueFloat(long) =0; virtual double getValueDouble(long) =0; - virtual int getValueMask(long) =0; double min(); const Vector& minXY() {return minXY_;} @@ -159,12 +156,9 @@ class FitsDatam : public FitsData { float getValueFloat(const Vector&); double getValueDouble(const Vector&); - int getValueMask(const Vector&); - int getValueMask(double, double); float getValueFloat(long i); double getValueDouble(long i); - int getValueMask(long i); void updateClip(FrScale*, FitsBound*); void hist(double*, int, double, double, FitsBound*); diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index 5c4fe87..19445b8 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -481,12 +481,9 @@ class FitsImage { const char* getValue(const Vector& v); float getValueFloat(const Vector& v) {return data_->getValueFloat(v);} double getValueDouble(const Vector& v) {return data_->getValueDouble(v);} - int getValueMask(const Vector& v) {return data_->getValueMask(v);} - int getValueMask(double x, double y) {return data_->getValueMask(x,y);} float getValueFloat(long i) {return data_->getValueFloat(i);} double getValueDouble(long i) {return data_->getValueDouble(i);} - int getValueMask(long i) {return data_->getValueMask(i);} void setClip(double l, double h) {data_->setClip(l,h);} diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C index 7713df4..bb99824 100644 --- a/tksao/frame/frame.C +++ b/tksao/frame/frame.C @@ -256,7 +256,7 @@ unsigned char* Frame::fillMask(FitsMask* msk, int width, int height, if (xx>=params->xmin && xxxmax && yy>=params->ymin && yyymax) { - double value = sptr->getValueDouble(long(yy)*srcw + long(xx)); + float value = sptr->getValueFloat(long(yy)*srcw + long(xx)); switch (mark) { case FitsMask::ZERO: -- cgit v0.12