next up previous contents index
Next: Related file (external) types Up: Shape Previous: Shape   Contents   Index


The structure Shape

The meaning of the different fields is explained above. There are two additional fields, data and data_size, whose content is left to the choice of the user. data is supposed to point to a memory extent of (at least) data_size bytes, if this value is positive. Failure in this assumption may lead to a memory corruption in I/O operations.

typedef struct shape
{
  char inferior_type; /* Indicates if it is extracted from a superior 
                         or inferior level set */
  float value; /* Limiting gray-level of the level set */
  char open; /* Indicates if the shape meets the border of the image */
  int area; /* Area of the shape = area of the cc of level set 
                                 + areas of the holes */
  char removed; /* Indicates whether the shape exists or not */

  Point_plane pixels; /* The array of pixels contained in the shape */

  Flist boundary; /* The boundary curve defining the shape */

  /* Data to include it in a tree. It has a parent (the smallest containing 
     shape), children (the largest contained shapes, whose first is pChild 
     and the others are its siblings), and siblings (the other children of 
     its parent) */
  struct shape *parent, *next_sibling, *child;

  int data_size;     /* size of data[] in bytes */
  void* data;        /* User defined field (saved). A pointer to something */

} *Shape;



mw 2004-05-05