Program Listing for File VmbCommonTypes.h

Return to documentation for file (include/VmbC/VmbCommonTypes.h)

/*=============================================================================
  Copyright (C) 2012 - 2021 Allied Vision Technologies.  All Rights Reserved.

  Redistribution of this header file, in original or modified form, without
  prior written consent of Allied Vision Technologies is prohibited.

-------------------------------------------------------------------------------

  File:        VmbCommonTypes.h

-------------------------------------------------------------------------------

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE ARE
  DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=============================================================================*/

#ifndef VMBCOMMONTYPES_H_INCLUDE_
#define VMBCOMMONTYPES_H_INCLUDE_

#ifdef _WIN32
#   include <wchar.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if defined (_MSC_VER)

    typedef __int8              VmbInt8_t;

    typedef unsigned __int8     VmbUint8_t;

    typedef __int16             VmbInt16_t;

    typedef unsigned __int16    VmbUint16_t;

    typedef __int32             VmbInt32_t;

    typedef unsigned __int32    VmbUint32_t;

    typedef __int64             VmbInt64_t;

    typedef unsigned __int64    VmbUint64_t;

#else

    typedef signed char         VmbInt8_t;

    typedef unsigned char       VmbUint8_t;

    typedef short               VmbInt16_t;

    typedef unsigned short      VmbUint16_t;

    typedef int                 VmbInt32_t;

    typedef unsigned int        VmbUint32_t;

    typedef long long           VmbInt64_t;

    typedef unsigned long long  VmbUint64_t;

#endif

    typedef void*               VmbHandle_t;

#if defined(__cplusplus) || defined(__bool_true_false_are_defined)

    typedef bool                VmbBool_t;

#else

    typedef char                VmbBool_t;

#endif

    typedef enum VmbBoolVal
    {
        VmbBoolTrue     = 1,
        VmbBoolFalse    = 0,
    } VmbBoolVal;

    typedef unsigned char       VmbUchar_t;

#ifdef _WIN32

    typedef wchar_t VmbFilePathChar_t;

#    define VMB_FILE_PATH_LITERAL(value) L##value

#else

    typedef char VmbFilePathChar_t;

#    define VMB_FILE_PATH_LITERAL(value) value
#endif

    typedef enum VmbErrorType
    {
        VmbErrorSuccess                 =  0,
        VmbErrorInternalFault           = -1,
        VmbErrorApiNotStarted           = -2,
        VmbErrorNotFound                = -3,
        VmbErrorBadHandle               = -4,
        VmbErrorDeviceNotOpen           = -5,
        VmbErrorInvalidAccess           = -6,
        VmbErrorBadParameter            = -7,
        VmbErrorStructSize              = -8,
        VmbErrorMoreData                = -9,
        VmbErrorWrongType               = -10,
        VmbErrorInvalidValue            = -11,
        VmbErrorTimeout                 = -12,
        VmbErrorOther                   = -13,
        VmbErrorResources               = -14,
        VmbErrorInvalidCall             = -15,
        VmbErrorNoTL                    = -16,
        VmbErrorNotImplemented          = -17,
        VmbErrorNotSupported            = -18,
        VmbErrorIncomplete              = -19,
        VmbErrorIO                      = -20,
        VmbErrorValidValueSetNotPresent = -21,
        VmbErrorGenTLUnspecified        = -22,
        VmbErrorUnspecified             = -23,
        VmbErrorBusy                    = -24,
        VmbErrorNoData                  = -25,
        VmbErrorParsingChunkData        = -26,
        VmbErrorInUse                   = -27,
        VmbErrorUnknown                 = -28,
        VmbErrorXml                     = -29,
        VmbErrorNotAvailable            = -30,
        VmbErrorNotInitialized          = -31,
        VmbErrorInvalidAddress          = -32,
        VmbErrorAlready                 = -33,
        VmbErrorNoChunkData             = -34,
        VmbErrorUserCallbackException   = -35,
        VmbErrorFeaturesUnavailable     = -36,
        VmbErrorTLNotFound              = -37,
        VmbErrorAmbiguous               = -39,
        VmbErrorRetriesExceeded         = -40,
        VmbErrorInsufficientBufferCount = -41,
        VmbErrorCustom                  = 1,
    } VmbErrorType;

    typedef VmbInt32_t VmbError_t;

    typedef struct VmbVersionInfo
    {
        VmbUint32_t             major;
        VmbUint32_t             minor;
        VmbUint32_t             patch;

    } VmbVersionInfo_t;

    typedef enum VmbPixelType
    {
        VmbPixelMono  =         0x01000000,
        VmbPixelColor =         0x02000000
    } VmbPixelType;

    typedef enum VmbPixelOccupyType
    {
        VmbPixelOccupy8Bit  =   0x00080000,
        VmbPixelOccupy10Bit =   0x000A0000,
        VmbPixelOccupy12Bit =   0x000C0000,
        VmbPixelOccupy14Bit =   0x000E0000,
        VmbPixelOccupy16Bit =   0x00100000,
        VmbPixelOccupy24Bit =   0x00180000,
        VmbPixelOccupy32Bit =   0x00200000,
        VmbPixelOccupy48Bit =   0x00300000,
        VmbPixelOccupy64Bit =   0x00400000,
    } VmbPixelOccupyType;

    typedef enum VmbPixelFormatType
    {
         // mono formats
        VmbPixelFormatMono8                   = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0001,
        VmbPixelFormatMono10                  = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0003,
        VmbPixelFormatMono10p                 = VmbPixelMono  | VmbPixelOccupy10Bit | 0x0046,
        VmbPixelFormatMono12                  = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0005,
        VmbPixelFormatMono12Packed            = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0006,
        VmbPixelFormatMono12p                 = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0047,
        VmbPixelFormatMono14                  = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0025,
        VmbPixelFormatMono16                  = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0007,

        // bayer formats
        VmbPixelFormatBayerGR8                = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0008,
        VmbPixelFormatBayerRG8                = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x0009,
        VmbPixelFormatBayerGB8                = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x000A,
        VmbPixelFormatBayerBG8                = VmbPixelMono  | VmbPixelOccupy8Bit  | 0x000B,
        VmbPixelFormatBayerGR10               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000C,
        VmbPixelFormatBayerRG10               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000D,
        VmbPixelFormatBayerGB10               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000E,
        VmbPixelFormatBayerBG10               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x000F,
        VmbPixelFormatBayerGR12               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0010,
        VmbPixelFormatBayerRG12               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0011,
        VmbPixelFormatBayerGB12               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0012,
        VmbPixelFormatBayerBG12               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0013,
        VmbPixelFormatBayerGR12Packed         = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002A,
        VmbPixelFormatBayerRG12Packed         = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002B,
        VmbPixelFormatBayerGB12Packed         = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002C,
        VmbPixelFormatBayerBG12Packed         = VmbPixelMono  | VmbPixelOccupy12Bit | 0x002D,
        VmbPixelFormatBayerGR10p              = VmbPixelMono  | VmbPixelOccupy10Bit | 0x0056,
        VmbPixelFormatBayerRG10p              = VmbPixelMono  | VmbPixelOccupy10Bit | 0x0058,
        VmbPixelFormatBayerGB10p              = VmbPixelMono  | VmbPixelOccupy10Bit | 0x0054,
        VmbPixelFormatBayerBG10p              = VmbPixelMono  | VmbPixelOccupy10Bit | 0x0052,
        VmbPixelFormatBayerGR12p              = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0057,
        VmbPixelFormatBayerRG12p              = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0059,
        VmbPixelFormatBayerGB12p              = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0055,
        VmbPixelFormatBayerBG12p              = VmbPixelMono  | VmbPixelOccupy12Bit | 0x0053,
        VmbPixelFormatBayerGR16               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x002E,
        VmbPixelFormatBayerRG16               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x002F,
        VmbPixelFormatBayerGB16               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0030,
        VmbPixelFormatBayerBG16               = VmbPixelMono  | VmbPixelOccupy16Bit | 0x0031,

         // rgb formats
        VmbPixelFormatRgb8                    = VmbPixelColor | VmbPixelOccupy24Bit | 0x0014,
        VmbPixelFormatBgr8                    = VmbPixelColor | VmbPixelOccupy24Bit | 0x0015,
        VmbPixelFormatRgb10                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x0018,
        VmbPixelFormatBgr10                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x0019,
        VmbPixelFormatRgb12                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x001A,
        VmbPixelFormatBgr12                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x001B,
        VmbPixelFormatRgb14                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x005E,
        VmbPixelFormatBgr14                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x004A,
        VmbPixelFormatRgb16                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x0033,
        VmbPixelFormatBgr16                   = VmbPixelColor | VmbPixelOccupy48Bit | 0x004B,

         // rgba formats
        VmbPixelFormatArgb8                   = VmbPixelColor | VmbPixelOccupy32Bit | 0x0016,
        VmbPixelFormatRgba8                   = VmbPixelFormatArgb8,
        VmbPixelFormatBgra8                   = VmbPixelColor | VmbPixelOccupy32Bit | 0x0017,
        VmbPixelFormatRgba10                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x005F,
        VmbPixelFormatBgra10                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x004C,
        VmbPixelFormatRgba12                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x0061,
        VmbPixelFormatBgra12                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x004E,
        VmbPixelFormatRgba14                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x0063,
        VmbPixelFormatBgra14                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x0050,
        VmbPixelFormatRgba16                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x0064,
        VmbPixelFormatBgra16                  = VmbPixelColor | VmbPixelOccupy64Bit | 0x0051,

         // yuv/ycbcr formats
        VmbPixelFormatYuv411                  = VmbPixelColor | VmbPixelOccupy12Bit | 0x001E,
        VmbPixelFormatYuv422                  = VmbPixelColor | VmbPixelOccupy16Bit | 0x001F,
        VmbPixelFormatYuv444                  = VmbPixelColor | VmbPixelOccupy24Bit | 0x0020,
        VmbPixelFormatYuv422_8                = VmbPixelColor | VmbPixelOccupy16Bit | 0x0032,
        VmbPixelFormatYCbCr8_CbYCr            = VmbPixelColor | VmbPixelOccupy24Bit | 0x003A,
        VmbPixelFormatYCbCr422_8              = VmbPixelColor | VmbPixelOccupy16Bit | 0x003B,
        VmbPixelFormatYCbCr411_8_CbYYCrYY     = VmbPixelColor | VmbPixelOccupy12Bit | 0x003C,
        VmbPixelFormatYCbCr601_8_CbYCr        = VmbPixelColor | VmbPixelOccupy24Bit | 0x003D,
        VmbPixelFormatYCbCr601_422_8          = VmbPixelColor | VmbPixelOccupy16Bit | 0x003E,
        VmbPixelFormatYCbCr601_411_8_CbYYCrYY = VmbPixelColor | VmbPixelOccupy12Bit | 0x003F,
        VmbPixelFormatYCbCr709_8_CbYCr        = VmbPixelColor | VmbPixelOccupy24Bit | 0x0040,
        VmbPixelFormatYCbCr709_422_8          = VmbPixelColor | VmbPixelOccupy16Bit | 0x0041,
        VmbPixelFormatYCbCr709_411_8_CbYYCrYY = VmbPixelColor | VmbPixelOccupy12Bit | 0x0042,
        VmbPixelFormatYCbCr422_8_CbYCrY       = VmbPixelColor | VmbPixelOccupy16Bit | 0x0043,
        VmbPixelFormatYCbCr601_422_8_CbYCrY   = VmbPixelColor | VmbPixelOccupy16Bit | 0x0044,
        VmbPixelFormatYCbCr709_422_8_CbYCrY   = VmbPixelColor | VmbPixelOccupy16Bit | 0x0045,
        VmbPixelFormatYCbCr411_8              = VmbPixelColor | VmbPixelOccupy12Bit | 0x005A,
        VmbPixelFormatYCbCr8                  = VmbPixelColor | VmbPixelOccupy24Bit | 0x005B,

        VmbPixelFormatLast,
    } VmbPixelFormatType;

    typedef VmbUint32_t VmbPixelFormat_t;

#ifdef __cplusplus
}
#endif

#endif // VMBCOMMONTYPES_H_INCLUDE_