Monado OpenXR Runtime
u_distortion_mesh.c File Reference

Code to generate disortion meshes. More...

#include "util/u_misc.h"
#include "util/u_frame.h"
#include "util/u_debug.h"
#include "util/u_format.h"
#include "util/u_distortion_mesh.h"
#include "math/m_vec2.h"
#include "math/m_api.h"
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
Include dependency graph for u_distortion_mesh.c:

Macros

#define mul   m_vec2_mul
 
#define mul_scalar   m_vec2_mul_scalar
 
#define add   m_vec2_add
 
#define sub   m_vec2_sub
 
#define div   m_vec2_div
 
#define div_scalar   m_vec2_div_scalar
 
#define len   m_vec2_len
 
#define len_sqrd   m_vec2_len_sqrd
 

Typedefs

typedef bool(* func_calc) (struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *result)
 

Functions

static int index_for (int row, int col, uint32_t stride, uint32_t offset)
 
static void run_func (struct xrt_device *xdev, func_calc calc, struct xrt_hmd_parts *target, uint32_t num)
 
bool u_compute_distortion_vive (struct u_vive_values *values, float u, float v, struct xrt_uv_triplet *result)
 Distortion correction implementation for the Vive, Vive Pro, Valve Index distortion values found in the HMD configuration. More...
 
bool u_compute_distortion_panotools (struct u_panotools_values *values, float u, float v, struct xrt_uv_triplet *result)
 Distortion correction implementation for Panotools distortion values. More...
 
bool u_compute_distortion_cardboard (struct u_cardboard_distortion_values *values, float u, float v, struct xrt_uv_triplet *result)
 Distortion correction implementation for the Cardboard devices. More...
 
static float u_ns_polyval2d (float X, float Y, float C[16])
 
bool u_compute_distortion_ns_p2d (struct u_ns_p2d_values *values, int view, float u, float v, struct xrt_uv_triplet *result)
 Distortion correction implementation for North Star 2D/Polynomial. More...
 
bool u_compute_distortion_ns_meshgrid (struct u_ns_meshgrid_values *values, int view, float u, float v, struct xrt_uv_triplet *result)
 Moshi Turner's North Star distortion correction implementation. More...
 
bool u_compute_distortion_none (float u, float v, struct xrt_uv_triplet *result)
 Identity distortion correction sets all result coordinates to u,v. More...
 
bool u_distortion_mesh_none (struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *result)
 Helper function for none distortion devices. More...
 
void u_distortion_mesh_fill_in_none (struct xrt_device *xdev)
 Given a xrt_device generates a no distortion mesh, populates xdev->hmd_parts.distortion.mesh & xdev->hmd_parts.distortion.models. More...
 
void u_distortion_mesh_set_none (struct xrt_device *xdev)
 Given a xrt_device generates a no distortion mesh, also sets xdev->compute_distortion() and populates xdev->hmd_parts.distortion.mesh & xdev->hmd_parts.distortion.models. More...
 
void u_distortion_mesh_fill_in_compute (struct xrt_device *xdev)
 Given a xrt_device generates meshes by calling xdev->compute_distortion(), populates xdev->hmd_parts.distortion.mesh & xdev->hmd_parts.distortion.models. More...
 

Detailed Description

Code to generate disortion meshes.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Moses Turner moses.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m