2021-06-22 16:58:17 +00:00
|
|
|
// Copyright 2019-2021, Collabora, Ltd.
|
2020-03-10 13:27:43 +00:00
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Small data helpers for calibration.
|
|
|
|
* @author Jakob Bornecrantz <jakob@collabora.com>
|
|
|
|
* @ingroup aux_tracking
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "tracking/t_tracking.h"
|
|
|
|
#include "util/u_misc.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2021-06-22 16:58:17 +00:00
|
|
|
#include <assert.h>
|
2020-03-10 13:27:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
void
|
2021-06-22 16:58:17 +00:00
|
|
|
t_stereo_camera_calibration_alloc(struct t_stereo_camera_calibration **out_c, uint32_t distortion_num)
|
2020-03-10 13:27:43 +00:00
|
|
|
{
|
2021-06-22 16:58:17 +00:00
|
|
|
assert(distortion_num == 5 || distortion_num == 14);
|
|
|
|
|
2021-01-14 14:13:48 +00:00
|
|
|
struct t_stereo_camera_calibration *c = U_TYPED_CALLOC(struct t_stereo_camera_calibration);
|
2021-06-22 16:58:17 +00:00
|
|
|
c->view[0].distortion_num = distortion_num;
|
|
|
|
c->view[1].distortion_num = distortion_num;
|
2020-03-10 13:27:43 +00:00
|
|
|
t_stereo_camera_calibration_reference(out_c, c);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
t_stereo_camera_calibration_destroy(struct t_stereo_camera_calibration *c)
|
|
|
|
{
|
|
|
|
free(c);
|
|
|
|
}
|