monado/src/xrt/auxiliary/util/u_frame.h

43 lines
1,004 B
C
Raw Normal View History

2019-08-22 13:15:41 +00:00
// Copyright 2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief @ref xrt_frame helpers.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup aux_util
*/
#pragma once
#include "xrt/xrt_frame.h"
#ifdef __cplusplus
extern "C" {
#endif
/*!
* Creates a single non-pooled frame, when the reference reaches zero it is
* freed.
*/
void
2021-01-14 14:13:48 +00:00
u_frame_create_one_off(enum xrt_format f, uint32_t width, uint32_t height, struct xrt_frame **out_frame);
2019-08-22 13:15:41 +00:00
2021-08-24 13:10:13 +00:00
/*!
* Clones a frame. The cloned frame is not freed when the original frame is freed; instead the cloned frame is freed
* when its reference reaches zero.
*/
void
u_frame_clone(struct xrt_frame *to_copy, struct xrt_frame **out_frame);
2019-08-22 13:15:41 +00:00
2021-12-12 16:10:54 +00:00
/*!
* Creates a frame out of a region of interest from @p original frame. Does not
* duplicate data, increases @p original refcount instead.
*/
void
u_frame_create_roi(struct xrt_frame *original, struct xrt_rect roi, struct xrt_frame **out_frame);
2019-08-22 13:15:41 +00:00
#ifdef __cplusplus
}
#endif