/Src/Dependencies/Boost/libs/gil/example/dynamic_image.cpp

http://hadesmem.googlecode.com/ · C++ · 34 lines · 11 code · 8 blank · 15 comment · 0 complexity · dd4b731120d99a883afa035bcb343cd5 MD5 · raw file

  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. /// \file
  10. /// \brief Test file for using dynamic images
  11. /// \author Lubomir Bourdev and Hailin Jin
  12. /// \date February 27, 2007
  13. #include <boost/mpl/vector.hpp>
  14. #include <boost/gil/extension/dynamic_image/any_image.hpp>
  15. #include <boost/gil/extension/io/jpeg_dynamic_io.hpp>
  16. int main() {
  17. using namespace boost::gil;
  18. typedef boost::mpl::vector<gray8_image_t, rgb8_image_t, gray16_image_t, rgb16_image_t> my_images_t;
  19. any_image<my_images_t> dynamic_img;
  20. jpeg_read_image("test.jpg",dynamic_img);
  21. // Save the image upside down, preserving its native color space and channel depth
  22. jpeg_write_view("out-dynamic_image.jpg",flipped_up_down_view(const_view(dynamic_img)));
  23. return 0;
  24. }