Browse Source

Doc++, allow to search literals without the nonobvious operator"" prefix.

pull/194/merge
Vladimír Vondruš 8 years ago
parent
commit
b79c245a63
  1. 2
      doc/changelog.dox
  2. 4
      src/Magnum/Math/Angle.h
  3. 8
      src/Magnum/Math/Color.h

2
doc/changelog.dox

@ -42,7 +42,7 @@ See also:
@subsubsection changelog-lates-new-math Math library
- Added @ref Math::piQuarter()
- Added @ref Math::Constants::piQuarter()
@subsection changelog-latest-changes Changes and improvements

4
src/Magnum/Math/Angle.h

@ -143,6 +143,7 @@ Example usage:
@snippet MagnumMath.cpp _deg
@see @link operator""_degf() @endlink, @link operator""_rad() @endlink
@m_keywords{_deg deg}
*/
constexpr Deg<Double> operator "" _deg(long double value) { return Deg<Double>(Double(value)); }
@ -154,6 +155,7 @@ Example usage:
@snippet MagnumMath.cpp _degf
@see @link operator""_deg() @endlink, @link operator""_radf() @endlink
@m_keywords{_degf degf}
*/
constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(Float(value)); }
@ -210,6 +212,7 @@ namespace Literals {
See @link operator""_deg() @endlink for more information.
@see @link operator""_radf() @endlink
@m_keywords{_rad rad}
*/
constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(Double(value)); }
@ -218,6 +221,7 @@ constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(D
See @link operator""_degf() @endlink for more information.
@see @link operator""_rad() @endlink
@m_keywords{_radf radf}
*/
constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(Float(value)); }

8
src/Magnum/Math/Color.h

@ -994,6 +994,7 @@ Unpacks the literal into three 8-bit values. Example usage:
literal instead.
@see @link operator""_rgba() @endlink, @link operator""_rgbf() @endlink
@m_keywords{_rgb rgb}
*/
constexpr Color3<UnsignedByte> operator "" _rgb(unsigned long long value) {
return {UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)};
@ -1016,6 +1017,7 @@ RGB. Use this literal to document that given value is in sRGB. Example usage:
representation directly or convert the value using @ref Color3::fromSrgb().
@see @link operator""_srgba() @endlink, @link operator""_rgb() @endlink
@m_keywords{_srgb srgb}
*/
/* Output is a Vector3 to hint that it doesn't have any (additive,
multiplicative) semantics of a linear RGB color */
@ -1036,6 +1038,7 @@ Unpacks the literal into four 8-bit values. Example usage:
literal instead.
@see @link operator""_rgb() @endlink, @link operator""_rgbaf() @endlink
@m_keywords{_rgba rgba}
*/
constexpr Color4<UnsignedByte> operator "" _rgba(unsigned long long value) {
return {UnsignedByte(value >> 24), UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)};
@ -1059,6 +1062,7 @@ usage:
representation directly or convert the value using @ref Color4::fromSrgbAlpha().
@see @link operator""_srgb() @endlink, @link operator""_rgba() @endlink
@m_keywords{_srgba srgba}
*/
/* Output is a Vector3 to hint that it doesn't have any (additive,
multiplicative) semantics of a linear RGB color */
@ -1079,6 +1083,7 @@ Unpacks the 8-bit values into three floats. Example usage:
literal instead.
@see @link operator""_rgbaf() @endlink, @link operator""_rgb() @endlink
@m_keywords{_rgbf rgbf}
*/
inline Color3<Float> operator "" _rgbf(unsigned long long value) {
return Math::unpack<Color3<Float>>(Color3<UnsignedByte>{UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)});
@ -1095,6 +1100,7 @@ usage:
@see @link operator""_srgbaf() @endlink, @link operator""_srgb() @endlink,
@link operator""_rgbf() @endlink
@m_keywords{_srgbf srgbf}
*/
inline Color3<Float> operator "" _srgbf(unsigned long long value) {
return Color3<Float>::fromSrgb<UnsignedByte>({UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)});
@ -1113,6 +1119,7 @@ Unpacks the 8-bit values into four floats. Example usage:
literal instead.
@see @link operator""_rgbf() @endlink, @link operator""_rgba() @endlink
@m_keywords{_rgbaf rgbaf}
*/
inline Color4<Float> operator "" _rgbaf(unsigned long long value) {
return Math::unpack<Color4<Float>>(Color4<UnsignedByte>{UnsignedByte(value >> 24), UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)});
@ -1129,6 +1136,7 @@ information. Example usage:
@see @link operator""_srgbf() @endlink, @link operator""_srgba() @endlink,
@link operator""_rgbaf() @endlink
@m_keywords{_srgbaf srgbaf}
*/
inline Color4<Float> operator "" _srgbaf(unsigned long long value) {
return Color4<Float>::fromSrgbAlpha<UnsignedByte>({UnsignedByte(value >> 24), UnsignedByte(value >> 16), UnsignedByte(value >> 8), UnsignedByte(value)});

Loading…
Cancel
Save