Supported by ...


Monochrome cameras can support PIXEL_FORMAT_MONO8, PIXEL_FORMAT_MONO16, and PIXEL_FORMAT_MONO12_PACKED formats.


Color cameras can support PIXEL_FORMAT_YUV422, PIXEL_FORMAT_BAYER8, PIXEL_FORMAT_BAYER16, and PIXEL_FORMAT_BAYER12_PACKED formats. 


The driver and API can also format the image into RGB24, RGB32 or RGB48 for any color camera.


Description


The Pixel Format feature selects the output type of the camera. The full range of possible settings is listed in the table below. For FireWire cameras, Color Coding is the equivalent IIDC feature and needs to be used in conjunction with the IIDC Color Filter ID when using color sensors.


The Pixel Format refers to the output formatted pixel. In cases where the camera's raw pixel size is larger than the output, the data is truncated and the least significant bits are lost. In cases where the camera's raw pixel size is smaller than the output, the least significant bits in the output data are padded with zeros. To determine what the raw pixel size is, see the Max Pixel Size feature. For more information on how the pixel is represented, refer to the Image Data Formats topic in the API reference.


Pixelink cameras that do not support flip or rotate functions on-board have the color coding raw/Bayer filter fixed in a format defined by the sensor. In IIDC, setting the Color Filter ID to a different value will have no effect on the output. In the API, color cameras will accept any of the Bayer formats listed in this table, but they will only implement the default sensor defined formats. For simplicity, PIXEL_FORMAT_BAYER8_GRBG is also defined as PIXEL_FORMAT_BAYER8, PIXEL_FORMAT_BAYER16_GRBG is also defined as PIXEL_FORMAT_BAYER16, and PIXEL_FORMAT_BAYER12_PACKED_GRBG is also defined as PIXEL_FORMAT_BAYER12_PACKED. These simplified compiler definitions can be used to set the BAYER8, BAYER16, or BAYER12_PACKED formats without having to know what the default configuration is.


Note: While the camera pixel format is not affected by a rotation or flip, the captured frame will have the rotation or flip applied in the driver. The pixel format of the captured frame is recorded in the frame descriptor that is returned along with the image buffer. This pixel format value will be different depending on the rotation and flip settings.   Applications that process the raw Bayer formats will have to take these orientations into account.


The driver and API can also format the image into RGB24, RGB32 or RGB48 using the PxLFormatImage function.


IIDC Name
API Name
Description
Mono8 (0)
PIXEL_FORMAT_MONO8
Grayscale, 8 bits per pixel.
Mono16 (5)
PIXEL_FORMAT_MONO16
Grayscale, 16 bits per pixel, where the first byte is the most significant byte.
N/A
PIXEL_FORMAT_
MONO12_PACKED
Grayscale, 12 bits per pixel, so 2 pixels are represented in 3 image bytes. The first byte will contain the 8 most significant bits of the first pixel, while the 4 least significant bits of the second byte, will contain the 4 least significant bits of the second pixel, while the 3rd byte will contain the most significant 8 bits of the second pixel. 
4:2:2 YUV (2)
PIXEL_FORMAT_YUV422
Color, 16 bits per pixel, with a coding pattern of U0, Y0, V0, Y1, U2, Y2, V2, Y3
Raw8 (9) Filter ID = 0
PIXEL_FORMAT_
BAYER8_RGGB
8 bits per pixel. Data in Bayer pattern format with first pixel being red.
Raw8 (9) Filter ID = 2
PIXEL_FORMAT_
BAYER8_GRBG or 
PIXEL_FORMAT_BAYER8
8 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line).
Raw8 (9) Filter ID = 1
PIXEL_FORMAT_
BAYER8_GBRG
8 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line).
Raw8 (9) Filter ID = 3
PIXEL_FORMAT_
BAYER8_BGGR
8 bits per pixel. Data in Bayer pattern format with first pixel being blue.
Raw16 (10) Filter ID = 0
PIXEL_FORMAT_
BAYER16_RGGB
16 bits per pixel. Data in Bayer pattern format with first pixel being red.
Raw16 (10) Filter ID = 2
PIXEL_FORMAT_
BAYER16_GRBG or PIXEL_FORMAT_BAYER16
16 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line).
Raw16 (10) Filter ID = 1

PIXEL_FORMAT_
BAYER16_GBRG
16 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line)..
Raw16 (10) Filter ID = 3
PIXEL_FORMAT_
BAYER16_BGGR
16 bits per pixel. Data in Bayer pattern format with first pixel being blue.
N/A
PIXEL_FORMAT_BAYER!@_
RGGB_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being red. See PIXEL_FORMAT_MONO12_PACKED for packing information.
N/A
PIXEL_FORMAT_BAYER12_
GRBG_PACKED or PIXEL_FORMAT_BAYER12_
PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being green ( on a red line). See PIXEL_FORMAT_MONO12_PACKED. 
N/A
PIXEL_FORMAT_BAYER12_
GBRG_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line). See PIXEL_FORMAT_MONO12_PACKED for packing information. 
N/A
PIXEL_FORMAT_
BAYER12_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being blue. See PIXEL_FORMAT_MONO12_PACKED for packing information.
RGB8 (4)
PIXEL_FORMAT_RGB24
Color, 24 bits per pixel.
RGB16 (8)
PIXEL_FORMAT_RGB48
Color, 48 bits per pixel.
N/A
PIXEL_FORMAT_RGB32
Color, 32 bits per pixel in the format (R,G,B,0)



API Control

PxLGetFeaturePxLSetFeature


FEATURE ID
Number of Params
Parameters
Units
Restrictions 
FEATURE_PIXEL_FORMAT 

Format of the pixel data.

1
fValue
N/A
Integer Only (see Pixel Format)


Note: The Pixel Format returned in the frame descriptor in PxlGetNextFrame will reflect that settings of FEATURE_ROTATE and FEATURE_FLIP, and may be different than the setting of FEATURE_PIXEL_FORMAT reported by the camera.


Note: The stream state must be off (STREAM_OFF) to modify this feature.  See PxLSetStreamState.   


Feature Flags


Camera
Presence
Read Only
Auto
Manual
One-time Auto
Off
CiD
All Cameras
Yes
No
No
Yes
No
No
Yes


Parameters


Camera
Parameter
Unit
Type
Min
Max
Default
Step Size
Comments
Monochrome
Color Coding 
Format
None
Absolute
0
5
0
N/A
Not all modes between 
the min and max 
value are supported.
Color
Color coding 
format
None
Absolute
2
10
9
N/A
Not all modes between 
the min and max 
value are supported.