diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-10-25 19:36:07 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-10-25 19:36:07 (GMT) |
commit | 875058d1eff7b5daac504b32a08dba62cc3c56e1 (patch) | |
tree | 1b09236a181c79aa11840dfd4ebcb4a605d9a26f | |
parent | 99ef2b09248baf92afbe4700beefaa7fccc9f186 (diff) | |
download | blt-875058d1eff7b5daac504b32a08dba62cc3c56e1.zip blt-875058d1eff7b5daac504b32a08dba62cc3c56e1.tar.gz blt-875058d1eff7b5daac504b32a08dba62cc3c56e1.tar.bz2 |
new mask
-rw-r--r-- | tksao/frame/frame.C | 155 | ||||
-rw-r--r-- | tksao/frame/frame.h | 10 | ||||
-rw-r--r-- | tksao/frame/frload.C | 45 |
3 files changed, 182 insertions, 28 deletions
diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C index ea061ca..3cfff17 100644 --- a/tksao/frame/frame.C +++ b/tksao/frame/frame.C @@ -854,7 +854,7 @@ void Frame::savePhotoCmd(const char* ph) } } -// load +// *** Fits *** void Frame::loadFitsAllocCmd(const char* ch, const char* fn, LayerType ll) { @@ -1041,9 +1041,162 @@ void Frame::loadFitsVarCmd(const char* ch, const char* fn, LayerType ll) } } +// *** Array *** + +void Frame::loadArrAllocCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrAllocCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrAlloc(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->load(ALLOC, fn, img)); + break; + } +} + +void Frame::loadArrAllocGZCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrAllocGZCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrAllocGZ(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->load(ALLOCGZ, fn, img)); + break; + } +} + +void Frame::loadArrChannelCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrChannelCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrChannel(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->load(CHANNEL, fn, img)); + break; + } +} + +void Frame::loadArrMMapCmd(const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrMMapCmd(fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrMMap(cc, interp, fn, 1); + loadDone(cc->load(MMAP, fn, img)); + break; + } +} + +void Frame::loadArrMMapIncrCmd(const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrMMapIncrCmd(fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrMMapIncr(cc, interp, fn, 1); + loadDone(cc->load(MMAPINCR, fn, img)); + break; + } +} + +void Frame::loadArrShareCmd(ShmType stype, int id, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrShareCmd(stype, id, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrShare(cc, interp, stype, id, fn, 1); + loadDone(cc->load(SHARE, fn, img)); + break; + } +} + +void Frame::loadArrSocketCmd(int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrSocketCmd(s, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrSocket(cc, interp, + s, fn, FitsFile::FLUSH, 1); + loadDone(cc->load(SOCKET, fn, img)); + break; + } +} + +void Frame::loadArrSocketGZCmd(int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrSocketGZCmd(s, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrSocketGZ(cc, interp, + s, fn, FitsFile::FLUSH, 1); + loadDone(cc->load(SOCKETGZ, fn, img)); + break; + } +} + +void Frame::loadArrVarCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadArrVarCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageArrVar(cc, interp, ch, fn, 1); + loadDone(cc->load(VAR, fn, img)); + break; + } +} + void Frame::loadDone(int rr) { if (rr) updateMaskMatrices(); Base::loadDone(rr); } + diff --git a/tksao/frame/frame.h b/tksao/frame/frame.h index dd2b879..d212af7 100644 --- a/tksao/frame/frame.h +++ b/tksao/frame/frame.h @@ -99,6 +99,16 @@ class Frame : public FrameBase { void loadFitsSocketCmd(int, const char*, LayerType); void loadFitsSocketGZCmd(int, const char*, LayerType); void loadFitsVarCmd(const char*, const char*, LayerType); + + void loadArrAllocCmd(const char*, const char*, LayerType); + void loadArrAllocGZCmd(const char*, const char*, LayerType); + void loadArrChannelCmd(const char*, const char*, LayerType); + void loadArrMMapCmd(const char*, LayerType); + void loadArrMMapIncrCmd(const char*, LayerType); + void loadArrShareCmd(ShmType, int, const char*, LayerType); + void loadArrSocketCmd(int, const char*, LayerType); + void loadArrSocketGZCmd(int, const char*, LayerType); + void loadArrVarCmd(const char*, const char*, LayerType); }; #endif diff --git a/tksao/frame/frload.C b/tksao/frame/frload.C index 3211e21..1b6eb88 100644 --- a/tksao/frame/frload.C +++ b/tksao/frame/frload.C @@ -107,85 +107,76 @@ void Base::loadFitsVarCmd(const char* ch, const char* fn, LayerType ll) void Base::loadArrAllocCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrAlloc(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); - loadDone(currentContext->load(ALLOC, fn, img), ll); + loadDone(currentContext->load(ALLOC, fn, img)); } void Base::loadArrAllocGZCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrAllocGZ(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); - loadDone(currentContext->load(ALLOCGZ, fn, img), ll); + loadDone(currentContext->load(ALLOCGZ, fn, img)); } void Base::loadArrChannelCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrChannel(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); - loadDone(currentContext->load(CHANNEL, fn, img), ll); + loadDone(currentContext->load(CHANNEL, fn, img)); } void Base::loadArrMMapCmd(const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrMMap(currentContext, interp, fn, 1); - loadDone(currentContext->load(MMAP, fn, img), ll); + loadDone(currentContext->load(MMAP, fn, img)); } void Base::loadArrMMapIncrCmd(const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrMMapIncr(currentContext, interp, fn, 1); - loadDone(currentContext->load(MMAPINCR, fn, img), ll); + loadDone(currentContext->load(MMAPINCR, fn, img)); } void Base::loadArrShareCmd(ShmType stype, int id, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrShare(currentContext, interp, stype, id, fn, 1); - loadDone(currentContext->load(SHARE, fn, img), ll); + loadDone(currentContext->load(SHARE, fn, img)); } void Base::loadArrSocketCmd(int s, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrSocket(currentContext, interp, s, fn, FitsFile::FLUSH, 1); - loadDone(currentContext->load(SOCKET, fn, img), ll); + loadDone(currentContext->load(SOCKET, fn, img)); } void Base::loadArrSocketGZCmd(int s, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrSocketGZ(currentContext, interp, s, fn, FitsFile::FLUSH, 1); - loadDone(currentContext->load(SOCKETGZ, fn, img), ll); + loadDone(currentContext->load(SOCKETGZ, fn, img)); } void Base::loadArrVarCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageArrVar(currentContext, interp, ch, fn, 1); - loadDone(currentContext->load(VAR, fn, img), ll); + loadDone(currentContext->load(VAR, fn, img)); } // *** ENVI *** |