Impact Acquire SDK C
Display Functions

Functions and data structures that can be used to display images. More...

Enumerations

enum  TDisplayMode {
  DM_Default = 0 ,
  DM_Fastest ,
  DM_DDrawOverlay ,
  DM_FullScreen
}
 Defines valid display modes. More...
 
enum  TFormatFlags {
  ffRGB888xPacked ,
  ffRGB888xPlanar ,
  ffMono ,
  ffYUY2 ,
  ffYUV422Planar ,
  ffRGB2BytePacked ,
  ffUYVY ,
  ffMonoPacked_V2 ,
  ffBGR888xPacked ,
  ffUYV444 ,
  ffYUV444 ,
  ffBGR2BytePacked_V2 ,
  ffMonoPacked_V1 ,
  ffYUV411_UYYVYY_Packed ,
  ffRaw
}
 Defines valid display pixel formats. More...
 
enum  TImageDisplayError {
  IDE_NoError = 0 ,
  IDE_OutOfMemory ,
  IDE_UpdateFailed ,
  IDE_InvalidHandle ,
  IDE_InternalError ,
  IDE_DirectDrawAccessFailed
}
 Defines valid error values for this module. More...
 
enum  TInterpolationMode {
  IM_NEAREST_NEIGHBOUR = 0 ,
  IM_LINEAR ,
  IM_CUBIC
}
 Defines valid scaler interpolation modes. More...
 

Functions

void MV_DISPLAY_API_CALL mvDispClear (TDisp *pDisp)
 Clears the display.
 
void MV_DISPLAY_API_CALL mvDispConvertFormat (TImageBufferPixelFormat pixelFormat, TFormatFlags *pFormat, int *pBitsPerPixel)
 Converts a Impact Acquire pixel format into a format that can be digested by this module.
 
void MV_DISPLAY_API_CALL mvDispDeinit (TDisp **ppDisp)
 Frees the resources consumed by this display object.
 
int MV_DISPLAY_API_CALL mvDispGetAppliedShift (TDisp *pDisp)
 Returns the current shift value that has been applied to the last image that has been displayed.
 
TDisplayMode MV_DISPLAY_API_CALL mvDispGetDisplayMode (TDisp *pDisp)
 Returns the current display mode.
 
int MV_DISPLAY_API_CALL mvDispGetError (TDisp *pDisp)
 Returns the last error and clears it.
 
void MV_DISPLAY_API_CALL mvDispGetImage (TDisp *pDisp, const void **ppData, int *pWidth, int *pHeight, int *pBitsPerPixel, int *pPitch)
 Gets the parameters of the current data block associated with the display.
 
TInterpolationMode MV_DISPLAY_API_CALL mvDispGetInterpolationMode (TDisp *pDisp)
 Gets the current interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.
 
int MV_DISPLAY_API_CALL mvDispGetShift (TDisp *pDisp)
 Returns the current shift value as defined by the application.
 
WindowHandle MV_DISPLAY_API_CALL mvDispGetWindowHandle (TDisp *pDisp)
 Returns the current window handle associated with the display object.
 
TDisp *MV_DISPLAY_API_CALL mvDispInit (HWND hwnd)
 Initialises a new display object and associates it with the window whose handle is passed to the function.
 
void MV_DISPLAY_API_CALL mvDispSetBackgroundBrush (TDisp *pDisp, BrushHandle hBrush)
 Associates a brush to be used for painting the background within the client area.
 
void MV_DISPLAY_API_CALL mvDispSetBitmapRectangle (TDisp *pDisp, int left, int top, int width, int height)
 Sets the position and dimension of bitmap data region.
 
void MV_DISPLAY_API_CALL mvDispSetDDrawOverlayKeyColor (TDisp *pDisp, ColorValue keyColor)
 Defines the key color for the DirectDraw® overlay.
 
void MV_DISPLAY_API_CALL mvDispSetDisplayMode (TDisp *pDisp, TDisplayMode mode)
 Switches to a different display mode.
 
void MV_DISPLAY_API_CALL mvDispSetDisplayRectangle (TDisp *pDisp, int left, int top, int width, int height)
 Defines the rectangle used for drawing within the window associated with the display structure.
 
void MV_DISPLAY_API_CALL mvDispSetImage (TDisp *pDisp, const void *pData, int width, int height, int bitsPerPixel, int pitch)
 Sets the next image to display.
 
void MV_DISPLAY_API_CALL mvDispSetImageEx (TDisp *pDisp, const void **ppData, size_t ppDataArraySize, TFormatFlags format, int width, int height, int bitsPerPixel, int pitch)
 Sets the next image to display.
 
void MV_DISPLAY_API_CALL mvDispSetImageFromImageBuffer (TDisp *pDisp, const ImageBuffer *pBuf)
 Sets the next image to display.
 
void mvDispSetImageFromRequest (TDisp *pDisp, const mvIMPACT::acquire::Request *pRequest)
 Sets the next image to display.
 
void MV_DISPLAY_API_CALL mvDispSetInterpolationMode (TDisp *pDisp, TInterpolationMode interpolationMode)
 Sets the new interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.
 
void MV_DISPLAY_API_CALL mvDispSetOverlayCallbackFunction (TDisp *pDisp, TImageDisplayOverlayFunction fctOverlay, void *pUserParam)
 Installs an overlay callback function.
 
void MV_DISPLAY_API_CALL mvDispSetShift (TDisp *pDisp, int shift)
 Sets the shift value that shall be subtracted from the shift value needed to display the 8 msb of a pixel.
 
void MV_DISPLAY_API_CALL mvDispSetWindowHandle (TDisp *pDisp, WindowHandle hwnd)
 Assigns a new destination window handle to a display object.
 
void MV_DISPLAY_API_CALL mvDispUpdate (TDisp *pDisp)
 Immediately redraws the current image.
 
HDISP MV_DISPLAY_API_CALL mvDispWindowCreate (const char *title)
 Creates a new display window object.
 
void MV_DISPLAY_API_CALL mvDispWindowDestroy (HDISP hDisp)
 Closes a display window and frees allocated memory.
 
TDisp *MV_DISPLAY_API_CALL mvDispWindowGetDisplayHandle (HDISP hDisp)
 Returns a pointer to the internal object used for displaying the image data.
 
TPreProcessMessage MV_DISPLAY_API_CALL mvDispWindowGetMessageHandler (HDISP hDisp)
 Returns the current message handler for this window.
 
WindowHandle MV_DISPLAY_API_CALL mvDispWindowGetWindowHandle (HDISP hDisp)
 Returns the handle of the display window.
 
void MV_DISPLAY_API_CALL mvDispWindowSetMessageHandler (HDISP hDisp, TPreProcessMessage handler)
 Installs a callback to handle the window messages.
 
int MV_DISPLAY_API_CALL mvDispWindowSetRefreshTime (HDISP hDisp, int time_ms)
 Defines the refresh time in ms.
 
void MV_DISPLAY_API_CALL mvDispWindowShow (HDISP hDisp)
 Shows the display window.
 

Detailed Description

Functions and data structures that can be used to display images.

Enumeration Type Documentation

◆ TDisplayMode

Defines valid display modes.

Enumerator
DM_Default 

The default display mode.

This display mode is capable of scaling the image. Scaling however will result in additional CPU load.

In this mode, the bitmap rectangle will always be scaled to fit into the display rectangle.

In this mode(and in this mode only) overlay callbacks will be executed.

DM_Fastest 

The fastest display mode.

In this mode there will be no scaling and no overlay callbacks but it will operate with the lowest possible CPU load.

DM_DDrawOverlay 

DirectDraw® mode.

This mode will use DirectDraw® for displaying the image.

In this mode, the bitmap rectangle will always be scaled to fit into the display rectangle.

DM_FullScreen 

Fullscreen (Exclusive) DirectDraw® mode.

This mode will use DirectDraw® exclusive mode for displaying the image.

In this mode, the bitmap rectangle will always be scaled to fit into the display rectangle.

◆ TFormatFlags

Defines valid display pixel formats.

Enumerator
ffRGB888xPacked 

Valid values for bits per pixel in this format: 15, 16, 24, 32; pData[0] points to the packed image data.

ffRGB888xPlanar 

Valid values for bits per pixel in this format: not used, 8 bit per plane, pData[0] points to the Blue, pData[1] points to the Green, pData[2] points to the Red plane.

ffMono 

Valid values for bits per pixel in this format: 8, 10, 12, 14, 16, LSB aligned.

ffYUY2 

Valid values for bits per pixel in this format: 16, 20, YUV422: 8-10 bit Y | 8-10 bit U | 8-10 bit Y | 8-10 bit V.

ffYUV422Planar 

Valid values for bits per pixel in this format: not used, YUV422 planar.

ffRGB2BytePacked 

Valid values for bits per pixel in this format: 30, 36, 42 or 48 10-16 bits per color component RGB packed data.

ffUYVY 

Valid values for bits per pixel in this format: 16, 20, YUV422: 8-10 bit U | 8-10 bit Y | 8-10 bit V | 8-10 bit Y.

ffMonoPacked_V2 

Valid values for bits per pixel in this format: 12, 8 MSB(1), 4 LSBs(1+2), 8MSB(2).

ffBGR888xPacked 

Valid values for bits per pixel in this format: 15, 16, 24, 32; pData[0] points to the packed image data.

ffUYV444 

Valid values for bits per pixel in this format: 24 or 48.

ffYUV444 

Valid values for bits per pixel in this format: 48.

ffBGR2BytePacked_V2 

Valid values for bits per pixel in this format: 30 (R=pix&0x3FF, G=(pix>>10)&0x3FF, B=(pix>>20)&3FF).

ffMonoPacked_V1 

Valid values for bits per pixel in this format: 12, 8 MSB(1), 4 LSB(1) + 4 MSB(2), 8LSB(2).

Since
2.5.0
ffYUV411_UYYVYY_Packed 

Valid values for bits per pixel in this format: not used, YUV411: 8 bit U | 8 bit Y1 | 8 bit Y2 | 8 bit V | 8 bit Y3 | 8 bit Y4.

Since
2.13.0
ffRaw 

Valid values for bits per pixel in this format: not used. Raw buffer. Won't be displayed.

Since
2.46.0

◆ TImageDisplayError

Defines valid error values for this module.

Enumerator
IDE_NoError 

No error occurred since the last time the error code was queried.

IDE_OutOfMemory 

There is not enough memory available to perform the requested operation.

IDE_UpdateFailed 

The update failed.

This usually is an internal error but will also be returned when a raw buffer has been passed to the display module since it then is unclear how to draw it.

IDE_InvalidHandle 

One or more of the handles passed to a function where invalid.

IDE_InternalError 

Unspecified internal error.

IDE_DirectDrawAccessFailed 

Calling a DirectDraw® function did fail.

◆ TInterpolationMode

Defines valid scaler interpolation modes.

Enumerator
IM_NEAREST_NEIGHBOUR 

Nearest neighbor interpolation (default).

Fast but with reduced quality.

IM_LINEAR 

Linear interpolation.

Both quality and CPU load will be average.

IM_CUBIC 

Cubic interpolation.

Best quality, highest CPU load.

Function Documentation

◆ mvDispClear()

void MV_DISPLAY_API_CALL mvDispClear ( TDisp * pDisp)

Clears the display.

Either the windows default background will be displayed afterwards or if a background brush has been defined the background brush will be used to fill the complete client area.

See also
mvDispSetBackgroundBrush()
Parameters
[in]pDispHandle to the display to clear. The handle must be the one obtained from a successful call to mvDispInit().

◆ mvDispConvertFormat()

void MV_DISPLAY_API_CALL mvDispConvertFormat ( TImageBufferPixelFormat pixelFormat,
TFormatFlags * pFormat,
int * pBitsPerPixel )

Converts a Impact Acquire pixel format into a format that can be digested by this module.

Parameters
[in]pixelFormatThe Impact Acquire pixel format to convert.
[out]pFormatA pointer to variable that receives the format flags that can be passed to functions of this library.
[out]pBitsPerPixelA pointer to variable that receives the bits per pixel for the format specified by pixelFormat.

◆ mvDispDeinit()

void MV_DISPLAY_API_CALL mvDispDeinit ( TDisp ** ppDisp)

Frees the resources consumed by this display object.

Frees the resources previously allocated by a call to mvDispInit().

See also
mvDispInit()
Parameters
[in,out]ppDispA pointer to the pointer addressing the display object. This pointer will be set to NULL during the execution of this function.

◆ mvDispGetAppliedShift()

int MV_DISPLAY_API_CALL mvDispGetAppliedShift ( TDisp * pDisp)

Returns the current shift value that has been applied to the last image that has been displayed.

This function returns the shift value that has been applied to the last image that has been displayed. See mvDispSetShift() for a detailed explanation about the display behaviour when applying custom shift values.

See also
mvDispSetShift(),
mvDispGetShift()
Since
2.4.0
Returns
The current shift value that has been applied to the last image that has been displayed.
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispGetDisplayMode()

TDisplayMode MV_DISPLAY_API_CALL mvDispGetDisplayMode ( TDisp * pDisp)

Returns the current display mode.

Valid display modes are defined by TDisplayMode.

Returns
The current display mode.
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispGetError()

int MV_DISPLAY_API_CALL mvDispGetError ( TDisp * pDisp)

Returns the last error and clears it.

If an error has occurred it will not be overwritten by subsequent errors till the error is queried and cleared. After calling this function a second call would return IDE_NoError until another error occurs.

Returns
The last error
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispGetImage()

void MV_DISPLAY_API_CALL mvDispGetImage ( TDisp * pDisp,
const void ** ppData,
int * pWidth,
int * pHeight,
int * pBitsPerPixel,
int * pPitch )

Gets the parameters of the current data block associated with the display.

If a parameter is not needed it might be 0 (NULL).

The data returned will always be in packed format.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[out]ppDataA pointer to a variable to receive the storage location of the pixel data. This can be 0 if the value is not needed.
[out]pWidthA pointer to a variable to receive the width of the current image. This can be 0 if the value is not needed.
[out]pHeightA pointer to a variable to receive the height of the current image. This can be 0 if the value is not needed.
[out]pBitsPerPixelA pointer to a variable to receive the bits per pixel of the current image. This can be 0 if the value is not needed.
[out]pPitchA pointer to a variable to receive the pitch (bytes per pixel * width in pixel)of the current image. This can be 0 if the value is not needed.

◆ mvDispGetInterpolationMode()

TInterpolationMode MV_DISPLAY_API_CALL mvDispGetInterpolationMode ( TDisp * pDisp)

Gets the current interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.

Valid interpolation modes are defined by TInterpolationMode.

Returns
The current interpolation mode.
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispGetShift()

int MV_DISPLAY_API_CALL mvDispGetShift ( TDisp * pDisp)

Returns the current shift value as defined by the application.

This function returns the current shift value as defined by the application by previous calls to mvDispSetShift(). See mvDispSetShift() for a detailed explanation about the display behaviour when applying custom shift values.

See also
mvDispSetShift(),
mvDispGetAppliedShift()
Since
2.4.0
Returns
The current shift value from previous calls to mvDispSetShift().
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispGetWindowHandle()

WindowHandle MV_DISPLAY_API_CALL mvDispGetWindowHandle ( TDisp * pDisp)

Returns the current window handle associated with the display object.

Since
1.12.68
Returns
The current window handle associated with the display object.
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().

◆ mvDispInit()

TDisp *MV_DISPLAY_API_CALL mvDispInit ( HWND hwnd)

Initialises a new display object and associates it with the window whose handle is passed to the function.

This group contains functions and data structures that can be used to display images.

The full client area of a window will be consumed by a display object. Where the actual image shall be display relative to the upper left corner of the windows client area can be defined by calling mvDispSetDisplayRectangle(). This function will also limit the area where image data will be displayed. The area outside the display rectangle but within the windows client area can be filled by defining a background brush and then attach this brush to the display by calling mvDispSetBackgroundBrush().

If the actual image size differs from the area defined by mvDispSetDisplayRectangle(), it depends on the display mode if the complete image is scaled, cropped of just drawn in the top left corner of the display rectangle. The display mode can be modified by calling mvDispSetDisplayMode().

In addition to that only a part of the actual image can be selected for drawing by the function mvDispSetBitmapRectangle(). For this region the same scaling and cropping regions will be applied then.

See also
mvDispDeinit(),
mvDispSetDisplayRectangle(),
mvDispSetBitmapRectangle(),
mvDispSetBackgroundBrush(),
mvDispSetDisplayMode()
Returns
  • a handle to the newly created display object if successful
  • 0 otherwise
Parameters
[in]hwndA handle to the window which should be used for the displaying.

◆ mvDispSetBackgroundBrush()

void MV_DISPLAY_API_CALL mvDispSetBackgroundBrush ( TDisp * pDisp,
BrushHandle hBrush )

Associates a brush to be used for painting the background within the client area.

See mvDispInit() for a detailed description on which regions will be painted using the background brush.

Attention
This only copies the handle to the brush object, not the actual brush, so as long as this handle is set and the display object is used, the referenced brush must NOT be deleted again.
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]hBrushHandle to the brush to be used to paint the background. This brush then will be used to paint the regions of the rectangle used for drawing that will not painted with the image itself.

◆ mvDispSetBitmapRectangle()

void MV_DISPLAY_API_CALL mvDispSetBitmapRectangle ( TDisp * pDisp,
int left,
int top,
int width,
int height )

Sets the position and dimension of bitmap data region.

This defines the area relative within the area consumed by the window associated with the window handle that is bound to this display. See mvDispInit() for a detailed description on how to define the different rectangles and areas for drawing.

See also
mvDispInit(),
mvDispSetDisplayRectangle()
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]leftThe left offset of the rectangle.
[in]topThe top offset of the rectangle.
[in]widthThe width of the bitmap rectangle.
[in]heightThe height of the rectangle.

◆ mvDispSetDDrawOverlayKeyColor()

void MV_DISPLAY_API_CALL mvDispSetDDrawOverlayKeyColor ( TDisp * pDisp,
ColorValue keyColor )

Defines the key color for the DirectDraw® overlay.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]keyColorThe key color to be used for the DirectDraw® overlay.

◆ mvDispSetDisplayMode()

void MV_DISPLAY_API_CALL mvDispSetDisplayMode ( TDisp * pDisp,
TDisplayMode mode )

Switches to a different display mode.

Valid display modes are defined by TDisplayMode.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]modeThe new display mode.

◆ mvDispSetDisplayRectangle()

void MV_DISPLAY_API_CALL mvDispSetDisplayRectangle ( TDisp * pDisp,
int left,
int top,
int width,
int height )

Defines the rectangle used for drawing within the window associated with the display structure.

This function can be used to define a rectangle within the defined window Only this then will be used for drawing. This window can be smaller than the image defined by mvDispSetImage() or mvDispSetImageEx(). Then just a part of the image will be displayed when in DM_Fastest or the whole image will be scaled down to fit into the rectangle when in DM_Default mode.

When the display rectangle is larger than the image the image will be placed in the lower left corner of the display rectangle (either scaled or unscaled). See mvDispInit() for a detailed description on how to define the different rectangles and areas for drawing.

See also
mvDispInit(),
mvDispSetBitmapRectangle()
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]leftThe left offset within the window.
[in]topThe top offset within the window.
[in]widthThe width of the rectangle to use for drawing.
[in]heightThe height of the rectangle to use for drawing.

◆ mvDispSetImage()

void MV_DISPLAY_API_CALL mvDispSetImage ( TDisp * pDisp,
const void * pData,
int width,
int height,
int bitsPerPixel,
int pitch )

Sets the next image to display.

This function can deal with RGB888x packed images, 8 bit grey-scale images and 16 bit Packed RGB images. For other formats the function mvDispSetImageEx() must be used.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]pDataA pointer to the address of the pixel data.
[in]widthThe width of the image.
[in]heightThe height of the image.
[in]bitsPerPixelThe number of bits per pixel.
[in]pitchThe pitch in bytes of one line of pixel data (bytes per pixel * width in pixel per line).
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.

◆ mvDispSetImageEx()

void MV_DISPLAY_API_CALL mvDispSetImageEx ( TDisp * pDisp,
const void ** ppData,
size_t ppDataArraySize,
TFormatFlags format,
int width,
int height,
int bitsPerPixel,
int pitch )

Sets the next image to display.

This is an enhanced version of the function mvDispSetImage().

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]ppDataAn array of pointers that point to the actual image data For planar RGB images e.g. this can be 3 pointers each pointing to one color plane.
[in]ppDataArraySizeThe number of pointers passed via ppData.
[in]formatThe pixel format as defined by TFormatFlags.
[in]widthThe width of the image.
[in]heightThe height of the image.
[in]bitsPerPixelThe number of bits per pixel.
[in]pitchThe pitch in bytes of one line of pixel data (bytes per pixel * width in pixel per line).

◆ mvDispSetImageFromImageBuffer()

void MV_DISPLAY_API_CALL mvDispSetImageFromImageBuffer ( TDisp * pDisp,
const ImageBuffer * pBuf )

Sets the next image to display.

This function can deal with any pixel format supported by Impact Acquire.

Since
1.12.68
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]pBufThe image buffer object that shall be displayed.

◆ mvDispSetImageFromRequest()

void mvDispSetImageFromRequest ( TDisp * pDisp,
const mvIMPACT::acquire::Request * pRequest )
inline

Sets the next image to display.

This function can deal with any pixel format supported by Impact Acquire.

Since
1.12.68
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]pRequestThe request object that shall be displayed.

◆ mvDispSetInterpolationMode()

void MV_DISPLAY_API_CALL mvDispSetInterpolationMode ( TDisp * pDisp,
TInterpolationMode interpolationMode )

Sets the new interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.

Valid interpolation modes are defined by TInterpolationMode.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]interpolationModeThe new interpolation mode.

◆ mvDispSetOverlayCallbackFunction()

void MV_DISPLAY_API_CALL mvDispSetOverlayCallbackFunction ( TDisp * pDisp,
TImageDisplayOverlayFunction fctOverlay,
void * pUserParam )

Installs an overlay callback function.

This function will be executed when operated in DM_Default mode and can be used to draw a user defined overlay on top of the image before it is displayed.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]fctOverlayThe address of the function to be called for a user. defined overlay
[in]pUserParamA pointer to a user defined parameter.

◆ mvDispSetShift()

void MV_DISPLAY_API_CALL mvDispSetShift ( TDisp * pDisp,
int shift )

Sets the shift value that shall be subtracted from the shift value needed to display the 8 msb of a pixel.

This function will allow to select which 8 bits out of a multi-byte pixel format shall be displayed the next time mvDispUpdate() is called. When the shift value is 0 the 8 msb of each pixel will be displayed so e.g. for a 12 bit format bits 11 to 4 will be displayed by default.

Consider the typical layout of 12 mono pixel data in memory:

So with an application defined shift value of 0 (the default), the display module will shift each 2 byte pixel by 4 positions to the right. This will remove the 4 lsb from the data. Afterwards the now empty upper byte of each pixel is removed from the data resulting in the following memory layout which is then displayed on the canvas:

Now sometimes it is required to display other bits from the image e.g. for analysis purposes. As most operating systems only support to display 8 bits per color component this requires to select a different range of pixels to be sent to the canvas. This can be done by calling this function and passing a custom shift value to it. The custom shift value will be subtracted from the value that would be needed to display the 8 msb for a given format.

So to display the 8 lsb for a 12 bit mono format, shift must be set to 4. This then results in the display module to use a actual shift value of 4(required to display the 8 msb) - 4(defined by calling this function) = 0. Then removing the upper byte from each pixel results in only the 8 lsb of each pixel being displayed.

When e.g. setting shift to 3 for a 12 bit mono for would result in bits 8 - 1 to be displayed:

The shift value that has actually been applied the last time an image has been displayed (thus '1' when taking the example in the image above (4(required) - 3(defined))) can be queried by calling mvDispGetAppliedShift().

Note
During the conversion from a multi-byte to a single byte format the pixel data will be clipped to 255 if a pixel value is larger than what can be stored in a single byte after the shift operation.
See also
mvDispGetShift(),
mvDispGetAppliedShift()
Since
2.4.0
Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]shiftThe shift value to apply to the displayed images. The maximum value for this function is 8, the minimum 0. Values out of this range will be ignored. It is NOT possible to shift pixel data in such a way that less than 8 bits contain valid data, thus e.g. a shift value of 2 applied to 8 bit mono data will be ignored.

◆ mvDispSetWindowHandle()

void MV_DISPLAY_API_CALL mvDispSetWindowHandle ( TDisp * pDisp,
WindowHandle hwnd )

Assigns a new destination window handle to a display object.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
[in]hwndThe handle of the new destination window.

◆ mvDispUpdate()

void MV_DISPLAY_API_CALL mvDispUpdate ( TDisp * pDisp)

Immediately redraws the current image.

Parameters
[in]pDispA handle to a display structure obtained from a successful call to mvDispInit().
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.

◆ mvDispWindowCreate()

HDISP MV_DISPLAY_API_CALL mvDispWindowCreate ( const char * title)

Creates a new display window object.

This function will allocate all internal data structures needed to work with a display window object. It uses the functions declared in mvDisplay.h internally and provides a complete window class as well. Calling this function will NOT display the window. To display the window, mvDispWindowShow() must be called.

Since
1.12.69
Returns
A handle to the newly creates window.
Parameters
[in]titleThe title of the window (will be displayed in the windows title bar).
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.

◆ mvDispWindowDestroy()

void MV_DISPLAY_API_CALL mvDispWindowDestroy ( HDISP hDisp)

Closes a display window and frees allocated memory.

This function frees every memory allocated by calls to mvDispWindowCreate() and mvDispWindowShow(). Afterwards the pointer returned by the function mvDispWindowGetDisplayHandle() will be invalid.

Since
1.12.69
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.

◆ mvDispWindowGetDisplayHandle()

TDisp *MV_DISPLAY_API_CALL mvDispWindowGetDisplayHandle ( HDISP hDisp)

Returns a pointer to the internal object used for displaying the image data.

Since
1.12.69
Returns
A pointer to the internal object used for displaying the image data.
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.

◆ mvDispWindowGetMessageHandler()

TPreProcessMessage MV_DISPLAY_API_CALL mvDispWindowGetMessageHandler ( HDISP hDisp)

Returns the current message handler for this window.

See also
mvDispWindowSetMessageHandler()
Returns
The current message handler for this window.
Since
1.12.69
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().

◆ mvDispWindowGetWindowHandle()

WindowHandle MV_DISPLAY_API_CALL mvDispWindowGetWindowHandle ( HDISP hDisp)

Returns the handle of the display window.

Since
1.12.69
Returns
The handle of the window created by the function mvDispWindowCreate().
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().

◆ mvDispWindowSetMessageHandler()

void MV_DISPLAY_API_CALL mvDispWindowSetMessageHandler ( HDISP hDisp,
TPreProcessMessage handler )

Installs a callback to handle the window messages.

See also
mvDispWindowGetMessageHandler()
Since
1.12.69
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().
[in]handlerPointer to a function which is called by the windows procedure before the display update is done. If zero is passed here even the internal default handler will be disabled and WM_SIZE and WM_LBUTTONDBLCLK will no longer be handled internally.

◆ mvDispWindowSetRefreshTime()

int MV_DISPLAY_API_CALL mvDispWindowSetRefreshTime ( HDISP hDisp,
int time_ms )

Defines the refresh time in ms.

This function can be used to define a refresh period that - when elapsed - will automatically repaint the window.

Since
1.12.69
Returns
  • 0 if the function fails
  • a non-zero return value otherwise
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().
[in]time_msThe refresh period for the window in ms. Passing 0 will disable the automatic repaint behaviour.

◆ mvDispWindowShow()

void MV_DISPLAY_API_CALL mvDispWindowShow ( HDISP hDisp)

Shows the display window.

Shows the display window previously created by mvDispWindowCreate().

Since
1.12.69
Parameters
[in]hDispA handle to a display window previously created with mvDispWindowCreate().
Examples
CaptureToUserMemory.c, ContinuousCapture.c, and ContinuousCaptureGenICam.c.