xrt_frame helpers for scribbling onto frames.
More...
#include "xrt/xrt_frame.h"
#include "xrt/xrt_config_have.h"
#include "u_frame_scribble.h"
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
|
|
static bool | mat_from_frame (const struct xrt_frame *frame, cv::Mat &out_mat) |
| |
|
static cv::Scalar | scalar_from_rgba_u8 (const struct xrt_colour_rgba_u8 *color) |
| |
|
static double | pixel_size_to_text_scale (float pixel_size, int font_face, int thickness) |
| |
| void | u_frame_scribble_rect (struct xrt_frame *frame, const struct xrt_rect *rect, bool fill, const struct xrt_colour_rgba_u8 *color) |
| | Scribbles a rectangle onto a frame.
|
| |
| void | u_frame_scribble_cross (struct xrt_frame *frame, uint32_t x, uint32_t y, uint32_t size, const struct xrt_colour_rgba_u8 *color) |
| | Scribbles a cross onto a frame.
|
| |
| void | u_frame_scribble_line (struct xrt_frame *frame, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, const struct xrt_colour_rgba_u8 *color) |
| | Scribbles a line onto a frame.
|
| |
| void | u_frame_scribble_text (struct xrt_frame *frame, uint32_t x, uint32_t y, const char *text, float size, const struct xrt_colour_rgba_u8 *color) |
| | Scribbles text onto a frame.
|
| |
◆ u_frame_scribble_cross()
| void u_frame_scribble_cross |
( |
struct xrt_frame * |
frame, |
|
|
uint32_t |
x, |
|
|
uint32_t |
y, |
|
|
uint32_t |
size, |
|
|
const struct xrt_colour_rgba_u8 * |
color |
|
) |
| |
Scribbles a cross onto a frame.
- Parameters
-
| frame | The frame to scribble on. |
| x | The x coordinate of the center of the cross. |
| y | The y coordinate of the center of the cross. |
| size | The size of the cross in pixels (from center to edge horizontally). |
| color | The color to scribble with. |
References u_frame_scribble_line().
◆ u_frame_scribble_line()
| void u_frame_scribble_line |
( |
struct xrt_frame * |
frame, |
|
|
uint32_t |
x0, |
|
|
uint32_t |
y0, |
|
|
uint32_t |
x1, |
|
|
uint32_t |
y1, |
|
|
const struct xrt_colour_rgba_u8 * |
color |
|
) |
| |
Scribbles a line onto a frame.
- Parameters
-
| frame | The frame to scribble on. |
| x0 | The x coordinate of the start of the line. |
| y0 | The y coordinate of the start of the line. |
| x1 | The x coordinate of the end of the line. |
| y1 | The y coordinate of the end of the line. |
| color | The color to scribble with. |
Referenced by u_frame_scribble_cross().
◆ u_frame_scribble_rect()
Scribbles a rectangle onto a frame.
- Parameters
-
| frame | The frame to scribble on. |
| rect | The rectangle to scribble. |
| fill | Whether to fill the rectangle or just draw the outline. |
| color | The color to scribble with. |
◆ u_frame_scribble_text()
| void u_frame_scribble_text |
( |
struct xrt_frame * |
frame, |
|
|
uint32_t |
x, |
|
|
uint32_t |
y, |
|
|
const char * |
text, |
|
|
float |
size, |
|
|
const struct xrt_colour_rgba_u8 * |
color |
|
) |
| |
Scribbles text onto a frame.
- Parameters
-
| frame | The frame to scribble on. |
| x | The x coordinate of the text baseline. |
| y | The y coordinate of the text baseline. |
| text | The text to scribble. |
| size | The desired pixel height of the text. |
| color | The color to scribble with. |