From 1f2af862dc6090435ad52ed0d1fa2e890b8866a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 6 Jan 2017 23:04:45 +0100 Subject: [PATCH] Doc++ --- doc/types.dox | 26 +++++++++++++++++++++++--- src/Magnum/Math/Angle.h | 2 +- src/Magnum/Math/Color.h | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/doc/types.dox b/doc/types.dox index 9e826daa1..90ea691fd 100644 --- a/doc/types.dox +++ b/doc/types.dox @@ -74,7 +74,7 @@ underlying type. | @ref Vector2ui, @ref Vector3ui, @ref Vector4ui | `uvec2`, `uvec3`, `uvec4` | | @ref Vector2i, @ref Vector3i, @ref Vector4i | `ivec2`, `ivec3`, `ivec4` | | @ref Vector2d, @ref Vector3d, @ref Vector4d | `dvec2`, `dvec3`, `dvec4` | -| @ref Color3ub, @ref Color4ub | *(none)* | +| @ref Color3ub, @ref Color4ub | (*none*) | | Magnum matrix type | Equivalent GLSL type | | ---------------------------------------------------------------- | ------------------------------------ | @@ -92,6 +92,24 @@ Any super- or sub-class of the same size and underlying type can be used equivalently (e.g. @ref Math::Vector "Math::Vector" or @ref Color3 instead of @ref Vector3). +For easier entering of (s)RGB colors in hexadecimal format there are +@link Math::Literals::operator""_srgb() _srgb @endlink / +@link Math::Literals::operator""_srgbf() _srgbf @endlink, +@link Math::Literals::operator""_srgba() _srgba @endlink / +@link Math::Literals::operator""_srgbaf() _srgbaf @endlink, +@link Math::Literals::operator""_rgb() _rgb @endlink / +@link Math::Literals::operator""_rgbf() _rgbf @endlink and +@link Math::Literals::operator""_rgba() _rgba @endlink / +@link Math::Literals::operator""_rgbaf() _rgbaf @endlink literals in +@ref Math::Literals namespace. See their documentation for more information +about the differences. +@code +using namespace Math::Literals; + +Color3 a = 0x33b27f_srgbf; // {0.0331048f, 0.445201f, 0.212231f} +Color4ub a = 0x33b27fcc_rgba; // {0x33, 0xb2, 0x7f, 0xcc} +@endcode + @section types-binary Binary representation Scalar types with GLSL equivalent are verified to be exactly the same as @@ -119,8 +137,10 @@ usability impact in practice. These classes are *not* implicitly constructible or convertible from/to @ref Float or @ref Double, you have to either construct/convert them explicitly -or use custom `_degf`/`_deg` and `_radf`/`_rad` literals that are provided in -the @ref Math::Literals namespace: +or use custom @link Math::Literals::operator""_degf() _degf @endlink / +@link Math::Literals::operator""_deg() _deg @endlink and @link Math::Literals::operator""_radf() _radf @endlink +/ @link Math::Literals::operator""_rad() _rad @endlink literals that are +provided in the @ref Math::Literals namespace: @code using namespace Math::Literals; diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index c2a1897d8..87661df9b 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -26,7 +26,7 @@ */ /** @file - * @brief Class @ref Magnum::Math::Deg, @ref Magnum::Math::Rad and related operators + * @brief Class @ref Magnum::Math::Deg, @ref Magnum::Math::Rad, literal @link Magnum::Math::Literals::operator""_degf() @endlink, @link Magnum::Math::Literals::operator""_radf() @endlink, @link Magnum::Math::Literals::operator""_deg() @endlink, @link Magnum::Math::Literals::operator""_rad() @endlink */ #include diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 17b54e661..8327352d8 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -26,7 +26,7 @@ */ /** @file - * @brief Class @ref Magnum::Math::Color3, @ref Magnum::Math::Color4 + * @brief Class @ref Magnum::Math::Color3, @ref Magnum::Math::Color4, literal @link Magnum::Math::Literals::operator""_rgb() @endlink, @link Magnum::Math::Literals::operator""_rgba() @endlink, @link Magnum::Math::Literals::operator""_rgbf() @endlink, @link Magnum::Math::Literals::operator""_rgbaf() @endlink, @link Magnum::Math::Literals::operator""_srgb() @endlink, @link Magnum::Math::Literals::operator""_srgba() @endlink, @link Magnum::Math::Literals::operator""_srgbf() @endlink, @link Magnum::Math::Literals::operator""_srgbaf() @endlink */ #include