// // Torbert, 8 March 2016 // #include // #define M 640 #define N 480 // int main(void) { int rgb[N][M][3] ; // red-green-blue for each pixel // int y , x ; // int xc = 300 ; int yc = 200 ; int r = 15 ; // int dx , dy ; // FILE* fout ; // for( y = 0 ; y < N ; y++ ) { for( x = 0 ; x < M ; x++) { rgb[y][x][0] = 0 ; // red rgb[y][x][1] = 255 ; // green rgb[y][x][2] = 0 ; // blue // dx = x - xc ; dy = y - yc ; // if( dx*dx + dy*dy < r*r ) { rgb[y][x][0] = 0 ; // black rgb[y][x][1] = 0 ; rgb[y][x][2] = 0 ; } } } // // // fout = fopen( "frame000.ppm" , "w" ) ; // fprintf( fout , "P3\n" ) ; fprintf( fout , "%d %d\n" , M , N ) ; fprintf( fout , "255\n" ) ; // for( y = 0 ; y < N ; y++ ) { for( x = 0 ; x < M ; x++) { fprintf( fout , "%d %d %d\n" , rgb[y][x][0] , rgb[y][x][1] , rgb[y][x][2] ) ; } } fclose( fout ) ; // return 0 ; } // // end of file //