00001 /* --------------------------------------------------------------------------- 00002 Phission : 00003 Realtime Vision Processing System 00004 00005 Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu) 00006 University of Massachusetts at Lowell, 00007 Laboratory for Artificial Intelligence and Robotics 00008 00009 This file is part of Phission. 00010 00011 Phission is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Phission is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with Phission; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 ---------------------------------------------------------------------------*/ 00026 #ifndef _PHAUTOBLOBDATA_H 00027 #define _PHAUTOBLOBDATA_H 00028 00029 #include <phautoblob.h> 00030 #include <phLiveObject.h> 00031 00032 /* ------------------------------------------------------------------------ */ 00033 /* Todo: add live source functionality to this object. */ 00034 /* ------------------------------------------------------------------------ */ 00035 class phAutoBlobData : public phLiveObject 00036 { 00037 phautoblob_data *m_data; 00038 00039 void init(); 00040 00041 public: 00042 phAutoBlobData(); 00043 phAutoBlobData( const phAutoBlobData &blob ); 00044 ~phAutoBlobData(); 00045 00046 int copy( phObject *obj ); 00047 int swap( phObject *obj ); 00048 00049 int reset(); 00050 00051 int setData( phautoblob_data *data ); 00052 00053 int copy( phAutoBlobData ©from); 00054 00055 /* The following should not be used with an object that is constantly 00056 * updating if one desires data coherency */ 00057 /* These will return the values of the particular variable during one 00058 * state of the object; Once returned, any of the other values may 00059 * change before calling the next relevant method. For example, calling 00060 * getTotalBlobs and then getBlobs; In between the two separate method 00061 * calls, the actual blobs array and total blobs may change and then 00062 * the value returned from the call to getTotalBlobs is invalidated. 00063 * 00064 * It is assumed that the following functions won't be used 00065 * with live/constantly changing instances of phAutoBlobData and so 00066 * they are not made to be thread-safe. 00067 * 00068 * The return values are internal to the class and must be 00069 * called again if the object is copied. 00070 * 00071 * Use the copy function above and then call these with a static copy 00072 * of the data. 00073 * 00074 * If another object is placing data into a phAutoBlobData object, it should 00075 * provide a method to call that will return a static copy of the 00076 * phAutoBlobData object: int getBlobData( phAutoBlobData &blobData ); 00077 * */ 00078 int32_t getTotalLines(); 00079 auto_line_segment *getLines(); 00080 auto_line_segment *getLine(int32_t index); 00081 auto_line_segment getLineData(int32_t index); 00082 00083 int32_t getTotalRows(); 00084 auto_line_segment **getRowPtrs(); 00085 int32_t *getRowIndexArray(); 00086 00087 int32_t getTotalBlobs(uint32_t min_size = 0); 00088 phautoblob *getBlobArray(); 00089 phautoblob getBlob(uint32_t blob_index); 00090 00091 phAutoBlobData &operator = ( phAutoBlobData &right ); 00092 00093 void print_data(uint32_t min_size, uint32_t verbose = 0); 00094 }; 00095 00096 #endif /* _PHAUTOBLOBDATA_H */
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |