Changeset 367

Show
Ignore:
Timestamp:
02/10/07 13:22:25 (2 years ago)
Author:
anthony_rowe
Message:

security cam added

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/hal/virtual-cam/cc3.c

    r335 r367  
    3131#include "devices.h" 
    3232 
     33char *_cc3_virtual_cam_path_prefix; 
    3334 
    3435// Globals used by CMUCam functions 
     
    6970  static int img_cnt=0; 
    7071   
     72  if( _cc3_virtual_cam_path_prefix==NULL ) 
     73                { 
     74                printf( "*Virtual-Camera Error: No Virtual Cam Path defined!, make sure you call cc3_camera_init()!\n" ); 
     75                exit(0); 
     76                } 
    7177  printf( "cc3_pixbuf_loaded()\n" ); 
    7278  if(_cc3_g_current_camera_state.colorspace==CC3_YCRCB) 
    7379        { 
    74         printf( "Virtual Cam Achtung! Das YCrCb Colorspace ist Verboten...\n" ); 
     80        printf( "*Virtual-Camera Error: Das YCrCb Colorspace ist Verboten...\n" ); 
    7581        exit(0); 
    7682        } 
    7783   
    78   sprintf(filename, "../virtual_cam_imgs/IMG%.5d.PPM", img_cnt); 
     84  sprintf(filename, "%s/IMG%.5d.PPM",_cc3_virtual_cam_path_prefix, img_cnt); 
    7985  img_cnt++; 
    8086  fp=fopen(filename,"r" ); 
    8187  if(fp==NULL ) 
    8288        { 
    83         printf( "Virtual Cam Error: No more test images...\n" ); 
     89        printf( "*Virtual-Camera Error: No more test images...\n" ); 
    8490        printf( "Last tried img: %s\n",filename ); 
    8591        exit(0); 
     
    9298  if(val==EOF)  
    9399        {  
    94         printf( "Virtual Cam Error: Malformed img file\n");    
     100        printf( "*Virtual-Camera Error: Malformed img file\n");    
    95101        exit(0);  
    96102        }  
     
    98104   if(x!=352 && y!=288) 
    99105        { 
    100         printf( "Virtual Cam Error: Bad Image Resolution\n" ); 
     106        printf( "*Virtual-Cam Error: Bad Image Resolution, it must be at the max image size!\n" ); 
    101107        exit(0); 
    102108        } 
     
    151157   if(i>=VIRTUAL_FIFO_SIZE) 
    152158        { 
    153           printf( "Virtual Cam Error: FIFO ran out during frame load.\n" ); 
     159          printf( "*Virtual-Camera Error: FIFO ran out of data during frame load.\n" ); 
    154160          exit(0); 
    155161        } 
     
    586592int cc3_camera_init () 
    587593{ 
     594 
    588595  _cc3_camera_reset (); 
    589596  _cc3_fifo_reset (); 
     
    600607  cc3_frame_default (); 
    601608  printf( "cc3_camera_init()\n" ); 
     609  _cc3_virtual_cam_path_prefix = getenv("CC3_VCAM_PATH");  
     610  if( _cc3_virtual_cam_path_prefix == NULL ) 
     611          { 
     612                printf( "*Virtual-Cam Error:  No CC3_VCAM_PATH defined.\n\nSet CC3_VCAM_PATH in your terminal to specify the directory that contains your virtual-camera test images.\n" ); 
     613          exit(0); 
     614          } 
     615   
    602616  return 1; 
    603617} 
  • trunk/include/cc3.h

    r335 r367  
    4444  CC3_CR = 1, 
    4545  CC3_CB = 2, 
     46  CC3_SINGLE = 0, 
    4647  CC3_ALL 
    4748} cc3_channel_t; 
  • trunk/lib/cc3_ilp/cc3_ilp.h

    r331 r367  
    2626    uint16_t width, height; 
    2727    uint8_t channels; 
     28    uint8_t depth;  // This can be used for binary images etc in the future 
    2829    void* pix; 
    2930} cc3_image_t;