VistaIOEdges(3)
π NAME π
VistaIOEdges β the edge set representation, bestie. That's it, that's the whole vibe. π¦
β¨ SYNOPSIS β¨
#include <vistaio.h>
VistaIOEdges edges;
VistaIOEdge edge;
VistaIOEdges VistaIOCreateEdges (int nrows, int ncolumns,
int nedge_fields, int npoint_fields)
VistaIOEdge VistaIOAddEdge (VistaIOEdges edges,
VistaIOFloat *edge_fields, int npoints, VistaIOFloat *points,
VistaIOBoolean closed, VistaIOBoolean copy)
VistaIOEdges VistaIOCopyEdges (VistaIOEdges edges)
void VistaIODestroyEdges (VistaIOEdges edges)
int VistaIONEdgeFields (VistaIOEdges edges)
int VistaIONPointFields (VistaIOEdges edges)
int VistaIOEdgesNRows (VistaIOEdges edges)
int VistaIOEdgesNColumns (VistaIOEdges edges)
VistaIOAttrList VistaIOEdgesAttrList (VistaIOEdges edges)
int VistaIONEdges (VistaIOEdges edges)
VistaIOEdge VistaIOFirstEdge (VistaIOEdges edges)
VistaIOEdge VistaIONextEdge (VistaIOEdge edge)
VistaIOBoolean VistaIOEdgeExists (VistaIOEdge edge)
VistaIOBoolean VistaIOEdgeClosed (VistaIOEdge edge)
VistaIOFloat * VistaIOEdgeFields (VistaIOEdge edge)
int VistaIOEdgeNPoints (VistaIOEdge edge)
VistaIOFloat * VistaIOEdgePointArray (VistaIOEdge edge)
π DESCRIPTION π
πΈ Introduction πΈ
okay so picture this: a Vista edge set. Usually it's holding two-dimensional connected edge points or lines that got extracted from images, but lowkey it can also represent any sets of vectors of floating point values. Versatile queen. π
An edge set chilling in memory is referred to by the C pointer type VistaIOEdges. In data files it's identified by the type name edges, and in memory by the VistaIORepnKind code VistaIOEdgesRepn. Since it's 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 like VistaIOReadFile(3), VistaIOWriteFile(3), and VistaIOGetAttr(3). It's giving main character energy, fr fr.
A single edge β one member of an edge set β is referred to by the C pointer type VistaIOEdge.
π Data Structure π
The VistaIOEdges data structure heads a linked list of structures, and each one of those represents 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 VistaIOEdges data structure also specifies the size of the display region in which the edges are to be displayed. So much structure, so much slay.
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. You can do it, bestie, but the display utilities will simply not understand you. π
π§ 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). Both? Yes. Iconic behavior.
VistaIOCreateEdges initializes and returns an empty edge set. The nrows and ncolumns arguments give the size of the display region (usually copied from the size of image from which the edges were derived). nedge_fields and npoint_fields give the number of floating point values that will be attached to each edge and point.
VistaIOAddEdge adds a new edge to edges. npoints is the number of points in this edge. The field values for each of the points is given sequentially in the floating point array points. The values for the fields attached to this edge are given in edge_fields. closed is TRUE if this edge is closed (i.e., the last point connects back to the first point). If copy is TRUE, then a new copy is made of the point and field data so that their storage can be reused. Recycling era. β»οΈ
VistaIOCopyEdges returns a copy of an edge set, made with newly-allocated storage.
VistaIODestroyEdges releases the memory occupied by an edge set, including that occupied by all points and fields of each the edge. Clean up after yourself, it's the polite thing to do. π«Ά
VistaIONEdgeFields 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. So like, decide early. No take-backs.
VistaIONPointFields 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. Same energy as above: locked in at creation, forever. π
VistaIOEdgesNRows 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).
VistaIOEdgesNColumns 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).
VistaIOEdgesAttrList accesses the attribute list associated with an edge set.
VistaIONEdges returns the number of edges currently in an edge set.
π¦ Accessing an Individual Edge π¦
VistaIOFirstEdge returns the first edge in the linked list of edge records associated with an edge set. Gotta start somewhere, and this is the somewhere. β¨
VistaIONextEdge returns the next edge in a set of edges. (The edges are chained in a linked list.) Chain gang, but make it data structures.
VistaIOEdgeExists returns FALSE if 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. Your little "we're done here" detector. π©
VistaIOEdgeClosed returns TRUE if the edge, edge, is closed (i.e., its last point connects back to its first point).
VistaIOEdgeFields returns the array of floating point values for the fields attached to an edge.
VistaIOEdgeNPoints returns the number of points in an edge.
VistaIOEdgePointArray returns a two-dimensional array, in which the first dimension indexes the points and the second indexes each point's fields.
π VistaIOEdges Representation in a Vista Data File π
attribute-name: edges {
nedges: nedges
npoints: npoints
nedge_fields: nedge-fields
npoint_fields: npoint-fields
nrows: nrows
ncolumns: ncolumns
data: data-offset
length: data-length
other attributes
}
The attributes listed above are the same as those accessed by the corresponding macros, with the exception of npoints which 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 by nedge_fields edge field values, then n vectors of npoint_fields point field values. Very "here's the data, in order, no cap." π¦
π₯ 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]);
Nested loops go brrr. π
π SEE ALSO π
π 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.
VistaIOReadEdgesβ Read sets of edges from a Vista data file.VistaIOWriteEdgesβ Write sets of edges to a Vista data file.VistaIOLinkImageβ Create an edge set by linking connected, non-zero image pixels.
and that's the whole page, bestie!! π this was VistaIO Version 1.2.14, dated 24 April 1993 β yes she's vintage, and yes she still eats. periodt. π
β¨
π¦ where this page comes from
- debian bookworm: libvistaio-dev 1.2.19-3 Β· libvista-orig
- debian trixie: libvistaio-dev 1.2.19-3+b2 Β· libvista-orig
- ubuntu jammy: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu noble: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu questing: libvistaio-dev 1.2.19-4
- ubuntu resolute: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- ubuntu stonking: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms