Skip to content

Image Handling Support#

Besides the Instant Camera classes used for grabbing images pylon offers additional classes that support handling the grabbed images. More…

Classes#

Name
struct Pylon::SAviCompressionOptions
Wraps the AVI compression options of the Video for Window API.
class Pylon::CAviWriter
Supports writing AVI files.
interface Pylon::IImage
Usable to access image properties and image buffer.
class Pylon::CImageFormatConverter
Creates new images by converting a source image to another format.
class Pylon::CImagePersistenceOptions
Used to pass options to CImagePersistence methods.
class Pylon::CImagePersistence
Contains static functions supporting loading and saving of images.
struct Pylon::SBGRA8Pixel
Describes the memory layout of a BGRA8 pixel. This pixel is used in Windows bitmaps.
struct Pylon::SBGR8Pixel
Describes the memory layout of a BGR8 pixel. This pixel is used in Windows bitmaps.
struct Pylon::SRGB8Pixel
Describes the memory layout of a RGB8 pixel.
struct Pylon::SRGB16Pixel
Describes the memory layout of a RGB16 pixel.
struct Pylon::SYUV422_UYVY
Describes the memory layout of a YUV422_UYVY pixel with information about brightness and chroma for two pixels.
struct Pylon::SYUV422_YUYV
Describes the memory layout of a YUV422_YUYV pixel with information about brightness and chroma for two pixels.
class Pylon::SPixelData
Describes the data of one pixel.
class Pylon::CPylonBitmapImage
This class can be used to easily create Windows bitmaps for displaying images.
class Pylon::CPylonImageWindow
Class to manage a pylon image window.
class Pylon::CPylonImage
Describes an image.
class Pylon::CPylonImageBase
Provides basic functionality for pylon image classes.
class Pylon::CPylonImageUserBufferEventHandler
The CPylonImage user buffer event handler base class.
interface Pylon::IReusableImage
Extends the IImage interface to be able to reuse the image's resources to represent a different image.

Types#

Name
enum EKeyFrameSelection { KeyFrameSelection_NoKeyFrame, KeyFrameSelection_KeyFrame, KeyFrameSelection_Auto}
List the possibilities for selecting a key frame when using compression.
enum EImageOrientation { ImageOrientation_TopDown, ImageOrientation_BottomUp}
Defines the vertical orientation of an image in memory.
enum EImageFileFormat { ImageFileFormat_Bmp = 0, ImageFileFormat_Tiff = 1, ImageFileFormat_Jpeg = 2, ImageFileFormat_Png = 3, ImageFileFormat_Raw = 4, ImageFileFormat_Dng = 5}
Lists the available file formats.
enum EPixelType { PixelType_Undefined = -1, PixelType_Mono1packed = (0x80000000)
enum EPixelColorFilter { PCF_BayerRG, PCF_BayerGB, PCF_BayerGR, PCF_BayerBG, PCF_Undefined}
Lists the Bayer color filter types.

Functions#

Name
bool IsMonoPacked(EPixelType pixelType)
Returns true if the pixel type is Mono and the pixel values are not byte aligned.
bool IsBayerPacked(EPixelType pixelType)
Returns true if the pixel type is Bayer and the pixel values are not byte aligned.
bool IsRGBPacked(EPixelType pixelType)
Returns true if the pixel type is RGB and the pixel values are not byte aligned.
bool IsBGRPacked(EPixelType pixelType)
Returns true if the pixel type is BGR and the pixel values are not byte aligned.
bool IsPacked(EPixelType pixelType)
Returns true if the pixels of the given pixel type are not byte aligned.
bool IsPackedInLsbFormat(EPixelType pixelType)
uint32_t PlaneCount(EPixelType pixelType)
Returns number of planes in the image composed of the pixel type.
EPixelType GetPlanePixelType(EPixelType pixelType)
Returns the pixel type of a plane.
bool IsPlanar(EPixelType pixelType)
Returns true if images of the pixel type are divided into multiple planes.
bool IsYUVSemiplanar(EPixelType pixelType)
Returns true if pixel type is YUV semiplanar.
EPixelColorFilter GetPixelColorFilter(EPixelType pixelType)
Returns the Bayer color filter type.
uint32_t BitPerPixel(EPixelType pixelType)
Returns the bits needed to store a pixel.
uint32_t SamplesPerPixel(EPixelType pixelType)
Returns the number of measured values per pixel.
bool IsYUV(EPixelType pixelType)
Returns true when the pixel type represents a YUV format.
bool IsRGBA(EPixelType pixelType)
Returns true when the pixel type represents an RGBA format.
bool IsRGB(EPixelType pixelType)
Returns true when the pixel type represents an RGB or RGBA format.
bool IsBGRA(EPixelType pixelType)
Returns true when the pixel type represents a BGRA format.
bool IsBGR(EPixelType pixelType)
Returns true when the pixel type represents a BGR or BGRA format.
bool IsBayer(EPixelType pixelType)
Returns true when the pixel type represents a Bayer format.
bool IsMono(EPixelType pixelType)
Returns true when a given pixel is monochrome, e.g. PixelType_Mono8 or PixelType_BayerGR8.
bool IsMonoImage(EPixelType pixelType)
Returns true when an image using the given pixel type is monochrome, e.g. PixelType_Mono8.
bool IsColorImage(EPixelType pixelType)
Returns true when an image using the given pixel type is a color image (RGB/BGR/RGBA/BGRA/ etc or Bayer.
bool HasAlpha(EPixelType pixelType)
Returns true when an the image using the given pixel type has an alpha channel.
bool IsFloatingPoint(EPixelType pixelType)
Returns true if a given pixel type represents a floating point number.
uint32_t GetPixelIncrementX(EPixelType pixelType)
Returns the minimum step size expressed in pixels for extracting an AOI.
uint32_t GetPixelIncrementY(EPixelType pixelType)
Returns the minimum step size expressed in pixels for extracting an AOI.
uint32_t BitDepth(EPixelType pixelType)
Returns the bit depth of a value of the pixel in bits.
bool ComputeStride(size_t & strideBytes, EPixelType pixelType, uint32_t width, size_t paddingX =0)
Computes the stride in byte.
size_t ComputePaddingX(size_t strideBytes, EPixelType pixelType, uint32_t width)
Computes the padding value from row stride in byte.
size_t ComputeBufferSize(EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX =0)
Computes the buffer size in byte.
bool GetPixelTypesForUnpacking(EPixelType pixelTypeSource, EPixelType & pixelTypeToImpose, EPixelType & pixelTypeTarget)
Returns the pixel types needed for conversion from packed to unpacked image formats using the CImageFormatConverter class.
void DisplayImage(size_t winIndex, const Pylon::IImage & image)
Convenience function to display an image on screen with one function call.

Detailed Description#

Besides the Instant Camera classes used for grabbing images pylon offers additional classes that support handling the grabbed images.

You can find more information here:

Types Documentation#

enum EKeyFrameSelection#

Enumerator Value Description
KeyFrameSelection_NoKeyFrame Indicates that an image is not a key frame.
KeyFrameSelection_KeyFrame Indicates that an image is a key frame.
KeyFrameSelection_Auto Every nth frame is a key frame. The value of n is specified by passing its value in the SAviCompressionOptions in the autoKeyFrameInsertionRate member when opening the AVI Writer.

List the possibilities for selecting a key frame when using compression.

enum EImageOrientation#

Enumerator Value Description
ImageOrientation_TopDown The first row of the image is located at the start of the image buffer. This is the default for images taken by a camera.
ImageOrientation_BottomUp The last row of the image is located at the start of the image buffer.

Defines the vertical orientation of an image in memory.

enum EImageFileFormat#

Enumerator Value Description
ImageFileFormat_Bmp 0 Windows Bitmap, no compression.
ImageFileFormat_Tiff 1 Tagged Image File Format, no compression, supports mono images with more than 8 bit bit depth.
ImageFileFormat_Jpeg 2 Joint Photographic Experts Group, lossy data compression.
ImageFileFormat_Png 3 Portable Network Graphics, lossless data compression.
ImageFileFormat_Raw 4 Saves the raw image buffer data. Packed image formats are unpacked. See GetPixelTypesForUnpacking() for more information. In the format used for saving, the data cannot be loaded using CImagePersistence::Load().
ImageFileFormat_Dng 5 Saves Bayer pattern images in DNG/TIFF format. Packed image formats are unpacked. See GetPixelTypesForUnpacking() for more information. In the format used for saving, the data cannot be loaded using CImagePersistence::Load().

Lists the available file formats.

enum EPixelType#

Enumerator Value Description
PixelType_Undefined -1 Undefined pixel type.
PixelType_Mono1packed (0x80000000) (0x01000000)
PixelType_Mono2packed (0x80000000) (0x01000000)
PixelType_Mono4packed (0x80000000) (0x01000000)
PixelType_Mono8 (0x01000000) (( 8 ) << 16)
PixelType_Mono8signed (0x01000000) (( 8 ) << 16)
PixelType_Mono10 (0x01000000) (( 16 ) << 16)
PixelType_Mono10packed (0x01000000) (( 12 ) << 16)
PixelType_Mono10p (0x01000000) (( 10 ) << 16)
PixelType_Mono12 (0x01000000) (( 16 ) << 16)
PixelType_Mono12packed (0x01000000) (( 12 ) << 16)
PixelType_Mono12p (0x01000000) (( 12 ) << 16)
PixelType_Mono16 (0x01000000) (( 16 ) << 16)
PixelType_BayerGR8 (0x01000000) (( 8 ) << 16)
PixelType_BayerRG8 (0x01000000) (( 8 ) << 16)
PixelType_BayerGB8 (0x01000000) (( 8 ) << 16)
PixelType_BayerBG8 (0x01000000) (( 8 ) << 16)
PixelType_BayerGR10 (0x01000000) (( 16 ) << 16)
PixelType_BayerRG10 (0x01000000) (( 16 ) << 16)
PixelType_BayerGB10 (0x01000000) (( 16 ) << 16)
PixelType_BayerBG10 (0x01000000) (( 16 ) << 16)
PixelType_BayerGR12 (0x01000000) (( 16 ) << 16)
PixelType_BayerRG12 (0x01000000) (( 16 ) << 16)
PixelType_BayerGB12 (0x01000000) (( 16 ) << 16)
PixelType_BayerBG12 (0x01000000) (( 16 ) << 16)
PixelType_RGB8packed (0x02000000) (( 24 ) << 16)
PixelType_BGR8packed (0x02000000) (( 24 ) << 16)
PixelType_RGBA8packed (0x02000000) (( 32 ) << 16)
PixelType_BGRA8packed (0x02000000) (( 32 ) << 16)
PixelType_RGB10packed (0x02000000) (( 48 ) << 16)
PixelType_BGR10packed (0x02000000) (( 48 ) << 16)
PixelType_RGB12packed (0x02000000) (( 48 ) << 16)
PixelType_BGR12packed (0x02000000) (( 48 ) << 16)
PixelType_RGB16packed (0x02000000) (( 48 ) << 16)
PixelType_BGR10V1packed (0x02000000) (( 32 ) << 16)
PixelType_BGR10V2packed (0x02000000) (( 32 ) << 16)
PixelType_YUV411packed (0x02000000) (( 12 ) << 16)
PixelType_YUV422packed (0x02000000) (( 16 ) << 16)
PixelType_YUV444packed (0x02000000) (( 24 ) << 16)
PixelType_RGB8planar (0x02000000) (( 24 ) << 16)
PixelType_RGB10planar (0x02000000) (( 48 ) << 16)
PixelType_RGB12planar (0x02000000) (( 48 ) << 16)
PixelType_RGB16planar (0x02000000) (( 48 ) << 16)
PixelType_YUV422_YUYV_Packed (0x02000000) (( 16 ) << 16)
PixelType_YUV444planar (0x80000000) (0x02000000)
PixelType_YUV422planar (0x80000000) (0x02000000)
PixelType_YUV420planar (0x80000000) (0x02000000)
PixelType_YCbCr420_8_YY_CbCr_Semiplanar (0x02000000) (( 12 ) << 16)
PixelType_YCbCr422_8_YY_CbCr_Semiplanar (0x02000000) (( 16 ) << 16)
PixelType_BayerGR12Packed (0x01000000) (( 12 ) << 16)
PixelType_BayerRG12Packed (0x01000000) (( 12 ) << 16)
PixelType_BayerGB12Packed (0x01000000) (( 12 ) << 16)
PixelType_BayerBG12Packed (0x01000000) (( 12 ) << 16)
PixelType_BayerGR10p (0x01000000) (( 10 ) << 16)
PixelType_BayerRG10p (0x01000000) (( 10 ) << 16)
PixelType_BayerGB10p (0x01000000) (( 10 ) << 16)
PixelType_BayerBG10p (0x01000000) (( 10 ) << 16)
PixelType_BayerGR12p (0x01000000) (( 12 ) << 16)
PixelType_BayerRG12p (0x01000000) (( 12 ) << 16)
PixelType_BayerGB12p (0x01000000) (( 12 ) << 16)
PixelType_BayerBG12p (0x01000000) (( 12 ) << 16)
PixelType_BayerGR16 (0x01000000) (( 16 ) << 16)
PixelType_BayerRG16 (0x01000000) (( 16 ) << 16)
PixelType_BayerGB16 (0x01000000) (( 16 ) << 16)
PixelType_BayerBG16 (0x01000000) (( 16 ) << 16)
PixelType_RGB12V1packed (0x02000000) (( 36 ) << 16)
PixelType_Double (0x80000000) (0x01000000)
PixelType_Confidence8 (0x01000000) (( 8 ) << 16)
PixelType_Confidence16 (0x01000000) (( 16 ) << 16)
PixelType_Coord3D_C8 (0x01000000) (( 8 ) << 16)
PixelType_Coord3D_C16 (0x01000000) (( 16 ) << 16)
PixelType_Coord3D_ABC32f (0x02000000) (( 96 ) << 16)
PixelType_Data8 (0x01000000) (( 8 ) << 16)
PixelType_Data8s (0x01000000) (( 8 ) << 16)
PixelType_Data16 (0x01000000) (( 16 ) << 16)
PixelType_Data16s (0x01000000) (( 16 ) << 16)
PixelType_Data32 (0x01000000) (( 32 ) << 16)
PixelType_Data32s (0x01000000) (( 32 ) << 16)
PixelType_Data64 (0x01000000) (( 64 ) << 16)
PixelType_Data64s (0x01000000) (( 64 ) << 16)
PixelType_Data32f (0x01000000) (( 32 ) << 16)
PixelType_Data64f (0x01000000) (( 64 ) << 16)

Lists the available pixel types.

These pixel types are returned by a grab result and are used by the Image Handling Support classes.

The camera parameter interface classes define additional pixel format enumerations. These pixel format enumerations are different from the enumeration EPixelType pylon uses, e.g. the pylon pixel type PixelType_Mono1packed corresponds to PixelFormat_Mono1packed or PixelFormat_Mono1p. See the documentation of the parameter interface classes for more information.

The camera User's Manual provides more information on pixel formats and the memory layout of the image data.

enum EPixelColorFilter#

Enumerator Value Description
PCF_BayerRG red green
PCF_BayerGB green blue
PCF_BayerGR green red
PCF_BayerBG blue green
PCF_Undefined undefined color filter or not applicable

Lists the Bayer color filter types.

Functions Documentation#

function IsMonoPacked#

inline bool IsMonoPacked(
    EPixelType pixelType
)

Returns true if the pixel type is Mono and the pixel values are not byte aligned.

function IsBayerPacked#

inline bool IsBayerPacked(
    EPixelType pixelType
)

Returns true if the pixel type is Bayer and the pixel values are not byte aligned.

function IsRGBPacked#

inline bool IsRGBPacked(
    EPixelType pixelType
)

Returns true if the pixel type is RGB and the pixel values are not byte aligned.

function IsBGRPacked#

inline bool IsBGRPacked(
    EPixelType pixelType
)

Returns true if the pixel type is BGR and the pixel values are not byte aligned.

function IsPacked#

inline bool IsPacked(
    EPixelType pixelType
)

Returns true if the pixels of the given pixel type are not byte aligned.

function IsPackedInLsbFormat#

inline bool IsPackedInLsbFormat(
    EPixelType pixelType
)

Returns true if the pixel type is packed in lsb packed format. For lsb packed format, the data is filled lsb first in the lowest address byte (byte 0) starting with the first pixel and continued in the lsb of byte 1 (and so on). See the camera User's Manual or the Pixel Format Naming Convention (PFNC) of the GenICam standard group for more information.

function PlaneCount#

inline uint32_t PlaneCount(
    EPixelType pixelType
)

Returns number of planes in the image composed of the pixel type.

function GetPlanePixelType#

inline EPixelType GetPlanePixelType(
    EPixelType pixelType
)

Returns the pixel type of a plane.

function IsPlanar#

inline bool IsPlanar(
    EPixelType pixelType
)

Returns true if images of the pixel type are divided into multiple planes.

function IsYUVSemiplanar#

inline bool IsYUVSemiplanar(
    EPixelType pixelType
)

Returns true if pixel type is YUV semiplanar.

function GetPixelColorFilter#

inline EPixelColorFilter GetPixelColorFilter(
    EPixelType pixelType
)

Returns the Bayer color filter type.

function BitPerPixel#

uint32_t BitPerPixel(
    EPixelType pixelType
)

Returns the bits needed to store a pixel.

Parameters:

  • pixelType The pixel type.

Precondition: The pixel type must be defined.

Error Safety:

Throws an exception when the pixel type is undefined.

BitPerPixel(PixelType_Mono12) returns 16 and BitPerPixel(PixelType_Mono12packed) returns 12 for example.

function SamplesPerPixel#

uint32_t SamplesPerPixel(
    EPixelType pixelType
)

Returns the number of measured values per pixel.

Parameters:

  • pixelType The pixel type.

Precondition: The pixel type must be defined. The pixel type is not PixelType_YUV411packed.

Error Safety:

Throws an exception when the pixel type is undefined.

SamplesPerPixel(PixelType_Mono8) returns 1 and SamplesPerPixel(PixelType_RGB8packed) returns 3 for example.

function IsYUV#

inline bool IsYUV(
    EPixelType pixelType
)

Returns true when the pixel type represents a YUV format.

function IsRGBA#

inline bool IsRGBA(
    EPixelType pixelType
)

Returns true when the pixel type represents an RGBA format.

function IsRGB#

inline bool IsRGB(
    EPixelType pixelType
)

Returns true when the pixel type represents an RGB or RGBA format.

function IsBGRA#

inline bool IsBGRA(
    EPixelType pixelType
)

Returns true when the pixel type represents a BGRA format.

function IsBGR#

inline bool IsBGR(
    EPixelType pixelType
)

Returns true when the pixel type represents a BGR or BGRA format.

function IsBayer#

inline bool IsBayer(
    EPixelType pixelType
)

Returns true when the pixel type represents a Bayer format.

function IsMono#

inline bool IsMono(
    EPixelType pixelType
)

Returns true when a given pixel is monochrome, e.g. PixelType_Mono8 or PixelType_BayerGR8.

function IsMonoImage#

inline bool IsMonoImage(
    EPixelType pixelType
)

Returns true when an image using the given pixel type is monochrome, e.g. PixelType_Mono8.

function IsColorImage#

inline bool IsColorImage(
    EPixelType pixelType
)

Returns true when an image using the given pixel type is a color image (RGB/BGR/RGBA/BGRA/ etc or Bayer.

function HasAlpha#

inline bool HasAlpha(
    EPixelType pixelType
)

Returns true when an the image using the given pixel type has an alpha channel.

function IsFloatingPoint#

inline bool IsFloatingPoint(
    EPixelType pixelType
)

Returns true if a given pixel type represents a floating point number.

function GetPixelIncrementX#

inline uint32_t GetPixelIncrementX(
    EPixelType pixelType
)

Returns the minimum step size expressed in pixels for extracting an AOI.

function GetPixelIncrementY#

inline uint32_t GetPixelIncrementY(
    EPixelType pixelType
)

Returns the minimum step size expressed in pixels for extracting an AOI.

function BitDepth#

uint32_t BitDepth(
    EPixelType pixelType
)

Returns the bit depth of a value of the pixel in bits.

Parameters:

  • pixelType The pixel type.

Precondition: The pixel type must be valid.

Error Safety:

Throws an exception when the pixel type is undefined.

This may be less than the size needed to store the pixel. BitDepth(PixelType_Mono12) returns 12, BitDepth(PixelType_Mono12packed) returns 12, and BitDepth(PixelType_RGB8packed) returns 8 for example.

function ComputeStride#

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

Computes the stride in byte.

Parameters:

  • strideBytes The stride in byte if it can be computed.
  • pixelType The pixel type.
  • width The number of pixels in a row.
  • paddingX The number of additional bytes at the end of a row (byte aligned).

Return: Returns true if the stride can be computed.

Precondition: The width value must be >= 0 and <= _I32_MAX.

Error Safety:

Throws an exception when the preconditions are not met.

The stride indicates the number of bytes between the beginning of one row in an image and the beginning of the next row. For planar pixel types the returned value represents the stride of a plane.

The stride in bytes cannot be computed for packed image format when the stride is not byte aligned and paddingX == 0. If paddingX is larger than zero and the stride without padding is not byte aligned then the rest of the partially filled byte is considered as padding, e.g. pixelType = PixelType_Mono12packed, width = 5, paddingX = 10 results in a stride of 18 Bytes (stride without padding is 5 * BitPerPixel( PixelType_Mono12packed) = 5 * 12 = 60 Bits = 7.5 Bytes).

The stride can also be not computed for planar YUV422 and YUV420 image formats.

See also Pylon::IsPacked().

function ComputePaddingX#

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

Computes the padding value from row stride in byte.

Parameters:

  • strideBytes The stride in byte.
  • pixelType The pixel type.
  • width The number of pixels in a row.

Return: Returns the paddingX value for the given stride value (byte aligned).

Precondition:

  • The value of strideBytes must be large enough to contain a line described by pixelType and width.
  • The pixel type must be valid.
  • The width value must be >= 0 and <= _I32_MAX.

Error Safety:

Throws an exception when the preconditions are not met.

function ComputeBufferSize#

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

Computes the buffer size in byte.

Parameters:

  • pixelType The pixel type.
  • width The number of pixels in a row.
  • height The number of rows in an image.
  • paddingX The number of extra data bytes at the end of each row (byte aligned).

Return: The buffer size in byte.

Precondition:

  • The pixel type must be valid.
  • The width value must be >= 0 and <= _I32_MAX.
  • The height value must be >= 0 and <= _I32_MAX.

Error Safety:

Throws an exception when the preconditions are not met.

function GetPixelTypesForUnpacking#

inline bool GetPixelTypesForUnpacking(
    EPixelType pixelTypeSource,
    EPixelType & pixelTypeToImpose,
    EPixelType & pixelTypeTarget
)

Returns the pixel types needed for conversion from packed to unpacked image formats using the CImageFormatConverter class.

Parameters:

  • pixelTypeSource The source pixel type.
  • pixelTypeToImpose The pixel type that is used for conversion instead of the source pixel type. Returns pixelTypeSource if changing the source pixel type is not needed. Returns PixelType_Undefined if no unpacking is needed.
  • pixelTypeTarget The pixel type to which the image pixel data are converted. Returns PixelType_Undefined if no unpacking is needed.

Return: Returns true if the source pixelTypeSource is in packed image format and a conversion is possible.

The following pixel types are supported:

  • source: PixelType_Mono1packed target: PixelType_Mono8
  • source: PixelType_Mono2packed target: PixelType_Mono8
  • source: PixelType_Mono4packed target: PixelType_Mono8
  • source: PixelType_Mono10packed target: PixelType_Mono16
  • source: PixelType_Mono10p target: PixelType_Mono16
  • source: PixelType_Mono12packed target: PixelType_Mono16
  • source: PixelType_Mono12p target: PixelType_Mono16
  • source: PixelType_BayerGB12Packed imposed: PixelType_Mono12packed target: PixelType_Mono16
  • source: PixelType_BayerGR12Packed imposed: PixelType_Mono12packed target: PixelType_Mono16
  • source: PixelType_BayerRG12Packed imposed: PixelType_Mono12packed target: PixelType_Mono16
  • source: PixelType_BayerBG12Packed imposed: PixelType_Mono12packed target: PixelType_Mono16
  • source: PixelType_BayerGB10p imposed: PixelType_Mono10p target: PixelType_Mono16
  • source: PixelType_BayerGR10p imposed: PixelType_Mono10p target: PixelType_Mono16
  • source: PixelType_BayerRG10p imposed: PixelType_Mono10p target: PixelType_Mono16
  • source: PixelType_BayerBG10p imposed: PixelType_Mono10p target: PixelType_Mono16
  • source: PixelType_BayerGB12p imposed: PixelType_Mono12p target: PixelType_Mono16
  • source: PixelType_BayerGR12p imposed: PixelType_Mono12p target: PixelType_Mono16
  • source: PixelType_BayerRG12p imposed: PixelType_Mono12p target: PixelType_Mono16
  • source: PixelType_BayerBG12p imposed: PixelType_Mono12p target: PixelType_Mono16

function DisplayImage#

void DisplayImage(
    size_t winIndex,
    const Pylon::IImage & image
)

Convenience function to display an image on screen with one function call.

Parameters:

  • winIndex The window used for displaying the image. Valid window indexes range from 0 to 31.
  • image The image to display in the window, specified in winIndex. You can also pass a CGrabResultPtr.

Postcondition:

  • The window specified by winIndex will be created and shown on the screen.
  • If the passed image is valid, it is shown in the window specified by winIndex.
  • If the passed image is invalid, the window specified by winIndex will be cleared.

Remark: To use this function, you must explicitly include pylon/PylonGUIIncludes.h in your code. Unlike other pylon headers, the GUI headers will not be included automatically when you include pylon/PylonIncludes.h.

Error Safety:

Can throw an exception if the passed winIndex is invalid or the window could not be created.

Thread Safety:

This function is thread-safe.

This convenience function displays the image or grab result passed in the image parameter in a window on the screen. Using this function is the easiest way to display an image on the screen.

You can pass any IImage based object or a GrabResultPtr. If the window hasn't been created before, it will be created with default positions and the image will be shown. When the function returns, you can free/delete the image. If you need more control over the window creation (e.g. to specify the position or size of the window), you can use the CPylonImageWindow class.

When you pass an empty/invalid (e.g. image.IsValid() returns false) image, the window will be cleared.

// This smart pointer will receive the grab result data.
CGrabResultPtr ptrGrabResult;
// Open the first device.
CInstantCamera Camera( CTlFactory::GetInstance().CreateFirstDevice());
// Grab one image.
Camera.GrabOne( 1000, ptrGrabResult);
// Display the image on the screen. If the grab result is invalid, the image window will be empty.
Pylon::DisplayImage(1, ptrGrabResult);