Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_frame_scribble.h
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief @ref xrt_frame helpers for scribbling onto frames.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
12#include "xrt/xrt_frame.h"
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19
20/*!
21 * Scribbles a rectangle onto a frame.
22 *
23 * @param frame The frame to scribble on.
24 * @param rect The rectangle to scribble.
25 * @param fill Whether to fill the rectangle or just draw the outline.
26 * @param color The color to scribble with.
27 */
28void
30 const struct xrt_rect *rect,
31 bool fill,
32 const struct xrt_colour_rgba_u8 *color);
33
34/*!
35 * Scribbles a cross onto a frame.
36 *
37 * @param frame The frame to scribble on.
38 * @param x The x coordinate of the center of the cross.
39 * @param y The y coordinate of the center of the cross.
40 * @param size The size of the cross in pixels (from center to edge horizontally).
41 * @param color The color to scribble with.
42 */
43void
45 struct xrt_frame *frame, uint32_t x, uint32_t y, uint32_t size, const struct xrt_colour_rgba_u8 *color);
46
47/*!
48 * Scribbles a line onto a frame.
49 *
50 * @param frame The frame to scribble on.
51 * @param x0 The x coordinate of the start of the line.
52 * @param y0 The y coordinate of the start of the line.
53 * @param x1 The x coordinate of the end of the line.
54 * @param y1 The y coordinate of the end of the line.
55 * @param color The color to scribble with.
56 */
57void
59 uint32_t x0,
60 uint32_t y0,
61 uint32_t x1,
62 uint32_t y1,
63 const struct xrt_colour_rgba_u8 *color);
64
65/*!
66 * Scribbles text onto a frame.
67 *
68 * @param frame The frame to scribble on.
69 * @param x The x coordinate of the text baseline.
70 * @param y The y coordinate of the text baseline.
71 * @param text The text to scribble.
72 * @param size The desired pixel height of the text.
73 * @param color The color to scribble with.
74 */
75void
77 uint32_t x,
78 uint32_t y,
79 const char *text,
80 float size,
81 const struct xrt_colour_rgba_u8 *color);
82
83#ifdef __cplusplus
84}
85#endif
Definition u_pacing_compositor.c:54
A 4 element colour with 8 bits per channel.
Definition xrt_defines.h:385
Basic frame data structure - holds a pointer to buffer.
Definition xrt_frame.h:25
Image rectangle.
Definition xrt_defines.h:457
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.
Definition u_frame_scribble.cpp:68
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.
Definition u_frame_scribble.cpp:124
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.
Definition u_frame_scribble.cpp:94
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.
Definition u_frame_scribble.cpp:102
Data frame header.