Main Page | Directories | File List | Globals | Related Pages

VideoWrapperTypes.h

Go to the documentation of this file.
00001 //  ==========================================================================================
00009 //  ==========================================================================================
00010 
00011 #ifndef _VIDEOWRAPPERTYPES_H
00012 #define _VIDEOWRAPPERTYPES_H
00013 
00014 
00015 #if defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
00016    #include <windows.h>
00017 #else
00018     #ifndef UNIX
00019         #define UNIX
00020     #endif
00021 #endif
00022 
00023 // ------------------------------------------------------------------------------------------
00024 // misc. type definitions
00025 // ------------------------------------------------------------------------------------------
00026 
00030 typedef int VWBool;
00031 
00032 #ifndef TRUE
00036     #define TRUE    1
00040     #define FALSE   0
00041 #endif
00042 
00043 
00044 // ------------------------------------------------------------------------------------------
00045 // video library and camera handles
00046 // ------------------------------------------------------------------------------------------
00047 
00055 typedef unsigned short VWHVideo;
00056 
00064 typedef unsigned char VWHCamera;
00065 
00066 //
00067 // Makes a video handle from two bytes representing the video lib id and 
00068 // the camera id within that lib
00069 //
00070 #define MAKE_VIDEO_HANDLE(lib, cam)     ((unsigned short)(((unsigned char)((unsigned long)(cam) & 0xff)) | ((unsigned short)((unsigned char)((unsigned long)(lib) & 0xff))) << 8))
00071 
00072 //
00073 // Extracts the camera id (low byte) from a video handle.
00074 //
00075 #define VIDEO_HANDLE_CAMBYTE(w) ((unsigned char)((unsigned long)(w) & 0xff))
00076 
00077 //
00078 // Extracts the video library id (hight byte) from a video handle.
00079 //
00080 #define VIDEO_HANDLE_LIBBYTE(w) ((unsigned char)((unsigned long)(w) >> 8))
00081 
00082 // ------------------------------------------------------------------------------------------
00083 // result codes
00084 // ------------------------------------------------------------------------------------------
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00096 typedef int VWResult;
00097 
00098 // REMEMBER to update the VW_RESULT_DESCRIPTIONS macro when adding or modifying 
00099 // the result code symbols.
00100 
00101 #define VW_SUCCESS                                      0               
00102 #define VW_E_ERROR                                      1               
00103 #define VW_E_NOT_IMPLEMENTED            100             
00104 #define VW_E_INVALID_HANDLE                     101             
00105 #define VW_E_INVALID_CONFIG_STRING      102             
00106 #define VW_E_LIB_NOT_LOADED                     103             
00107 #define VW_E_LIB_ALREADY_LOADED         104             
00108 #define VW_E_LIB_LOAD_FAILED            105             
00109 #define VW_E_INVALID_CAMERA_ID          106             
00110 #define VW_E_MEMORY_ALLOCATION          107             
00111 #define VW_E_CAM_NOT_INITIALIZED        108             
00112 #define VW_E_STRING_OVERFLOW            109             
00113 #define VW_E_NOT_STARTED                        110             
00114 #define VW_E_PLAYING                            300             
00115 #define VW_E_NOT_PLAYING                        301             
00116 #define VW_E_CAPTURING                          302             
00117 #define VW_E_NOT_CAPTURING                      303             
00118 #define VW_E_NO_CAPTURE_DATA            304             
00119 #define VW_E_CANT_CAPTURE_REPLAY        305             
00120 #define VW_E_WRITE_FAILED                       400             
00121 #define VW_E_READ_FAILED                        401             
00122 #define VW_E_NOT_REPLAY_CAM                     402             
00123 #define VW_E_UNSUPPORTED_PROPERTY       500             
00124 #define VW_E_AUTO_UNSUPPORTED           501             
00125 #define VW_E_OUT_OF_RANGE                       502             
00126 #define VW_E_INTERNAL_ERROR                     900             
00128 // This macro is used by VIDEO_getErrDescription in VideoWrapper to generate descriptions of result codes.
00129 // There shouldn't be any need for this macro elsewhere.
00131 #define VW_RESULT_DESCRIPTIONS  \
00132         VW_RESULT_DESC( VW_SUCCESS,                                     "The function succeeded.")\
00133         VW_RESULT_DESC( VW_E_ERROR,                                     "Unspecified error.")\
00134         VW_RESULT_DESC( VW_E_NOT_IMPLEMENTED,           "The function is not implemented.")\
00135         VW_RESULT_DESC( VW_E_INVALID_HANDLE,            "The handle is unknown.")\
00136         VW_RESULT_DESC( VW_E_INVALID_CONFIG_STRING,     "The configuration string is invalid.")\
00137         VW_RESULT_DESC( VW_E_LIB_NOT_LOADED,            "The requested library is not loaded.")\
00138         VW_RESULT_DESC( VW_E_LIB_ALREADY_LOADED,        "The requested library is already loaded.")\
00139         VW_RESULT_DESC( VW_E_LIB_LOAD_FAILED,           "The library failed to load.")\
00140         VW_RESULT_DESC( VW_E_INVALID_CAMERA_ID,         "The camera id specified in the initialization string is not valid.")\
00141         VW_RESULT_DESC( VW_E_MEMORY_ALLOCATION,         "Memory allocation failed.")\
00142         VW_RESULT_DESC( VW_E_CAM_NOT_INITIALIZED,       "The camera has not been initialized.")\
00143         VW_RESULT_DESC( VW_E_STRING_OVERFLOW,           "The string has exceeded its alocated buffer.")\
00144         VW_RESULT_DESC( VW_E_NOT_STARTED,                       "The camera has not been started.")\
00145         VW_RESULT_DESC( VW_E_PLAYING,                           "Operation can not complete because playback is in progress.")\
00146         VW_RESULT_DESC( VW_E_NOT_PLAYING,                       "Operation can not complete because playback is not in progress.")\
00147         VW_RESULT_DESC( VW_E_CAPTURING,                         "Operation can not complete because capture is in progress.")\
00148         VW_RESULT_DESC( VW_E_NOT_CAPTURING,                     "Operation can not complete because capture is not in progress.")\
00149         VW_RESULT_DESC( VW_E_NO_CAPTURE_DATA,           "No captured data exists.")\
00150         VW_RESULT_DESC( VW_E_CANT_CAPTURE_REPLAY,       "Can not capture a replay camera.")\
00151         VW_RESULT_DESC( VW_E_WRITE_FAILED,                      "Failed to write to file.")\
00152         VW_RESULT_DESC( VW_E_READ_FAILED,                       "Failed to read from file.")\
00153         VW_RESULT_DESC( VW_E_NOT_REPLAY_CAM,            "The camera is not a replay camera.")\
00154         VW_RESULT_DESC( VW_E_UNSUPPORTED_PROPERTY,      "The camera property is unsupported.")\
00155         VW_RESULT_DESC( VW_E_AUTO_UNSUPPORTED,          "The camera property doesn't support automatic control.")\
00156         VW_RESULT_DESC( VW_E_OUT_OF_RANGE,                      "The camera property value is out of range.")\
00157         VW_RESULT_DESC( VW_E_INTERNAL_ERROR,            "An unexpected, internal error has occurred within the API.")
00158 
00159 
00163 #define VW_SUCCEEDED(code)      (code == VW_SUCCESS)
00164 
00166 
00167 // ------------------------------------------------------------------------------------------
00168 // pixel format
00169 // ------------------------------------------------------------------------------------------
00171 
00172 
00173 
00174 
00175 
00176 
00177 
00178 
00179 
00180 
00181 
00182 
00186 typedef int VWPixelFormat;
00187 
00188 // TODO: determine if all of these are needed.
00189 // TODO: doc pixel formats
00190 #define VW_PF_COLOR_INDEX                       0x1900  
00191 #define VW_PF_STENCIL_INDEX                     0x1901  
00192 #define VW_PF_DEPTH_COMPONENT           0x1902  
00193 #define VW_PF_RED                                       0x1903  
00194 #define VW_PF_GREEN                                     0x1904  
00195 #define VW_PF_BLUE                                      0x1905  
00196 #define VW_PF_ALPHA                                     0x1906  
00197 #define VW_PF_RGB                                       0x1907  
00198 #define VW_PF_RGBA                                      0x1908  
00199 #define VW_PF_LUMINANCE                         0x1909  
00200 #define VW_PF_LUMINANCE_ALPHA           0x190A  
00202 #define VW_PF_BGR_EXT               0x80E0      
00203 #define VW_PF_BGRA_EXT              0x80E1      
00206 
00207 // ------------------------------------------------------------------------------------------
00208 // camera image properties
00209 // ------------------------------------------------------------------------------------------
00211 
00212 
00213 
00214 
00215 
00216 
00217 
00218 
00219 
00220 
00221 
00222 
00226 typedef int VWCamProp;
00227 
00228 // built-in properties
00229 #define VWCAMPROP_BRIGHTNESS                            100     
00230 #define VWCAMPROP_CONTRAST                                      101     
00231 #define VWCAMPROP_HUE                                           102     
00232 #define VWCAMPROP_SATURATION                            103     
00233 #define VWCAMPROP_SHARPNESS                                     104     
00234 #define VWCAMPROP_GAMMA                                         105     
00235 #define VWCAMPROP_COLORENABLE                           106     
00236 #define VWCAMPROP_WHITEBALANCE                          107     
00237 #define VWCAMPROP_BACKLIGHTCOMPENSATION         108     
00238 #define VWCAMPROP_GAIN                                          109     
00239 #define VWCAMPROP_EXPOSURE                                      110     
00240 #define VWCAMPROP_IRIS                                          111     
00241 #define VWCAMPROP_FOCUS                                         112     
00242 #define VWCAMPROP_ZOOM                                          113     
00243 #define VWCAMPROP_PAN                                           114     
00244 #define VWCAMPROP_TILT                                          115     
00245 #define VWCAMPROP_SHUTTER                                       116     
00246 #define VWCAMPROP_TRIGGER_DELAY                         117     
00248 
00249 
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 
00258 #define VWCAMPROP_CUSTOM                                        1000
00259 
00261 
00262 // ------------------------------------------------------------------------------------------
00263 // misc. symbols
00264 // ------------------------------------------------------------------------------------------
00265 
00269 #define VW_UNLIMITED_BUFFER             -1
00270 
00271 
00272 #endif // ifndef _VIDEOWRAPPERTYPES_H

Generated on Tue Oct 18 12:18:51 2005 for VideoWrapper API by  doxygen 1.4.1