All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Pylon::CCameraPixelTypeMapperT< EnumT > Class Template Reference

A camera specific pixeltypemapper (maps device specific pixelformats contained in the generated camera classes to pylon pixeltypes by their name). More...

#include <pylon/PixelTypeMapper.h>

Inheritance diagram for Pylon::CCameraPixelTypeMapperT< EnumT >:
Inheritance graph
[legend]

Public Member Functions

 CCameraPixelTypeMapperT (void)
 Create an empty mapper. Before calling any non-static function.
 
 CCameraPixelTypeMapperT (GenApi::IEnumerationT< EnumT > *pEnumT)
 create a mapper by using the enum node passed.
 
bool IsValid () const
 Checks the objects validity. More...
 
void SetPixelFormatEnumNode (GenApi::IEnumerationT< EnumT > *pEnumT)
 Lazy initialization of the object. More...
 
EPixelType GetPylonPixelTypeFromPixelFormatEnum (EnumT pixelFormatEnumValue) const
 Converts a enumeration node value to a Pylon::EPixelType enum. More...
 

Static Public Member Functions

static EPixelType GetPylonPixelTypeByName (const char *pszSymbolicName)
 Returns a Pylon::EPixelType for a given symbolic name. More...
 
static EPixelType GetPylonPixelTypeByName (const String_t &symbolicName)
 Returns a Pylon::EPixelType for a given symbolic name. More...
 
static const char * GetNameByPixelType (EPixelType pixelType, SFNCVersion sfncVer=SFNCVersion_pre2_0)
 Static function that returns a string representation of the given EPixelType. More...
 

Protected Member Functions

void SetPixelFormatEnumNode (GenApi::IEnumeration *pEnum)
 Lazy initialization of the object. More...
 
EPixelType GetPylonPixelTypeFromNodeValue (int64_t nodeValue) const
 Converts a enumeration node value to a Pylon::EPixelType enum. More...
 

Detailed Description

template<typename EnumT>
class Pylon::CCameraPixelTypeMapperT< EnumT >

A camera specific pixeltypemapper (maps device specific pixelformats contained in the generated camera classes to pylon pixeltypes by their name).

Use this mapper to convert a PixelTypeEnums or ChunkPixelFormatEnums enum values to a Pylon_PixelType used for PixelTypeConverter creation. When passing the symbolic name of the pixeltype you can use the static version GetPylonPixelTypeByName. This function will do the lookup everytime you call it. The non-static member function GetPylonPixelTypeFromPixelFormatEnum uses caching to speed up subsequent calls.

The template parameter EnumT is the enumeration type from the camera class (typically Basler_GigECamera::PixelFormatEnums for GigE cameras or Basler_IIDC1394CameraParams::PixelFormatEnums for 1394 cameras)

Member Function Documentation

template<typename EnumT >
static const char* Pylon::CCameraPixelTypeMapperT< EnumT >::GetNameByPixelType ( EPixelType  pixelType,
SFNCVersion  sfncVer = SFNCVersion_pre2_0 
)
inlinestatic

Static function that returns a string representation of the given EPixelType.

Parameters
pixelTypeThe pixel type to return the name for.
sfncVerSFNC Version to use when doing the mapping. Some names have been changed in SFNC 2.0
Returns
Returns the pointer to a null terminated string representing the symbolic name of the pixel type.

Passing Pylon::PixelType_Mono16 will return "Mono16" will be returned. If the pixel type is not known an empty string is returned.

Note
The returned name cannot be used to parameterize the pixel format of a camera device, because the camera's pixel format name can be different. The camera's pixel format name depends on the used standard feature naming convention (SFNC).
template<typename EnumT >
static EPixelType Pylon::CCameraPixelTypeMapperT< EnumT >::GetPylonPixelTypeByName ( const char *  pszSymbolicName)
inlinestatic

Returns a Pylon::EPixelType for a given symbolic name.

Parameters
pszSymbolicNamepointer to the symbolic name. Note: Symbolic names are case sensitive. You can obtain the symbolic name by calling GENAPI_NAMESPACE::IEnumEntry::GetSymbolic()
Returns
Returns the Pylon_PixelType for a given symbolic name.

Static version which does the lookup soley by symbolic string comparison. Passing "Mono16" will return Pylon::PixelType_Mono16. If the name is not found Pylon::PixelType_Undefined will be returned.

template<typename EnumT >
static EPixelType Pylon::CCameraPixelTypeMapperT< EnumT >::GetPylonPixelTypeByName ( const String_t symbolicName)
inlinestatic

Returns a Pylon::EPixelType for a given symbolic name.

Parameters
symbolicNameThe symbolic name. Note: Symbolic names are case sensitive. You can obtain the symbolic name by calling GENAPI_NAMESPACE::IEnumEntry::GetSymbolic()
Returns
Returns the Pylon_PixelType for a given symbolic name.

Static version which does the lookup solely by symbolic string comparison. Passing "Mono16" will return Pylon::PixelType_Mono16. If the name is not found Pylon::PixelType_Undefined will be returned.

EPixelType Pylon::CPixelTypeMapper::GetPylonPixelTypeFromNodeValue ( int64_t  nodeValue) const
inherited

Converts a enumeration node value to a Pylon::EPixelType enum.

Parameters
nodeValuenode value to convert. You can obtain this value by calling GENAPI_NAMESPACE::IEnumeration::GetIntValue.
Returns
Returns the Pylon::EPixelType for a given pixelformat enum value defined in the Enum passed in c'tor

Converts a enumeration node value to a Pylon::EPixelType enum. You must have initialized the mapper before you can call this function.

template<typename EnumT >
EPixelType Pylon::CCameraPixelTypeMapperT< EnumT >::GetPylonPixelTypeFromPixelFormatEnum ( EnumT  pixelFormatEnumValue) const
inline

Converts a enumeration node value to a Pylon::EPixelType enum.

Parameters
pixelFormatEnumValueenumeration value to convert. You obtain this value by calling GENAPI_NAMESPACE::IEnumerationT::GetValue.
Returns
Returns the Pylon::EPixelType for a given pixelformat enum value defined in the enum node passed in c'tor

Converts a enumeration node value to a Pylon::EPixelType enum. You must have initialized the mapper before you can call this function.

template<typename EnumT >
bool Pylon::CCameraPixelTypeMapperT< EnumT >::IsValid ( ) const
inline

Checks the objects validity.

Returns
Returns true if the object is initialized properly.

Essentially this function checks whether you've called SetPixelFormatEnumNode.

void Pylon::CPixelTypeMapper::SetPixelFormatEnumNode ( GenApi::IEnumeration *  pEnum)
inherited

Lazy initialization of the object.

Parameters
pEnumPointer to the enumeration node containing the PixelFormats.

Call this function initialize the mapper when using the default c'tor.

template<typename EnumT >
void Pylon::CCameraPixelTypeMapperT< EnumT >::SetPixelFormatEnumNode ( GenApi::IEnumerationT< EnumT > *  pEnumT)
inline

Lazy initialization of the object.

Parameters
pEnumTPointer to the enumeration node containing the PixelFormats.

Call this function initialize the mapper when using the default c'tor.


The documentation for this class was generated from the following file:

pylon 5.0.5
Copyright © 2006-2016 Basler AG (Thu Aug 11 2016 18:01:28)