AddPixelFormat
Top  Previous  Next

Description

Adds the specified pixel format to the list of formats supported by the virtual camera.

[C++]
int
 AddPixelFormat(const char* format, const char* pisImplemented = NULL, const char* pisAvailable = NULL);


Parameters
[C/C++]
 
[in] const char* format  
String specifying the pixel format to add to the list of supported formats. See Remarks for the list of possible values.  
 
[in] const char* pisImplemented  
If not NULL, a <pisImplemented> tag with the specified string will be added to the description of the pixel format entry in the XML file.  
 
[in] const char* pisAvailable  
If not NULL, a <pisAvailable> tag with the specified string will be added to the description of the pixel format entry in the XML file.  
 

Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_INVALIDARG  
Unsupported format  
 

Example 1


This fragment of code instantiates a camera object and sets up initial values for the image transfer :

static CGevCamera* m_pCamera;  
m_pCamera = createCamera();  
 
m_pCamera->SetImageSize (1024, 768);  
m_pCamera->AddPixelFormat("Mono16");  
m_pCamera->AddPixelFormat("RGB8");  
m_pCamera->SetPixelFormat("Mono16");  
 

Example 2


This line of code ads the BayerGR12Packed pixel format and makes its availability dependent on two variables:

m_pCamera->AddPixelFormat("BayerGR12Packed", "isColorCamera", "isGRLayoutAvaliable");  
 
As a result, the following code will be added to the XML file
 
<EnumEntry Name="BayerGR12Packed">  
<pIsImplemented>isColorCamera</pIsImplemented>  
<pIsAvailable>isGRLayoutAvailable</pIsAvailable>  
<Value>17563690</Value>  
</EnumEntry>  


Remarks


This method adds an entry to the PixelFormat feature of the virtual camera. PixelFormat is a mandatory GigE Vision enumerated feature which is automatically created when a virtual camera object is instantiated.

By default, the PixelFormat contains one entry corresponding to the "Mono8" format. To add more pixel formats to the list of supported formats, use one of the following string values as the format parameter for SetPixelFormat:

Format
ID
Description
Bits per pixel
"Mono8"
0x01080001
8-bit monochrome unsigned
8
"Mono8s"
0x01080002
8-bit monochrome signed
8
"Mono10"
0x01100003
10-bit monochrome unpacked
16
"Mono10Packed"
0x010C0004
10-bit monochrome packed
12
"Mono12"
0x01100005
12-bit monochrome unpacked
16
"Mono12Packed"
0x010C0006
12-bit monochrome packed
12
"Mono14"
0x01100025
14-bit monochrome pixel
16
"Mono16"
0x01100007
16-bit monochrome
16
"BayerGR8"
0x01080008
8-bit raw Bayer, GRBG layout
8
"BayerRG8"
0x01080009
8-bit raw Bayer, RGGB layout
8
"BayerGB8"
0x0108000A
8-bit raw Bayer, GBRG layout
8
"BayerBG8"
0x0108000B
8-bit raw Bayer, BGGR layout
8
"BayerGR10"
0x0110000C
10-bit raw Bayer unpacked, GRBG layout
16
"BayerRG10"
0x0110000D
10-bit raw Bayer unpacked, RGGB layout
16
"BayerGB10"
0x0110000E
10-bit raw Bayer unpacked, GBRG layout
16
"BayerBG10"
0x0110000F
10-bit raw Bayer unpacked, BGGR layout
16
"BayerGR12"
0x01100010
12-bit raw Bayer unpacked, GRBG layout
16
"BayerRG12"
0x01100011
12-bit raw Bayer unpacked, RGGB layout
16
"BayerGB12"
0x01100012
12-bit raw Bayer unpacked, GBRG layout
16
"BayerBG12"
0x01100013
12-bit raw Bayer unpacked, BGGR layout
16
"BayerGR10Packed"
0x010C0026
10-bit raw Bayer packed, GRBG layout
12
"BayerRG10Packed"
0x010C0027
10-bit raw Bayer packed, RGGB layout
12
"BayerGB10Packed"
0x010C0028
10-bit raw Bayer packed, GBGR layout
12
"BayerBG10Packed"
0x010C0029
10-bit raw Bayer packed, BGGR layout
12
"BayerGR12Packed"
0x0000002A
12-bit raw Bayer packed, GRBG layout
12
"BayerRG12Packed"
0x0000002B
12-bit raw Bayer packed, RGGB layout
12
"BayerGB12Packed"
0x0000002C
12-bit raw Bayer packed, GBRG layout
12
"BayerBG12Packed"
0x0000002D
12-bit raw Bayer packed, BGGR layout
12
"BayerGR16"
0x0110002E
16-bit raw Bayer unpacked, GRBG layout
16
"BayerRG16"
0x0110002F
16-bit raw Bayer unpacked, RGGB layout
16
"BayerGB16"
0x01100030
16-bit raw Bayer unpacked, GBRG layout
16
"BayerBG16"
0x01100031
16-bit raw Bayer unpacked, BGGR layout
16
"RGB8"
0x02180014
24-bit RGB color
24
"BGR8"
0x02180015
24-bit BGR color
24
"RGBa8"
0x02200016
24-bit RGB color with alpha channel
32
"BGRa8"
0x02200017
24-bit BGR color with alpha channel
32
"RGB10"
0x02300018
30-bit RGB color
48
"BGR10"
0x02300019
30-bit BGR color
48
"RGB12"
0x0230001A
36-bit RGB color
48
"BGR12"
0x0230001B
36-bit BGR color
48
"RGB16"
0x02300033
48-bit RGB color
48
"RGB10V1Packed"
0x0220001C
30-bit BGR color packed
32
"RGB12V1Packed"
0x02240034
36-bit BGR color packed
36
"YUV411_8_UYYVYY"
0x020C001E
12-bit YUV color (YUV 4:1:1)
12
"YUV422_8_UYVY"
0x0210001F
16-bit YUV color (YUV 4:2:2)
16
"YUV8_UYV"
0x02180020
24-bit YUV color (YUV 4:4:4)
24
"RGB8Planar"
0x02180021
24-bit RGB in form of three 8-bit planes
24
"RGB10Planar"
0x02300022
30-bit BGR in form of three 16-bit planes
48
"RGB12Planar"
0x02300023
36-bit BGR in form of three 16-bit planes
48
"RGB16Planar"
0x02300024
48-bit BGR in form of three 16-bit planes
48


To populate the list of formats, this method should be called repeatedly with different values of the first argument. After the list of formats is created, a specific format can be assigned to the by calling SetPixelFormat.

The use of pisImplemented and pisAvailable arguments requires an advanced knowledge of the GenICam standard and XML syntax. For more information please refer to the description of the GenICam standard available at www.genicam.org
.

Note that the camera must be in the disconnected state in order for AddPixelFormat to work.