typedefs.hpp 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // Copyright 2007-2008 Christian Henning
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. #ifndef BOOST_GIL_IO_TYPEDEFS_HPP
  9. #define BOOST_GIL_IO_TYPEDEFS_HPP
  10. #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  11. #include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
  12. #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  13. #include <boost/gil/image.hpp>
  14. #include <boost/gil/point.hpp>
  15. #include <boost/gil/utilities.hpp>
  16. #include <type_traits>
  17. #include <vector>
  18. namespace boost { namespace gil {
  19. struct double_zero { static double apply() { return 0.0; } };
  20. struct double_one { static double apply() { return 1.0; } };
  21. using byte_t = unsigned char;
  22. using byte_vector_t = std::vector<byte_t>;
  23. }} // namespace boost::gil
  24. namespace boost {
  25. template<> struct is_floating_point<gil::float32_t> : std::true_type {};
  26. template<> struct is_floating_point<gil::float64_t> : std::true_type {};
  27. } // namespace boost
  28. namespace boost { namespace gil {
  29. ///@todo We should use boost::preprocessor here.
  30. /// TODO: NO! Please do not use preprocessor here! --mloskot
  31. using gray1_image_t = bit_aligned_image1_type<1, gray_layout_t>::type;
  32. using gray2_image_t = bit_aligned_image1_type<2, gray_layout_t>::type;
  33. using gray4_image_t = bit_aligned_image1_type<4, gray_layout_t>::type;
  34. using gray6_image_t = bit_aligned_image1_type<6, gray_layout_t>::type;
  35. using gray10_image_t = bit_aligned_image1_type<10, gray_layout_t>::type;
  36. using gray12_image_t = bit_aligned_image1_type<12, gray_layout_t>::type;
  37. using gray14_image_t = bit_aligned_image1_type<14, gray_layout_t>::type;
  38. using gray24_image_t = bit_aligned_image1_type<24, gray_layout_t>::type;
  39. using gray64f_pixel_t = pixel<double, gray_layout_t>;
  40. #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  41. using gray_alpha8_pixel_t = pixel<uint8_t, gray_alpha_layout_t>;
  42. using gray_alpha16_pixel_t = pixel<uint16_t, gray_alpha_layout_t>;
  43. using gray_alpha64f_pixel_t = pixel<double, gray_alpha_layout_t>;
  44. #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  45. using rgb64f_pixel_t = pixel<double, rgb_layout_t>;
  46. using rgba64f_pixel_t = pixel<double, rgba_layout_t>;
  47. using gray64f_image_t = image<gray64f_pixel_t, false>;
  48. #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  49. using gray_alpha8_image_t = image<gray_alpha8_pixel_t, false>;
  50. using gray_alpha16_image_t = image<gray_alpha16_pixel_t, false>;
  51. using gray_alpha32f_image_t = image<gray_alpha32f_pixel_t, false>;
  52. using gray_alpha32f_planar_image_t = image<gray_alpha32f_pixel_t, true>;
  53. using gray_alpha64f_image_t = image<gray_alpha64f_pixel_t, false>;
  54. using gray_alpha64f_planar_image_t = image<gray_alpha64f_pixel_t, true>;
  55. #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
  56. using rgb64f_image_t = image<rgb64f_pixel_t, false>;
  57. using rgb64f_planar_image_t = image<rgb64f_pixel_t, true>;
  58. using rgba64f_image_t = image<rgba64f_pixel_t, false>;
  59. using rgba64f_planar_image_t = image<rgba64f_pixel_t, true>;
  60. }} // namespace boost::gil
  61. #endif