TLIB documentation
 

tlSpiral.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://www.tuyphon.com/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLSPIRAL_H__
00018 #define __TLSPIRAL_H__
00019 
00020 
00021 #include "tlVision.h"
00022 
00023 #include "tlPoint.h"
00024 
00025 
00026 // class declaration
00027 class tlSpiral
00028 {
00029 private:
00030   int x0,y0;
00031   int x,y;
00032   int nextX, nextY;
00033   int lastX, lastY;
00034   int width, height;
00035   int minX,maxX,minY,maxY;
00036   int done;
00037   int condX;
00038   int condY;
00039   int cur_incr;
00040   int x_incr;
00041   int y_incr;
00042 
00043 
00044 public:
00045 
00046   // constructors
00047   tlSpiral  (tlRect *rect = NULL);
00048   tlSpiral  (int x0, int y0, int width, int height, tlRect *rect = NULL);
00049   tlSpiral  (tlPoint *p0,    int width, int height, tlRect *rect = NULL);
00050   virtual ~tlSpiral ();
00051 
00052   // init spiral
00053   int     init (int x0, int y0, int width, int height, tlRect *rect = NULL);
00054   int     init (tlPoint *p0,    int width, int height, tlRect *rect = NULL);
00055 
00056   // update spiral
00057   int     toNext  ();
00058   int     toNext  (tlPoint *point);
00059   
00060   // get spiral info
00061   tlPoint *get     ()                     { return new tlPoint (x,y); };
00062   int     get      (tlPoint *point)       { return point->setLocation (x,y); }
00063   int     getX     ()                     { return x; };
00064   int     getY     ()                     { return y; };
00065   int     getIndex ()                     { return y*width+x; };
00066 
00067   // get last spiral info
00068   tlPoint *getLast     ()                 { return new tlPoint (lastX, lastY); };
00069   int     getLast      (tlPoint *point)   { return point->setLocation (lastX, lastY); };
00070   int     getLastX     ()                 { return lastX; };
00071   int     getLastY     ()                 { return lastY; };
00072   int     getLastIndex ()                 { return lastY*width+lastX; };
00073 
00074   // get last spiral info
00075   tlPoint *getNext     ()                 { return new tlPoint (nextX, nextY); };
00076   int     getNext      (tlPoint *point)   { return point->setLocation (nextX, nextY); };
00077   int     getNextX     ()                 { return nextX; };
00078   int     getNextY     ()                 { return nextY; };
00079   int     getNextIndex ()                 { return nextY*width+nextX; };
00080 
00081 };
00082 
00083 
00084 #endif
00085 


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.