00001 // This is brl/bseg/vpro/vpro_frame_diff_params.cxx 00002 #include "vpro_frame_diff_params.h" 00003 //: 00004 // \file 00005 // See vpro_frame_diff_params.h 00006 // 00007 //----------------------------------------------------------------------------- 00008 #include <vcl_sstream.h> 00009 #include <vcl_iostream.h> 00010 00011 //------------------------------------------------------------------------ 00012 // Constructors 00013 // 00014 00015 vpro_frame_diff_params:: 00016 vpro_frame_diff_params(const vpro_frame_diff_params& vmp) 00017 : gevd_param_mixin() 00018 { 00019 InitParams(vmp.thresh_, vmp.level_, vmp.range_); 00020 } 00021 00022 vpro_frame_diff_params:: 00023 vpro_frame_diff_params(const float thresh, const float level, const float range) 00024 { 00025 InitParams(thresh, level, range); 00026 } 00027 00028 void vpro_frame_diff_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_frame_diff_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_frame_diff_params& vmp) 00053 { 00054 return 00055 os << "vpro_frame_diff_params:\n[---\n" 00056 << "thresh " << vmp.thresh_ << vcl_endl 00057 << "level " << vmp.level_ << vcl_endl 00058 << "range " << vmp.range_ << vcl_endl 00059 << "---]" << vcl_endl; 00060 }
1.7.5.1