Skip to content

pylon/PixelType.h#

Definition of types of helper functions concerning image format and pixel type.

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Defines#

Name
PIXEL_MONO
PIXEL_COLOR
PIXEL_CUSTOMTYPE
PIXEL_BIT_COUNT(n)

Macros Documentation#

define PIXEL_MONO#

#define PIXEL_MONO (0x01000000)

define PIXEL_COLOR#

#define PIXEL_COLOR (0x02000000)

define PIXEL_CUSTOMTYPE#

#define PIXEL_CUSTOMTYPE (0x80000000)

define PIXEL_BIT_COUNT#

#define PIXEL_BIT_COUNT(
    n
)
((n) << 16)

Source code#

//-----------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2006-2022 Basler AG
//  http://www.baslerweb.com
//  Author:  Hartmut Nebelung, Edgar Katzer, AG
//-----------------------------------------------------------------------------
#ifndef INCLUDED_PIXELTYPE_H_1534845
#define INCLUDED_PIXELTYPE_H_1534845

#if _MSC_VER > 1000
#pragma once
#endif

#include <pylon/Platform.h>

#ifdef _MSC_VER
#   pragma pack(push, PYLON_PACKING)
#endif /* _MSC_VER */


#include <pylon/PylonBase.h>

namespace Pylon
{
    // Bitmask value of the monochrome type. Internal use only.
#define PIXEL_MONO  (0x01000000)
    // Bitmask value of the color pixel type. Internal use only.
#define PIXEL_COLOR (0x02000000)
    // Pixel type is not standard
#define PIXEL_CUSTOMTYPE (0x80000000)
    // Sets the bit count of pixel type. Internal use only.
#define PIXEL_BIT_COUNT(n) ((n) << 16)

    enum EPixelType
    {
        PixelType_Undefined = -1, 
        PixelType_Mono1packed = PIXEL_CUSTOMTYPE | PIXEL_MONO | PIXEL_BIT_COUNT( 1 ) | 0x000c,  
        PixelType_Mono2packed = PIXEL_CUSTOMTYPE | PIXEL_MONO | PIXEL_BIT_COUNT( 2 ) | 0x000d,  
        PixelType_Mono4packed = PIXEL_CUSTOMTYPE | PIXEL_MONO | PIXEL_BIT_COUNT( 4 ) | 0x000e,  

        PixelType_Mono8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0001,           
        PixelType_Mono8signed = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0002,     
        PixelType_Mono10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0003,         
        PixelType_Mono10packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0004,   
        PixelType_Mono10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0046,        
        PixelType_Mono12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0005,         
        PixelType_Mono12packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0006,   
        PixelType_Mono12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0047,        
        PixelType_Mono16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0007,         

        PixelType_BayerGR8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0008,  
        PixelType_BayerRG8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0009,  
        PixelType_BayerGB8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x000a,  
        PixelType_BayerBG8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x000b,  

        PixelType_BayerGR10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000c,  
        PixelType_BayerRG10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000d,  
        PixelType_BayerGB10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000e,  
        PixelType_BayerBG10 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x000f,  

        PixelType_BayerGR12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0010,  
        PixelType_BayerRG12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0011,  
        PixelType_BayerGB12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0012,  
        PixelType_BayerBG12 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0013,  

        PixelType_RGB8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0014,  
        PixelType_BGR8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0015,  

        PixelType_RGBA8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x0016,  
        PixelType_BGRA8packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x0017,  

        PixelType_RGB10packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0018,  
        PixelType_BGR10packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0019,  

        PixelType_RGB12packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x001a,  
        PixelType_BGR12packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x001b,  

        PixelType_RGB16packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0033,  

        PixelType_BGR10V1packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x001c,  
        PixelType_BGR10V2packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 32 ) | 0x001d,  

        PixelType_YUV411packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x001e,  
        PixelType_YUV422packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x001f,  
        PixelType_YUV444packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0020,  

        PixelType_RGB8planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0021,   
        PixelType_RGB10planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0022,  
        PixelType_RGB12planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0023,  
        PixelType_RGB16planar = PIXEL_COLOR | PIXEL_BIT_COUNT( 48 ) | 0x0024,  

        PixelType_YUV422_YUYV_Packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0032,                
        PixelType_YUV444planar = PIXEL_CUSTOMTYPE | PIXEL_COLOR | PIXEL_BIT_COUNT( 24 ) | 0x0044,   
        PixelType_YUV422planar = PIXEL_CUSTOMTYPE | PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0042,   
        PixelType_YUV420planar = PIXEL_CUSTOMTYPE | PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x0040,   

        PixelType_YCbCr420_8_YY_CbCr_Semiplanar = PIXEL_COLOR | PIXEL_BIT_COUNT( 12 ) | 0x0112,   
        PixelType_YCbCr422_8_YY_CbCr_Semiplanar = PIXEL_COLOR | PIXEL_BIT_COUNT( 16 ) | 0x0113,   

        PixelType_BayerGR12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002A,  
        PixelType_BayerRG12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002B,  
        PixelType_BayerGB12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002C,  
        PixelType_BayerBG12Packed = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x002D,  

        PixelType_BayerGR10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0056,  
        PixelType_BayerRG10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0058,  
        PixelType_BayerGB10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0054,  
        PixelType_BayerBG10p = PIXEL_MONO | PIXEL_BIT_COUNT( 10 ) | 0x0052,  

        PixelType_BayerGR12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0057,  
        PixelType_BayerRG12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0059,  
        PixelType_BayerGB12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0055,  
        PixelType_BayerBG12p = PIXEL_MONO | PIXEL_BIT_COUNT( 12 ) | 0x0053,  

        PixelType_BayerGR16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x002E,  
        PixelType_BayerRG16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x002F,  
        PixelType_BayerGB16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0030,  
        PixelType_BayerBG16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0031,  

        PixelType_RGB12V1packed = PIXEL_COLOR | PIXEL_BIT_COUNT( 36 ) | 0x0034,  

        PixelType_Double = PIXEL_CUSTOMTYPE | PIXEL_MONO | PIXEL_BIT_COUNT( 64 ) | 0x100,  

        // For ToF
        PixelType_Confidence8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x00C6,       
        PixelType_Confidence16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x00C7,     
        PixelType_Coord3D_C8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x00B1,        
        PixelType_Coord3D_C16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x00B8,      
        PixelType_Coord3D_ABC32f = PIXEL_COLOR | PIXEL_BIT_COUNT( 96 ) | 0x00C0,  

        // General formats
        PixelType_Data8 = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0116,      
        PixelType_Data8s = PIXEL_MONO | PIXEL_BIT_COUNT( 8 ) | 0x0117,     
        PixelType_Data16 = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0118,    
        PixelType_Data16s = PIXEL_MONO | PIXEL_BIT_COUNT( 16 ) | 0x0119,   
        PixelType_Data32 = PIXEL_MONO | PIXEL_BIT_COUNT( 32 ) | 0x011A,    
        PixelType_Data32s = PIXEL_MONO | PIXEL_BIT_COUNT( 32 ) | 0x011B,   
        PixelType_Data64 = PIXEL_MONO | PIXEL_BIT_COUNT( 64 ) | 0x011D,    
        PixelType_Data64s = PIXEL_MONO | PIXEL_BIT_COUNT( 64 ) | 0x011E,   
        PixelType_Data32f = PIXEL_MONO | PIXEL_BIT_COUNT( 32 ) | 0x011C,   
        PixelType_Data64f = PIXEL_MONO | PIXEL_BIT_COUNT( 64 ) | 0x011F,   
    };

    inline bool IsMonoPacked( EPixelType pixelType )
    {
        if (PixelType_Mono1packed == pixelType)   return true;
        if (PixelType_Mono2packed == pixelType)   return true;
        if (PixelType_Mono4packed == pixelType)   return true;
        if (PixelType_Mono10packed == pixelType)   return true;
        if (PixelType_Mono10p == pixelType)   return true;
        if (PixelType_Mono12packed == pixelType)   return true;
        if (PixelType_Mono12p == pixelType)   return true;

        return false;
    }

    inline bool IsBayerPacked( EPixelType pixelType )
    {
        if (PixelType_BayerGB12Packed == pixelType)   return true;
        if (PixelType_BayerGR12Packed == pixelType)   return true;
        if (PixelType_BayerRG12Packed == pixelType)   return true;
        if (PixelType_BayerBG12Packed == pixelType)   return true;
        if (PixelType_BayerGB10p == pixelType)   return true;
        if (PixelType_BayerGR10p == pixelType)   return true;
        if (PixelType_BayerRG10p == pixelType)   return true;
        if (PixelType_BayerBG10p == pixelType)   return true;
        if (PixelType_BayerGB12p == pixelType)   return true;
        if (PixelType_BayerGR12p == pixelType)   return true;
        if (PixelType_BayerRG12p == pixelType)   return true;
        if (PixelType_BayerBG12p == pixelType)   return true;

        return false;
    }

    inline bool IsRGBPacked( EPixelType pixelType )
    {
        if (PixelType_RGB12V1packed == pixelType) return true;

        return false;
    }

    inline bool IsBGRPacked( EPixelType pixelType )
    {
        if (PixelType_BGR10V1packed == pixelType) return true;
        if (PixelType_BGR10V2packed == pixelType) return true;

        return false;
    }

    inline bool IsPacked( EPixelType pixelType )
    {
        return (IsMonoPacked( pixelType ) || IsBayerPacked( pixelType ) || IsRGBPacked( pixelType ) || IsBGRPacked( pixelType ));
    }

    inline bool IsPackedInLsbFormat( EPixelType pixelType )
    {
        if (PixelType_Mono1packed == pixelType)   return true;
        if (PixelType_Mono2packed == pixelType)   return true;
        if (PixelType_Mono4packed == pixelType)   return true;
        if (PixelType_Mono10p == pixelType)   return true;
        if (PixelType_BayerGB10p == pixelType)   return true;
        if (PixelType_BayerGR10p == pixelType)   return true;
        if (PixelType_BayerRG10p == pixelType)   return true;
        if (PixelType_BayerBG10p == pixelType)   return true;
        if (PixelType_BayerGB12p == pixelType)   return true;
        if (PixelType_BayerGR12p == pixelType)   return true;
        if (PixelType_BayerRG12p == pixelType)   return true;
        if (PixelType_BayerBG12p == pixelType)   return true;
        if (PixelType_Mono12p == pixelType)   return true;

        return false;
    }

    inline uint32_t PlaneCount( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_RGB8planar:
            case PixelType_RGB10planar:
            case PixelType_RGB12planar:
            case PixelType_RGB16planar:
            case PixelType_YUV444planar:
            case PixelType_YUV422planar:
            case PixelType_YUV420planar:
                return 3;
            default:
                return 1;
        }
    }

    inline EPixelType GetPlanePixelType( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_RGB8planar:
            case PixelType_YUV444planar:
            case PixelType_YUV422planar:
            case PixelType_YUV420planar:
                return PixelType_Mono8;
            case PixelType_RGB10planar:
                return PixelType_Mono10;
            case PixelType_RGB12planar:
                return PixelType_Mono12;
            case PixelType_RGB16planar:
                return PixelType_Mono16;
            default:
                return pixelType;
        }
    }

    inline bool IsPlanar( EPixelType pixelType )
    {
        return PlaneCount( pixelType ) > 1;
    }

    enum EPixelColorFilter
    {
        PCF_BayerRG,    
        PCF_BayerGB,    
        PCF_BayerGR,    
        PCF_BayerBG,    
        PCF_Undefined   
    };

    inline EPixelColorFilter GetPixelColorFilter( EPixelType pixelType )
    {
        if (PixelType_BayerGR8 == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG8 == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB8 == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG8 == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR10 == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG10 == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB10 == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG10 == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR12 == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG12 == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB12 == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG12 == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR12Packed == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG12Packed == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB12Packed == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG12Packed == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR10p == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG10p == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB10p == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG10p == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR12p == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG12p == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB12p == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG12p == pixelType)   return PCF_BayerBG;

        if (PixelType_BayerGR16 == pixelType)   return PCF_BayerGR;
        if (PixelType_BayerRG16 == pixelType)   return PCF_BayerRG;
        if (PixelType_BayerGB16 == pixelType)   return PCF_BayerGB;
        if (PixelType_BayerBG16 == pixelType)   return PCF_BayerBG;

        return PCF_Undefined;
    }

    PYLONBASE_API uint32_t BitPerPixel( EPixelType pixelType );

    PYLONBASE_API uint32_t SamplesPerPixel( EPixelType pixelType );

    inline bool IsYUV( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_YUV411packed:
            case PixelType_YUV422_YUYV_Packed:
            case PixelType_YUV422packed:
            case PixelType_YUV444packed:
            case PixelType_YUV444planar:
            case PixelType_YUV422planar:
            case PixelType_YUV420planar:
                return true;
            default:
                return false;
        }
    }

    inline bool IsRGBA( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_RGBA8packed:
                return true;
            default:
                return false;
        }
    }

    inline bool IsRGB( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_RGB8packed:
            case PixelType_RGB10packed:
            case PixelType_RGB12packed:
            case PixelType_RGB16packed:
            case PixelType_RGB8planar:
            case PixelType_RGB10planar:
            case PixelType_RGB12planar:
            case PixelType_RGB16planar:
            case PixelType_RGB12V1packed:
                return true;
            default:
                return IsRGBA( pixelType );
        }
    }

    inline bool IsBGRA( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_BGRA8packed:
                return true;
            default:
                return false;
        }

    }

    inline bool IsBGR( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_BGR8packed:
            case PixelType_BGR10packed:
            case PixelType_BGR12packed:
            case PixelType_BGR10V1packed:
            case PixelType_BGR10V2packed:
                return true;
            default:
                return IsBGRA( pixelType );
        }
    }

    inline bool IsBayer( EPixelType pixelType )
    {
        return GetPixelColorFilter( pixelType ) != PCF_Undefined;
    }

    inline bool IsMono( EPixelType pixelType )
    {
        return (pixelType != PixelType_Undefined) && (PIXEL_MONO == (pixelType & PIXEL_MONO));
    }

    inline bool IsMonoImage( EPixelType pixelType )
    {
        return IsMono( pixelType ) && !IsBayer( pixelType );
    }

    inline bool IsColorImage( EPixelType pixelType )
    {
        bool res = (pixelType != PixelType_Undefined) && (IsBayer( pixelType ) || ((pixelType & PIXEL_COLOR) != 0));
        return res;
    }

    inline bool HasAlpha( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_RGBA8packed:
            case PixelType_BGRA8packed:
                return true;
            default:
                return false;
        }
    }

    inline bool IsFloatingPoint( EPixelType pixelType )
    {
        switch (pixelType)
        {
            case PixelType_Double:
            case PixelType_Coord3D_ABC32f:
            case PixelType_Data32f:
            case PixelType_Data64f:
                return true;
            default:
                return false;
        }
    }

    inline uint32_t GetPixelIncrementX( EPixelType pixelType )
    {
        if (IsBayer( pixelType ))
        {
            return 2;
        }

        switch (pixelType)
        {
            case PixelType_YUV422packed:
                return 2;
            case PixelType_YUV422_YUYV_Packed:
                return 2;
            case PixelType_YUV411packed:
                return 4;
            default:
                return 1;
        }
    }

    inline uint32_t GetPixelIncrementY( EPixelType pixelType )
    {
        if (IsBayer( pixelType ))
        {
            return 2;
        }
        return 1;
    }

    PYLONBASE_API uint32_t BitDepth( EPixelType pixelType );

    PYLONBASE_API bool ComputeStride( size_t& strideBytes, EPixelType pixelType, uint32_t width, size_t paddingX = 0 );

    PYLONBASE_API size_t ComputePaddingX( size_t strideBytes, EPixelType pixelType, uint32_t width );

    PYLONBASE_API size_t ComputeBufferSize( EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX = 0 );

    inline bool GetPixelTypesForUnpacking( EPixelType pixelTypeSource, EPixelType& pixelTypeToImpose, EPixelType& pixelTypeTarget )
    {
        pixelTypeToImpose = pixelTypeSource;
        pixelTypeTarget = PixelType_Undefined;

        if (PixelType_Mono1packed == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono8;
        }
        else if (PixelType_Mono2packed == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono8;
        }
        else if (PixelType_Mono4packed == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono8;
        }
        else if (PixelType_Mono10packed == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_Mono10p == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_Mono12packed == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_Mono12p == pixelTypeSource)
        {
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGB12Packed == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12packed;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGR12Packed == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12packed;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerRG12Packed == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12packed;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerBG12Packed == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12packed;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGB10p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono10p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGR10p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono10p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerRG10p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono10p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerBG10p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono10p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGB12p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerGR12p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerRG12p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12p;
            pixelTypeTarget = PixelType_Mono16;
        }
        else if (PixelType_BayerBG12p == pixelTypeSource)
        {
            pixelTypeToImpose = PixelType_Mono12p;
            pixelTypeTarget = PixelType_Mono16;
        }

        return pixelTypeTarget != PixelType_Undefined;
    }


}

#ifdef _MSC_VER
#   pragma pack(pop)
#endif /* _MSC_VER */

#endif /* INCLUDED_PIXELTYPE_H_1534845 */

Updated on 5 July 2022 at 15:30:01