next up previous
Next: 5 Implementation Up: 4 Object Oriented Design Previous: 4.2.4.3 NopProcess class


4.3 Main Program

Following is a highly simplified rough approximation to the anticipated main loop of the Stereocam program, in C++ syntax. It highlights the two greatest benefits of using an Object Oriented methodology for the system -- flexibility and simplicity. Most of the details of the system will be buried in the implementations of the various classes, and these implementations can be changed, added and removed without ever directly affecting other parts of the system.

Input *input;

Process *process;

Output *output;

StereoImage *image;

Dimension outputdim;

 

// Create the desired concrete instantiations. Eg:

input = new MovieFileInput("input.mpg");

process = new NopProcess();

outputdim = process->ProcessDimension(input->GetDimension());

output = new CrystalEyesOutput(outputdim);

 

while( ! image = input->GetImage() ) {

    image = process->ProcessImage(image);

    if( ! output->PutImage(image) )

        break;

}



Kevin Pulo
2000-08-22