.ds Vv 1.2.14 .TH VistaIOEdges 3 "24 April 1993" "VistaIO Version \*(Vv" .SH NAME VistaIOEdges \- edge set representation .SH SYNOPSIS .na .nh .B #include .PP .B VistaIOEdges \fIedges\fP; .br .B VistaIOEdge \fIedge\fP; .HP 10n .B VistaIOEdges VistaIOCreateEdges (int\ \fInrows\fP, int\ \fIncolumns\fP, .B int\ \fInedge_fields\fP, int\ \fInpoint_fields\fP) .HP 10n .B VistaIOEdge VistaIOAddEdge (VistaIOEdges\ \fIedges\fP, VistaIOFloat\ *\fIedge_fields\fP, .B int\ \fInpoints\fP, VistaIOFloat\ *\fIpoints\fP, VistaIOBoolean\ \fIclosed\fP, .B VistaIOBoolean\ \fIcopy\fP) .PP .B VistaIOEdges VistaIOCopyEdges (VistaIOEdges \fIedges\fP) .PP .B void VistaIODestroyEdges (VistaIOEdges \fIedges\fP) .PP .B int VistaIONEdgeFields (VistaIOEdges \fIedges\fP) .PP .B int VistaIONPointFields (VistaIOEdges \fIedges\fP) .PP .B int VistaIOEdgesNRows (VistaIOEdges \fIedges\fP) .PP .B int VistaIOEdgesNColumns (VistaIOEdges \fIedges\fP) .PP .B VistaIOAttrList VistaIOEdgesAttrList (VistaIOEdges \fIedges\fP) .PP .B int VistaIONEdges (VistaIOEdges \fIedges\fP) .PP .B VistaIOEdge VistaIOFirstEdge (VistaIOEdges \fIedges\fP) .PP .B VistaIOEdge VistaIONextEdge (VistaIOEdge \fIedge\fP) .PP .B VistaIOBoolean VistaIOEdgeExists (VistaIOEdge \fIedge\fP) .PP .B VistaIOBoolean VistaIOEdgeClosed (VistaIOEdge \fIedge\fP) .PP .B VistaIOFloat * VistaIOEdgeFields (VistaIOEdge \fIedge\fP) .PP .B int VistaIOEdgeNPoints (VistaIOEdge \fIedge\fP) .PP .B VistaIOFloat * VistaIOEdgePointArray (VistaIOEdge \fIedge\fP) .ad .hy .SH DESCRIPTION .SS Introduction A 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. .PP An edge set in memory is referred to by the C pointer type \fBVistaIOEdges\fP. In data files it's identified by the type name \fBedges\fP, and in memory, by the \fBVistaIORepnKind\fP code \fBVistaIOEdgesRepn\fP. 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 as \fBVistaIOReadFile\fP(3), \fBVistaIOWriteFile\fP(3), and \fBVistaIOGetAttr\fP(3). .PP A single edge, a member of an edge set, is referred to by the C pointer type \fBVistaIOEdge\fP. .SS "Data Structure" The \fBVistaIOEdges\fP data 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. The \fBVistaIOEdges\fP data structure also specifies the size of the display region in which the edges are to be displayed. .PP 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. .SS "Accessing an Edge Set" Vista 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). .PP \fBVistaIOCreateEdges\fP initializes and returns an empty edge set. The \fInrows\fP and \fIncolumns\fP arguments give the size of the display region (usually copied from the size of image from which the edges were derived). \fInedge_fields\fP and \fInpoint_fields\fP give the number of floating point values that will be attached to each edge and point. .PP \fBVistaIOAddEdge\fP adds a new edge to \fIedges\fP. \fInpoints\fP is the number of points in this edge. The field values for each of the points is given sequentially in the floating point array \fIpoints\fP. The values for the fields attached to this edge are given in \fIedge_fields\fP. \fIclosed\fP is .SB TRUE if this edge is closed (i.e., the last point connects back to the first point). If \fIcopy\fP is .SB TRUE\c , then a new copy is made of the point and field data so that their storage can be reused. .PP \fBVistaIOCopyEdges\fP returns a copy of an edge set, made with newly-allocated storage. .PP \fBVistaIODestroyEdges\fP releases the memory occupied by an edge set, including that occupied by all points and fields of each the edge. .PP \fBVistaIONEdgeFields\fP returns 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. .PP \fBVistaIONPointFields\fP returns 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. .PP \fBVistaIOEdgesNRows\fP accesses the number of rows in the image from which the edge set was derived (i.e., it specifies the height of the display region). .PP \fBVistaIOEdgesNColumns\fP accesses the number of columns in the image from which the edge set was derived (i.e., it specifies the width of the display region). .PP \fBVistaIOEdgesAttrList\fP accesses the attribute list associated with an edge set. .PP \fBVistaIONEdges\fP returns the number of edges currently in an edge set. .SS "Accessing an Individual Edge" \fBVistaIOFirstEdge\fP returns the first edge in the linked list of edge records associated with an edge set. .PP \fBVistaIONextEdge\fP returns the next edge in a set of edges. (The edges are chained in a linked list.) .PP \fBVistaIOEdgeExists\fP returns .SB FALSE if the edge pointer, \fIedge\fP, does not point to an edge. This is used to detect the end of the linked list when traversing through an edge set. .PP \fBVistaIOEdgeClosed\fP returns .SB TRUE if the edge, \fIedge\fP, is closed (i.e., its last point connects back to its first point). .PP \fBVistaIOEdgeFields\fP returns the array of floating point values for the fields attached to an edge. .PP \fBVistaIOEdgeNPoints\fP returns the number of points in an edge. .PP \fBVistaIOEdgePointArray\fP returns a two-dimensional array, in which the first dimensionthe points and the second indexes each point fields. .SS "VistaIOEdges Representation in a Vista Data File" .nf .ft B \fIattribute-name\fP: edges { .RS nedges: \fInedges\fP npoints: \fInpoints\fP nedge_fields: \fInedge-fields\fP npoint_fields: \fInpoint-fields\fP nrows: \fInrows\fP ncolumns: \fIncolumns\fP data: \fIdata-offset\fP length: \fIdata-length\fP \fIother attributes\fP .RE } .fi .PP The attributes listed above are the same as those accessed by the corresponding macros, with the exception of \fBnpoints\fP which refers to the total number of points in all edges in this edge set. .PP 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, \fIn\fP, in the edge; it is negated if the edge is closed. This is followed by \fInedge_fields\fP edge field values, then \fIn\fP vectors of \fInpoint_fields\fP point field values. .SH 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: .PP .nf .ft B .RS for (e = VistaIOFirstEdge(edges); VistaIOEdgeExists(e); e = VistaIONextEdge(e)) .RS for (i = 0; i < VistaIOEdgeNPoints(e); i++) .RS printf("%f ", (float) VistaIOEdgePointArray(e)[i][0]); .RE .RE .RE .fi .SH "SEE ALSO" .na .nh .BR VistaIOattribute (3) .ad .hy .SH AUTHOR David Lowe Adaption to vistaio: Gert Wollny .SH "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. .RS 2n .IP \fBVistaIOReadEdges\fP 15n Read sets of edges from a Vista data file. .IP \fBVistaIOWriteEdges\fP Write sets of edges to a Vista data file. .IP \fBVistaIOLinkImage\fP Create an edge set by linking connected, non-zero image pixels. .RE