diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-03-15 21:02:59 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-03-15 21:02:59 (GMT) |
commit | 97188ea8de794e7604ca7398418ed4aadaadb46b (patch) | |
tree | 4ef4bc8fdb9d0f4cfbfad9f315fff7676bbbcef1 /tksao/frame | |
parent | 9d8e9f68356e5c054e2c54513fe05eb56d809329 (diff) | |
download | blt-97188ea8de794e7604ca7398418ed4aadaadb46b.zip blt-97188ea8de794e7604ca7398418ed4aadaadb46b.tar.gz blt-97188ea8de794e7604ca7398418ed4aadaadb46b.tar.bz2 |
thread contour
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/context.C | 3 | ||||
-rw-r--r-- | tksao/frame/fitsanalysis.C | 41 | ||||
-rw-r--r-- | tksao/frame/fitsimage.h | 16 |
3 files changed, 16 insertions, 44 deletions
diff --git a/tksao/frame/context.C b/tksao/frame/context.C index fb97996..4fe3245 100644 --- a/tksao/frame/context.C +++ b/tksao/frame/context.C @@ -17,6 +17,7 @@ #include "socket.h" #include "socketgz.h" #include "var.h" +#include "convolve.h" #include "head.h" @@ -115,7 +116,7 @@ void Context::analysis() if (thread_) delete [] thread_; thread_ = new pthread_t[parent_->nthreads_]; - t_smooth_arg* targ = new t_smooth_arg[parent_->nthreads_]; + t_convolve_arg* targ = new t_convolve_arg[parent_->nthreads_]; int cnt =0; FitsImage* ptr = fits; diff --git a/tksao/frame/fitsanalysis.C b/tksao/frame/fitsanalysis.C index 283b185..ce6e816 100644 --- a/tksao/frame/fitsanalysis.C +++ b/tksao/frame/fitsanalysis.C @@ -9,21 +9,11 @@ #include "context.h" #include "convolve.h" -void FitsImage::analysis(int which, pthread_t* thread, t_smooth_arg* targ) +void FitsImage::analysis(int which, pthread_t* thread, void* targ) { if (DebugPerf) cerr << "FitsImage::analysis()" << endl; - targ->kernel =NULL; - targ->src =NULL; - targ->dest =NULL; - targ->xmin =0; - targ->xmax =0; - targ->ymin =0; - targ->ymax =0; - targ->width =0; - targ->r =0; - if (manageAnalysis_) { if (analysis_) delete analysis_; @@ -52,15 +42,7 @@ void FitsImage::analysis(int which, pthread_t* thread, t_smooth_arg* targ) data_ = analysisdata_; } -void* convolveThread(void* vv) -{ - t_smooth_arg* tt = (t_smooth_arg*)vv; - convolve(tt->kernel, tt->src, tt->dest, - tt->xmin, tt->ymin, tt->xmax, tt->ymax, tt->width, tt->r); - return NULL; -} - -void FitsImage::smooth(pthread_t* thread, t_smooth_arg* targ) +void FitsImage::smooth(pthread_t* thread, void* targ) { FitsBound* params = getDataParams(context_->secMode()); int width = analysis_->head()->naxis(0); @@ -96,15 +78,16 @@ void FitsImage::smooth(pthread_t* thread, t_smooth_arg* targ) } // convolve - targ->kernel = kernel; - targ->src = src; - targ->dest = dest; - targ->xmin = params->xmin; - targ->xmax = params->xmax; - targ->ymin = params->ymin; - targ->ymax = params->ymax; - targ->width = width; - targ->r = context_->smoothRadius(); + t_convolve_arg* tt = (t_convolve_arg*)targ; + tt->kernel = kernel; + tt->src = src; + tt->dest = dest; + tt->xmin = params->xmin; + tt->xmax = params->xmax; + tt->ymin = params->ymin; + tt->ymax = params->ymax; + tt->width = width; + tt->r = context_->smoothRadius(); int result = pthread_create(thread, NULL, convolveThread, targ); if (result) diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index ec95573..76680c3 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -18,18 +18,6 @@ #define MULTWCSA 28 typedef struct { - double* kernel; - double* src; - double* dest; - int xmin; - int ymin; - int xmax; - int ymax; - int width; - int r; -} t_smooth_arg; - -typedef struct { FitsFile* base; FitsData* basedata; FitsFile* block; @@ -146,7 +134,7 @@ class FitsImage { protected: void reset(); Vector getHistCenter(); - void smooth(pthread_t*, t_smooth_arg*); + void smooth(pthread_t*, void*); void process(const char*, int); void initCompress(); void initNRRD(); @@ -289,7 +277,7 @@ class FitsImage { void setContext(Context* cx) {context_ = cx;} void load(); - void analysis(int, pthread_t*, t_smooth_arg*); + void analysis(int, pthread_t*, void*); void block(); void block(pthread_t*); |