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

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