libcruft-util/test/colour.cpp
Danny Robson d3f434b523 coord: make template parameters more flexible
The coordinate system was unable to support types that prohibited
redim or retype operations. Additionally, the `tags' type used for
providing named data parameters was unwiedly.

We remove much of the dependance on template template parameters in the
defined operations and instead define these in terms of a template
specialisation of is_coord.

The tag types were replaced with direct specialisation of the `store'
struct by the primary type, and passing this type through use of the
CRTP.
2017-11-22 17:03:00 +11:00

21 lines
414 B
C++

#include "colour.hpp"
#include "tap.hpp"
int
main (int, char**)
{
util::TAP::logger tap;
// Check casting works between intergral and floating formats
{
util::srgba<4,float> f {1.f};
util::srgba<4,uint8_t> u {255};
tap.expect_eq (f.cast<uint8_t> (), u, "cast float to u8");
tap.expect_eq (u.cast<float> (), f, "cast u8 to float");
}
return tap.status ();
}