Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvDisplayWnd Class Reference

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...
 
PvBufferConverterGetConverter ()
 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...
 
PvBufferGetInternalBuffer ()
 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.
 
- Public Member Functions inherited from PvWnd
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

- Protected Member Functions inherited from PvWnd
 PvWnd ()
 Constructor.
 
virtual ~PvWnd ()
 Destructor.
 

Detailed Description

A user interface for displaying the contents of an image.

To display images:

  1. Decide if you want the display in a standalone window or embedded as an element of a window you control.
  2. Create a display control (PvDisplayWnd object).
  3. If you want to display in a standalone window, optionally set window's position. Use SetPosition.
  4. Optionally, set the background color. Use SetBackgroundColor.
  5. Make the display controller appear.
    • To embed the display in your own application (a window you control yourself), use Create.
    • To set the display as part of a standalone modal window, use ShowModal.
    • To set the display as part of a standalone nonmodal window, use ShowModeless.
  6. Make an image appear in the display area. Use Display.
  7. Optionally, update the image (i.e. show a movie by displaying many images sequentially). Use additional calls to Display.
  8. Set the window's position. Use SetPosition. Use the same method to resize the window.
  9. Close the window. Use Close.

Member Function Documentation

◆ Display() [1/2]

PvResult PvDisplayWnd::Display ( const IPvImage aImage,
bool  aVSync = false 
)

Display an image.

Parameters
[in]aImageThe image to display.
[in]aVSyncVertical 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.
Returns
Includes:

◆ Display() [2/2]

PvResult PvDisplayWnd::Display ( const PvBuffer aBuffer,
bool  aVSync = false 
)

Display an image.

Parameters
[in]aBufferThe buffer containing the image to display.
[in]aVSyncVertical 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.
Returns
Includes:

◆ GetConverter()

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.

Returns
The internal buffer converter.

◆ GetHScrollPos()

int PvDisplayWnd::GetHScrollPos ( ) const

Returns the current position of the horizontal scroll bar.

Returns
Position of the horizontal scroll bar.

◆ GetHScrollRange()

void PvDisplayWnd::GetHScrollRange ( int &  aMin,
int &  aMax 
) const

Retrieves the valid range of the horizontal scroll bar.

Parameters
aMin[out] Minimum scroll value, inclusive.
aMax[out] Maximum scroll value, inclusive.

◆ GetInternalBuffer()

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.

Returns
A reference to the internal display buffer.

◆ GetTextOverlay()

PvString PvDisplayWnd::GetTextOverlay ( ) const

Returns the current text overlay string.

Returns
Text overlay string.

◆ GetTextOverlayColor()

void PvDisplayWnd::GetTextOverlayColor ( uint8_t &  aR,
uint8_t &  aG,
uint8_t &  aB 
) const

Returns the text overlay color.

Parameters
aR[in] 8-bit red color component
aG[in] 8-bit green color component
aB[in] 8-bit blue color component

◆ GetTextOverlayOffsetX()

int32_t PvDisplayWnd::GetTextOverlayOffsetX ( ) const

Returns the text overlay offset X.

Defined in display pixels, from the upper left corner of the display.

Returns
Text overlay offset X.

◆ GetTextOverlayOffsetY()

int32_t PvDisplayWnd::GetTextOverlayOffsetY ( ) const

Returns the text overlay offset Y.

Defined in display pixels, from the upper left corner of the display.

Returns
Text overlay offset Y.

◆ GetTextOverlaySize()

int32_t PvDisplayWnd::GetTextOverlaySize ( ) const

Returns the text overlay size.

The size is native font size on MFC, Qt or .NET.

Returns
Text overlay size.

◆ GetVScrollPos()

int PvDisplayWnd::GetVScrollPos ( ) const

Returns the current position of the vertical scroll bar.

Returns
Position of the horizontal scroll bar.

◆ GetVScrollRange()

void PvDisplayWnd::GetVScrollRange ( int &  aMin,
int &  aMax 
) const

Retrieves the valid range of the vertical scroll bar.

Parameters
aMin[out] Minimum scroll value, inclusive.
aMax[out] Maximum scroll value, inclusive.

◆ SetBackgroundColor()

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.

Parameters
[in]aRColor component: Red.
[in]aGColor component: Green.
[in]aBColor component: Blue.
Returns
Includes:

◆ SetHScrollPos()

PvResult PvDisplayWnd::SetHScrollPos ( int  aPos)

Sets the horizontal scroll bar position.

Use GetHScrollRange to retrieve the valid scroll bar range.

Parameters
aPos[in] New horizontal scroll bar position.
Returns
Includes:
  • PvResult::Code::OK
  • RPvResult::Code::INVALID_PARAMETER if new position is out of the scroll bar range.

◆ SetTextOverlay()

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.

Parameters
aText[in] The new text overlay.

◆ SetTextOverlayColor()

void PvDisplayWnd::SetTextOverlayColor ( uint8_t  aR,
uint8_t  aG,
uint8_t  aB 
)

Sets the color of the text overlay.

Parameters
aR[in] 8-bit red color component
aG[in] 8-bit green color component
aB[in] 8-bit blue color component

◆ SetTextOverlayOffsetX()

void PvDisplayWnd::SetTextOverlayOffsetX ( uint32_t  aX)

Sets the X offset of the text overlay on the image.

The offset is defined in screen pixels.

Parameters
aX[in] X offset

◆ SetTextOverlayOffsetY()

void PvDisplayWnd::SetTextOverlayOffsetY ( uint32_t  aY)

Sets the Y offset of the text overlay on the image.

The offset is defined in screen pixels.

Parameters
aY[in] Y offset

◆ SetTextOverlaySize()

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 );

Parameters
aSize[in] New font size
Returns
Includes:

◆ SetVScrollPos()

PvResult PvDisplayWnd::SetVScrollPos ( int  aPos)

Sets the vertical scroll bar position.

Use GetVScrollRange to retrieve the valid scroll bar range.

Parameters
aPos[in] New vertical scroll bar position.
Returns
Includes:
  • PvResult::Code::OK
  • RPvResult::Code::INVALID_PARAMETER if new position is out of the scroll bar range.

◆ Zoom1_1()

void PvDisplayWnd::Zoom1_1 ( )

Sets the display in 1:1 mode.

1:1 refers to 1 display pixel = 1 image pixel.


The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com