libcruft-util/test/colour.cpp

21 lines
414 B
C++
Raw Normal View History

#include "colour.hpp"
2015-04-13 18:06:08 +10:00
2015-04-13 16:45:56 +10:00
#include "tap.hpp"
2016-07-28 13:31:52 +10:00
int
main (int, char**)
{
2015-04-13 16:45:56 +10:00
util::TAP::logger tap;
2015-04-09 20:45:55 +10:00
// Check casting works between intergral and floating formats
{
util::srgba<4,float> f {1.f};
util::srgba<4,uint8_t> u {255};
2015-04-13 16:45:56 +10:00
tap.expect_eq (f.cast<uint8_t> (), u, "cast float to u8");
tap.expect_eq (u.cast<float> (), f, "cast u8 to float");
2015-04-09 20:45:55 +10:00
}
2015-04-09 20:46:55 +10:00
return tap.status ();
}