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

http://hadesmem.googlecode.com/ · C++ · 42 lines · 14 code · 8 blank · 20 comment · 0 complexity · 99bd843987d48cc70d21709a89a7cb27 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 resize_view() in the numeric extension
  11. /// \author Lubomir Bourdev and Hailin Jin
  12. /// \date February 27, 2007
  13. ///////////////////////
  14. //// NOTE: This sample file uses the numeric extension, which does not come with the Boost distribution.
  15. //// You may download it from http://opensource.adobe.com/gil
  16. ///////////////////////
  17. #include <boost/gil/image.hpp>
  18. #include <boost/gil/typedefs.hpp>
  19. #include <boost/gil/extension/io/jpeg_io.hpp>
  20. #include <boost/gil/extension/numeric/sampler.hpp>
  21. #include <boost/gil/extension/numeric/resample.hpp>
  22. int main() {
  23. using namespace boost::gil;
  24. rgb8_image_t img;
  25. jpeg_read_image("test.jpg",img);
  26. // test resize_view
  27. // Scale the image to 100x100 pixels using bilinear resampling
  28. rgb8_image_t square100x100(100,100);
  29. resize_view(const_view(img), view(square100x100), bilinear_sampler());
  30. jpeg_write_view("out-resize.jpg",const_view(square100x100));
  31. return 0;
  32. }