Changeset 212
- Timestamp:
- 03/26/06 19:50:39 (3 years ago)
- Files:
-
- trunk/hal/lpc2106-cmucam3/cc3.c (modified) (6 diffs)
- trunk/lib/cc3_ilp/cc3_ilp.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
r211 r212 41 41 static bool _cc3_second_green_valid; 42 42 43 static void _cc3_update_frame_bounds ( );43 static void _cc3_update_frame_bounds (cc3_frame_t *); 44 44 45 45 void cc3_pixbuf_load () … … 245 245 int width = cc3_g_current_frame.width; 246 246 247 int row_limit = (cc3_g_current_frame.y1 - cc3_g_current_frame.y_loc)247 unsigned int row_limit = (cc3_g_current_frame.y1 - cc3_g_current_frame.y_loc) 248 248 / cc3_g_current_frame.y_step; 249 249 … … 288 288 } else if (cc3_g_current_frame.x_step + x 289 289 >= cc3_g_current_frame.raw_width) { 290 _cc3_pixbuf_skip_pixels ((cc3_g_current_frame.raw_width - x) / 2); 290 //printf("outside the window\n"); 291 _cc3_pixbuf_skip_pixels ((cc3_g_current_frame.raw_width - x - 1) / 2); 291 292 // and we're done with this row 292 293 } else { 293 _cc3_pixbuf_skip_pixels (cc3_g_current_frame.x_step / 2); 294 //printf("inside the window\n"); 295 _cc3_pixbuf_skip_pixels ((cc3_g_current_frame.x_step - 1) / 2); 294 296 x += cc3_g_current_frame.x_step; 295 297 } … … 309 311 * cc3_wait_ms(): 310 312 * 311 * This function returns the time since startup in ms as a uint32312 313 */ 313 314 void cc3_wait_ms (uint32_t delay) … … 367 368 uint8_t y_step) 368 369 { 369 // can't be < 0 if unsigned 370 /* 371 if (x_step < 0 || y_step < 0) 372 return 0; 373 */ 370 int result = 1; 371 372 if (x_step == 0) { 373 x_step = 1; 374 result = 0; 375 } 376 if (y_step == 0) { 377 y_step = 1; 378 result = 0; 379 } 380 381 // only allow even subsampling (or 1) 382 if (x_step != 1 && x_step % 2 != 0) { 383 x_step++; 384 result = 0; 385 } 386 if (y_step != 1 && y_step % 2 != 0) { 387 y_step++; 388 result = 0; 389 } 390 391 374 392 cc3_g_current_frame.x_step = x_step; 375 393 cc3_g_current_frame.y_step = y_step; … … 381 399 382 400 _cc3_update_frame_bounds (&cc3_g_current_frame); 383 return 1; 401 402 return result; 384 403 } 385 404 trunk/lib/cc3_ilp/cc3_ilp.c
r211 r212 28 28 cc3_pixbuf_read_rows(row, 1); 29 29 for (x = 0; x < size_x * 3U; x++) { 30 putchar (row[x]); 30 uint8_t p = row[x]; 31 if (p < 14) { 32 p = 14; 33 } 34 putchar (p); 31 35 } 32 36 } trunk/projects/jpeg-6b/main.c
r210 r212 25 25 // cc3_set_colorspace(CC3_YCRCB); 26 26 cc3_set_resolution(CC3_HIGH_RES); 27 // cc3_pixbuf_set_pixel_mode( CC3_DROP_2ND_GREEN);27 // cc3_pixbuf_set_subsample (CC3_NEAREST, 2, 2); 28 28 cc3_wait_ms(1000); 29 29
