2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-19 14:32:10 +00:00
Files
gil/io/test/subimage_test.hpp
Stefan Seefeld 1f0bc35012 Introduce top-level gil.hpp header. (#70)
Introduce top-level boost/gil.hpp header.
2018-06-27 00:02:27 -04:00

52 lines
1.4 KiB
C++

/*
Copyright 2013 Christian Henning
Use, modification and distribution are subject to 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).
*/
#ifndef BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP
#define BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP
#include <boost/gil.hpp>
using namespace std;
using namespace boost;
using namespace gil;
template< typename Image
, typename Format
>
void run_subimage_test( string filename
, const point_t& top_left
, const point_t& dimension
)
{
Image original, subimage;
read_image( filename
, original
, Format()
);
image_read_settings< Format > settings( top_left
, dimension
);
read_image( filename
, subimage
, settings
);
BOOST_CHECK( equal_pixels( const_view( subimage )
, subimage_view( const_view( original )
, top_left
, dimension
)
)
);
}
#endif // BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP