Imaging Control 4 C++ Library 1.2.0
|
Represents a display that can be used to display images. More...
Public Types | |
using | WindowClosedHandler = std::function< void(Display &display)> |
Function prototype for window-closed event handlers. | |
using | NotificationToken = void * |
Represents a registered callback. | |
Public Member Functions | |
bool | displayBuffer (const std::shared_ptr< ic4::ImageBuffer > &buffer, Error &err=Error::Default()) |
Displays a specific image buffer. | |
bool | setRenderPosition (DisplayRenderPosition pos, int left=-1, int top=-1, int width=-1, int height=-1, Error &err=Error::Default()) |
Configure the image scaling and alignment options for a display. | |
DisplayStatistics | statistics (Error &err=Error::Default()) |
Queries display statistics. | |
NotificationToken | eventAddWindowClosed (WindowClosedHandler cb, Error &err=Error::Default()) |
Registers a new window-closed event handler. | |
bool | eventRemoveWindowClosed (NotificationToken token, Error &err=Error::Default()) |
Unregisters a window-closed event handler. | |
Static Public Member Functions | |
static std::shared_ptr< Display > | create (DisplayType type, WindowHandle hParent, Error &err=Error::Default()) |
Creates a new display. | |
Represents a display that can be used to display images.
To create a display, call Display::create() or ExternalOpenGLDisplay::create().
Display objects are generally used in two distinct ways:
Display objects are neither copyable nor movable, and are only handled via std::shared_ptr<Display>
.
using NotificationToken = void* |
Represents a registered callback.
When a callback function is registered using Display::eventAddWindowClosed, a token is returned.
The token can then be used to remove the callback using Display::eventRemoveWindowClosed at a later time.
using WindowClosedHandler = std::function<void(Display& display)> |
Function prototype for window-closed event handlers.
[in] | display | The Display on which the event handler was registered. |
|
inlinestatic |
Creates a new display.
[in] | type | The type of display to create |
[in] | hParent | Handle to the parent window to embed the display into. |
[out] | err | Reference to an error handler. See Error Handling for details. |
nullptr
if an error occurs.
|
inline |
Displays a specific image buffer.
[in] | buffer | The buffer to display |
[out] | err | Reference to an error handler. See Error Handling for details. |
true
on success, otherwise false
.nullptr
, the display is cleared and will no longer display the previous buffer.
|
inline |
Registers a new window-closed event handler.
[in] | cb | Callback function to be called when the display window is closed. |
[out] | err | Reference to an error handler. See Error Handling for details. |
nullptr
.
|
inline |
Unregisters a window-closed event handler.
[in] | token | A token that was returned when registering an event handler using Display::eventAddWindowClosed(). |
[out] | err | Reference to an error handler. See Error Handling for details. |
true
on success, otherwise false
.
|
inline |
Configure the image scaling and alignment options for a display.
[in] | pos | The scaling and alignment mode to use |
[in] | left | The left coordinate of the target rectangle inside the display window |
[in] | top | The top coordinate of the target rectangle inside the display window |
[in] | width | The width of the target rectangle inside the display window |
[in] | height | The height of the target rectangle inside the display window |
[out] | err | Reference to an error handler. See Error Handling for details. |
true
on success, otherwise false
.
|
inline |
Queries display statistics.
[out] | err | Reference to an error handler. See Error Handling for details. |