|
Ocean
|
This class implements utilities and helper functions. More...
#include <Utilities.h>
Public Types | |
| enum | AnchorPosition : uint32_t { AP_TOP_LEFT , AP_TOP_RIGHT , AP_BOTTOM_LEFT , AP_BOTTOM_RIGHT , AP_CENTER } |
| Definition of anchor positions for text rendering. More... | |
Static Public Member Functions | |
| static void | textOutput (HDC dc, const int x, const int y, const std::string &text) |
| Prints a text on the given device context. | |
| static void | textOutput (HDC deviceContext, const std::wstring &text, const std::wstring &font, const unsigned int fontSize, const bool bold, const AnchorPosition anchorPosition, const unsigned int windowWidth, const unsigned int windowHeight, const int32_t foregroundColor, const int32_t backgroundColor=-1, const int32_t shadowColor=-1, const unsigned int shadowOffsetX=2u, const unsigned int shadowOffsetY=2u, const unsigned int marginX=20u, const unsigned int marginY=20u) |
| Draws styled text on a device context with customizable font, anchor position, and colors. | |
| static void | desktopTextOutput (const int x, const int y, const std::string &text) |
| Prints a text on the desktop. | |
| static void | frameOutput (HDC dc, const int x, const int y, const Frame &frame) |
| Prints a frame on the given device context. | |
| static void | frameOutput (HDC dc, const int x, const int y, const unsigned int width, const unsigned int height, const Frame &frame) |
| Prints a frame on the given device context. | |
| static void | desktopFrameOutput (const int x, const int y, const Frame &frame) |
| Prints a given frame on the Windows' main desktop at a specified location. | |
| static void | desktopFrameOutput (const int x, const int y, const unsigned int scale, const Frame &frame) |
| Prints a given frame on the Windows' main desktop at a specified location. | |
| static void | desktopFrameOutput (const int x, const int y, const unsigned int width, const unsigned int height, const Frame &frame) |
| Prints a given frame on the Windows' main desktop at a specified location. | |
| static void | bitmapOutput (HDC dc, const int x, const int y, const Bitmap &bitmap) |
| Prints a bitmap on the given device context. | |
| static void | desktopBitmapOutput (const int x, const int y, const unsigned int scale, const Bitmap &bitmap) |
| Prints a bitmap on the desktop. | |
| static void | bitmapOutput (HDC dc, const int x, const int y, const unsigned int width, const unsigned int height, const Bitmap &bitmap) |
| Prints a bitmap on the given device context. | |
| static void | desktopBitmapOutput (const int x, const int y, const Bitmap &bitmap) |
| Prints a bitmap on the desktop. | |
| static void | desktopBitmapOutput (const int x, const int y, const unsigned int width, const unsigned int height, const Bitmap &bitmap) |
| Prints a bitmap on the desktop. | |
| static CV::PixelBoundingBox | textBoundingBox (const std::string &value, const std::string &font=std::string(), const unsigned int size=0u) |
| Determines the bounding box of a given string with specified font and font size. | |
| static CV::PixelBoundingBox | textBoundingBox (const std::wstring &value, const std::wstring &font=std::wstring(), const unsigned int size=0u) |
| Determines the bounding box of a given string with specified font and font size. | |
This class implements utilities and helper functions.
| enum Ocean::Platform::Win::Utilities::AnchorPosition : uint32_t |
Definition of anchor positions for text rendering.
|
static |
Prints a bitmap on the given device context.
| dc | Device context receiving the bitmap |
| x | Horizontal output position |
| y | Vertical output position |
| bitmap | bitmap to be printed |
|
static |
Prints a bitmap on the given device context.
| dc | Device context receiving the text |
| x | Horizontal output position |
| y | Vertical output position |
| width | Output width in pixel |
| height | Output height in pixel |
| bitmap | bitmap to be printed |
|
static |
Prints a bitmap on the desktop.
| x | Horizontal output position |
| y | Vertical output position |
| bitmap | bitmap to be printed |
|
inlinestatic |
Prints a bitmap on the desktop.
| x | Horizontal output position |
| y | Vertical output position |
| scale | Scale of the output bitmap |
| bitmap | Bitmap to be printed |
|
static |
Prints a bitmap on the desktop.
| x | Horizontal output position |
| y | Vertical output position |
| width | Output width in pixel |
| height | Output height in pixel |
| bitmap | bitmap to be printed |
|
static |
Prints a given frame on the Windows' main desktop at a specified location.
You do not need to have a GUI application to use this function.
Call this function from any application and from any thread.
The painted frame will disappear immediately when Windows receives any repaint event.
This function is intended for debugging purposes only.
| x | Horizontal output position, with range (-infinity, infinity) |
| y | Vertical output position, with range (-infinity, infinity) |
| frame | The frame to be printed |
|
inlinestatic |
Prints a given frame on the Windows' main desktop at a specified location.
You do not need to have a GUI application to use this function.
Call this function from any application and from any thread.
The painted frame will disappear immediately when Windows receives any repaint event.
This function is intended for debugging purposes only.
| x | Horizontal output position, with range (-infinity, infinity) |
| y | Vertical output position, with range (-infinity, infinity) |
| scale | The scale that is applied to the frame, a factor of 2 will increase the painted frame by two, with range [1, infinity) |
| frame | The frame to be printed |
|
static |
Prints a given frame on the Windows' main desktop at a specified location.
You do not need to have a GUI application to use this function.
Call this function from any application and from any thread.
The painted frame will disappear immediately when Windows receives any repaint event.
This function is intended for debugging purposes only.
| x | Horizontal output position, with range (-infinity, infinity) |
| y | Vertical output position, with range (-infinity, infinity) |
| width | The width of the painted frame in the domain of the desktop, in pixel, with range [1, infinity) |
| height | The height of the painted frame in the domain of the desktop, in pixel, with range [1, infinity) |
| frame | The frame to be printed |
|
static |
Prints a text on the desktop.
| x | Horizontal output position |
| y | Vertical output position |
| text | Text to be printed |
|
static |
Prints a frame on the given device context.
| dc | Device context receiving the frame |
| x | Horizontal output position |
| y | Vertical output position |
| frame | The frame to be printed |
|
static |
Prints a frame on the given device context.
| dc | Device context receiving the text |
| x | Horizontal output position |
| y | Vertical output position |
| width | Output width in pixel |
| height | Output height in pixel |
| frame | The frame to be printed |
|
static |
Determines the bounding box of a given string with specified font and font size.
| value | The string for which the bounding box will be determined |
| font | The name of the font which will be applied |
| size | The size of the font |
|
static |
Determines the bounding box of a given string with specified font and font size.
| value | The string for which the bounding box will be determined |
| font | The name of the font which will be applied |
| size | The size of the font |
|
static |
Prints a text on the given device context.
| dc | The device context on which the text will be drawn |
| x | Horizontal output position |
| y | Vertical output position |
| text | Text to be printed |
|
static |
Draws styled text on a device context with customizable font, anchor position, and colors.
The text can be positioned using anchor points relative to the window dimensions, with optional shadow for better visibility.
| dc | The device context on which the text will be drawn |
| text | The text to be drawn |
| font | The name of the font to use (e.g., "Arial") |
| fontSize | The height of the font in pixels |
| bold | True to use bold font weight; False for normal weight |
| anchorPosition | The anchor position for the text |
| windowWidth | The width of the window, used for anchor calculations |
| windowHeight | The height of the window, used for anchor calculations |
| foregroundColor | The color of the text (RGB value) |
| backgroundColor | The background color of the text, or -1 for transparent background |
| shadowColor | The color of the shadow, or -1 to disable shadow |
| shadowOffsetX | The horizontal offset of the shadow in pixels, with range [0, infinity) |
| shadowOffsetY | The vertical offset of the shadow in pixels, with range [0, infinity) |
| marginX | The horizontal margin from the window edge in pixels, with range [0, infinity) |
| marginY | The vertical margin from the window edge in pixels, with range [0, infinity) |