9
3

deprecated.hpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // Copyright 2005-2007 Adobe Systems Incorporated
  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_DEPRECATED_HPP
  9. #define BOOST_GIL_DEPRECATED_HPP
  10. #include <cstddef>
  11. /// This file is provided as a courtesy to ease upgrading GIL client code.
  12. /// Please make sure your code compiles when this file is not included.
  13. #define planar_ptr planar_pixel_iterator
  14. #define planar_ref planar_pixel_reference
  15. #define membased_2d_locator memory_based_2d_locator
  16. #define pixel_step_iterator memory_based_step_iterator
  17. #define pixel_image_iterator iterator_from_2d
  18. #define equal_channels static_equal
  19. #define copy_channels static_copy
  20. #define fill_channels static_fill
  21. #define generate_channels static_generate
  22. #define for_each_channel static_for_each
  23. #define transform_channels static_transform
  24. #define max_channel static_max
  25. #define min_channel static_min
  26. #define semantic_channel semantic_at_c
  27. template <typename Img>
  28. void resize_clobber_image(Img& img, const typename Img::point_t& new_dims) {
  29. img.recreate(new_dims);
  30. }
  31. template <typename Img>
  32. void resize_clobber_image(Img& img, const typename Img::x_coord_t& width, const typename Img::y_coord_t& height) {
  33. img.recreate(width,height);
  34. }
  35. template <typename T> typename T::x_coord_t get_width(const T& a) { return a.width(); }
  36. template <typename T> typename T::y_coord_t get_height(const T& a) { return a.height(); }
  37. template <typename T> typename T::point_t get_dimensions(const T& a) { return a.dimensions(); }
  38. template <typename T> std::size_t get_num_channels(const T& a) { return a.num_channels(); }
  39. #define GIL boost::gil
  40. #define ADOBE_GIL_NAMESPACE_BEGIN namespace boost { namespace gil {
  41. #define ADOBE_GIL_NAMESPACE_END } }
  42. #define ByteAdvancableIteratorConcept MemoryBasedIteratorConcept
  43. #define byte_advance memunit_advance
  44. #define byte_advanced memunit_advanced
  45. #define byte_step memunit_step
  46. #define byte_distance memunit_distance
  47. #define byte_addressable_step_iterator memory_based_step_iterator
  48. #define byte_addressable_2d_locator memory_based_2d_locator
  49. // These are members of memory-based locators
  50. //#define row_bytes row_size // commented out because row_bytes is commonly used
  51. #define pix_bytestep pixel_size
  52. #endif