ECE 418 C++ Library Documentation

Introduction

In this course you will be performing different manipulations on images. This library was written to remove some of the more tedius and error-prone aspects from the labs.

The main structure in this library is the Image class and some variations, the ComplexImage and ComplexFFTImage.

The Image class is for images whose pixels are integer-valued, from 0 through 255.

The ComplexImage class (used in Lab 2) is for images whose pixels have complex floating-point values. the ComplexFFTImage class (used in Lab 3) is the same as ComplexImage except it has built-in routines to Fourier-transform and untransform the image.

In addition to using the course-specific structures, you will also use the Complex class, which is an instance of the C++ Standard Template Library's built-in support for complex numbers.

The following documentation will give you enough information to complete all of the labs in this course. You are encouraged to look at the source code of the library.

Loading and saving images

Modifying an image

Complex numbers

The STL that comes with C++ includes support for complex variables. In this class, the Complex type represents floating-point complex variables. Here are some of their more useful features:

Note that in many cases, the double type and Complex types are compatible. That is you can add, multiply, divide, and assign Complex variables with double variables. Therefore, the following code block is valid and will do what you expect it to do.

Complex z (3, 3);
double x = 3;
z /= x; // sets z to 1+i
z = x; // sets z to 3