00001 /*============================================================================= 00002 Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved. 00003 00004 Redistribution of this header file, in original or modified form, without 00005 prior written consent of Allied Vision Technologies is prohibited. 00006 00007 ------------------------------------------------------------------------------- 00008 00009 File: VmbCommonTypes.h 00010 00011 Description: Main header file for the common types of the Vimba APIs. 00012 00013 ------------------------------------------------------------------------------- 00014 00015 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 00016 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, 00017 NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00018 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 00019 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00021 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00022 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00024 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 00026 =============================================================================*/ 00027 00028 #ifndef VMBCOMMONTYPES_H_INCLUDE_ 00029 #define VMBCOMMONTYPES_H_INCLUDE_ 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 // This file describes all necessary definitions for types used within 00036 // Allied Vision's Vimba APIs. These type definitions are designed to be 00037 // portable from other languages and other operating systems. 00038 00039 #if defined (_MSC_VER) 00040 00041 // 8 bit signed integer on Microsoft systems 00042 typedef __int8 VmbInt8_t; 00043 // 8 bit unsigned integer on Microsoft systems 00044 typedef unsigned __int8 VmbUint8_t; 00045 // 16 bit signed integer on Microsoft systems 00046 typedef __int16 VmbInt16_t; 00047 // 16 bit unsigned integer on Microsoft systems 00048 typedef unsigned __int16 VmbUint16_t; 00049 // 32 bit signed integer on Microsoft systems 00050 typedef __int32 VmbInt32_t; 00051 // 32 bit unsigned integer on Microsoft systems 00052 typedef unsigned __int32 VmbUint32_t; 00053 // 64 bit signed integer on Microsoft systems 00054 typedef __int64 VmbInt64_t; 00055 // 64 bit unsigned integer on Microsoft systems 00056 typedef unsigned __int64 VmbUint64_t; 00057 00058 #else // for non MS or GNU compilers without any warranty for the size 00059 00060 //#pragma message("Compatibility warning: typedefs in " __FILE__ " may not have the correct number of bits") 00061 00062 // 8 bit signed integer on non-Microsoft systems 00063 typedef signed char VmbInt8_t; 00064 // 8 bit unsigned integer on non-Microsoft systems 00065 typedef unsigned char VmbUint8_t; 00066 // 16 bit signed integer on non-Microsoft systems 00067 typedef short VmbInt16_t; 00068 // 16 bit unsigned integer on non-Microsoft systems 00069 typedef unsigned short VmbUint16_t; 00070 // 32 bit signed integer on non-Microsoft systems 00071 typedef int VmbInt32_t; 00072 // 32 bit signed integer on non-Microsoft systems 00073 typedef unsigned int VmbUint32_t; 00074 // 64 bit signed integer on non-Microsoft systems 00075 typedef long long VmbInt64_t; 00076 // 64 bit unsigned integer on non-Microsoft systems 00077 typedef unsigned long long VmbUint64_t; 00078 00079 #endif 00080 00081 // Handle; e.g. for a camera 00082 typedef void* VmbHandle_t; 00083 00084 // Standard type for boolean values 00085 #if defined(__cplusplus) || defined(__bool_true_false_are_defined) 00086 typedef bool VmbBool_t; 00087 #else 00088 // Boolean type (equivalent to char) 00089 typedef char VmbBool_t; // 1 means true and 0 means false 00090 #endif 00091 // 00092 // enum for bool values 00093 // 00094 typedef enum VmbBoolVal 00095 { 00096 VmbBoolTrue = 1, 00097 VmbBoolFalse = 0, 00098 } VmbBoolVal; 00099 00100 // char type 00101 typedef unsigned char VmbUchar_t; 00102 00103 // 00104 // Error codes, returned by most functions: (not yet complete) 00105 // 00106 typedef enum VmbErrorType 00107 { 00108 VmbErrorSuccess = 0, // No error 00109 VmbErrorInternalFault = -1, // Unexpected fault in VimbaC or driver 00110 VmbErrorApiNotStarted = -2, // VmbStartup() was not called before the current command 00111 VmbErrorNotFound = -3, // The designated instance (camera, feature etc.) cannot be found 00112 VmbErrorBadHandle = -4, // The given handle is not valid 00113 VmbErrorDeviceNotOpen = -5, // Device was not opened for usage 00114 VmbErrorInvalidAccess = -6, // Operation is invalid with the current access mode 00115 VmbErrorBadParameter = -7, // One of the parameters is invalid (usually an illegal pointer) 00116 VmbErrorStructSize = -8, // The given struct size is not valid for this version of the API 00117 VmbErrorMoreData = -9, // More data available in a string/list than space is provided 00118 VmbErrorWrongType = -10, // Wrong feature type for this access function 00119 VmbErrorInvalidValue = -11, // The value is not valid; either out of bounds or not an increment of the minimum 00120 VmbErrorTimeout = -12, // Timeout during wait 00121 VmbErrorOther = -13, // Other error 00122 VmbErrorResources = -14, // Resources not available (e.g. memory) 00123 VmbErrorInvalidCall = -15, // Call is invalid in the current context (e.g. callback) 00124 VmbErrorNoTL = -16, // No transport layers are found 00125 VmbErrorNotImplemented = -17, // API feature is not implemented 00126 VmbErrorNotSupported = -18, // API feature is not supported 00127 VmbErrorIncomplete = -19, // A multiple registers read or write is partially completed 00128 } VmbErrorType; 00129 typedef VmbInt32_t VmbError_t; // Type for an error returned by API methods; for values see VmbErrorType 00130 00131 // 00132 // Version information 00133 // 00134 typedef struct 00135 { 00136 VmbUint32_t major; // Major version number 00137 VmbUint32_t minor; // Minor version number 00138 VmbUint32_t patch; // Patch version number 00139 00140 } VmbVersionInfo_t; 00141 00142 // 00143 // Indicate if pixel is monochrome or RGB. 00144 // 00145 typedef enum VmbPixelType 00146 { 00147 VmbPixelMono = 0x01000000, // Monochrome pixel 00148 VmbPixelColor = 0x02000000 // Pixel bearing color information 00149 } VmbPixelType; 00150 00151 // 00152 // Indicate number of bits for a pixel. Needed for building values of VmbPixelFormatType 00153 // 00154 typedef enum VmbPixelOccupyType 00155 { 00156 VmbPixelOccupy8Bit = 0x00080000, // Pixel effectively occupies 8 bits 00157 VmbPixelOccupy10Bit = 0x000A0000, // Pixel effectively occupies 10 bits 00158 VmbPixelOccupy12Bit = 0x000C0000, // Pixel effectively occupies 12 bits 00159 VmbPixelOccupy14Bit = 0x000E0000, // Pixel effectively occupies 14 bits 00160 VmbPixelOccupy16Bit = 0x00100000, // Pixel effectively occupies 16 bits 00161 VmbPixelOccupy24Bit = 0x00180000, // Pixel effectively occupies 24 bits 00162 VmbPixelOccupy32Bit = 0x00200000, // Pixel effectively occupies 32 bits 00163 VmbPixelOccupy48Bit = 0x00300000, // Pixel effectively occupies 48 bits 00164 VmbPixelOccupy64Bit = 0x00400000, // Pixel effectively occupies 48 bits 00165 } VmbPixelOccupyType; 00166 00167 // 00168 // Pixel format types. 00169 // As far as possible, the Pixel Format Naming Convention (PFNC) has been followed, allowing a few deviations. 00170 // If data spans more than one byte, it is always LSB aligned, except if stated differently. 00171 // 00172 typedef enum VmbPixelFormatType 00173 { 00174 // mono formats 00175 VmbPixelFormatMono8 = VmbPixelMono | VmbPixelOccupy8Bit | 0x0001, // Monochrome, 8 bits (PFNC:Mono8) 00176 VmbPixelFormatMono10 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0003, // Monochrome, 10 bits in 16 bits (PFNC:Mono10) 00177 VmbPixelFormatMono10p = VmbPixelMono | VmbPixelOccupy10Bit | 0x0046, // Monochrome, 10 bits in 16 bits (PFNC:Mono10p) 00178 VmbPixelFormatMono12 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0005, // Monochrome, 12 bits in 16 bits (PFNC:Mono12) 00179 VmbPixelFormatMono12Packed = VmbPixelMono | VmbPixelOccupy12Bit | 0x0006, // Monochrome, 2x12 bits in 24 bits (GEV:Mono12Packed) 00180 VmbPixelFormatMono12p = VmbPixelMono | VmbPixelOccupy12Bit | 0x0047, // Monochrome, 2x12 bits in 24 bits (PFNC:MonoPacked) 00181 VmbPixelFormatMono14 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0025, // Monochrome, 14 bits in 16 bits (PFNC:Mono14) 00182 VmbPixelFormatMono16 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0007, // Monochrome, 16 bits (PFNC:Mono16) 00183 // bayer formats 00184 VmbPixelFormatBayerGR8 = VmbPixelMono | VmbPixelOccupy8Bit | 0x0008, // Bayer-color, 8 bits, starting with GR line (PFNC:BayerGR8) 00185 VmbPixelFormatBayerRG8 = VmbPixelMono | VmbPixelOccupy8Bit | 0x0009, // Bayer-color, 8 bits, starting with RG line (PFNC:BayerRG8) 00186 VmbPixelFormatBayerGB8 = VmbPixelMono | VmbPixelOccupy8Bit | 0x000A, // Bayer-color, 8 bits, starting with GB line (PFNC:BayerGB8) 00187 VmbPixelFormatBayerBG8 = VmbPixelMono | VmbPixelOccupy8Bit | 0x000B, // Bayer-color, 8 bits, starting with BG line (PFNC:BayerBG8) 00188 VmbPixelFormatBayerGR10 = VmbPixelMono | VmbPixelOccupy16Bit | 0x000C, // Bayer-color, 10 bits in 16 bits, starting with GR line (PFNC:BayerGR10) 00189 VmbPixelFormatBayerRG10 = VmbPixelMono | VmbPixelOccupy16Bit | 0x000D, // Bayer-color, 10 bits in 16 bits, starting with RG line (PFNC:BayerRG10) 00190 VmbPixelFormatBayerGB10 = VmbPixelMono | VmbPixelOccupy16Bit | 0x000E, // Bayer-color, 10 bits in 16 bits, starting with GB line (PFNC:BayerGB10) 00191 VmbPixelFormatBayerBG10 = VmbPixelMono | VmbPixelOccupy16Bit | 0x000F, // Bayer-color, 10 bits in 16 bits, starting with BG line (PFNC:BayerBG10) 00192 VmbPixelFormatBayerGR12 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0010, // Bayer-color, 12 bits in 16 bits, starting with GR line (PFNC:BayerGR12) 00193 VmbPixelFormatBayerRG12 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0011, // Bayer-color, 12 bits in 16 bits, starting with RG line (PFNC:BayerRG12) 00194 VmbPixelFormatBayerGB12 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0012, // Bayer-color, 12 bits in 16 bits, starting with GB line (PFNC:BayerGB12) 00195 VmbPixelFormatBayerBG12 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0013, // Bayer-color, 12 bits in 16 bits, starting with BG line (PFNC:BayerBG12) 00196 VmbPixelFormatBayerGR12Packed = VmbPixelMono | VmbPixelOccupy12Bit | 0x002A, // Bayer-color, 2x12 bits in 24 bits, starting with GR line (GEV:BayerGR12Packed) 00197 VmbPixelFormatBayerRG12Packed = VmbPixelMono | VmbPixelOccupy12Bit | 0x002B, // Bayer-color, 2x12 bits in 24 bits, starting with RG line (GEV:BayerRG12Packed) 00198 VmbPixelFormatBayerGB12Packed = VmbPixelMono | VmbPixelOccupy12Bit | 0x002C, // Bayer-color, 2x12 bits in 24 bits, starting with GB line (GEV:BayerGB12Packed) 00199 VmbPixelFormatBayerBG12Packed = VmbPixelMono | VmbPixelOccupy12Bit | 0x002D, // Bayer-color, 2x12 bits in 24 bits, starting with BG line (GEV:BayerBG12Packed) 00200 VmbPixelFormatBayerGR10p = VmbPixelMono | VmbPixelOccupy10Bit | 0x0056, // Bayer-color, 12 bits continuous packed, starting with GR line (PFNC:BayerGR10p) 00201 VmbPixelFormatBayerRG10p = VmbPixelMono | VmbPixelOccupy10Bit | 0x0058, // Bayer-color, 12 bits continuous packed, starting with RG line (PFNC:BayerRG10p) 00202 VmbPixelFormatBayerGB10p = VmbPixelMono | VmbPixelOccupy10Bit | 0x0054, // Bayer-color, 12 bits continuous packed, starting with GB line (PFNC:BayerGB10p) 00203 VmbPixelFormatBayerBG10p = VmbPixelMono | VmbPixelOccupy10Bit | 0x0052, // Bayer-color, 12 bits continuous packed, starting with BG line (PFNC:BayerBG10p) 00204 VmbPixelFormatBayerGR12p = VmbPixelMono | VmbPixelOccupy12Bit | 0x0057, // Bayer-color, 12 bits continuous packed, starting with GR line (PFNC:BayerGR12p) 00205 VmbPixelFormatBayerRG12p = VmbPixelMono | VmbPixelOccupy12Bit | 0x0059, // Bayer-color, 12 bits continuous packed, starting with RG line (PFNC:BayerRG12p) 00206 VmbPixelFormatBayerGB12p = VmbPixelMono | VmbPixelOccupy12Bit | 0x0055, // Bayer-color, 12 bits continuous packed, starting with GB line (PFNC:BayerGB12p) 00207 VmbPixelFormatBayerBG12p = VmbPixelMono | VmbPixelOccupy12Bit | 0x0053, // Bayer-color, 12 bits continuous packed, starting with BG line (PFNC:BayerBG12p) 00208 VmbPixelFormatBayerGR16 = VmbPixelMono | VmbPixelOccupy16Bit | 0x002E, // Bayer-color, 16 bits, starting with GR line (PFNC:BayerGR16) 00209 VmbPixelFormatBayerRG16 = VmbPixelMono | VmbPixelOccupy16Bit | 0x002F, // Bayer-color, 16 bits, starting with RG line (PFNC:BayerRG16) 00210 VmbPixelFormatBayerGB16 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0030, // Bayer-color, 16 bits, starting with GB line (PFNC:BayerGB16) 00211 VmbPixelFormatBayerBG16 = VmbPixelMono | VmbPixelOccupy16Bit | 0x0031, // Bayer-color, 16 bits, starting with BG line (PFNC:BayerBG16) 00212 // rgb formats 00213 VmbPixelFormatRgb8 = VmbPixelColor | VmbPixelOccupy24Bit | 0x0014, // RGB, 8 bits x 3 (PFNC:RGB8) 00214 VmbPixelFormatBgr8 = VmbPixelColor | VmbPixelOccupy24Bit | 0x0015, // BGR, 8 bits x 3 (PFNC:BGR8) 00215 VmbPixelFormatRgb10 = VmbPixelColor | VmbPixelOccupy48Bit | 0x0018, // RGB, 12 bits in 16 bits x 3 (PFNC:RGB12) 00216 VmbPixelFormatBgr10 = VmbPixelColor | VmbPixelOccupy48Bit | 0x0019, // RGB, 12 bits in 16 bits x 3 (PFNC:RGB12) 00217 VmbPixelFormatRgb12 = VmbPixelColor | VmbPixelOccupy48Bit | 0x001A, // RGB, 12 bits in 16 bits x 3 (PFNC:RGB12) 00218 VmbPixelFormatBgr12 = VmbPixelColor | VmbPixelOccupy48Bit | 0x001B, // RGB, 12 bits in 16 bits x 3 (PFNC:RGB12) 00219 VmbPixelFormatRgb16 = VmbPixelColor | VmbPixelOccupy48Bit | 0x0033, // RGB, 16 bits x 3 (PFNC:RGB16) 00220 VmbPixelFormatBgr16 = VmbPixelColor | VmbPixelOccupy48Bit | 0x004B, // RGB, 16 bits x 3 (PFNC:RGB16) 00221 // rgba formats 00222 VmbPixelFormatArgb8 = VmbPixelColor | VmbPixelOccupy32Bit | 0x0016, // ARGB, 8 bits x 4 (PFNC:RGBa8) 00223 VmbPixelFormatRgba8 = VmbPixelFormatArgb8, // RGBA, 8 bits x 4, legacy name 00224 VmbPixelFormatBgra8 = VmbPixelColor | VmbPixelOccupy32Bit | 0x0017, // BGRA, 8 bits x 4 (PFNC:BGRa8) 00225 VmbPixelFormatRgba10 = VmbPixelColor | VmbPixelOccupy64Bit | 0x005F, // RGBA, 8 bits x 4, legacy name 00226 VmbPixelFormatBgra10 = VmbPixelColor | VmbPixelOccupy64Bit | 0x004C, // RGBA, 8 bits x 4, legacy name 00227 VmbPixelFormatRgba12 = VmbPixelColor | VmbPixelOccupy64Bit | 0x0061, // RGBA, 8 bits x 4, legacy name 00228 VmbPixelFormatBgra12 = VmbPixelColor | VmbPixelOccupy64Bit | 0x004E, // RGBA, 8 bits x 4, legacy name 00229 VmbPixelFormatRgba16 = VmbPixelColor | VmbPixelOccupy64Bit | 0x0064, // RGBA, 8 bits x 4, legacy name 00230 VmbPixelFormatBgra16 = VmbPixelColor | VmbPixelOccupy64Bit | 0x0051, // RGBA, 8 bits x 4, legacy name 00231 // yuv/ycbcr formats 00232 VmbPixelFormatYuv411 = VmbPixelColor | VmbPixelOccupy12Bit | 0x001E, // YUV 411 with 8 bits (GEV:YUV411Packed) 00233 VmbPixelFormatYuv422 = VmbPixelColor | VmbPixelOccupy16Bit | 0x001F, // YUV 422 with 8 bits (GEV:YUV422Packed) 00234 VmbPixelFormatYuv444 = VmbPixelColor | VmbPixelOccupy24Bit | 0x0020, // YUV 444 with 8 bits (GEV:YUV444Packed) 00235 VmbPixelFormatYCbCr411_8_CbYYCrYY = VmbPixelColor | VmbPixelOccupy12Bit | 0x003C, // Y´CbCr 411 with 8 bits (PFNC:YCbCr411_8_CbYYCrYY) - identical to VmbPixelFormatYuv411 00236 VmbPixelFormatYCbCr422_8_CbYCrY = VmbPixelColor | VmbPixelOccupy16Bit | 0x0043, // Y´CbCr 422 with 8 bits (PFNC:YCbCr422_8_CbYCrY) - identical to VmbPixelFormatYuv422 00237 VmbPixelFormatYCbCr8_CbYCr = VmbPixelColor | VmbPixelOccupy24Bit | 0x003A, // Y´CbCr 444 with 8 bits (PFNC:YCbCr8_CbYCr) - identical to VmbPixelFormatYuv444 00238 } VmbPixelFormatType; 00239 typedef VmbUint32_t VmbPixelFormat_t; // Type for the pixel format; for values see VmbPixelFormatType 00240 00241 #ifdef __cplusplus 00242 } 00243 #endif 00244 00245 #endif // VMBCOMMONTYPES_H_INCLUDE_