PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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   
 4    Use, modification and distribution are subject to the Boost Software License,
 5    Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 6    http://www.boost.org/LICENSE_1_0.txt).
 7
 8    See http://opensource.adobe.com/gil for most recent version including documentation.
 9*/
10
11/*************************************************************************************************/
12
13/// \file
14/// \brief Test file for using dynamic images
15/// \author Lubomir Bourdev and Hailin Jin
16/// \date February 27, 2007
17
18#include <boost/mpl/vector.hpp>
19#include <boost/gil/extension/dynamic_image/any_image.hpp>
20#include <boost/gil/extension/io/jpeg_dynamic_io.hpp>
21
22int main() {
23    using namespace boost::gil;
24
25    typedef boost::mpl::vector<gray8_image_t, rgb8_image_t, gray16_image_t, rgb16_image_t> my_images_t;
26
27    any_image<my_images_t> dynamic_img;
28    jpeg_read_image("test.jpg",dynamic_img);
29
30    // Save the image upside down, preserving its native color space and channel depth
31    jpeg_write_view("out-dynamic_image.jpg",flipped_up_down_view(const_view(dynamic_img)));
32
33    return 0;
34}