VmbCommonTypes.h
Go to the documentation of this file.
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 AVT's 
00036 // Vimba APIs. These type definitions are designed to be portable from other 
00037 // 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 ofVmbPixelFormatType
00153     //
00154     typedef enum VmbPixelOccupyType
00155     {
00156         VmbPixelOccupy8Bit  =    0x00080000,        // Pixel effectively occupies 8 bits
00157         VmbPixelOccupy12Bit =    0x000C0000,        // Pixel effectively occupies 12 bits
00158         VmbPixelOccupy16Bit =    0x00100000,        // Pixel effectively occupies 16 bits
00159         VmbPixelOccupy24Bit =    0x00180000,        // Pixel effectively occupies 24 bits
00160         VmbPixelOccupy32Bit =    0x00200000,        // Pixel effectively occupies 32 bits
00161         VmbPixelOccupy48Bit =    0x00300000         // Pixel effectively occupies 48 bits
00162     } VmbPixelOccupyType;
00163 
00164     //
00165     // Pixel format types.
00166     // As far as possible, the Pixel Naming Convention has been followed, allowing a few deviations.
00167     // If data spans more than one byte, it is always LSB aligned, except if stated differently.
00168     //
00169     typedef enum VmbPixelFormatType
00170     {
00171         VmbPixelFormatMono8           = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0001,  // Monochrome, 8 bits
00172         VmbPixelFormatMono10          = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0003,  // Monochrome, 10 bits in 16 bits
00173         VmbPixelFormatMono12          = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0005,  // Monochrome, 12 bits in 16 bits
00174         VmbPixelFormatMono12Packed    = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0006,  // Monochrome, 2x12 bits in 24 bits
00175         VmbPixelFormatMono14          = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0025,  // Monochrome, 14 bits in 16 bits
00176         VmbPixelFormatMono16          = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0007,  // Monochrome, 16 bits
00177         VmbPixelFormatBayerGR8        = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0008,  // Bayer-color, 8 bits, starting with GR line
00178         VmbPixelFormatBayerRG8        = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0009,  // Bayer-color, 8 bits, starting with RG line
00179         VmbPixelFormatBayerGB8        = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x000A,  // Bayer-color, 8 bits, starting with GB line
00180         VmbPixelFormatBayerBG8        = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x000B,  // Bayer-color, 8 bits, starting with BG line
00181         VmbPixelFormatBayerGR10       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000C,  // Bayer-color, 10 bits in 16 bits, starting with GR line
00182         VmbPixelFormatBayerRG10       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000D,  // Bayer-color, 10 bits in 16 bits, starting with RG line
00183         VmbPixelFormatBayerGB10       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000E,  // Bayer-color, 10 bits in 16 bits, starting with GB line
00184         VmbPixelFormatBayerBG10       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000F,  // Bayer-color, 10 bits in 16 bits, starting with BG line
00185         VmbPixelFormatBayerGR12       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0010,  // Bayer-color, 12 bits in 16 bits, starting with GR line
00186         VmbPixelFormatBayerRG12       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0011,  // Bayer-color, 12 bits in 16 bits, starting with RG line
00187         VmbPixelFormatBayerGB12       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0012,  // Bayer-color, 12 bits in 16 bits, starting with GB line
00188         VmbPixelFormatBayerBG12       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0013,  // Bayer-color, 12 bits in 16 bits, starting with BG line
00189         VmbPixelFormatBayerGR12Packed = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002A,  // Bayer-color, 2x12 bits in 24 bits, starting with GR line
00190         VmbPixelFormatBayerRG12Packed = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002B,  // Bayer-color, 2x12 bits in 24 bits, starting with RG line
00191         VmbPixelFormatBayerGB12Packed = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002C,  // Bayer-color, 2x12 bits in 24 bits, starting with GB line
00192         VmbPixelFormatBayerBG12Packed = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002D,  // Bayer-color, 2x12 bits in 24 bits, starting with BG line
00193         VmbPixelFormatBayerGR16       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x002E,  // Bayer-color, 16 bits, starting with GR line
00194         VmbPixelFormatBayerRG16       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x002F,  // Bayer-color, 16 bits, starting with RG line
00195         VmbPixelFormatBayerGB16       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0030,  // Bayer-color, 16 bits, starting with GB line
00196         VmbPixelFormatBayerBG16       = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0031,  // Bayer-color, 16 bits, starting with BG line
00197         VmbPixelFormatRgb8            = VmbPixelColor | VmbPixelOccupy24Bit | 0x0014,  // RGB, 8 bits x 3
00198         VmbPixelFormatBgr8            = VmbPixelColor | VmbPixelOccupy24Bit | 0x0015,  // BGR, 8 bits x 3
00199         VmbPixelFormatArgb8           = VmbPixelColor | VmbPixelOccupy32Bit | 0x0016,  // ARGB, 8 bits x 4
00200         VmbPixelFormatRgba8           = VmbPixelFormatArgb8,                           // RGBA, 8 bits x 4, legacy name
00201         VmbPixelFormatBgra8           = VmbPixelColor | VmbPixelOccupy32Bit | 0x0017,  // BGRA, 8 bits x 4
00202         VmbPixelFormatRgb12           = VmbPixelColor | VmbPixelOccupy48Bit | 0x001A,  // RGB, 12 bits in 16 bits x 3
00203         VmbPixelFormatRgb16           = VmbPixelColor | VmbPixelOccupy48Bit | 0x0033,  // RGB, 16 bits x 3
00204         VmbPixelFormatYuv411          = VmbPixelColor | VmbPixelOccupy12Bit | 0x001E,  // YUV 411 with 8 bits
00205         VmbPixelFormatYuv422          = VmbPixelColor | VmbPixelOccupy16Bit | 0x001F,  // YUV 422 with 8 bits
00206         VmbPixelFormatYuv444          = VmbPixelColor | VmbPixelOccupy24Bit | 0x0020,  // YUV 444 with 8 bits
00207     } VmbPixelFormatType;
00208     typedef VmbUint32_t VmbPixelFormat_t;           // Type for the pixel format; for values see VmbPixelFormatType
00209 
00210 #ifdef __cplusplus
00211 }
00212 #endif
00213 
00214 #endif // VMBCOMMONTYPES_H_INCLUDE_


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Thu Aug 27 2015 12:29:49