Changeset 210
- Timestamp:
- 03/26/06 15:35:17 (3 years ago)
- Files:
-
- trunk/hal/lpc2106-cmucam3/cc3.c (modified) (7 diffs)
- trunk/include/cc3.h (modified) (1 diff)
- trunk/lib/cc3_ilp/cc3_color_track.c (modified) (2 diffs)
- trunk/lib/cc3_ilp/cc3_ilp.c (modified) (1 diff)
- trunk/projects/cmucam2/cmucam2.c (modified) (3 diffs)
- trunk/projects/hello_world/main.c (modified) (1 diff)
- trunk/projects/jpeg-6b/main.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/hal/lpc2106-cmucam3/cc3.c
r209 r210 40 40 static uint8_t _cc3_second_green; 41 41 static bool _cc3_second_green_valid; 42 43 static void _cc3_update_frame_bounds (); 42 44 43 45 void cc3_pixbuf_load () … … 212 214 { 213 215 int channels; 214 int width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) 215 / cc3_g_current_frame.x_step; 216 int width = cc3_g_current_frame.width; 216 217 217 218 if (cc3_g_current_frame.coi == CC3_ALL) { … … 242 243 uint8_t off0, off1, off2; 243 244 244 int width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) 245 / cc3_g_current_frame.x_step; 245 int width = cc3_g_current_frame.width; 246 246 247 247 int row_limit = (cc3_g_current_frame.y1 - cc3_g_current_frame.y_loc) … … 349 349 cc3_g_current_frame.x1 = x1; 350 350 cc3_g_current_frame.y1 = y1; 351 352 _cc3_update_frame_bounds (&cc3_g_current_frame); 353 351 354 return 1; 352 355 } … … 375 378 cc3_g_current_frame.y1 = cc3_g_current_frame.raw_height; 376 379 cc3_g_current_frame.subsample_mode = mode; 380 381 _cc3_update_frame_bounds (&cc3_g_current_frame); 377 382 return 1; 378 383 } … … 438 443 cc3_g_current_frame.y_loc = 0; 439 444 cc3_g_current_frame.subsample_mode = CC3_NEAREST; 445 446 _cc3_update_frame_bounds (&cc3_g_current_frame); 440 447 } 441 448 … … 582 589 } 583 590 591 void _cc3_update_frame_bounds (cc3_frame_t *f) 592 { 593 f->width = (f->x1 - f->x0) / f->x_step; 594 f->height = (f->y1 - f->y0) / f->y_step; 595 } 596 584 597 /** 585 598 * This sets the hardware colorspace that comes out of the camera. trunk/include/cc3.h
r209 r210 83 83 cc3_channel_t coi; 84 84 cc3_subsample_mode_t subsample_mode; 85 uint16_t width, height; 85 86 } cc3_frame_t; 86 87 trunk/lib/cc3_ilp/cc3_color_track.c
r209 r210 21 21 { 22 22 uint16_t y, x; 23 int height, width;24 23 25 24 uint8_t *row, *pixel; … … 43 42 pixel = row = cc3_malloc_rows(1); 44 43 45 height = (cc3_g_current_frame.y1 - cc3_g_current_frame.y0) 46 / cc3_g_current_frame.y_step; 47 width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) 48 / cc3_g_current_frame.x_step; 49 50 for (y = 0; y < height; y++) { 44 for (y = 0; y < cc3_g_current_frame.height; y++) { 51 45 cc3_pixbuf_read_rows(row, 1); 52 46 53 for (x = 0; x < width; x++) {47 for (x = 0; x < cc3_g_current_frame.width; x++) { 54 48 bool pixel_good = 0; 55 49 trunk/lib/cc3_ilp/cc3_ilp.c
r209 r210 8 8 { 9 9 uint32_t x, y; 10 uint32_t size_x, size_y;11 10 uint8_t *row = cc3_malloc_rows(1); 12 11 13 12 cc3_set_led (1); 14 size_x = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0)15 / cc3_g_current_frame.x_step;16 size_y = (cc3_g_current_frame.y1 - cc3_g_current_frame.y0)17 / cc3_g_current_frame.y_step;18 13 19 14 putchar (1); 20 putchar ( size_x);21 if ( size_y> 255)22 size_y= 255;23 putchar ( size_y);24 for (y = 0; y < size_y; y++) {15 putchar (cc3_g_current_frame.width); 16 if (cc3_g_current_frame.height > 255) 17 cc3_g_current_frame.height = 255; 18 putchar (cc3_g_current_frame.height); 19 for (y = 0; y < cc3_g_current_frame.height; y++) { 25 20 putchar (2); 26 21 27 22 cc3_pixbuf_read_rows(row, 1); 28 for (x = 0; x < size_x * 3; x++) {23 for (x = 0; x < cc3_g_current_frame.width * 3U; x++) { 29 24 putchar (row[x]); 30 25 } trunk/projects/cmucam2/cmucam2.c
r209 r210 238 238 { 239 239 cc3_image_t img; 240 uint16_t i;241 240 img.channels = 3; 242 img.width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) 243 / cc3_g_current_frame.x_step; 241 img.width = cc3_g_current_frame.width; 244 242 img.height = 1; // image will hold just 1 row for scanline processing 245 243 img.pix = malloc (3 * img.width); … … 265 263 cc3_image_t img; 266 264 uint16_t i; 267 int height = (cc3_g_current_frame.y1 - cc3_g_current_frame.y0) / cc3_g_current_frame.y_step;268 265 269 266 img.channels = 3; 270 img.width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) / cc3_g_current_frame.x_step;267 img.width = cc3_g_current_frame.width; 271 268 img.height = 1; // image will hold just 1 row for scanline processing 272 269 img.pix = cc3_malloc_rows(1); … … 284 281 lm_width++; 285 282 putchar (0xAA); 286 if ( height > 255)283 if (cc3_g_current_frame.height > 255) 287 284 lm_height = 255; 288 285 else 289 lm_height = height;286 lm_height = cc3_g_current_frame.height; 290 287 291 288 //putchar(lm_width); trunk/projects/hello_world/main.c
r209 r210 69 69 // setup an image structure 70 70 img.channels=3; 71 img.width= (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) / cc3_g_current_frame.x_step;71 img.width=cc3_g_current_frame.width; 72 72 img.height=1; // image will hold just 1 row for scanline processing 73 73 img.pix = cc3_malloc_rows(1); trunk/projects/jpeg-6b/main.c
r209 r210 81 81 82 82 // parameters for jpeg image 83 cinfo.image_width = (cc3_g_current_frame.x1 - cc3_g_current_frame.x0) / cc3_g_current_frame.x_step;84 cinfo.image_height = (cc3_g_current_frame.y1 - cc3_g_current_frame.y0) / cc3_g_current_frame.y_step;83 cinfo.image_width = cc3_g_current_frame.width; 84 cinfo.image_height = cc3_g_current_frame.height; 85 85 printf( "image width=%d image height=%d\n", cinfo.image_width, cinfo.image_height ); 86 86 cinfo.input_components = 3;
