Main Page | File List

Canvas.h File Reference


Detailed Description

The Canvas class is a discrete simulation of the real life canvas.

The canvas is cutted into grid structure, with vReso grids along vertical (Row) direction and hReso horizontal grids along horizontal(Col) direction. Each rectangular grid is called a pixel, or picture element, and is specified by its lower-left (row, col) position. The coordinate system has the lower-left corner of the canvas as its origin, with Row going up and Col going right. The lower-left corner pixel has a coordinate of (0,0), and the upper-right one of (hReso - 1, vReso - 1).

A (x, y) pair means col = x+hReso/2, and row = y+vReso/2.

To each piexel (row, col) on the Canvas, a RGB color value is associated, which can be accessed via index operator [row][col].

WritePPM() writes the Canvas to an image file of PPM format.

Author:
Xianming Chen

Definition in file Canvas.h.

Go to the source code of this file.

Namespaces

namespace  columbia


Generated on Thu Jul 8 10:41:20 2004 by doxygen 1.3.6