Changeset 243 in cmucam


Ignore:
Timestamp:
04/29/06 18:26:49 (6 years ago)
Author:
goodea
Message:

channels

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/lpc2106-cmucam3/cc3.c

    r228 r243  
    213213uint8_t *cc3_malloc_rows (uint32_t rows) 
    214214{ 
    215   int channels; 
     215  int channels = cc3_g_current_frame.channels; 
    216216  int width = cc3_g_current_frame.width; 
    217  
    218   if (cc3_g_current_frame.coi == CC3_ALL) { 
    219     channels = 3; 
    220   } 
    221   else { 
    222     channels = 1; 
    223   } 
    224217 
    225218  return (uint8_t *) malloc (width * channels * rows); 
     
    487480    return 0;                   // Sanity check on bounds 
    488481  cc3_g_current_frame.coi = chan; 
     482 
     483  cc3_g_current_frame.channels = (chan == CC3_ALL ? 3 : 1); 
     484 
    489485  return 1; 
    490486} 
     
    527523void cc3_frame_default () 
    528524{ 
    529   cc3_g_current_frame.coi = CC3_ALL; 
    530525  cc3_g_current_frame.x_step = 1; 
    531526  cc3_g_current_frame.y_step = 1; 
     
    536531  cc3_g_current_frame.y_loc = 0; 
    537532  cc3_g_current_frame.subsample_mode = CC3_NEAREST; 
     533 
     534  cc3_pixbuf_set_coi(CC3_ALL); 
    538535 
    539536  _cc3_update_frame_bounds (&cc3_g_current_frame); 
  • trunk/include/cc3.h

    r210 r243  
    8484  cc3_subsample_mode_t subsample_mode; 
    8585  uint16_t width, height; 
     86  uint8_t channels; 
    8687} cc3_frame_t; 
    8788 
Note: See TracChangeset for help on using the changeset viewer.