Changeset 286
- Timestamp:
- 01/10/07 22:33:38 (2 years ago)
- Files:
-
- trunk/include/common.mk (modified) (1 diff)
- trunk/lib/cc3_ilp/cc3_ilp.c (modified) (2 diffs)
- trunk/projects/jpeg-6b/main.c (modified) (1 diff)
- trunk/projects/polly/main.c (modified) (14 diffs)
- trunk/projects/polly/polly_no_cc3.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/common.mk
r279 r286 26 26 27 27 INCLUDES += ../../include/cc3.h 28 29 28 HALDIR=../../hal/$(hal) 30 29 trunk/lib/cc3_ilp/cc3_ilp.c
r285 r286 64 64 } 65 65 66 void cc3_get_pixel (cc3_image_t * img, uint16_t x, uint16_t y,66 inline void cc3_get_pixel (cc3_image_t * img, uint16_t x, uint16_t y, 67 67 cc3_pixel_t * out_pix) 68 68 { … … 81 81 82 82 83 void cc3_set_pixel (cc3_image_t * img, uint16_t x, uint16_t y,83 inline void cc3_set_pixel (cc3_image_t * img, uint16_t x, uint16_t y, 84 84 cc3_pixel_t * in_pix) 85 85 { trunk/projects/jpeg-6b/main.c
r273 r286 97 97 // allocate memory for 1 row 98 98 row = cc3_malloc_rows(1); 99 if(row==NULL) printf( " FUCK, out of memory!\n" );99 if(row==NULL) printf( "Out of memory!\n" ); 100 100 } 101 101 trunk/projects/polly/main.c
r285 r286 9 9 10 10 //#define VIRTUAL_CAM 11 #define MMC_DEBUG 11 12 12 13 #define COLOR_THRESH 25 … … 37 38 int main (void) 38 39 { 39 uint32_t start_time, val;40 uint32_t last_time, val; 40 41 char c; 41 42 cc3_pixel_t p; … … 43 44 cc3_image_t img; 44 45 uint8_t range[WIDTH]; 45 //uint8_t p_img[WIDTH][HEIGHT];46 46 uint8_t p_img[HEIGHT * WIDTH]; 47 47 … … 66 66 67 67 cc3_pixbuf_set_subsample (CC3_NEAREST, 2, 2); 68 cc3_pixbuf_set_coi (CC3_ RED);68 cc3_pixbuf_set_coi (CC3_GREEN); 69 69 70 70 cc3_clr_led (0); … … 100 100 cc3_pixel_t down_pix; 101 101 102 #ifdef MMC_DEBUG 102 103 cc3_set_led(2); 103 104 while(!cc3_read_button()); 104 105 cc3_clr_led(2); 105 106 #endif 106 107 107 108 // clear polly working image … … 113 114 114 115 cc3_pixbuf_load (); 116 117 #ifdef MMC_DEBUG 115 118 cc3_pixbuf_set_coi (CC3_ALL); 116 119 write_raw_fifo_ppm(); 117 120 cc3_pixbuf_set_coi (CC3_GREEN); 118 121 cc3_pixbuf_rewind(); 122 #endif 119 123 120 124 cc3_pixbuf_read_rows (img.pix, cc3_g_current_frame.height); … … 132 136 if (m < r - COLOR_THRESH || m > r + COLOR_THRESH) 133 137 cc3_set_pixel (&polly_img, x, y, &p); 134 //p_img[x][y]=SELECTED;135 138 if (m < d - COLOR_THRESH || m > d + COLOR_THRESH) 136 139 cc3_set_pixel (&polly_img, x, y, &p); 137 //p_img[x][y]=SELECTED;138 140 139 141 } … … 141 143 142 144 connected_component_reduce (&polly_img, MIN_BLOB_SIZE); 145 #ifdef MMC_DEBUG 143 146 matrix_to_pgm (&polly_img); 144 147 #endif 145 148 generate_histogram (&polly_img, range); 146 149 convert_histogram_to_ppm (&polly_img, range); 150 #ifdef MMC_DEBUG 147 151 matrix_to_pgm (&polly_img); 148 149 printf( "Frame done\n" ); 152 #endif 153 printf( "Frame done, time=%d\n",cc3_timer()-last_time ); 154 last_time=cc3_timer(); 150 155 151 156 } … … 423 428 do { 424 429 #ifdef VIRTUAL_CAM 430 sprintf(filename, "img%.5d.pgm", pgm_cnt); 431 #else 425 432 sprintf(filename, "c:/img%.5d.pgm", pgm_cnt); 426 #else427 sprintf(filename, "img%.5d.pgm", pgm_cnt);428 433 #endif 429 434 fp = fopen(filename, "r"); … … 438 443 // print file that you are going to write to stderr 439 444 fprintf(stderr,"%s\r\n", filename); 440 fp = fopen(filename, "w"); 445 fp = fopen(filename, "w"); 441 446 if(fp==NULL || pgm_cnt>200 ) 442 447 { 448 printf( "PGM Can't open file\n" ); 443 449 cc3_set_led(3); 444 450 while(1); … … 454 460 } 455 461 } 456 fflush(fp);457 462 fclose (fp); 458 463 … … 471 476 do { 472 477 #ifdef VIRTUAL_CAM 478 sprintf(filename, "img%.5d.ppm", ppm_cnt); 479 #else 473 480 sprintf(filename, "c:/img%.5d.ppm", ppm_cnt); 474 #else475 sprintf(filename, "img%.5d.ppm", ppm_cnt);476 481 #endif 477 482 f = fopen(filename, "r"); … … 486 491 // print file that you are going to write to stderr 487 492 fprintf(stderr,"%s\r\n", filename); 488 f = fopen(filename, "w"); 493 f = fopen(filename, "w"); 489 494 if(f==NULL || ppm_cnt>200 ) 490 495 { 496 printf( "PPM Can't open file\n" ); 491 497 cc3_set_led(3); 492 498 while(1); … … 506 512 fprintf(f,"\n"); 507 513 } 508 fflush(f);509 514 fclose(f); 510 515 free(row); trunk/projects/polly/polly_no_cc3.c
r284 r286 34 34 int main (void) 35 35 { 36 uint32_t start_time,val;36 uint32_t last_time,val; 37 37 int cnt; 38 38 char c; … … 117 117 generate_histogram(range ); 118 118 convert_histogram_to_ppm(range ); 119 matrix_to_ppm(); 120 119 //matrix_to_ppm(); 120 121 printf( "Frame done. time=%d\n",cc3_timer()-last_time ); 122 last_time=cc3_timer(); 121 123 122 124 }
