Main Page | Class Hierarchy | Class List | File List | Class Members

chaincode.h

00001 /* 00002 * This file is part of libCP 00003 * FILE: chaincode.h 00004 * AUTHOR: Mathias Herzog <mathu@gmx.ch> 00005 * 00006 * 00007 * Copyright (c) 2004, The libCP project 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your opinion) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; see the file LICENSE. If not, write to 00021 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 * Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _LIBCP_CHAINCODE_H_ 00026 #define _LIBCP_CHAINCODE_H_ 00027 00028 #include <cstring> 00029 #include <vector> 00030 00031 using namespace std; 00032 00033 #include "globals.h" 00034 #include "dataobject.h" 00035 00036 namespace LIBCP{ 00037 00038 static const int RIGHT = 0; 00039 static const int UP = 1; 00040 static const int LEFT = 2; 00041 static const int DOWN = 3; 00042 00043 static const int FOREGROUND = G-1; 00044 static const int BACKGROUND = 0; 00045 static const int SEEN = 100; 00046 00051 struct ChainCodeImage{ 00052 int x; 00053 int y; 00054 int width; 00055 int height; 00056 int minX; 00057 int minY; 00058 int maxX; 00059 int maxY; 00060 int originX; 00061 int originY; 00062 int perimeter; 00063 vector<int> *chain; 00064 }; 00065 00066 00075 class ChainCode : public DataObject 00076 { 00077 public: 00078 ~ChainCode(); 00079 void addChainCodeImage(vector<int> *chain, 00080 const int x, const int y, 00081 const int xMin, const int yMin, 00082 const int xMax, const int yMax); 00083 vector<ChainCodeImage*>* getChainCodeImages(); 00084 ChainCodeImage* getMajor(); 00085 static ChainCode* createChainCode(); 00086 00087 00088 private: 00089 ChainCode(); 00090 vector<ChainCodeImage*> *m_chainCodeImages; 00091 00092 };//end of class chaincode definition 00093 00094 } //end of namespace LIBCP 00095 00096 #endif /* _LIBCP_CHAINCODE_H_ */

Generated on Wed May 26 16:43:52 2004 for libcp by doxygen 1.3.7