Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EndPoint.cc

Go to the documentation of this file.
00001 #include "EndPoint.h"
00002 
00003 namespace DualCoding {
00004 
00005 void EndPoint::checkValidity(int width, int height, int edge_thresh) {
00006   const bool v = ( coordX() > edge_thresh &&
00007                    coordX() < (width-1-edge_thresh) &&
00008                    coordY() > edge_thresh &&
00009                    coordY() < (height-1-edge_thresh) );
00010   setValid(v);
00011 }
00012 
00013 void EndPoint::updateParams(const EndPoint& other){
00014   ++nsamples;
00015   //  cout << "conf (this,other): " << nsamples << " " << other.nsamples << endl;
00016   //  cout << "old coords: " << coordX() << " " << coordY() << endl;
00017   //  cout << "other coords: " << other.coordX() << " " << other.coordY() << endl;
00018   coords = (coords*nsamples + other.coords*other.nsamples)/(nsamples+other.nsamples);
00019   rendering_valid = false;
00020   //  cout << "new coords: " << coordX() << " " << coordY() << endl;
00021 }
00022 
00023 void EndPoint::updateParams(const EndPoint& other, unsigned int num_updates){
00024   nsamples += num_updates-1;
00025   updateParams(other);
00026 }
00027 
00028 } // namespace

DualCoding 5.1CVS
Generated Mon May 9 04:56:26 2016 by Doxygen 1.6.3