diff --git a/colour.hpp b/colour.hpp index e4a8b6cf..39d87534 100644 --- a/colour.hpp +++ b/colour.hpp @@ -46,11 +46,14 @@ namespace util { }; // Convenience types - typedef colour<3,uint8_t> colour3u; - typedef colour<4,uint8_t> colour4u; + template using colour3 = colour<3,T>; + template using colour4 = colour<4,T>; - typedef colour<4,float> colour4f; - typedef colour<3,float> colour3f; + typedef colour3 colour3u; + typedef colour4 colour4u; + + typedef colour4 colour4f; + typedef colour3 colour3f; // RGB <-> HSV colour3f rgb_to_hsv (colour3f); diff --git a/extent.hpp b/extent.hpp index 63d2d0be..f654cb0c 100644 --- a/extent.hpp +++ b/extent.hpp @@ -51,10 +51,14 @@ namespace util { static const extent MIN; }; - typedef extent<2,intmax_t> extent2i; - typedef extent<2,size_t> extent2u; - typedef extent<2,float> extent2f; - typedef extent<2,double> extent2d; + // convenience typedefs + template using extent2 = extent<2,T>; + template using extent3 = extent<3,T>; + + typedef extent2 extent2i; + typedef extent2 extent2u; + typedef extent2 extent2f; + typedef extent2 extent2d; template std::ostream& operator<< (std::ostream&, util::extent); diff --git a/point.hpp b/point.hpp index 4228b691..22b0964d 100644 --- a/point.hpp +++ b/point.hpp @@ -61,15 +61,25 @@ namespace util { std::ostream& operator<< (std::ostream&, point); // Convenience typedefs - typedef point<2,float> point2f; - typedef point<3,float> point3f; - typedef point<4,float> point4f; + template using point2 = point<2,T>; + template using point3 = point<3,T>; + template using point4 = point<4,T>; - typedef point<2,double> point2d; - typedef point<3,double> point3d; + typedef point2 point2f; + typedef point3 point3f; + typedef point4 point4f; - typedef point<2,size_t> point2u; - typedef point<2,intmax_t> point2i; + typedef point2 point2d; + typedef point3 point3d; + typedef point4 point4d; + + typedef point2 point2u; + typedef point3 point3u; + typedef point4 point4u; + + typedef point2 point2i; + typedef point3 point3i; + typedef point4 point4i; } #include diff --git a/vector.hpp b/vector.hpp index 5ade27ec..bab7eded 100644 --- a/vector.hpp +++ b/vector.hpp @@ -77,19 +77,19 @@ namespace util { template using vector3 = vector<3,T>; template using vector4 = vector<4,T>; - typedef vector<2,size_t> vector2u; - typedef vector<3,size_t> vector3u; + typedef vector2 vector2u; + typedef vector3 vector3u; - typedef vector<2,intmax_t> vector2i; - typedef vector<3,intmax_t> vector3i; + typedef vector2 vector2i; + typedef vector3 vector3i; - typedef vector<2,float> vector2f; - typedef vector<3,float> vector3f; - typedef vector<4,float> vector4f; + typedef vector2 vector2f; + typedef vector3 vector3f; + typedef vector4 vector4f; - typedef vector<2,double> vector2d; - typedef vector<3,double> vector3d; - typedef vector<3,double> vector4d; + typedef vector2 vector2d; + typedef vector3 vector3d; + typedef vector3 vector4d; } #include "vector.ipp"