diff options
-rw-r--r-- | ds9/doc/release/r8.1.html | 2 | ||||
-rw-r--r-- | tksao/frame/context.C | 6 | ||||
-rw-r--r-- | tksao/frame/fvcontour.C | 18 | ||||
-rw-r--r-- | tksao/frame/fvcontour.h | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/ds9/doc/release/r8.1.html b/ds9/doc/release/r8.1.html index c8fa643..cef67fd 100644 --- a/ds9/doc/release/r8.1.html +++ b/ds9/doc/release/r8.1.html @@ -61,6 +61,8 @@ <li><tt>03.06.2019 PLOT: support graph background color.</tt></li> <li><tt>03.06.2019 PLOT: add plot export to gif,png,tiff,jpeg.</tt></li> <li><tt>03.07.2019 TKBLT: fix segv Marker Op delete.</tt></li> +<li><tt>03.18.2019 CONTOUR: contours are now threaded.</tt></li> +<li><tt>03.18.2019 CONTOUR: default contour method is now smooth.</tt></li> <li><tt><b>xx.xx.2019 RELEASE version 8.1b1</b></tt></li> </ol> </div> diff --git a/tksao/frame/context.C b/tksao/frame/context.C index 4dc7abf..49fbc1c 100644 --- a/tksao/frame/context.C +++ b/tksao/frame/context.C @@ -408,8 +408,6 @@ void Context::contourCreateFV(const char* color, int width, int dash, if (targ[ii].lcl) delete targ[ii].lcl; - if (targ[ii].kernel) - delete [] targ[ii].kernel; if (targ[ii].src) delete [] targ[ii].src; if (targ[ii].dest) @@ -431,8 +429,6 @@ void Context::contourCreateFV(const char* color, int width, int dash, if (targ[ii].lcl) delete targ[ii].lcl; - if (targ[ii].kernel) - delete [] targ[ii].kernel; if (targ[ii].src) delete [] targ[ii].src; if (targ[ii].dest) @@ -2703,8 +2699,6 @@ void Context::updateContours() if (targ[0].lcl) delete targ[0].lcl; - if (targ[0].kernel) - delete [] targ[0].kernel; if (targ[0].src) delete [] targ[0].src; if (targ[0].dest) diff --git a/tksao/frame/fvcontour.C b/tksao/frame/fvcontour.C index e266f74..ab09d53 100644 --- a/tksao/frame/fvcontour.C +++ b/tksao/frame/fvcontour.C @@ -52,6 +52,7 @@ FVContour::FVContour() level_ =NULL; scale_ =NULL; + kernel_ =NULL; } FVContour::~FVContour() @@ -64,6 +65,9 @@ FVContour::~FVContour() if (scale_) delete scale_; + + if (kernel_) + delete [] kernel_; } void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, @@ -82,7 +86,6 @@ void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, method_ = mm; smooth_ = rr; numLevel_ = nn; - frScale_ = *fr; level_ = dupstr(ll); @@ -100,6 +103,11 @@ void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, } else buildScale(fits); + + // generate kernel + if (kernel_) + delete [] kernel_; + kernel_ = gaussian(smooth_-1, (smooth_-1)/2.); } void FVContour::buildScale(FitsImage* fits) @@ -289,13 +297,9 @@ void FVContour::smooth(FitsImage* fits, pthread_t* thread, void* targ) } CLEARSIGBUS - // generate kernel - int r = smooth_-1; - double* kernel = ::gaussian(r, r/2.); - // convolve t_fvcontour_arg* tt = (t_fvcontour_arg*)targ; - tt->kernel = kernel; + tt->kernel = kernel_; tt->src = src; tt->dest = dest; tt->xmin = params->xmin; @@ -304,7 +308,7 @@ void FVContour::smooth(FitsImage* fits, pthread_t* thread, void* targ) tt->ymax = params->ymax; tt->width = width; tt->height = height; - tt->r = r; + tt->r = smooth_-1; tt->mm = mm; tt->fv = this; tt->lcl = new List<ContourLevel>; diff --git a/tksao/frame/fvcontour.h b/tksao/frame/fvcontour.h index dcd6897..ff8555b 100644 --- a/tksao/frame/fvcontour.h +++ b/tksao/frame/fvcontour.h @@ -49,6 +49,7 @@ class FVContour { char* level_; InverseScale* scale_; + double* kernel_; void buildScale(FitsImage* fits); void unity(FitsImage*, pthread_t* thread, void* targ); @@ -59,7 +60,6 @@ public: FVContour(); ~FVContour(); - void create(Base*, FitsImage*, FrScale*, const char*, int, int, Method, int, int, |