A user interface for displaying the contents of an image. More...
Public Member Functions | |
virtual | ~PvDisplayWnd () |
Destructor. | |
PvResult | Display (const PvBuffer &aBuffer, bool aVSync=false) |
Display an image. More... | |
PvResult | Display (const IPvImage *aImage, bool aVSync=false) |
Display an image. More... | |
PvResult | SetBackgroundColor (uint8_t aR, uint8_t aG, uint8_t aB) |
Set the display's background color. More... | |
PvBufferConverter & | GetConverter () |
Returns a reference to the internal buffer converter. More... | |
void | Clear () |
Clears the display content. | |
void | SetTextOverlay (const PvString &aText) |
Sets the text overlay. More... | |
void | SetTextOverlayColor (uint8_t aR, uint8_t aG, uint8_t aB) |
Sets the color of the text overlay. More... | |
PvResult | SetTextOverlaySize (int32_t aSize) |
Sets the text overlay font size. More... | |
void | SetTextOverlayOffsetX (uint32_t aX) |
Sets the X offset of the text overlay on the image. More... | |
void | SetTextOverlayOffsetY (uint32_t aY) |
Sets the Y offset of the text overlay on the image. More... | |
PvString | GetTextOverlay () const |
Returns the current text overlay string. More... | |
void | GetTextOverlayColor (uint8_t &aR, uint8_t &aG, uint8_t &aB) const |
Returns the text overlay color. More... | |
int32_t | GetTextOverlaySize () const |
Returns the text overlay size. More... | |
int32_t | GetTextOverlayOffsetX () const |
Returns the text overlay offset X. More... | |
int32_t | GetTextOverlayOffsetY () const |
Returns the text overlay offset Y. More... | |
PvBuffer & | GetInternalBuffer () |
Returns a reference to the internal display buffer. More... | |
int | GetHScrollPos () const |
Returns the current position of the horizontal scroll bar. More... | |
PvResult | SetHScrollPos (int aPos) |
Sets the horizontal scroll bar position. More... | |
void | GetHScrollRange (int &aMin, int &aMax) const |
Retrieves the valid range of the horizontal scroll bar. More... | |
int | GetVScrollPos () const |
Returns the current position of the vertical scroll bar. More... | |
PvResult | SetVScrollPos (int aPos) |
Sets the vertical scroll bar position. More... | |
void | GetVScrollRange (int &aMin, int &aMax) const |
Retrieves the valid range of the vertical scroll bar. More... | |
void | Zoom1_1 () |
Sets the display in 1:1 mode. More... | |
void | ZoomIn () |
Zooms the display in. | |
void | ZoomOut () |
Zooms the display out. | |
void | ZoomFit () |
Sets the display so the image fits the display without scroll bars. | |
![]() | |
void | SetPosition (int32_t aPosX, int32_t aPosY, int32_t aSizeX, int32_t aSizeY) |
Set the window's position and size. More... | |
void | GetPosition (int32_t &aPosX, int32_t &aPosY, int32_t &aSizeX, int32_t &aSizeY) |
Get the window's position and size. More... | |
PvString | GetTitle () const |
Get the window's title. More... | |
void | SetTitle (const PvString &aTitle) |
Set the window's title. More... | |
PvResult | Close () |
Close the window. More... | |
Additional Inherited Members | |
![]() | |
PvWnd () | |
Constructor. | |
virtual | ~PvWnd () |
Destructor. | |
A user interface for displaying the contents of an image.
To display images:
Display an image.
[in] | aImage | The image to display. |
[in] | aVSync | Vertical synchronization. If true, synchronizes with the monitor's refresh refresh rate. Yields a smoother display without horizontal tearing but is more CPU intensive and limits achievable display rate. |
Display an image.
[in] | aBuffer | The buffer containing the image to display. |
[in] | aVSync | Vertical synchronization. If true, synchronizes with the monitor's refresh refresh rate. Yields a smoother display without horizontal tearing but is more CPU intensive and limits achievable display rate. |
PvBufferConverter & PvDisplayWnd::GetConverter | ( | ) |
Returns a reference to the internal buffer converter.
When displaying a buffer requires a conversion, it is performed automatically by the PvDisplayWnd. The converter used for this operation can be configured using this method. As an example, a RGB filter could be set or the Bayer interpolation method could be selected.
int PvDisplayWnd::GetHScrollPos | ( | ) | const |
Returns the current position of the horizontal scroll bar.
void PvDisplayWnd::GetHScrollRange | ( | int & | aMin, |
int & | aMax | ||
) | const |
Retrieves the valid range of the horizontal scroll bar.
aMin | [out] Minimum scroll value, inclusive. |
aMax | [out] Maximum scroll value, inclusive. |
PvBuffer & PvDisplayWnd::GetInternalBuffer | ( | ) |
Returns a reference to the internal display buffer.
It is not recommended to write to this buffer. The main use of this method would be save an extra conversion to RGB when displaying an image. Just use the Display method and then access the display's internal RGB image instead of having to re-perform the conversion to RGB.
PvString PvDisplayWnd::GetTextOverlay | ( | ) | const |
Returns the current text overlay string.
void PvDisplayWnd::GetTextOverlayColor | ( | uint8_t & | aR, |
uint8_t & | aG, | ||
uint8_t & | aB | ||
) | const |
Returns the text overlay color.
aR | [in] 8-bit red color component |
aG | [in] 8-bit green color component |
aB | [in] 8-bit blue color component |
int32_t PvDisplayWnd::GetTextOverlayOffsetX | ( | ) | const |
Returns the text overlay offset X.
Defined in display pixels, from the upper left corner of the display.
int32_t PvDisplayWnd::GetTextOverlayOffsetY | ( | ) | const |
Returns the text overlay offset Y.
Defined in display pixels, from the upper left corner of the display.
int32_t PvDisplayWnd::GetTextOverlaySize | ( | ) | const |
Returns the text overlay size.
The size is native font size on MFC, Qt or .NET.
int PvDisplayWnd::GetVScrollPos | ( | ) | const |
Returns the current position of the vertical scroll bar.
void PvDisplayWnd::GetVScrollRange | ( | int & | aMin, |
int & | aMax | ||
) | const |
Retrieves the valid range of the vertical scroll bar.
aMin | [out] Minimum scroll value, inclusive. |
aMax | [out] Maximum scroll value, inclusive. |
PvResult PvDisplayWnd::SetBackgroundColor | ( | uint8_t | aR, |
uint8_t | aG, | ||
uint8_t | aB | ||
) |
Set the display's background color.
Each of the color components can range from 0 to 255.
[in] | aR | Color component: Red. |
[in] | aG | Color component: Green. |
[in] | aB | Color component: Blue. |
PvResult PvDisplayWnd::SetHScrollPos | ( | int | aPos | ) |
Sets the horizontal scroll bar position.
Use GetHScrollRange to retrieve the valid scroll bar range.
aPos | [in] New horizontal scroll bar position. |
void PvDisplayWnd::SetTextOverlay | ( | const PvString & | aText | ) |
Sets the text overlay.
The display is not immediately updated: the new text overlay is used with all Display method calls until changed or reset.
To clear the text overlay, set it to an empty string.
aText | [in] The new text overlay. |
void PvDisplayWnd::SetTextOverlayColor | ( | uint8_t | aR, |
uint8_t | aG, | ||
uint8_t | aB | ||
) |
Sets the color of the text overlay.
aR | [in] 8-bit red color component |
aG | [in] 8-bit green color component |
aB | [in] 8-bit blue color component |
void PvDisplayWnd::SetTextOverlayOffsetX | ( | uint32_t | aX | ) |
Sets the X offset of the text overlay on the image.
The offset is defined in screen pixels.
aX | [in] X offset |
void PvDisplayWnd::SetTextOverlayOffsetY | ( | uint32_t | aY | ) |
Sets the Y offset of the text overlay on the image.
The offset is defined in screen pixels.
aY | [in] Y offset |
PvResult PvDisplayWnd::SetTextOverlaySize | ( | int32_t | aSize | ) |
Sets the text overlay font size.
The size is native font size on MFC, Qt or .NET.
A good way of managing the font size is to start with the default size and increase or decrease it relatively:
Make text size 50% of original: display.SetTextOverlaySize( display.GetTextOverlaySize() / 2 ); Make text size 200% of original: display.SetTextOverlaySize( display.GetTextOverlaySize() * 2 );
aSize | [in] New font size |
PvResult PvDisplayWnd::SetVScrollPos | ( | int | aPos | ) |
Sets the vertical scroll bar position.
Use GetVScrollRange to retrieve the valid scroll bar range.
aPos | [in] New vertical scroll bar position. |
void PvDisplayWnd::Zoom1_1 | ( | ) |
Sets the display in 1:1 mode.
1:1 refers to 1 display pixel = 1 image pixel.
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com