Monado OpenXR Runtime
u_frame.h
Go to the documentation of this file.
1 // Copyright 2019, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief @ref xrt_frame helpers.
6  * @author Jakob Bornecrantz <jakob@collabora.com>
7  * @ingroup aux_util
8  */
9 
10 #pragma once
11 
12 #include "xrt/xrt_frame.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 
19 /*!
20  * Creates a single non-pooled frame, when the reference reaches zero it is
21  * freed.
22  */
23 void
24 u_frame_create_one_off(enum xrt_format f, uint32_t width, uint32_t height, struct xrt_frame **out_frame);
25 
26 /*!
27  * Clones a frame. The cloned frame is not freed when the original frame is freed; instead the cloned frame is freed
28  * when its reference reaches zero.
29  */
30 void
31 u_frame_clone(struct xrt_frame *to_copy, struct xrt_frame **out_frame);
32 
33 /*!
34  * Creates a frame out of a region of interest from @p original frame. Does not
35  * duplicate data, increases @p original refcount instead.
36  */
37 void
38 u_frame_create_roi(struct xrt_frame *original, struct xrt_rect roi, struct xrt_frame **out_frame);
39 
40 #ifdef __cplusplus
41 }
42 #endif
Basic frame data structure - holds a pointer to buffer.
Definition: xrt_frame.h:25
Image rectangle.
Definition: xrt_defines.h:430
void u_frame_create_one_off(enum xrt_format f, uint32_t width, uint32_t height, struct xrt_frame **out_frame)
Creates a single non-pooled frame, when the reference reaches zero it is freed.
Definition: u_frame.c:26
void u_frame_create_roi(struct xrt_frame *original, struct xrt_rect roi, struct xrt_frame **out_frame)
Creates a frame out of a region of interest from original frame.
Definition: u_frame.c:90
void u_frame_clone(struct xrt_frame *to_copy, struct xrt_frame **out_frame)
Clones a frame.
Definition: u_frame.c:55
xrt_format
Common formats, use u_format_* functions to reason about them.
Definition: xrt_defines.h:176
Data frame header.