deprecated.hpp 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Copyright 2005-2007 Adobe Systems Incorporated
  3. Use, modification and distribution are subject to the Boost Software License,
  4. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. See http://opensource.adobe.com/gil for most recent version including documentation.
  7. */
  8. /*************************************************************************************************/
  9. #ifndef GIL_DEPRECATED_HPP
  10. #define GIL_DEPRECATED_HPP
  11. ////////////////////////////////////////////////////////////////////////////////////////
  12. /// \file
  13. /// \brief Deprecated names
  14. /// This file is provided as a courtesy to ease upgrading GIL client code.
  15. /// Please make sure your code compiles when this file is not included.
  16. ///
  17. /// \author Lubomir Bourdev and Hailin Jin \n
  18. /// Adobe Systems Incorporated
  19. /// \date 2005-2007 \n Last updated on February 12, 2007
  20. ///
  21. ////////////////////////////////////////////////////////////////////////////////////////
  22. #include <cstddef>
  23. #define planar_ptr planar_pixel_iterator
  24. #define planar_ref planar_pixel_reference
  25. #define membased_2d_locator memory_based_2d_locator
  26. #define pixel_step_iterator memory_based_step_iterator
  27. #define pixel_image_iterator iterator_from_2d
  28. #define equal_channels static_equal
  29. #define copy_channels static_copy
  30. #define fill_channels static_fill
  31. #define generate_channels static_generate
  32. #define for_each_channel static_for_each
  33. #define transform_channels static_transform
  34. #define max_channel static_max
  35. #define min_channel static_min
  36. #define semantic_channel semantic_at_c
  37. template <typename Img>
  38. void resize_clobber_image(Img& img, const typename Img::point_t& new_dims) {
  39. img.recreate(new_dims);
  40. }
  41. template <typename Img>
  42. void resize_clobber_image(Img& img, const typename Img::x_coord_t& width, const typename Img::y_coord_t& height) {
  43. img.recreate(width,height);
  44. }
  45. template <typename T> typename T::x_coord_t get_width(const T& a) { return a.width(); }
  46. template <typename T> typename T::y_coord_t get_height(const T& a) { return a.height(); }
  47. template <typename T> typename T::point_t get_dimensions(const T& a) { return a.dimensions(); }
  48. template <typename T> std::size_t get_num_channels(const T& a) { return a.num_channels(); }
  49. #define GIL boost::gil
  50. #define ADOBE_GIL_NAMESPACE_BEGIN namespace boost { namespace gil {
  51. #define ADOBE_GIL_NAMESPACE_END } }
  52. #define ByteAdvancableIteratorConcept MemoryBasedIteratorConcept
  53. #define byte_advance memunit_advance
  54. #define byte_advanced memunit_advanced
  55. #define byte_step memunit_step
  56. #define byte_distance memunit_distance
  57. #define byte_addressable_step_iterator memory_based_step_iterator
  58. #define byte_addressable_2d_locator memory_based_2d_locator
  59. // These are members of memory-based locators
  60. //#define row_bytes row_size // commented out because row_bytes is commonly used
  61. #define pix_bytestep pixel_size
  62. #endif