home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 10 / mycd10.iso / share / os2 / graficos / qcamdd01 / qcamdd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-30  |  3.7 KB  |  105 lines

  1. /******************************************************************************
  2.  *
  3.  *  QCAMDD.H - Header file for the QuickCam device driver.
  4.  *
  5.  *****************************************************************************/
  6.  
  7. /*
  8.  *  Return codes.
  9.  */
  10. #define QCAM_OK                 0
  11. #define QCAM_ERROR              -1
  12.  
  13. /*
  14.  *  Camera defaults.
  15.  */
  16. #define QCAM_DEF_CONTRAST       104
  17. #define QCAM_DEF_BRIGHT         210
  18.  
  19. /*
  20.  *  Bounds for camera image.
  21.  */
  22. #define QCAM_MIN_LEFT           1
  23. #define QCAM_MIN_TOP            1
  24. #define QCAM_MAX_WIDTH          320
  25. #define QCAM_MAX_HEIGHT         240
  26. #define QCAM_MAX_PALETTE        64
  27.  
  28. /*
  29.  *  Category to use when making IOCTL calls.
  30.  */
  31. #define QCAM_IOCTL_CATEGORY   0xA0      // Should not conflict with others
  32.  
  33. /*
  34.  *  IOCTL functions supported by this driver.
  35.  */
  36. #define QCAM_IOCTL_ALLOC_BUF    1       // Get 32-bit pointer to image buffer
  37. #define QCAM_IOCTL_FREE_BUF     2       // Free the allocated buffer
  38. #define QCAM_IOCTL_GET_FRAME    3       // Fill buffer with camera image
  39. #define QCAM_IOCTL_SET_CAMERA   4       // Make adjustments to camera settings
  40.  
  41. /*
  42.  *  Main structure used to communicate camera settings to the driver.
  43.  */
  44. typedef struct
  45.         {
  46.         USHORT  left;           // Frame within CCD window to view
  47.         USHORT  top;
  48.         USHORT  right;
  49.         USHORT  bottom;
  50.         UCHAR   depth;          // Pixel depth: either 4-bit or 6-bit
  51.         UCHAR   transfer_mode;  // Capture every 1, 2, or 4 pixels
  52.         UCHAR   contrast;       // Camera image adjustments
  53.         UCHAR   exposure;
  54.         UCHAR   balance;
  55.         UCHAR   camera_version; // Version of the camera firmware
  56.         UCHAR   port_number;    // Printer port to connect to (1-3, 0 for auto)
  57.         USHORT  port_address;   // Base address for printer port
  58.         UCHAR   port_mode;      // 0=unidirectional  1=bidirectional
  59.         UCHAR   delay_factor;   // Set the "settling" delays within the driver
  60.         } QCAM_SETTINGS;
  61.  
  62. /*
  63.  *  Things that can be requested in the IOCTL Setup call.  Requests can be
  64.  *  combined in a single call.
  65.  */
  66. #define QCAM_GET_SETTINGS       0x0000  // Just return the current settings
  67. #define QCAM_INITIALIZE         0x0001  // Initialize the camera
  68. #define QCAM_AUTO_CALIBRATE     0x0002  // Determines the white balance
  69. #define QCAM_SET_CONTRAST       0x0004  // Contrast
  70. #define QCAM_SET_EXPOSURE       0x0008  // Exposure time
  71. #define QCAM_SET_DEPTH          0x0010  // Pixel depth
  72. #define QCAM_SET_TRANS_MODE     0x0020  // Every 1, 2, or 4th pixel
  73. #define QCAM_SET_FRAME          0x0040  // Frame within CCD window
  74. #define QCAM_SET_BALANCE        0x0080  // White balance
  75. #define QCAM_SET_PORT           0x0100  // Setup the printer port
  76. #define QCAM_SET_DELAY          0x0200  // Change the delay factor
  77.  
  78. /*
  79.  *  Parameters used when "opening" the camera for use.
  80.  */
  81. #define QCAM_OPEN_NAME          "QCAM$" // Device driver name
  82. #define QCAM_OPEN_SIZE          0L      // Logical file size (not required)
  83. #define QCAM_OPEN_ATTRIBUTE     0L      // Normal file (not required)
  84. #define QCAM_OPEN_FLAG          0x01    // Open device
  85. #define QCAM_OPEN_MODE          0x2042  // Fail on error, deny none, read-write
  86. #define QCAM_OPEN_EABUF         0L      // No extended attributes
  87.  
  88. /*
  89.  *  Parameters used when "reading" images from the camera.
  90.  */
  91. #define QCAM_READ_MAXBUF        57600   // Maximum size required for buffer
  92.  
  93. /*
  94.  *  Valid values for Transfer Modes.
  95.  */
  96. #define QCAM_EVERY_PIXEL        1
  97. #define QCAM_EVERY_2ND_PIXEL    2
  98. #define QCAM_EVERY_4TH_PIXEL    4
  99.                                         
  100. /*
  101.  *  Valid values for bit depth (gray levels).
  102.  */
  103. #define QCAM_DEPTH_16GRAYS      4
  104. #define QCAM_DEPTH_64GRAYS      6
  105.