Main Page | File List

main.cpp

Go to the documentation of this file.
00001 /**
00002  *\file         main.cpp
00003  *
00004  *\brief        Lecture one of week one(PM): Use Canvas class and RGB class to generate a checkerboard.
00005  *
00006  *\author       Xianming Chen
00007  *
00008  */
00009 
00010 
00011 #include "Canvas.h"
00012 #include "color.h"
00013 #include <iostream>
00014 
00015 using namespace columbia;
00016 
00017 int main() 
00018 {
00019   try 
00020   {
00021     Canvas canvas;
00022     canvas.filename = "lec11.ppm";
00023   
00024     for(int row = 0; row < canvas.vReso; row++)
00025       for(int col = 0; col < canvas.hReso; col++)
00026       {
00027         canvas[row][col] = (col/32 + row/32) % 2 ? White : Black;
00028       }
00029   
00030     canvas.WritePPM();
00031   }
00032   catch(char const* msg) 
00033   {
00034     std :: cerr << msg << std :: endl;
00035   }
00036   
00037   return 0;
00038 }

Generated on Tue Jul 6 18:12:02 2004 by doxygen 1.3.6