Chapter 2. A Test Application


IN THIS CHAPTER

C++ Concepts

Class Design

Simple Memory Allocation

Assignment and Copy Constructors

Image Framework Concepts

Image Object Design

Thumbnail Images

Our test application is a simple image processing application that accepts full-resolution grayscale images and produces thumbnails of those images. This is a deliberately simple, inadequate application that we use as a test bed for the C++ techniques we explore in later chapters. Our goal is to use prototypes to evolve our design of a robust, commercial-quality image framework by applying C++ techniques effectively.

A thumbnail image is a much smaller version of an image, which still contains enough image content to look like the original. Web sites, for example, often make use of thumbnail images because they are smaller and faster to transmit. By convention, clicking on a thumbnail image often displays the original, full-resolution image.

With limited details about what this test application should do, the list of design objectives is small. The application will

  • Accept a grayscale image as input.

  • Compute a thumbnail image with a user -specified scale factor (such as 1/2, 1/3, or 1/4 of the size of the original).

It is fairly easy to design and implement a C++ class to solve this problem. Our initial design is very simple, using only these design objectives and good programming practices as a guide. Later, we will expand the design as more requirements are added.

We use this iterative process to show how a design that initially appears to meet the objectives may not be the optimum solution. Techniques and tips introduced later in this book will be used to ensure a solid expandable design that will ultimately meet the goals of a comprehensive image framework.



Applied C++
Applied C++: Practical Techniques for Building Better Software
ISBN: 0321108949
EAN: 2147483647
Year: 2003
Pages: 59

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net