contrib/brl/bseg/vpro/vpro_fourier_params.cxx
Go to the documentation of this file.
00001 // This is brl/bseg/vpro/vpro_fourier_params.cxx
00002 #include "vpro_fourier_params.h"
00003 //:
00004 // \file
00005 // See vpro_fourier_params.h
00006 //
00007 //-----------------------------------------------------------------------------
00008 #include <vcl_sstream.h>
00009 #include <vcl_iostream.h>
00010 
00011 //------------------------------------------------------------------------
00012 // Constructors
00013 //
00014 
00015 vpro_fourier_params::
00016 vpro_fourier_params(const vpro_fourier_params& vfp)
00017   : gevd_param_mixin()
00018 {
00019   InitParams(vfp.thresh_, vfp.level_, vfp.range_);
00020 }
00021 
00022 vpro_fourier_params::
00023 vpro_fourier_params(const float thresh, const float level, const float range)
00024 {
00025   InitParams(thresh, level, range);
00026 }
00027 
00028 void vpro_fourier_params::InitParams(float thresh, float level, float range)
00029 {
00030   thresh_= thresh;
00031   level_ = level;
00032   range_ = range;
00033 }
00034 
00035 //-----------------------------------------------------------------------------
00036 //
00037 //:   Checks that parameters are within acceptable bounds
00038 //    Note that msg << ends seems to restart the string and erase the
00039 //    previous string. We should only use it as the last call, use
00040 //    vcl_endl otherwise.
00041 bool vpro_fourier_params::SanityCheck()
00042 {
00043   vcl_stringstream msg;
00044   bool valid = true;
00045 
00046   msg << vcl_ends;
00047 
00048   SetErrorMsg(msg.str().c_str());
00049   return valid;
00050 }
00051 
00052 vcl_ostream& operator << (vcl_ostream& os, const vpro_fourier_params& vfp)
00053 {
00054   return
00055   os << "vpro_fourier_params:\n[---\n"
00056      << "thresh " << vfp.thresh_ << vcl_endl
00057      << "level " << vfp.level_ << vcl_endl
00058      << "range " << vfp.range_ << vcl_endl
00059      << "---]" << vcl_endl;
00060 }