Provided by: libvistaio-dev_1.2.19-2_amd64

**NAME**

VistaIOEdges - edge set representation

**SYNOPSIS**

#include<vistaio.h>VistaIOEdgesedges;VistaIOEdgeedge;VistaIOEdgesVistaIOCreateEdges(intnrows,intncolumns,intnedge_fields,intnpoint_fields)VistaIOEdgeVistaIOAddEdge(VistaIOEdgesedges,VistaIOFloat*edge_fields,intnpoints,VistaIOFloat*points,VistaIOBooleanclosed,VistaIOBooleancopy)VistaIOEdgesVistaIOCopyEdges(VistaIOEdgesedges)voidVistaIODestroyEdges(VistaIOEdgesedges)intVistaIONEdgeFields(VistaIOEdgesedges)intVistaIONPointFields(VistaIOEdgesedges)intVistaIOEdgesNRows(VistaIOEdgesedges)intVistaIOEdgesNColumns(VistaIOEdgesedges)VistaIOAttrListVistaIOEdgesAttrList(VistaIOEdgesedges)intVistaIONEdges(VistaIOEdgesedges)VistaIOEdgeVistaIOFirstEdge(VistaIOEdgesedges)VistaIOEdgeVistaIONextEdge(VistaIOEdgeedge)VistaIOBooleanVistaIOEdgeExists(VistaIOEdgeedge)VistaIOBooleanVistaIOEdgeClosed(VistaIOEdgeedge)VistaIOFloat*VistaIOEdgeFields(VistaIOEdgeedge)intVistaIOEdgeNPoints(VistaIOEdgeedge)VistaIOFloat*VistaIOEdgePointArray(VistaIOEdgeedge)

**DESCRIPTION**

IntroductionA Vista edge set is typically used to represent two-dimensional connected edge points or lines that have been extracted from images, but it can also be used to represent any sets of vectors of floating point values. An edge set in memory is referred to by the C pointer typeVistaIOEdges. In data files it's identified by the type nameedges, and in memory, by theVistaIORepnKindcodeVistaIOEdgesRepn. Since it is a standard object type with built-in support in the Vista library, edge sets can be read from data files, written to data files, and manipulated as part of attribute lists by routines such asVistaIOReadFile(3),VistaIOWriteFile(3), andVistaIOGetAttr(3). A single edge, a member of an edge set, is referred to by the C pointer typeVistaIOEdge.DataStructureTheVistaIOEdgesdata structure heads a linked list of structures each representing one edge. An edge consists of an array of connected points along the edge, and each point contains a selected number of floating point values specifying its location and other properties. The edge itself may also have a selected number of floating point fields attached to it. TheVistaIOEdgesdata structure also specifies the size of the display region in which the edges are to be displayed. By convention, the first two values associated with each point give its x and y location within the display region, and the third value can be used to represent a measure of ``strength'' that may map to a variable display intensity. The coordinate system for display of edges assumes that the origin is at the lower left corner of the display region. An application is free to assign other meanings to the various point values (they can be used to represent arbitrary floating point vectors), but then of course they will not be suitable for viewing with the standard display utilities.AccessinganEdgeSetVista data structures are accessed in an object-oriented style by macros and routines, with no need to know the details of the underlying C data structures. A macro that is described as ``accessing'' an attribute can be used either as an rvalue (e.g, on the right hand side of an assignment operator) or as an lvalue (on the left hand side of an assignment operator).VistaIOCreateEdgesinitializes and returns an empty edge set. Thenrowsandncolumnsarguments give the size of the display region (usually copied from the size of image from which the edges were derived).nedge_fieldsandnpoint_fieldsgive the number of floating point values that will be attached to each edge and point.VistaIOAddEdgeadds a new edge toedges.npointsis the number of points in this edge. The field values for each of the points is given sequentially in the floating point arraypoints. The values for the fields attached to this edge are given inedge_fields.closedisTRUEif this edge is closed (i.e., the last point connects back to the first point). IfcopyisTRUE, then a new copy is made of the point and field data so that their storage can be reused.VistaIOCopyEdgesreturns a copy of an edge set, made with newly-allocated storage.VistaIODestroyEdgesreleases the memory occupied by an edge set, including that occupied by all points and fields of each the edge.VistaIONEdgeFieldsreturns the number of floating point fields that are attached to each edge. This number is established when the edge set is first created and must not be changed later.VistaIONPointFieldsreturns the number of floating point fields that are attached to each point. By convention the first 2 fields are used to represent the x and y coordinates of the point. This number is established when the edge set is first created and must not be changed later.VistaIOEdgesNRowsaccesses the number of rows in the image from which the edge set was derived (i.e., it specifies the height of the display region).VistaIOEdgesNColumnsaccesses the number of columns in the image from which the edge set was derived (i.e., it specifies the width of the display region).VistaIOEdgesAttrListaccesses the attribute list associated with an edge set.VistaIONEdgesreturns the number of edges currently in an edge set.AccessinganIndividualEdgeVistaIOFirstEdgereturns the first edge in the linked list of edge records associated with an edge set.VistaIONextEdgereturns the next edge in a set of edges. (The edges are chained in a linked list.)VistaIOEdgeExistsreturnsFALSEif the edge pointer,edge, does not point to an edge. This is used to detect the end of the linked list when traversing through an edge set.VistaIOEdgeClosedreturnsTRUEif the edge,edge, is closed (i.e., its last point connects back to its first point).VistaIOEdgeFieldsreturns the array of floating point values for the fields attached to an edge.VistaIOEdgeNPointsreturns the number of points in an edge.VistaIOEdgePointArrayreturns a two-dimensional array, in which the first dimensionthe points and the second indexes each point fields.VistaIOEdgesRepresentationinaVistaDataFileattribute-name:edges{nedges:nedgesnpoints:npointsnedge_fields:nedge-fieldsnpoint_fields:npoint-fieldsnrows:nrowsncolumns:ncolumnsdata:data-offsetlength:data-lengthotherattributes}The attributes listed above are the same as those accessed by the corresponding macros, with the exception ofnpointswhich refers to the total number of points in all edges in this edge set. The binary data is simply a sequence of 32-bit floating point numbers in IEEE standard format. Data is present for each edge, in sequence. The first value for an edge specifies the number of points,n, in the edge; it is negated if the edge is closed. This is followed bynedge_fieldsedge field values, thennvectors ofnpoint_fieldspoint field values.

**EXAMPLES**

This code fragment iterates over the edges in an edge set and over the points in each edge while printing the first field of each point:for(e=VistaIOFirstEdge(edges);VistaIOEdgeExists(e);e=VistaIONextEdge(e))for(i=0;i<VistaIOEdgeNPoints(e);i++)printf("%f",(float)VistaIOEdgePointArray(e)[i][0]);

**SEE** **ALSO**

VistaIOattribute(3)

**AUTHOR**

David Lowe <lowe@cs.ubc.ca> Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>

**LIST** **OF** **ROUTINES**

The following table summarizes other Vista library routines that operate on edge sets. Each routine is documented elsewhere, by a section 3 man page named for the routine.VistaIOReadEdgesRead sets of edges from a Vista data file.VistaIOWriteEdgesWrite sets of edges to a Vista data file.VistaIOLinkImageCreate an edge set by linking connected, non-zero image pixels.