2
0
mirror of https://github.com/boostorg/gil.git synced 2026-01-19 16:22:14 +00:00
Files
gil/example/dynamic_image.cpp
Mateusz Łoskot 32fec9f05b Refactor library includes to #include <boost/gil/...>
Group include directives, sort within group:
* In headers of GIL core and extensions:
  1. boost/gil/extension/*
  2. boost/gil/*
  3. boost/*
  4. C++ standard library headers
* In programs:
  1. boost/gil/*
  2. boost/*
  3. C++ standard library headers
  4. "xxx.hpp" for local headers
Add basic guidelines to CONTRIBUTING.md.
Add/Remove #include <boost/config.hpp> or std headers un/necessary.
Rename gil_concept.hpp to concepts.hpp.
Remove gil_all.hpp - we already have all-in-one boost/gil.hpp.
Tidy up and unify copyright and license header.
Tidy up formatting and excessive whitespaces in some comments.
Remove Doxygen block with file description, author, date, etc.
Remove dead or commented pragmas and directives.
Trim trailing whitespaces.
2018-09-28 16:26:34 +02:00

24 lines
887 B
C++

//
// Copyright 2005-2007 Adobe Systems Incorporated
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/gil.hpp>
#include <boost/gil/extension/dynamic_image/any_image.hpp>
#include <boost/gil/extension/io/jpeg.hpp>
#include <boost/mpl/vector.hpp>
int main()
{
namespace gil = boost::gil;
using my_images_t = boost::mpl::vector<gil::gray8_image_t, gil::rgb8_image_t, gil::gray16_image_t, gil::rgb16_image_t>;
gil::any_image<my_images_t> dynamic_image;
gil::read_image("test.jpg", dynamic_image, gil::jpeg_tag());
// Save the image upside down, preserving its native color space and channel depth
auto view = gil::flipped_up_down_view(gil::const_view(dynamic_image));
gil::write_view("out-dynamic_image.jpg", view, gil::jpeg_tag());
}