ccstruct/stepblob.h

Go to the documentation of this file.
00001 
00020 #ifndef           STEPBLOB_H
00021 #define           STEPBLOB_H
00022 
00023 #include          "coutln.h"
00024 #include          "rect.h"
00025 
00030 class C_BLOB:public ELIST_LINK
00031 {
00032   public:
00033     C_BLOB() { 
00034     }                            //empty constructor
00035     C_BLOB(  //constructor //in random order
00036            C_OUTLINE_LIST *outline_list);
00037 
00038     C_OUTLINE_LIST *out_list() {  //get outline list
00039       return &outlines;
00040     }
00041 
00042     BOX bounding_box();  //compute bounding box
00043     INT32 area();  //compute area
00044     INT32 outer_area();  //compute area
00045     INT32 count_transitions(                   //count maxima
00046                             INT32 threshold);  //size threshold
00047 
00048     void move(                    // reposition blob
00049               const ICOORD vec);  // by vector
00050 
00051     void plot(                       //draw one
00052               WINDOW window,         //window to draw in
00053               COLOUR blob_colour,    //for outer bits
00054               COLOUR child_colour);  //for holes
00055 
00056     void prep_serialise() {  //set ptrs to counts
00057       outlines.prep_serialise ();
00058     }
00059 
00060     void dump(  //write external bits
00061               FILE *f) {
00062       outlines.dump (f);
00063     }
00064 
00065     void de_dump(  //read external bits
00066                  FILE *f) {
00067       outlines.de_dump (f);
00068     }
00069 
00070                                  //assignment
00071     make_serialise (C_BLOB) C_BLOB & operator= (
00072     const C_BLOB & source) {     //from this
00073       if (!outlines.empty ())
00074         outlines.clear ();
00075 
00076       outlines.deep_copy (&source.outlines);
00077       return *this;
00078     }
00079 
00080   private:
00081     C_OUTLINE_LIST outlines;     //master elements
00082 };
00083 
00084 ELISTIZEH_S (C_BLOB)
00085 #endif

Generated on Wed Feb 28 19:49:08 2007 for Tesseract by  doxygen 1.5.1