A class that can be used for displaying images within existing windows or GUI elements that can provide a window handle.
More...
|
void | Clear (void) const |
| Clears the display.
|
|
int | GetAppliedShift (void) const |
| Returns the current shift value that has been applied to the last image that has been displayed.
|
|
TDisplayMode | GetDisplayMode (void) const |
| Returns the current display mode.
|
|
void | GetImage (const void **ppData, int *pWidth, int *pHeight, int *pBitsPerPixel, int *pPitch) |
| Gets the parameters of the current data block associated with the display.
|
|
TInterpolationMode | GetInterpolationMode (void) const |
| Gets the current interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.
|
|
int | GetLastError (void) const |
| Returns the last error and clears it.
|
|
int | GetShift (void) const |
| Returns the current shift value as defined by the application.
|
|
WindowHandle | GetWindowHandle (void) const |
| Returns the current window handle associated with the display object.
|
|
| ImageDisplay (WindowHandle hwnd) |
| Create a new object that can be used for displaying images.
|
|
void | RemoveImage (void) |
| Removes the current image from the display.
|
|
void | SetBackgroundBrush (BrushHandle hBrush) |
| Associates a brush to be used for painting the background within the client area.
|
|
void | SetBitmapRectangle (int left, int top, int width, int height) |
| Sets the position and dimension of bitmap data region.
|
|
void | SetDDrawOverlayKeyColor (ColorValue keyColor) |
| Defines the key color for the DirectDraw® overlay.
|
|
void | SetDisplayMode (TDisplayMode mode) |
| Switches to a different display mode.
|
|
void | SetDisplayRectangle (int left, int top, int width, int height) |
| Defines the rectangle used for drawing within the window associated with the display structure.
|
|
void | SetImage (const mvIMPACT::acquire::ImageBuffer *pBuf) |
| Sets the next image to display.
|
|
void | SetImage (const mvIMPACT::acquire::Request *pRequest) |
| Sets the next image to display.
|
|
void | SetImage (const void **ppData, size_t ppDataArraySize, TFormatFlags format, int width, int height, int bitsPerPixel, int pitch) |
| Sets the next image to display.
|
|
void | SetImage (const void *pData, int width, int height, int bitsPerPixel, int pitch) |
| Sets the next image to display.
|
|
void | SetImage (std::shared_ptr< Request > pRequest) |
| Sets the next image to display.
|
|
void | SetInterpolationMode (TInterpolationMode mode) |
| Sets the new interpolation mode that will be used for scaling if display window rectangle is different to input image rectangle.
|
|
void | SetOverlayCallbackFunction (TImageDisplayOverlayFunction fctOverlay, void *pUserParam) |
| Installs an overlay callback function.
|
|
void | SetShift (int shift) |
| Sets the shift value that shall be subtracted from the shift value needed to display the 8 msb of a pixel.
|
|
void | SetWindowHandle (WindowHandle hwnd) |
| Assigns a new destination window handle to a display object.
|
|
void | Update (void) const |
| Immediately redraws the current image.
|
|
| ~ImageDisplay () |
| Frees the resources previously allocated.
|
|
A class that can be used for displaying images within existing windows or GUI elements that can provide a window handle.
Instances of this class can be associated with an existing window object of which the window handle is known and can be passed to the constructor of this class.
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 mvIMPACT::acquire::display::ImageDisplay::SetDisplayRectangle(). 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 mvIMPACT::acquire::display::ImageDisplay::SetBackgroundBrush().
If the actual image size differs from the area defined by mvIMPACT::acquire::display::ImageDisplay::SetDisplayRectangle(), 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 mvIMPACT::acquire::display::ImageDisplay::SetDisplayMode().
In addition to that only a part of the actual image can be selected for drawing by the function mvIMPACT::acquire::display::ImageDisplay::SetBitmapRectangle(). For this region the same scaling and cropping regions will be applied then.
- Note
- This class can be used without using the rest of Impact Acquire. This is achieved by using a pre-processor check for the presence of a certain include guard that is defined by Impact Acquire. Now in order to be able to use those functions, that can directly work on data types as defined by Impact Acquire, the main Impact Acquire header must be included BEFORE including this header:
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>
#include <mvDisplay/Include/mvIMPACT_acquire_display.h>
- See also
- mvIMPACT::acquire::display::ImageDisplay::SetDisplayRectangle(),
mvIMPACT::acquire::display::ImageDisplay::SetBitmapRectangle(),
mvIMPACT::acquire::display::ImageDisplay::SetBackgroundBrush(),
mvIMPACT::acquire::display::ImageDisplay::SetDisplayMode()
- Examples
- ContinuousCapture.win32.cpp, ContinuousCaptureAllDevices.cpp, ContinuousCaptureAllDevices.win32.cpp, ContinuousCaptureMultiPart.cpp, ContinuousCaptureMultiPart.legacy.cpp, ContinuousCaptureOnlyProcessLatest.cpp, ContinuousCaptureOnlyProcessLatest.legacy.cpp, ContinuousCaptureToAVIFile.cpp, GenICamCallbackOnEvent.cpp, GenICamSmartFrameRecallUsage.cpp, GenICamSmartFrameRecallUsage.legacy.cpp, SequenceCapture.cpp, SequenceCapture.win32.cpp, SingleCaptureMasterSlave.cpp, SingleCaptureMasterSlave.legacy.cpp, and TimestampFeatures.cpp.
void SetShift |
( |
int | shift | ) |
|
|
inline |
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 mvIMPACT::acquire::display::ImageDisplay::Update 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 mvIMPACT::acquire::display::ImageDisplay::GetAppliedShift.
- 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
- mvIMPACT::acquire::display::ImageDisplay::GetShift,
mvIMPACT::acquire::display::ImageDisplay::GetAppliedShift
- Since
- 2.4.0
- Parameters
-
[in] | shift | The 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. |