From b9c3ac797e2c0464cffb7402b3e79cea6c3e371f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 22 Aug 2019 14:11:25 +0100 Subject: [PATCH] xrt: Add colour structs --- src/xrt/include/xrt/xrt_defines.h | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/xrt/include/xrt/xrt_defines.h b/src/xrt/include/xrt/xrt_defines.h index ef1231296..763ce91b6 100644 --- a/src/xrt/include/xrt/xrt_defines.h +++ b/src/xrt/include/xrt/xrt_defines.h @@ -133,6 +133,56 @@ struct xrt_vec3 float z; }; +/*! + * A 3 element colour with 8 bits per channel. + * + * @ingroup xrt_iface math + */ +struct xrt_colour_rgb_u8 +{ + uint8_t r; + uint8_t g; + uint8_t b; +}; + +/*! + * A 4 element colour with 8 bits per channel. + * + * @ingroup xrt_iface math + */ +struct xrt_colour_rgba_u8 +{ + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t a; +}; + +/*! + * A 3 element colour with floating point channels. + * + * @ingroup xrt_iface math + */ +struct xrt_colour_rgb_f32 +{ + float r; + float g; + float b; +}; + +/*! + * A 4 element colour with floating point channels. + * + * @ingroup xrt_iface math + */ +struct xrt_colour_rgba_f32 +{ + float r; + float g; + float b; + float a; +}; + /*! * A pose composed of a position and orientation. *