diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-10-22 18:28:41 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-10-22 18:28:41 (GMT) |
commit | f1c59d1c6809ead733c3a7b226b622ff9357a210 (patch) | |
tree | 9a41ea6e18ed000df510c01070f6acc182a5538f /tksao | |
parent | 3a98acb6407b3570be0ebb6a730b98d24ea3afc1 (diff) | |
download | blt-f1c59d1c6809ead733c3a7b226b622ff9357a210.zip blt-f1c59d1c6809ead733c3a7b226b622ff9357a210.tar.gz blt-f1c59d1c6809ead733c3a7b226b622ff9357a210.tar.bz2 |
new mask
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/base.C | 7 | ||||
-rw-r--r-- | tksao/frame/base.h | 16 | ||||
-rw-r--r-- | tksao/frame/basecommand.C | 23 | ||||
-rw-r--r-- | tksao/frame/frame.C | 39 | ||||
-rw-r--r-- | tksao/frame/frame.h | 11 |
5 files changed, 59 insertions, 37 deletions
diff --git a/tksao/frame/base.C b/tksao/frame/base.C index 1494385..f5dc495 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -119,10 +119,6 @@ Base::Base(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item) irafAlign_ =1; irafOrientation_ = (Coord::Orientation)-1; - maskColorName = dupstr("red"); - maskAlpha = 1; - maskMark = 1; - invert = 0; useHighlite = 0; @@ -225,9 +221,6 @@ Base::~Base() if (highliteGC) XFreeGC(display, highliteGC); - if (maskColorName) - delete [] maskColorName; - if (markerGC_) XFreeGC(display, markerGC_); diff --git a/tksao/frame/base.h b/tksao/frame/base.h index 4e57b78..70c2834 100644 --- a/tksao/frame/base.h +++ b/tksao/frame/base.h @@ -227,10 +227,6 @@ public: Coord::Orientation irafOrientation_; // orientation of first iraf segment Matrix irafMatrix_; // orientation matrix for iraf mosaic - char* maskColorName; - float maskAlpha; - int maskMark; - int invert; int useHighlite; @@ -1555,14 +1551,14 @@ public: void regionSelectShiftEndCmd(); // Mask Commands - void getMaskColorCmd(); - void getMaskMarkCmd(); - void getMaskTransparencyCmd(); + virtual void getMaskColorCmd(); + virtual void getMaskMarkCmd(); + virtual void getMaskTransparencyCmd(); - void maskColorCmd(const char*); virtual void maskClearCmd() {}; - void maskMarkCmd(int m) {maskMark=m;} - void maskTransparencyCmd(float); + virtual void maskColorCmd(const char*) {}; + virtual void maskTransparencyCmd(float) {}; + virtual void maskMarkCmd(int) {}; // NaN Commands void getNANColorCmd(); diff --git a/tksao/frame/basecommand.C b/tksao/frame/basecommand.C index 6bcc2d3..5daa343 100644 --- a/tksao/frame/basecommand.C +++ b/tksao/frame/basecommand.C @@ -1934,20 +1934,17 @@ void Base::getIRAFAlignCmd() void Base::getMaskColorCmd() { - Tcl_AppendResult(interp, maskColorName, NULL); + Tcl_AppendResult(interp, "red", NULL); } void Base::getMaskMarkCmd() { - if (maskMark) - Tcl_AppendResult(interp, "1", NULL); - else - Tcl_AppendResult(interp, "0", NULL); + Tcl_AppendResult(interp, "1", NULL); } void Base::getMaskTransparencyCmd() { - printDouble((1-maskAlpha)*100.); + printDouble(0); } void Base::getMinMaxCmd() @@ -2523,20 +2520,6 @@ void Base::matchCmd(const char* xxname1, const char* yyname1, rrname); } -void Base::maskColorCmd(const char* color) -{ - if (maskColorName) - delete [] maskColorName; - - maskColorName = dupstr(color); -} - -void Base::maskTransparencyCmd(float t) -{ - maskAlpha = 1-(t/100.); - update(BASE); -} - void Base::nanColorCmd(const char* color) { if (nanColorName) diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C index f41c426..17b4ef8 100644 --- a/tksao/frame/frame.C +++ b/tksao/frame/frame.C @@ -30,6 +30,10 @@ Frame::Frame(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item) colorCount = 0; colorScale = NULL; colorCells = NULL; + + maskColorName = dupstr("red"); + maskAlpha = 1; + maskMark = 1; } Frame::~Frame() @@ -45,6 +49,9 @@ Frame::~Frame() if (colormapData) delete [] colormapData; + + if (maskColorName) + delete [] maskColorName; } unsigned char* Frame::blend(unsigned char* src, unsigned char* msk, @@ -364,12 +371,44 @@ void Frame::unloadFits() // Commands +void Frame::getMaskColorCmd() +{ + Tcl_AppendResult(interp, maskColorName, NULL); +} + +void Frame::getMaskMarkCmd() +{ + if (maskMark) + Tcl_AppendResult(interp, "1", NULL); + else + Tcl_AppendResult(interp, "0", NULL); +} + +void Frame::getMaskTransparencyCmd() +{ + printDouble((1-maskAlpha)*100.); +} + void Frame::maskClearCmd() { mask.deleteAll(); update(BASE); } +void Frame::maskColorCmd(const char* color) +{ + if (maskColorName) + delete [] maskColorName; + + maskColorName = dupstr(color); +} + +void Frame::maskTransparencyCmd(float t) +{ + maskAlpha = 1-(t/100.); + update(BASE); +} + void Frame::colormapCmd(int id, float b, float c, int i, unsigned char* cells, int cnt) { diff --git a/tksao/frame/frame.h b/tksao/frame/frame.h index b15ac63..51e2549 100644 --- a/tksao/frame/frame.h +++ b/tksao/frame/frame.h @@ -26,6 +26,10 @@ class Frame : public FrameBase { List <FitsMask> mask; + char* maskColorName; + float maskAlpha; + int maskMark; + private: unsigned char* blend(unsigned char*, unsigned char*, int, int); int isIIS(); @@ -49,7 +53,14 @@ class Frame : public FrameBase { Frame(Tcl_Interp*, Tk_Canvas, Tk_Item*); virtual ~Frame(); + void getMaskColorCmd(); + void getMaskMarkCmd(); + void getMaskTransparencyCmd(); + void maskClearCmd(); + void maskColorCmd(const char*); + void maskTransparencyCmd(float); + void maskMarkCmd(int mm) {maskMark=mm;} void colormapCmd(int, float, float, int, unsigned char*, int); void colormapBeginCmd(); |