Outline of the Image and Vector Class Design
Primary Classes
The base class for all image and vector classes is
ProtoVector<T, R, S>, where T is the pixel type
(eg. float), R is the return type for certain
member functions (such as the function computing the norm of a
vector), and S is a class specifying the dimensions of
the object. Image<T, R> and Vector<T,
R> are derived from ProtoVector<T, R, S>,
with S chosen as ImageSize or
VectorSize for images and vectors respectively. User
image and vector types are derived from Image<T, R>
and Vector<T, R> respectively, with T chosen as
unsigned char and R chosen as float for
ucharImage (the template parameter
S would be chosen as double for a
double image, for example).
Support Classes
A number of additional classes, most of which should be transparent
to the user, provide support for the image and vector classes:
- Subimage<T, R> and Subvector<T,
R> allow subregions of images and vectors to be
selected and assigned. A subimage may, for example, be
extracted from an image and assigned to another subimage, or
to an image of the appropriate size.
- ImageRef<T, R> and VectorRef<T, R>
allow images or vectors which have been constructed within a
function to be returned from that function without unnecessary
copy constructor calls. If the return type of a function is
ImageRef<T, R>, ownership of the actual data
within the returned object is passed out of the function, and
is not destroyed when the returned object goes out of
scope. This return type should not be used when the returned
object is not local to the function from which it is
returned.
- ImageFileInterface<T, R> and
VectorFileInterface<T, R> provide a mechanism
for loading and saving files in different formats. Each file
format has an associated class (currently PGMFile for
PGM format images and ViffFile for Khoros Viff images
and vectors) which is derived from an
ImageFileInterface<T, R> or
VectorFileInterface<T, R> for each of the image
and vector types supported by that file format. Each file format
class is also derived from ImageFile and/or
VectorFile (depending on whether it supports both
images and vectors), which are both derived from
ProtoVectorFile.
Brendt Wohlberg
Last modified: Wed May 6 11:10:33 GMT 1998