From 32fec9f05ba8d558c7af7b1bd537c80f31c2b826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Thu, 27 Sep 2018 21:54:12 +0200 Subject: [PATCH] Refactor library includes to #include 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 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. --- CONTRIBUTING.md | 39 +++++ doc/doxygen/tutorial.dox | 4 +- example/affine.cpp | 31 +--- example/convolution.cpp | 30 +--- example/dynamic_image.cpp | 24 +-- example/histogram.cpp | 27 ++- example/interleaved_ptr.cpp | 34 ++-- example/interleaved_ptr.hpp | 63 +++---- example/interleaved_ref.hpp | 94 +++++----- example/mandelbrot.cpp | 29 ++-- example/packed_pixel.cpp | 59 +++---- example/resize.cpp | 34 ++-- example/x_gradient.cpp | 30 ++-- include/boost/gil.hpp | 37 ++-- include/boost/gil/algorithm.hpp | 62 +++---- .../boost/gil/bit_aligned_pixel_iterator.hpp | 43 ++--- .../boost/gil/bit_aligned_pixel_reference.hpp | 101 +++++------ include/boost/gil/channel.hpp | 44 ++--- include/boost/gil/channel_algorithm.hpp | 51 ++---- include/boost/gil/cmyk.hpp | 38 ++-- include/boost/gil/color_base.hpp | 40 ++--- include/boost/gil/color_base_algorithm.hpp | 45 ++--- include/boost/gil/color_convert.hpp | 62 +++---- .../gil/{gil_concept.hpp => concepts.hpp} | 33 ++-- include/boost/gil/deprecated.hpp | 38 ++-- include/boost/gil/device_n.hpp | 41 ++--- .../gil/extension/dynamic_image/algorithm.hpp | 32 ++-- .../gil/extension/dynamic_image/any_image.hpp | 47 ++--- .../dynamic_image/any_image_view.hpp | 39 ++--- .../dynamic_image/apply_operation.hpp | 54 +++--- .../dynamic_image/apply_operation_base.hpp | 46 ++--- .../extension/dynamic_image/dynamic_at_c.hpp | 54 +++--- .../dynamic_image/dynamic_image_all.hpp | 44 ++--- .../dynamic_image/image_view_factory.hpp | 94 +++++----- .../gil/extension/dynamic_image/reduce.hpp | 146 ++++++++-------- .../gil/extension/dynamic_image/variant.hpp | 80 ++++----- include/boost/gil/extension/io/bmp.hpp | 25 +-- .../extension/io/bmp/detail/is_allowed.hpp | 27 ++- .../gil/extension/io/bmp/detail/read.hpp | 43 ++--- .../io/bmp/detail/reader_backend.hpp | 39 ++--- .../extension/io/bmp/detail/scanline_read.hpp | 39 ++--- .../io/bmp/detail/supported_types.hpp | 38 ++-- .../gil/extension/io/bmp/detail/write.hpp | 50 ++---- .../io/bmp/detail/writer_backend.hpp | 37 ++-- include/boost/gil/extension/io/bmp/old.hpp | 25 +-- include/boost/gil/extension/io/bmp/read.hpp | 39 ++--- include/boost/gil/extension/io/bmp/tags.hpp | 29 +--- include/boost/gil/extension/io/bmp/write.hpp | 26 +-- include/boost/gil/extension/io/jpeg.hpp | 25 +-- .../gil/extension/io/jpeg/detail/base.hpp | 38 ++-- .../extension/io/jpeg/detail/is_allowed.hpp | 25 +-- .../gil/extension/io/jpeg/detail/read.hpp | 53 +++--- .../io/jpeg/detail/reader_backend.hpp | 44 ++--- .../io/jpeg/detail/scanline_read.hpp | 49 ++---- .../io/jpeg/detail/supported_types.hpp | 37 ++-- .../gil/extension/io/jpeg/detail/write.hpp | 50 ++---- .../io/jpeg/detail/writer_backend.hpp | 39 ++--- include/boost/gil/extension/io/jpeg/old.hpp | 41 ++--- include/boost/gil/extension/io/jpeg/read.hpp | 39 ++--- include/boost/gil/extension/io/jpeg/tags.hpp | 35 ++-- include/boost/gil/extension/io/jpeg/write.hpp | 26 +-- include/boost/gil/extension/io/png.hpp | 25 +-- .../gil/extension/io/png/detail/base.hpp | 25 +-- .../extension/io/png/detail/is_allowed.hpp | 28 +-- .../gil/extension/io/png/detail/read.hpp | 51 ++---- .../io/png/detail/reader_backend.hpp | 43 ++--- .../extension/io/png/detail/scanline_read.hpp | 38 ++-- .../io/png/detail/supported_types.hpp | 34 ++-- .../gil/extension/io/png/detail/write.hpp | 51 +++--- .../io/png/detail/writer_backend.hpp | 56 +++--- include/boost/gil/extension/io/png/old.hpp | 41 ++--- include/boost/gil/extension/io/png/read.hpp | 39 ++--- include/boost/gil/extension/io/png/tags.hpp | 39 ++--- include/boost/gil/extension/io/png/write.hpp | 28 +-- include/boost/gil/extension/io/pnm.hpp | 25 +-- .../extension/io/pnm/detail/is_allowed.hpp | 25 +-- .../gil/extension/io/pnm/detail/read.hpp | 58 +++---- .../io/pnm/detail/reader_backend.hpp | 39 ++--- .../extension/io/pnm/detail/scanline_read.hpp | 55 +++--- .../io/pnm/detail/supported_types.hpp | 30 +--- .../gil/extension/io/pnm/detail/write.hpp | 48 ++---- .../io/pnm/detail/writer_backend.hpp | 37 ++-- include/boost/gil/extension/io/pnm/old.hpp | 41 ++--- include/boost/gil/extension/io/pnm/read.hpp | 35 ++-- include/boost/gil/extension/io/pnm/tags.hpp | 29 +--- include/boost/gil/extension/io/pnm/write.hpp | 28 +-- include/boost/gil/extension/io/raw.hpp | 25 +-- .../gil/extension/io/raw/detail/device.hpp | 35 ++-- .../extension/io/raw/detail/is_allowed.hpp | 26 +-- .../gil/extension/io/raw/detail/read.hpp | 51 +++--- .../io/raw/detail/reader_backend.hpp | 39 ++--- .../io/raw/detail/supported_types.hpp | 31 ++-- include/boost/gil/extension/io/raw/read.hpp | 36 ++-- include/boost/gil/extension/io/raw/tags.hpp | 28 +-- include/boost/gil/extension/io/targa.hpp | 25 +-- .../extension/io/targa/detail/is_allowed.hpp | 25 +-- .../gil/extension/io/targa/detail/read.hpp | 76 ++++---- .../io/targa/detail/reader_backend.hpp | 55 +++--- .../io/targa/detail/scanline_read.hpp | 47 ++--- .../io/targa/detail/supported_types.hpp | 34 ++-- .../gil/extension/io/targa/detail/write.hpp | 44 ++--- .../io/targa/detail/writer_backend.hpp | 37 ++-- include/boost/gil/extension/io/targa/old.hpp | 41 ++--- include/boost/gil/extension/io/targa/read.hpp | 37 ++-- include/boost/gil/extension/io/targa/tags.hpp | 49 ++---- .../boost/gil/extension/io/targa/write.hpp | 28 +-- include/boost/gil/extension/io/tiff.hpp | 25 +-- .../gil/extension/io/tiff/detail/device.hpp | 57 +++--- .../extension/io/tiff/detail/is_allowed.hpp | 33 ++-- .../gil/extension/io/tiff/detail/log.hpp | 27 +-- .../gil/extension/io/tiff/detail/read.hpp | 86 ++++----- .../io/tiff/detail/reader_backend.hpp | 39 ++--- .../io/tiff/detail/scanline_read.hpp | 138 +++++++-------- .../io/tiff/detail/supported_types.hpp | 35 ++-- .../gil/extension/io/tiff/detail/write.hpp | 74 ++++---- .../io/tiff/detail/writer_backend.hpp | 39 ++--- include/boost/gil/extension/io/tiff/old.hpp | 41 ++--- include/boost/gil/extension/io/tiff/read.hpp | 39 ++--- include/boost/gil/extension/io/tiff/tags.hpp | 30 ++-- include/boost/gil/extension/io/tiff/write.hpp | 29 +--- .../boost/gil/extension/numeric/affine.hpp | 32 ++-- .../boost/gil/extension/numeric/algorithm.hpp | 49 ++---- .../numeric/channel_numeric_operations.hpp | 43 ++--- .../boost/gil/extension/numeric/convolve.hpp | 52 +++--- .../boost/gil/extension/numeric/kernel.hpp | 44 ++--- .../numeric/pixel_numeric_operations.hpp | 49 +++--- .../boost/gil/extension/numeric/resample.hpp | 55 +++--- .../boost/gil/extension/numeric/sampler.hpp | 42 ++--- .../extension/toolbox/color_converters.hpp | 27 +-- .../toolbox/color_converters/gray_to_rgba.hpp | 31 +--- .../color_converters/rgb_to_luminance.hpp | 27 +-- .../gil/extension/toolbox/color_spaces.hpp | 27 +-- .../extension/toolbox/color_spaces/cmyka.hpp | 40 ++--- .../toolbox/color_spaces/gray_alpha.hpp | 40 ++--- .../extension/toolbox/color_spaces/hsl.hpp | 27 +-- .../extension/toolbox/color_spaces/hsv.hpp | 32 ++-- .../extension/toolbox/color_spaces/lab.hpp | 32 ++-- .../extension/toolbox/color_spaces/xyz.hpp | 27 +-- .../extension/toolbox/color_spaces/ycbcr.hpp | 31 ++-- .../gil/extension/toolbox/dynamic_images.hpp | 33 ++-- .../gil/extension/toolbox/image_types.hpp | 27 +-- .../toolbox/image_types/indexed_image.hpp | 35 ++-- .../toolbox/image_types/subchroma_image.hpp | 32 ++-- .../gil/extension/toolbox/metafunctions.hpp | 27 +-- .../toolbox/metafunctions/channel_type.hpp | 65 +++---- .../toolbox/metafunctions/channel_view.hpp | 31 ++-- .../toolbox/metafunctions/get_num_bits.hpp | 29 +--- .../toolbox/metafunctions/get_pixel_type.hpp | 29 +--- .../toolbox/metafunctions/gil_extensions.hpp | 42 ----- .../toolbox/metafunctions/is_bit_aligned.hpp | 35 ++-- .../toolbox/metafunctions/is_homogeneous.hpp | 47 ++--- .../toolbox/metafunctions/is_similar.hpp | 27 +-- .../toolbox/metafunctions/pixel_bit_size.hpp | 43 ++--- .../boost/gil/extension/toolbox/toolbox.hpp | 30 +--- include/boost/gil/gil_all.hpp | 45 ----- include/boost/gil/gray.hpp | 38 ++-- include/boost/gil/image.hpp | 57 ++---- include/boost/gil/image_view.hpp | 45 ++--- include/boost/gil/image_view_factory.hpp | 45 ++--- include/boost/gil/io/base.hpp | 54 +++--- include/boost/gil/io/bit_operations.hpp | 27 +-- include/boost/gil/io/conversion_policies.hpp | 32 ++-- include/boost/gil/io/device.hpp | 47 ++--- include/boost/gil/io/dynamic_io_new.hpp | 29 ++-- include/boost/gil/io/error.hpp | 31 ++-- include/boost/gil/io/get_read_device.hpp | 29 +--- include/boost/gil/io/get_reader.hpp | 27 +-- include/boost/gil/io/get_write_device.hpp | 28 +-- include/boost/gil/io/get_writer.hpp | 27 +-- include/boost/gil/io/io.hpp | 63 +++---- include/boost/gil/io/make_backend.hpp | 30 ++-- .../gil/io/make_dynamic_image_reader.hpp | 27 +-- .../gil/io/make_dynamic_image_writer.hpp | 27 +-- include/boost/gil/io/make_reader.hpp | 27 +-- include/boost/gil/io/make_scanline_reader.hpp | 27 +-- include/boost/gil/io/make_writer.hpp | 27 +-- include/boost/gil/io/path_spec.hpp | 35 ++-- .../boost/gil/io/read_and_convert_image.hpp | 35 ++-- .../boost/gil/io/read_and_convert_view.hpp | 43 ++--- include/boost/gil/io/read_image.hpp | 37 ++-- include/boost/gil/io/read_image_info.hpp | 41 ++--- include/boost/gil/io/read_view.hpp | 31 ++-- include/boost/gil/io/reader_base.hpp | 29 +--- include/boost/gil/io/row_buffer_helper.hpp | 43 ++--- .../boost/gil/io/scanline_read_iterator.hpp | 27 +-- include/boost/gil/io/typedefs.hpp | 41 ++--- include/boost/gil/io/write_view.hpp | 27 ++- include/boost/gil/iterator_from_2d.hpp | 41 ++--- include/boost/gil/locator.hpp | 44 ++--- include/boost/gil/metafunctions.hpp | 46 ++--- include/boost/gil/packed_pixel.hpp | 41 ++--- include/boost/gil/pixel.hpp | 52 +++--- include/boost/gil/pixel_iterator.hpp | 39 ++--- include/boost/gil/pixel_iterator_adaptor.hpp | 44 ++--- include/boost/gil/planar_pixel_iterator.hpp | 38 ++-- include/boost/gil/planar_pixel_reference.hpp | 58 +++---- include/boost/gil/position_iterator.hpp | 35 ++-- include/boost/gil/premultiply.hpp | 63 +++---- include/boost/gil/promote_integral.hpp | 8 +- include/boost/gil/rgb.hpp | 41 ++--- include/boost/gil/rgba.hpp | 44 ++--- include/boost/gil/step_iterator.hpp | 43 ++--- include/boost/gil/typedefs.hpp | 15 +- include/boost/gil/utilities.hpp | 79 ++++----- include/boost/gil/version.hpp | 29 ++-- include/boost/gil/virtual_locator.hpp | 37 ++-- io/test/all_formats_test.cpp | 24 +-- io/test/bmp_old_test.cpp | 18 +- io/test/bmp_read_test.cpp | 109 ++++++------ io/test/bmp_test.cpp | 44 +++-- io/test/bmp_write_test.cpp | 19 +- io/test/cmp_view.hpp | 30 ++-- io/test/color_space_write_test.hpp | 22 +-- io/test/jpeg_old_test.cpp | 18 +- io/test/jpeg_read_test.cpp | 20 +-- io/test/jpeg_test.cpp | 33 ++-- io/test/jpeg_write_test.cpp | 18 +- io/test/make.cpp | 25 ++- io/test/mandel_view.hpp | 20 +-- io/test/paths.hpp | 20 +-- io/test/png_file_format_test.cpp | 27 ++- io/test/png_old_test.cpp | 18 +- io/test/png_read_test.cpp | 163 +++++++++--------- io/test/png_test.cpp | 37 ++-- io/test/png_write_test.cpp | 22 ++- io/test/pnm_old_test.cpp | 14 +- io/test/pnm_read_test.cpp | 29 ++-- io/test/pnm_test.cpp | 32 ++-- io/test/pnm_write_test.cpp | 17 +- io/test/raw_test.cpp | 23 ++- io/test/scanline_read_test.hpp | 20 +-- io/test/subimage_test.hpp | 20 +-- io/test/targa_old_test.cpp | 17 +- io/test/targa_read_test.cpp | 19 +- io/test/targa_test.cpp | 35 ++-- io/test/targa_write_test.cpp | 18 +- io/test/test.cpp | 14 +- io/test/tiff_file_format_test.cpp | 23 +-- io/test/tiff_old_test.cpp | 28 ++- io/test/tiff_subimage_test.cpp | 23 +-- io/test/tiff_test.cpp | 40 ++--- io/test/tiff_tiled_float_test.cpp | 24 ++- io/test/tiff_tiled_minisblack_test_1-10.cpp | 21 +-- io/test/tiff_tiled_minisblack_test_11-20.cpp | 21 +-- ...tiff_tiled_minisblack_test_21-31_32-64.cpp | 20 +-- .../tiff_tiled_minisblack_write_test_1-10.cpp | 20 +-- ...tiff_tiled_minisblack_write_test_11-20.cpp | 19 +- ...iled_minisblack_write_test_21-31_32-64.cpp | 20 +-- io/test/tiff_tiled_palette_test_1-8.cpp | 19 +- io/test/tiff_tiled_palette_test_8-16.cpp | 20 +-- io/test/tiff_tiled_palette_write_test_1-8.cpp | 20 +-- .../tiff_tiled_palette_write_test_8-16.cpp | 20 +-- io/test/tiff_tiled_read_macros.hpp | 22 +-- io/test/tiff_tiled_rgb_contig_test_1-10.cpp | 19 +- io/test/tiff_tiled_rgb_contig_test_11-20.cpp | 19 +- ...tiff_tiled_rgb_contig_test_21-31_32_64.cpp | 19 +- .../tiff_tiled_rgb_contig_write_test_1-10.cpp | 19 +- ...tiff_tiled_rgb_contig_write_test_11-20.cpp | 19 +- ...iled_rgb_contig_write_test_21-31_32_64.cpp | 19 +- io/test/tiff_tiled_rgb_planar_test_1-10.cpp | 19 +- io/test/tiff_tiled_rgb_planar_test_11-20.cpp | 19 +- ...tiff_tiled_rgb_planar_test_21-31_32_64.cpp | 19 +- io/test/tiff_tiled_test.cpp | 20 +-- io/test/tiff_tiled_write_macros.hpp | 20 +-- io/test/tiff_write_test.cpp | 20 +-- test/channel.cpp | 38 ++-- test/channel/channel_concepts.cpp | 2 +- test/channel/channel_test_fixture.hpp | 2 +- test/image.cpp | 35 ++-- test/image_view/image_view_concepts.cpp | 2 +- test/performance.cpp | 72 +++----- test/pixel.cpp | 84 ++++----- test/pixel_iterator.cpp | 36 ++-- test/recreate_image.cpp | 42 ++--- test/sample_image.cpp | 17 +- toolbox/test/channel_type.cpp | 17 +- toolbox/test/channel_view.cpp | 19 +- toolbox/test/cmyka.cpp | 17 +- toolbox/test/get_num_bits.cpp | 21 ++- toolbox/test/get_pixel_type.cpp | 21 ++- toolbox/test/gray_alpha.cpp | 17 +- toolbox/test/gray_to_rgba.cpp | 15 +- toolbox/test/hsl_hsv_test.cpp | 18 +- toolbox/test/indexed_image_test.cpp | 29 ++-- toolbox/test/is_bit_aligned.cpp | 19 +- toolbox/test/is_homogeneous.cpp | 18 +- toolbox/test/is_similar.cpp | 19 +- toolbox/test/lab_test.cpp | 28 ++- toolbox/test/pixel_bit_size.cpp | 18 +- toolbox/test/rgb_to_luminance.cpp | 19 +- toolbox/test/xyz_test.cpp | 24 ++- 291 files changed, 3981 insertions(+), 6514 deletions(-) rename include/boost/gil/{gil_concept.hpp => concepts.hpp} (98%) delete mode 100644 include/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp delete mode 100644 include/boost/gil/gil_all.hpp diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c4b55f74a3..ed2fb870a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,7 @@ please follow the workflow explained in this document. * [Using Boost.Build](#using-boostbuild) * [Using CMake](#using-cmake) * [Using Faber](#using-faber) +* [Guidelines](#guidelines) ## Prerequisites @@ -391,3 +392,41 @@ Here is an example of such lightweight workflow in Linux environment (Debian-bas Maintainer: [@stefanseefeld](https://github.com/stefanseefeld) _TODO_ + +## Guidelines + +Boost.GIL is a more than a decade old mature library maintained by several +developers with help from a couple of dozens contributors. +It is important to maintain consistent design, look and feel. +Thus, below a few basic guidelines are listed. + +First and foremost, make sure you are familiar with the official +[Boost Library Requirements and Guidelines](https://www.boost.org/development/requirements.html). + +Second, strive for writing idiomatic C++11, clean and elegant code. + +**NOTE:** *The Boost.GIL source code does not necessary represent clean and elegant +code to look up to. The library has recently entered the transition to C++11. +Major refactoring overhaul is ongoing.* + +Maintain structure your source code files according to the following guidelines: + +* Name files in meaningful way. +* Put copyright and license information in every file +* If your changes [meet a certain threshold of originality](https://www.boost.org/users/license.html), + add yourself to the copyright notice. Do not put any additional authorship or + file comments (eg. no `\file` for Doxygen), revision information, etc. +* In header, put `#include` guard based on header path and file name + ``` + #ifndef BOOST_GIL____HPP + #define BOOST_GIL____HPP + ... + #endif + ``` +* Make sure each [header is self-contained](https://github.com/boostorg/gil/wiki/Include-Directives-Order), i.e. that they include all headers they need. +* All public headers should be placed in `boost/gil/` or `boost/gil//`. +* All non-public headers should be placed `boost/gil/detail` or `boost/gil//detail`. +* All public definitions should reside in scope of `namespace boost { namespace gil {...}}`. +* All non-public definitions should reside in scope of `namespace boost { namespace gil { namespace detail {...}}}`. +* Write your code to fit within **90** columns of text (see discussion on [preferred line length](https://lists.boost.org/boost-gil/2018/04/0028.php) in GIL). +* Indent with **4 spaces**, not tabs. See the [.editorconfig](https://github.com/boostorg/gil/blob/develop/.editorconfig) file for details. Please, do not increases the indentation level within namespace. diff --git a/doc/doxygen/tutorial.dox b/doc/doxygen/tutorial.dox index 397ce12c7b..193a616390 100644 --- a/doc/doxygen/tutorial.dox +++ b/doc/doxygen/tutorial.dox @@ -44,7 +44,7 @@ at http://stlab.adobe.com/gil The latest version of GIL can be downloaded from GIL's web page, at http://stlab.adobe.com/gil. GIL is approved for integration into Boost and in the future will be installed simply by installing Boost from http://www.boost.org. GIL consists of header files only and does not require any libraries to link against. It does not require Boost to be built. -Including \p boost/gil/gil_all.hpp will be sufficient for most projects. +Including \p boost/gil.hpp will be sufficient for most projects. \section ExampleSec Example - Computing the Image Gradient @@ -63,7 +63,7 @@ Let us first start with 8-bit unsigned grayscale image as the input and 8-bit si Here is how the interface to our algorithm looks like: \code -#include +#include using namespace boost::gil; void x_gradient(const gray8c_view_t& src, const gray8s_view_t& dst) { diff --git a/example/affine.cpp b/example/affine.cpp index 0e71a794b9..f8f2b2cfa0 100644 --- a/example/affine.cpp +++ b/example/affine.cpp @@ -1,30 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/////////////////////// -//// NOTE: This sample file uses the numeric extension, which does not come with the Boost distribution. -//// You may download it from http://opensource.adobe.com/gil -/////////////////////// - -/// \file -/// \brief Test file for resample_pixels() in the numeric extension -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 #include #include #include +// Example for resample_pixels() in the numeric extension + int main() { namespace gil = boost::gil; diff --git a/example/convolution.cpp b/example/convolution.cpp index 0ed18e5f32..329eeb9769 100644 --- a/example/convolution.cpp +++ b/example/convolution.cpp @@ -1,31 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/////////////////////// -//// NOTE: This sample file uses the numeric extension, which does not come with the Boost distribution. -//// You may download it from http://opensource.adobe.com/gil -/////////////////////// - -/// \file -/// \brief Test file for convolve_rows() and convolve_cols() in the numeric extension -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 #include #include #include #include +// Example for convolve_rows() and convolve_cols() in the numeric extension + int main() { using namespace boost::gil; diff --git a/example/dynamic_image.cpp b/example/dynamic_image.cpp index 9b8bfaa08a..04cfefba27 100644 --- a/example/dynamic_image.cpp +++ b/example/dynamic_image.cpp @@ -1,20 +1,10 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Test file for using dynamic images -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 #include #include diff --git a/example/histogram.cpp b/example/histogram.cpp index aedb3968b6..90129119db 100644 --- a/example/histogram.cpp +++ b/example/histogram.cpp @@ -1,25 +1,18 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Example file to demonstrate a way to compute histogram -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 #include + #include #include +// Example file to demonstrate a way to compute histogram + using namespace boost::gil; template diff --git a/example/interleaved_ptr.cpp b/example/interleaved_ptr.cpp index 995e7e7ff5..2371e7ceba 100644 --- a/example/interleaved_ptr.cpp +++ b/example/interleaved_ptr.cpp @@ -1,27 +1,19 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Example file to demonstrate how to create a model of a pixel iterator -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 +// #ifdef WIN32 #define _CRT_SECURE_NO_DEPRECATE 1 -#pragma warning(disable : 4244) // +#pragma warning(disable : 4244) // #pragma warning(disable : 4996) // MSFT declared it deprecated #endif -// gcc doesn't compile unless we forward-declare at_c before we include gil... +// Example file to demonstrate how to create a model of a pixel iterator + +// FIXME: Review and remove if possible: gcc doesn't compile unless we forward-declare at_c before we include gil... namespace boost { namespace gil { template struct interleaved_ref; template struct element_reference_type; @@ -31,8 +23,10 @@ namespace boost { namespace gil { at_c(const interleaved_ref& p); } } -#include #include + +#include + #include "interleaved_ptr.hpp" int main(int argc, unsigned char* argv[]) diff --git a/example/interleaved_ptr.hpp b/example/interleaved_ptr.hpp index 69e9670d37..2ab7739967 100644 --- a/example/interleaved_ptr.hpp +++ b/example/interleaved_ptr.hpp @@ -1,48 +1,31 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Example on how to create a pixel iterator -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 26, 2007 -/// -/// Definitions of standard GIL channel models -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#ifndef GIL_INTERLEAVED_PTR_HPP -#define GIL_INTERLEAVED_PTR_HPP +// +// 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 +// +#ifndef BOOST_GIL_EXAMPLE_INTERLEAVED_PTR_HPP +#define BOOST_GIL_EXAMPLE_INTERLEAVED_PTR_HPP #include #include "interleaved_ref.hpp" +// Example on how to create a pixel iterator + namespace boost { namespace gil { -///////////////////////////////////////////////////////////////////////// -/// -/// A model of an interleaved pixel iterator. Contains an iterator to the first channel of the current pixel -/// -/// Models: -/// MutablePixelIteratorConcept -/// PixelIteratorConcept -/// boost_concepts::RandomAccessTraversalConcept -/// PixelBasedConcept -/// HomogeneousPixelBasedConcept -/// PixelBasedConcept -/// ByteAdvanceableConcept -/// HasDynamicXStepTypeConcept -/// -///////////////////////////////////////////////////////////////////////// + +// A model of an interleaved pixel iterator. Contains an iterator to the first channel of the current pixel +// +// Models: +// MutablePixelIteratorConcept +// PixelIteratorConcept +// boost_concepts::RandomAccessTraversalConcept +// PixelBasedConcept +// HomogeneousPixelBasedConcept +// PixelBasedConcept +// ByteAdvanceableConcept +// HasDynamicXStepTypeConcept template // A layout (includes the color space and channel ordering) diff --git a/example/interleaved_ref.hpp b/example/interleaved_ref.hpp index 02616ec8fa..2e55ad3fa4 100644 --- a/example/interleaved_ref.hpp +++ b/example/interleaved_ref.hpp @@ -1,53 +1,37 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXAMPLE_INTERLEAVED_REF_HPP +#define BOOST_GIL_EXAMPLE_INTERLEAVED_REF_HPP - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Example on how to create a new model of a pixel reference -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 26, 2007 -////// -//////////////////////////////////////////////////////////////////////////////////////// - -#ifndef GIL_INTERLEAVED_REF_HPP -#define GIL_INTERLEAVED_REF_HPP +#include #include #include -#include -namespace boost { namespace gil { +// Example on how to create a new model of a pixel reference +namespace boost { namespace gil { -///////////////////////////////////////////////////////////////////////// -/// -/// A model of an interleaved pixel reference. Holds a pointer to the first channel -/// MODELS: -/// MutableHomogeneousPixelConcept -/// MutableHomogeneousColorBaseConcept -/// MutableColorBaseConcept -/// HomogeneousColorBaseConcept -/// ColorBaseConcept -/// HomogeneousPixelBasedConcept -/// PixelBasedConcept -/// -/// For planar reference proxies to work properly, all of their methods must be const-qualified -/// and their iterator's reference type must be const-qualified. -/// Mutability of the reference proxy is part of its type (in this case, depends on the mutability of ChannelReference) -///////////////////////////////////////////////////////////////////////// - -template // A layout (includes the color space and channel ordering) struct interleaved_ref { private: @@ -67,8 +51,8 @@ struct interleaved_ref { template bool operator!=(const P& p) const { return !(*this==p); } // Required by MutableColorBaseConcept - - // Assignment from a compatible type + + // Assignment from a compatible type const interleaved_ref& operator=(const interleaved_ref& p) const { static_copy(p,*this); return *this; } template const interleaved_ref& operator=(const P& p) const { check_compatible

(); static_copy(p,*this); return *this; } @@ -93,19 +77,19 @@ struct interleaved_ref { // Required by ColorBaseConcept template -struct kth_element_type,K> { - typedef ChannelReference type; +struct kth_element_type,K> { + typedef ChannelReference type; }; template -struct kth_element_reference_type,K> { - typedef ChannelReference type; +struct kth_element_reference_type,K> { + typedef ChannelReference type; }; template struct kth_element_const_reference_type,K> { - typedef ChannelReference type; -// typedef typename channel_traits::const_reference type; + typedef ChannelReference type; +// typedef typename channel_traits::const_reference type; }; @@ -130,7 +114,7 @@ namespace detail { // Required by MutableColorBaseConcept. The default std::swap does not do the right thing for proxy references - it swaps the references, not the values template -void swap(const interleaved_ref& x, const interleaved_ref& y) { +void swap(const interleaved_ref& x, const interleaved_ref& y) { static_for_each(x,y,detail::swap_fn_t()); }; @@ -143,13 +127,13 @@ struct is_pixel > : public boost::mpl:: template struct color_space_type > { typedef typename Layout::color_space_t type; -}; +}; // Required by PixelBasedConcept template struct channel_mapping_type > { typedef typename Layout::channel_mapping_t type; -}; +}; // Required by PixelBasedConcept template @@ -159,7 +143,7 @@ struct is_planar > : mpl::false_ {}; template struct channel_type > { typedef typename channel_traits::value_type type; -}; +}; } } // namespace boost::gil diff --git a/example/mandelbrot.cpp b/example/mandelbrot.cpp index eaf8e858dd..0bd86c1c5e 100644 --- a/example/mandelbrot.cpp +++ b/example/mandelbrot.cpp @@ -1,29 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Test file for convolve_rows() and convolve_cols() in the numeric extension -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - +// +// 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 #include #include +// Example for convolve_rows() and convolve_cols() in the numeric extension + using namespace boost::gil; // Models a Unary Function template // Models PixelValueConcept -struct mandelbrot_fn { +struct mandelbrot_fn +{ typedef point2 point_t; typedef mandelbrot_fn const_t; diff --git a/example/packed_pixel.cpp b/example/packed_pixel.cpp index 3a234ba095..74e6fec04b 100644 --- a/example/packed_pixel.cpp +++ b/example/packed_pixel.cpp @@ -1,39 +1,30 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Example file to show how to deal with packed pixels -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 -/// -/// This test file demonstrates how to use packed pixel formats in GIL. -/// A "packed" pixel is a pixel whose channels are bit ranges. -/// Here we create an RGB image whose pixel has 16-bits, such as: -/// bits [0..6] are the blue channel -/// bits [7..13] are the green channel -/// bits [14..15] are the red channel -/// We read a regular 8-bit RGB image, convert it to packed BGR772, convert it back to 8-bit RGB and save it to a file. -/// Since the red channel is only two bits the color loss should be observable in the result -/// -/// This test file also demonstrates how to use bit-aligned images - these are images whose pixels themselves are not byte aligned. -/// For example, an rgb222 image has a pixel whose size is 6 bits. Bit-aligned images are more complicated than packed images. They -/// require a special proxy class to represent pixel reference and pixel iterator (packed images use C++ reference and C pointer respectively). -/// The alignment parameter in the constructor of bit-aligned images is in bit units. For example, if you want your bit-aligned image to have 4-byte -/// alignment of its rows use alignment of 32, not 4. -/// -/// To demonstrate that image view transformations work on packed images, we save the result transposed. +// +// 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 #include -#include + +// This test file demonstrates how to use packed pixel formats in GIL. +// A "packed" pixel is a pixel whose channels are bit ranges. +// Here we create an RGB image whose pixel has 16-bits, such as: +// bits [0..6] are the blue channel +// bits [7..13] are the green channel +// bits [14..15] are the red channel +// We read a regular 8-bit RGB image, convert it to packed BGR772, convert it back to 8-bit RGB and save it to a file. +// Since the red channel is only two bits the color loss should be observable in the result +// +// This test file also demonstrates how to use bit-aligned images - these are images whose pixels themselves are not byte aligned. +// For example, an rgb222 image has a pixel whose size is 6 bits. Bit-aligned images are more complicated than packed images. They +// require a special proxy class to represent pixel reference and pixel iterator (packed images use C++ reference and C pointer respectively). +// The alignment parameter in the constructor of bit-aligned images is in bit units. For example, if you want your bit-aligned image to have 4-byte +// alignment of its rows use alignment of 32, not 4. +// +// To demonstrate that image view transformations work on packed images, we save the result transposed. using namespace boost; using namespace boost::gil; diff --git a/example/resize.cpp b/example/resize.cpp index 50dd03e924..36cbdae4d1 100644 --- a/example/resize.cpp +++ b/example/resize.cpp @@ -1,32 +1,20 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Test file for resize_view() in the numeric extension -/// \author Lubomir Bourdev and Hailin Jin -/// \date February 27, 2007 - -/////////////////////// -//// NOTE: This sample file uses the numeric extension, which does not come with the Boost distribution. -//// You may download it from http://opensource.adobe.com/gil -/////////////////////// - +// +// 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 #include #include #include #include -int main() { +// Example for resize_view() in the numeric extension + +int main() +{ using namespace boost::gil; rgb8_image_t img; diff --git a/example/x_gradient.cpp b/example/x_gradient.cpp index 2020f72ff1..db85e7b206 100644 --- a/example/x_gradient.cpp +++ b/example/x_gradient.cpp @@ -1,22 +1,14 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief Example file to demonstrate a way to compute gradients along x-axis -/// \author Lubomir Bourdev and Hailin Jin -/// \date October 19, 2006 - +// +// 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 +// Example to demonstrate a way to compute gradients along x-axis + using namespace boost::gil; template @@ -36,7 +28,7 @@ void x_gradient(const SrcView& src, const DstView& dst) { typename DstView::x_iterator dst_it = dst.row_begin(y); for (int x=1; x()); } } @@ -51,7 +43,7 @@ void x_luminosity_gradient(const SrcView& src, const DstView& dst) { int main() { rgb8_image_t img; jpeg_read_image("test.jpg",img); - + gray8s_image_t img_out(img.dimensions()); fill_pixels(view(img_out),int8_t(0)); diff --git a/include/boost/gil.hpp b/include/boost/gil.hpp index 6d11c2968b..e780135848 100644 --- a/include/boost/gil.hpp +++ b/include/boost/gil.hpp @@ -1,30 +1,31 @@ -// Copyright 2005-2007 Adobe Systems Incorporated +// // Copyright 2018 Stefan Seefeld +// 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) - -#ifndef boost_gil_hpp_ -#define boost_gil_hpp_ +// 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 +// +#ifndef BOOST_GIL_HPP +#define BOOST_GIL_HPP -#include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include #include -#include #include -#include -#include -#include #include -#include -#include -#include #include -#include +#include #endif diff --git a/include/boost/gil/algorithm.hpp b/include/boost/gil/algorithm.hpp index 994a5a5380..dd21ec5953 100644 --- a/include/boost/gil/algorithm.hpp +++ b/include/boost/gil/algorithm.hpp @@ -1,52 +1,34 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ +// +// 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 +// +#ifndef BOOST_GIL_ALGORITHM_HPP +#define BOOST_GIL_ALGORITHM_HPP -/*************************************************************************************************/ +#include +#include +#include +#include +#include -#ifndef GIL_ALGORITHM_HPP -#define GIL_ALGORITHM_HPP +#include +#include +#include +#include +#include #include #include #include -#include #include #include #include -#include -#include -#include -#include - -#include "gil_concept.hpp" -#include "color_base_algorithm.hpp" -#include "image_view.hpp" -#include "image_view_factory.hpp" -#include "bit_aligned_pixel_iterator.hpp" - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Some basic STL-style algorithms when applied to image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2008 \n Last updated on March 12, 2008 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -//#ifdef _MSC_VER -//#pragma warning(push) -//#pragma warning(disable : 4244) // conversion from 'gil::image::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) -//#endif - namespace boost { namespace gil { + //forward declarations template struct planar_pixel_iterator; @@ -1033,8 +1015,4 @@ F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst } } } // namespace boost::gil -//#ifdef _MSC_VER -//#pragma warning(pop) -//#endif - #endif diff --git a/include/boost/gil/bit_aligned_pixel_iterator.hpp b/include/boost/gil/bit_aligned_pixel_iterator.hpp index 984f7c1133..1f8ece424b 100644 --- a/include/boost/gil/bit_aligned_pixel_iterator.hpp +++ b/include/boost/gil/bit_aligned_pixel_iterator.hpp @@ -1,37 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP -#define GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief A model of a heterogeneous pixel that is not byte aligned. Examples are bitmap (1-bit pixels) or 6-bit RGB (222) -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 28, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +// +// 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 +// +#ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP +#define BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP + +#include +#include #include #include -#include "bit_aligned_pixel_reference.hpp" -#include "pixel_iterator.hpp" +#include namespace boost { namespace gil { +/// A model of a heterogeneous pixel that is not byte aligned. +/// Examples are bitmap (1-bit pixels) or 6-bit RGB (222). + /// \defgroup PixelIteratorNonAlignedPixelIterator bit_aligned_pixel_iterator /// \ingroup PixelIteratorModel /// \brief An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept diff --git a/include/boost/gil/bit_aligned_pixel_reference.hpp b/include/boost/gil/bit_aligned_pixel_reference.hpp index 36b316b212..35f85f8043 100644 --- a/include/boost/gil/bit_aligned_pixel_reference.hpp +++ b/include/boost/gil/bit_aligned_pixel_reference.hpp @@ -1,28 +1,15 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP -#define GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief A model of a heterogeneous pixel that is not byte aligned. Examples are bitmap (1-bit pixels) or 6-bit RGB (222) -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 28, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP +#define BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP -#include +#include +#include #include #include @@ -33,17 +20,19 @@ #include #include -#include "pixel.hpp" -#include "channel.hpp" +#include namespace boost { namespace gil { +/// A model of a heterogeneous pixel that is not byte aligned. +/// Examples are bitmap (1-bit pixels) or 6-bit RGB (222). + ///////////////////////////// // bit_range // // Represents a range of bits that can span multiple consecutive bytes. The range has a size fixed at compile time, but the offset is specified at run time. ///////////////////////////// - + template class bit_range { public: @@ -56,7 +45,7 @@ class bit_range { public: bit_range() : _current_byte(NULL), _bit_offset(0) {} - bit_range(byte_t* current_byte, int bit_offset) : _current_byte(current_byte), _bit_offset(bit_offset) { assert(bit_offset>=0 && bit_offset<8); } + bit_range(byte_t* current_byte, int bit_offset) : _current_byte(current_byte), _bit_offset(bit_offset) { assert(bit_offset>=0 && bit_offset<8); } bit_range(const bit_range& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {} template bit_range(const bit_range& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {} @@ -88,12 +77,12 @@ class bit_range { }; -/// \defgroup ColorBaseModelNonAlignedPixel bit_aligned_pixel_reference +/// \defgroup ColorBaseModelNonAlignedPixel bit_aligned_pixel_reference /// \ingroup ColorBaseModel /// \brief A heterogeneous color base representing pixel that may not be byte aligned, i.e. it may correspond to a bit range that does not start/end at a byte boundary. Models ColorBaseConcept. /** -\defgroup PixelModelNonAlignedPixel bit_aligned_pixel_reference +\defgroup PixelModelNonAlignedPixel bit_aligned_pixel_reference \ingroup PixelModel \brief A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept @@ -106,7 +95,7 @@ typedef const bit_aligned_pixel_reference - typename Layout, + typename Layout, bool IsMutable> struct bit_aligned_pixel_reference { BOOST_STATIC_CONSTANT(int, bit_size = (mpl::accumulate, mpl::plus >::type::value)); typedef boost::gil::bit_range bit_range_t; - typedef BitField bitfield_t; + typedef BitField bitfield_t; typedef typename mpl::if_c::type data_ptr_t; typedef Layout layout_t; @@ -152,9 +141,9 @@ struct bit_aligned_pixel_reference { } const bit_aligned_pixel_reference& operator=(const bit_aligned_pixel_reference& p) const { static_copy(p,*this); return *this; } - template const bit_aligned_pixel_reference& operator=(const P& p) const { assign(p, mpl::bool_::value>()); return *this; } + template const bit_aligned_pixel_reference& operator=(const P& p) const { assign(p, mpl::bool_::value>()); return *this; } - template bool operator==(const P& p) const { return equal(p, mpl::bool_::value>()); } + template bool operator==(const P& p) const { return equal(p, mpl::bool_::value>()); } template bool operator!=(const P& p) const { return !(*this==p); } const bit_aligned_pixel_reference* operator->() const { return this; } @@ -166,8 +155,8 @@ struct bit_aligned_pixel_reference { template static void check_compatible() { gil_function_requires >(); } - template void assign(const Pixel& p, mpl::true_) const { check_compatible(); static_copy(p,*this); } - template bool equal(const Pixel& p, mpl::true_) const { check_compatible(); return static_equal(*this,p); } + template void assign(const Pixel& p, mpl::true_) const { check_compatible(); static_copy(p,*this); } + template bool equal(const Pixel& p, mpl::true_) const { check_compatible(); return static_equal(*this,p); } private: static void check_gray() { BOOST_STATIC_ASSERT((is_same::value)); } @@ -179,24 +168,24 @@ struct bit_aligned_pixel_reference { // ColorBasedConcept ///////////////////////////// -template +template struct kth_element_type, K> { public: typedef const packed_dynamic_channel_reference::type::value, IsMutable> type; }; -template +template struct kth_element_reference_type, K> : public kth_element_type, K> {}; -template +template struct kth_element_const_reference_type, K> : public kth_element_type, K> {}; namespace detail { // returns sum of IntegralVector[0] ... IntegralVector[K-1] - template + template struct sum_k : public mpl::plus, typename mpl::at_c::type > {}; template struct sum_k : public mpl::int_<0> {}; @@ -205,7 +194,7 @@ namespace detail { // at_c required by MutableColorBaseConcept template inline typename kth_element_reference_type,K>::type -at_c(const bit_aligned_pixel_reference& p) { +at_c(const bit_aligned_pixel_reference& p) { typedef bit_aligned_pixel_reference pixel_t; typedef typename kth_element_reference_type::type channel_t; typedef typename pixel_t::bit_range_t bit_range_t; @@ -213,7 +202,7 @@ at_c(const bit_aligned_pixel_reference& p) { bit_range_t bit_range(p.bit_range()); bit_range.bit_advance(detail::sum_k::value); - return channel_t(bit_range.current_byte(), bit_range.bit_offset()); + return channel_t(bit_range.current_byte(), bit_range.bit_offset()); } ///////////////////////////// @@ -221,7 +210,7 @@ at_c(const bit_aligned_pixel_reference& p) { ///////////////////////////// /// Metafunction predicate that flags bit_aligned_pixel_reference as a model of PixelConcept. Required by PixelConcept -template +template struct is_pixel > : public mpl::true_{}; ///////////////////////////// @@ -231,15 +220,15 @@ struct is_pixel > : public mpl::true_{}; template struct color_space_type > { typedef typename L::color_space_t type; -}; +}; template struct channel_mapping_type > { typedef typename L::channel_mapping_t type; -}; +}; template -struct is_planar > : mpl::false_ {}; +struct is_planar > : mpl::false_ {}; ///////////////////////////// // pixel_reference_type @@ -255,7 +244,7 @@ namespace detail { } // Constructs a homogeneous bit_aligned_pixel_reference given a channel reference -template +template struct pixel_reference_type, Layout, false, false> { private: typedef typename mpl::size::type size_t; @@ -265,7 +254,7 @@ struct pixel_reference_type +template struct pixel_reference_type, Layout, false, true> { private: typedef typename mpl::size::type size_t; @@ -278,27 +267,27 @@ struct pixel_reference_type inline -void swap(const boost::gil::bit_aligned_pixel_reference x, R& y) { - boost::gil::swap_proxy::value_type>(x,y); +void swap(const boost::gil::bit_aligned_pixel_reference x, R& y) { + boost::gil::swap_proxy::value_type>(x,y); } template inline -void swap(typename boost::gil::bit_aligned_pixel_reference::value_type& x, const boost::gil::bit_aligned_pixel_reference y) { - boost::gil::swap_proxy::value_type>(x,y); +void swap(typename boost::gil::bit_aligned_pixel_reference::value_type& x, const boost::gil::bit_aligned_pixel_reference y) { + boost::gil::swap_proxy::value_type>(x,y); } template inline -void swap(const boost::gil::bit_aligned_pixel_reference x, const boost::gil::bit_aligned_pixel_reference y) { - boost::gil::swap_proxy::value_type>(x,y); +void swap(const boost::gil::bit_aligned_pixel_reference x, const boost::gil::bit_aligned_pixel_reference y) { + boost::gil::swap_proxy::value_type>(x,y); } } // namespace std #endif diff --git a/include/boost/gil/channel.hpp b/include/boost/gil/channel.hpp index 9828d0fde6..0ec67aeea6 100644 --- a/include/boost/gil/channel.hpp +++ b/include/boost/gil/channel.hpp @@ -1,41 +1,25 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_CHANNEL_HPP -#define GIL_CHANNEL_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Channel utilities -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 6, 2007 -/// -/// Definitions of standard GIL channel models -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "utilities.hpp" +// +// 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 +// +#ifndef BOOST_GIL_CHANNEL_HPP +#define BOOST_GIL_CHANNEL_HPP + +#include #include #include #include #include -#include #include #include +#include -#if defined(BOOST_GIL_DOXYGEN_ONLY) +#ifdef BOOST_GIL_DOXYGEN_ONLY /// \def BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS /// \brief Define to allow unaligned memory access for models of packed channel value. /// Theoretically (or historically?) on platforms which support dereferencing on @@ -46,7 +30,7 @@ #define BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS #endif -#if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS) +#ifdef BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS #if defined(sun) || defined(__sun) || \ // SunOS defined(__osf__) || defined(__osf) || \ // Tru64 defined(_hpux) || defined(hpux) || \ // HP-UX diff --git a/include/boost/gil/channel_algorithm.hpp b/include/boost/gil/channel_algorithm.hpp index c03cc6bf0f..31456575a5 100644 --- a/include/boost/gil/channel_algorithm.hpp +++ b/include/boost/gil/channel_algorithm.hpp @@ -1,47 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated +// +// 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 +// +#ifndef BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP +#define BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP + +#include +#include +#include - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_CHANNEL_ALGORITHM_HPP -#define GIL_CHANNEL_ALGORITHM_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Channel algorithms -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 6, 2007 -/// -/// Definitions of standard GIL 8-bit, 16-bit, 32-bit channels -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include #include #include #include #include -#include "channel.hpp" -#include "promote_integral.hpp" -#include "typedefs.hpp" - #include namespace boost { namespace gil { -//#ifdef _MSC_VER -//#pragma warning(push) -//#pragma warning(disable: 4309) // disable truncation of constant value warning (using -1 to get the max value of an integral) -//#endif - namespace detail { // some forward declarations @@ -540,10 +519,6 @@ inline typename channel_traits::value_type channel_invert(Channel x) { return inverted_x; } -//#ifdef _MSC_VER -//#pragma warning(pop) -//#endif - } } // namespace boost::gil #endif diff --git a/include/boost/gil/cmyk.hpp b/include/boost/gil/cmyk.hpp index 9625b1a02e..0fd3f40984 100644 --- a/include/boost/gil/cmyk.hpp +++ b/include/boost/gil/cmyk.hpp @@ -1,33 +1,19 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_CMYK_HPP +#define BOOST_GIL_CMYK_HPP + +#include - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_CMYK_H -#define GIL_CMYK_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for CMYK color space and variants -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on October 10, 2007 -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include #include #include -#include "metafunctions.hpp" +#include namespace boost { namespace gil { diff --git a/include/boost/gil/color_base.hpp b/include/boost/gil/color_base.hpp index 5fcb1b96fb..6ea5dbc7e4 100644 --- a/include/boost/gil/color_base.hpp +++ b/include/boost/gil/color_base.hpp @@ -1,28 +1,15 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_COLOR_BASE_HPP -#define GIL_COLOR_BASE_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel class and related utilities -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 6, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +// +// 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 +// +#ifndef BOOST_GIL_COLOR_BASE_HPP +#define BOOST_GIL_COLOR_BASE_HPP + +#include +#include #include #include @@ -31,8 +18,7 @@ #include #include -#include "utilities.hpp" -#include "gil_concept.hpp" +#include namespace boost { namespace gil { diff --git a/include/boost/gil/color_base_algorithm.hpp b/include/boost/gil/color_base_algorithm.hpp index 73f23c6856..c0f8eda1e2 100644 --- a/include/boost/gil/color_base_algorithm.hpp +++ b/include/boost/gil/color_base_algorithm.hpp @@ -1,41 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_COLOR_BASE_ALGORITHM_HPP -#define GIL_COLOR_BASE_ALGORITHM_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel related algorithms -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 16, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +// +// 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 +// +#ifndef BOOST_GIL_COLOR_BASE_ALGORITHM_HPP +#define BOOST_GIL_COLOR_BASE_ALGORITHM_HPP + +#include +#include #include +#include +#include #include #include -#include -#include -#include "gil_concept.hpp" -#include "utilities.hpp" +#include namespace boost { namespace gil { - /////////////////////////////////////// /// /// size: Semantic channel size diff --git a/include/boost/gil/color_convert.hpp b/include/boost/gil/color_convert.hpp index b943cdbd58..2a5a30e5fe 100644 --- a/include/boost/gil/color_convert.hpp +++ b/include/boost/gil/color_convert.hpp @@ -1,45 +1,31 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_COLOR_CONVERT_HPP -#define GIL_COLOR_CONVERT_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief GIL default color space conversions -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on January 30, 2007 -/// -/// Support for fast and simple color conversion. Accurate color conversion using color -/// profiles can be supplied separately in a dedicated module -/// -//////////////////////////////////////////////////////////////////////////////////////// - +// +// 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 +// +#ifndef BOOST_GIL_COLOR_CONVERT_HPP +#define BOOST_GIL_COLOR_CONVERT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include - -#include "channel_algorithm.hpp" -#include "pixel.hpp" -#include "gray.hpp" -#include "rgb.hpp" -#include "rgba.hpp" -#include "cmyk.hpp" -#include "metafunctions.hpp" -#include "utilities.hpp" -#include "color_base_algorithm.hpp" - namespace boost { namespace gil { +/// Support for fast and simple color conversion. +/// Accurate color conversion using color profiles can be supplied separately in a dedicated module. + // Forward-declare template struct channel_type; diff --git a/include/boost/gil/gil_concept.hpp b/include/boost/gil/concepts.hpp similarity index 98% rename from include/boost/gil/gil_concept.hpp rename to include/boost/gil/concepts.hpp index 722ac5fd3f..9b8cd2e633 100644 --- a/include/boost/gil/gil_concept.hpp +++ b/include/boost/gil/concepts.hpp @@ -1,27 +1,14 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_CONCEPT_H -#define GIL_CONCEPT_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Concept check classes for GIL concepts -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_CONCEPTS_HPP +#define BOOST_GIL_CONCEPTS_HPP +#include #include #include #include diff --git a/include/boost/gil/deprecated.hpp b/include/boost/gil/deprecated.hpp index 84f08fef1a..77459d2c72 100644 --- a/include/boost/gil/deprecated.hpp +++ b/include/boost/gil/deprecated.hpp @@ -1,32 +1,18 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_DEPRECATED_HPP -#define GIL_DEPRECATED_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Deprecated names -/// This file is provided as a courtesy to ease upgrading GIL client code. -/// Please make sure your code compiles when this file is not included. -/// -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_DEPRECATED_HPP +#define BOOST_GIL_DEPRECATED_HPP #include +/// This file is provided as a courtesy to ease upgrading GIL client code. +/// Please make sure your code compiles when this file is not included. + #define planar_ptr planar_pixel_iterator #define planar_ref planar_pixel_reference #define membased_2d_locator memory_based_2d_locator diff --git a/include/boost/gil/device_n.hpp b/include/boost/gil/device_n.hpp index 41693dffe2..1334687b85 100644 --- a/include/boost/gil/device_n.hpp +++ b/include/boost/gil/device_n.hpp @@ -1,35 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_DEVICE_N_HPP +#define BOOST_GIL_DEVICE_N_HPP + +#include +#include - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_DEVICE_N_H -#define GIL_DEVICE_N_H - - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for color space of N channels and variants -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2009 \n Last updated on February 20, 2009 -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include #include #include #include +#include -#include "utilities.hpp" -#include "metafunctions.hpp" +#include namespace boost { namespace gil { diff --git a/include/boost/gil/extension/dynamic_image/algorithm.hpp b/include/boost/gil/extension/dynamic_image/algorithm.hpp index abd5776b0e..1043e76766 100644 --- a/include/boost/gil/extension/dynamic_image/algorithm.hpp +++ b/include/boost/gil/extension/dynamic_image/algorithm.hpp @@ -1,19 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_DYNAMICIMAGE_ALGORITHM_HPP -#define GIL_DYNAMICIMAGE_ALGORITHM_HPP - -#include "../../algorithm.hpp" -#include "any_image.hpp" +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP + +#include + +#include + #include //////////////////////////////////////////////////////////////////////////////////////// @@ -168,6 +166,6 @@ void fill_pixels(const any_image_view& img_view, const Value& val) { } -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/extension/dynamic_image/any_image.hpp b/include/boost/gil/extension/dynamic_image/any_image.hpp index 3c4445ff10..ccbb2577f6 100644 --- a/include/boost/gil/extension/dynamic_image/any_image.hpp +++ b/include/boost/gil/extension/dynamic_image/any_image.hpp @@ -1,35 +1,20 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ +#include -#ifndef GIL_DYNAMICIMAGE_ANY_IMAGE_HPP -#define GIL_DYNAMICIMAGE_ANY_IMAGE_HPP +#include -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for run-time instantiated images and image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "any_image_view.hpp" -#include "../../image.hpp" +#include -//#ifdef _MSC_VER -//#pragma warning(push) -//#pragma warning(disable : 4244) // conversion from 'std::ptrdiff_t' to 'int', possible loss of data. even if we static-assert the two types are the same (on visual studio 8) -//#endif - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:4512) //assignment operator could not be generated #endif @@ -123,14 +108,10 @@ typename any_image::const_view_t const_view(const any_image& anyIm } ///@} -} } // namespace boost::gil +}} // namespace boost::gil #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(pop) #endif -//#ifdef _MSC_VER -//#pragma warning(pop) -//#endif - #endif diff --git a/include/boost/gil/extension/dynamic_image/any_image_view.hpp b/include/boost/gil/extension/dynamic_image/any_image_view.hpp index a99e8baaea..399114154b 100644 --- a/include/boost/gil/extension/dynamic_image/any_image_view.hpp +++ b/include/boost/gil/extension/dynamic_image/any_image_view.hpp @@ -1,30 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ +#include -/*************************************************************************************************/ - -#ifndef GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP -#define GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for run-time instantiated image view -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "variant.hpp" -#include "../../image_view.hpp" -#include "../../image.hpp" +#include +#include namespace boost { namespace gil { @@ -112,6 +99,6 @@ struct dynamic_xy_step_transposed_type > { typedef any_image_view >::type> type; }; -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/extension/dynamic_image/apply_operation.hpp b/include/boost/gil/extension/dynamic_image/apply_operation.hpp index beb79bad77..cebca61ce8 100644 --- a/include/boost/gil/extension/dynamic_image/apply_operation.hpp +++ b/include/boost/gil/extension/dynamic_image/apply_operation.hpp @@ -1,31 +1,27 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_APPLY_OPERATION_HPP -#define GIL_APPLY_OPERATION_HPP +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP + +#include +#include + +#ifdef BOOST_GIL_DOXYGEN_ONLY +#undef BOOST_GIL_REDUCE_CODE_BLOAT +#endif -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Implements apply_operation for variants. Optionally performs type reduction -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 4, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// Implements apply_operation for variants. +// Optionally performs type reduction. +#ifdef BOOST_GIL_REDUCE_CODE_BLOAT -#include "apply_operation_base.hpp" -#include "variant.hpp" +#include -#ifndef GIL_REDUCE_CODE_BLOAT +#else namespace boost { namespace gil { @@ -50,12 +46,8 @@ typename BinaryOp::result_type apply_operation(const variant& arg1, cons return apply_operation_base(arg1._bits, arg1._index, arg2._bits, arg2._index, op); } -} } // namespace boost::gil - -#else - -#include "reduce.hpp" +}} // namespace boost::gil -#endif +#endif // defined(BOOST_GIL_REDUCE_CODE_BLOAT) #endif diff --git a/include/boost/gil/extension/dynamic_image/apply_operation_base.hpp b/include/boost/gil/extension/dynamic_image/apply_operation_base.hpp index 397a60f95a..1cf21a36ce 100644 --- a/include/boost/gil/extension/dynamic_image/apply_operation_base.hpp +++ b/include/boost/gil/extension/dynamic_image/apply_operation_base.hpp @@ -1,37 +1,28 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_APPLY_OPERATION_BASE_HPP -#define GIL_APPLY_OPERATION_BASE_HPP - -#include "../../utilities.hpp" +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_BASE_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_BASE_HPP + +#include + +#include #include #include #include #include #include -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Given an object with run-time specified type (denoted as an array of Bits, dynamic index, and a static set of Types) and a generic operation, -/// casts the object to its appropriate type and applies the operation -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on November 6, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { +/// Given an object with run-time specified type (denoted as an array of Bits, +/// dynamic index, and a static set of Types) and a generic operation, +/// casts the object to its appropriate type and applies the operation + /* GENERATE_APPLY_FWD_OPS generates for every N functions that look like this (for N==2): @@ -178,7 +169,6 @@ static typename Op::result_type BOOST_FORCEINLINE apply_operation_base(const Bit #undef GIL_GENERATE_APPLY_FWD_OPS #undef BHS -} } // namespace boost::gil - +}} // namespace boost::gil #endif diff --git a/include/boost/gil/extension/dynamic_image/dynamic_at_c.hpp b/include/boost/gil/extension/dynamic_image/dynamic_at_c.hpp index 87e0bfcde5..1de9f248f1 100644 --- a/include/boost/gil/extension/dynamic_image/dynamic_at_c.hpp +++ b/include/boost/gil/extension/dynamic_image/dynamic_at_c.hpp @@ -1,35 +1,23 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_DYNAMIC_AT_C_HPP -#define GIL_DYNAMIC_AT_C_HPP - -#include -#include #include #include - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Constructs for static-to-dynamic integer convesion -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 4, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include namespace boost { namespace gil { +// Constructs for static-to-dynamic integer convesion + #define GIL_AT_C_VALUE(z, N, text) mpl::at_c::type::value, #define GIL_DYNAMIC_AT_C_LIMIT 226 // size of the maximum vector to handle @@ -68,7 +56,7 @@ namespace detail { const std::size_t REM = SIZE % GIL_DYNAMIC_AT_C_LIMIT; switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply(index); - case 1: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT); + case 1: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT); }; throw; } @@ -83,7 +71,7 @@ namespace detail { switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply(index); case 1: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT); - case 2: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*2); + case 2: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*2); }; throw; } @@ -98,8 +86,8 @@ namespace detail { switch (index / GIL_DYNAMIC_AT_C_LIMIT) { case 0: return at_c_fn<0 ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply(index); case 1: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT); - case 2: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*2); - case 3: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*3); + case 2: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*2); + case 3: return at_c_fn::template apply(index - GIL_DYNAMIC_AT_C_LIMIT*3); }; throw; } @@ -114,16 +102,16 @@ namespace detail { /// //////////////////////////////////////////////////////////////////////////////////// -template inline -ValueType at_c(std::size_t index) { +template inline +ValueType at_c(std::size_t index) { const std::size_t Size=mpl::size::value; return detail::at_c::at_c_impl::template apply(index); -} +} #undef GIL_AT_C_VALUE #undef GIL_DYNAMIC_AT_C_LIMIT #undef GIL_AT_C_LOOKUP -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/extension/dynamic_image/dynamic_image_all.hpp b/include/boost/gil/extension/dynamic_image/dynamic_image_all.hpp index 99cab1fe74..0fa2d39012 100644 --- a/include/boost/gil/extension/dynamic_image/dynamic_image_all.hpp +++ b/include/boost/gil/extension/dynamic_image/dynamic_image_all.hpp @@ -1,32 +1,18 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_DYNAMICIMAGE_ALL_HPP -#define GIL_DYNAMICIMAGE_ALL_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Includes all of the GIL dynamic image extension files, for convenience -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 8, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "../../gil_all.hpp" -#include "algorithm.hpp" -#include "any_image.hpp" -#include "apply_operation.hpp" -#include "variant.hpp" -#include "image_view_factory.hpp" +#include +#include +#include +#include +#include +#include // FIXME: Include what you use! #endif diff --git a/include/boost/gil/extension/dynamic_image/image_view_factory.hpp b/include/boost/gil/extension/dynamic_image/image_view_factory.hpp index 69ac4f681d..f9ff435fe3 100644 --- a/include/boost/gil/extension/dynamic_image/image_view_factory.hpp +++ b/include/boost/gil/extension/dynamic_image/image_view_factory.hpp @@ -1,32 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ +#include -/*************************************************************************************************/ - -#ifndef GIL_DYNAMICIMAGE_IMAGE_VIEWS_HPP -#define GIL_DYNAMICIMAGE_IMAGE_VIEWS_HPP - -/*! -/// \file -/// \brief Methods for constructing any image views from other any image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on January 31, 2007 -/// Extends image view factory to runtime type-specified views (any_image_view) -*/ - -#include "any_image_view.hpp" -#include "../../image_view_factory.hpp" +#include namespace boost { namespace gil { +// Methods for constructing any image views from other any image views +// Extends image view factory to runtime type-specified views (any_image_view) + namespace detail { template struct flipped_up_down_view_fn { typedef Result result_type; @@ -84,62 +74,62 @@ template /// \ingroup ImageViewTransformationsFlipUD template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_y_step_type >::type flipped_up_down_view(const any_image_view& src) { - return apply_operation(src,detail::flipped_up_down_view_fn >::type>()); +typename dynamic_y_step_type >::type flipped_up_down_view(const any_image_view& src) { + return apply_operation(src,detail::flipped_up_down_view_fn >::type>()); } /// \ingroup ImageViewTransformationsFlipLR template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_x_step_type >::type flipped_left_right_view(const any_image_view& src) { - return apply_operation(src,detail::flipped_left_right_view_fn >::type>()); +typename dynamic_x_step_type >::type flipped_left_right_view(const any_image_view& src) { + return apply_operation(src,detail::flipped_left_right_view_fn >::type>()); } /// \ingroup ImageViewTransformationsTransposed template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_transposed_type >::type transposed_view(const any_image_view& src) { - return apply_operation(src,detail::tranposed_view_fn >::type>()); +typename dynamic_xy_step_transposed_type >::type transposed_view(const any_image_view& src) { + return apply_operation(src,detail::tranposed_view_fn >::type>()); } /// \ingroup ImageViewTransformations90CW template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_transposed_type >::type rotated90cw_view(const any_image_view& src) { - return apply_operation(src,detail::rotated90cw_view_fn >::type>()); +typename dynamic_xy_step_transposed_type >::type rotated90cw_view(const any_image_view& src) { + return apply_operation(src,detail::rotated90cw_view_fn >::type>()); } /// \ingroup ImageViewTransformations90CCW template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_transposed_type >::type rotated90ccw_view(const any_image_view& src) { - return apply_operation(src,detail::rotated90ccw_view_fn >::type>()); +typename dynamic_xy_step_transposed_type >::type rotated90ccw_view(const any_image_view& src) { + return apply_operation(src,detail::rotated90ccw_view_fn >::type>()); } /// \ingroup ImageViewTransformations180 template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_type >::type rotated180_view(const any_image_view& src) { - return apply_operation(src,detail::rotated180_view_fn >::type>()); +typename dynamic_xy_step_type >::type rotated180_view(const any_image_view& src) { + return apply_operation(src,detail::rotated180_view_fn >::type>()); } /// \ingroup ImageViewTransformationsSubimage template inline // Models MPL Random Access Container of models of ImageViewConcept -any_image_view subimage_view(const any_image_view& src, const point2& topleft, const point2& dimensions) { - return apply_operation(src,detail::subimage_view_fn >(topleft,dimensions)); +any_image_view subimage_view(const any_image_view& src, const point2& topleft, const point2& dimensions) { + return apply_operation(src,detail::subimage_view_fn >(topleft,dimensions)); } /// \ingroup ImageViewTransformationsSubimage template inline // Models MPL Random Access Container of models of ImageViewConcept -any_image_view subimage_view(const any_image_view& src, int xMin, int yMin, int width, int height) { - return apply_operation(src,detail::subimage_view_fn >(point2(xMin,yMin),point2(width,height))); +any_image_view subimage_view(const any_image_view& src, int xMin, int yMin, int width, int height) { + return apply_operation(src,detail::subimage_view_fn >(point2(xMin,yMin),point2(width,height))); } /// \ingroup ImageViewTransformationsSubsampled template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_type >::type subsampled_view(const any_image_view& src, const point2& step) { - return apply_operation(src,detail::subsampled_view_fn >::type>(step)); +typename dynamic_xy_step_type >::type subsampled_view(const any_image_view& src, const point2& step) { + return apply_operation(src,detail::subsampled_view_fn >::type>(step)); } /// \ingroup ImageViewTransformationsSubsampled template inline // Models MPL Random Access Container of models of ImageViewConcept -typename dynamic_xy_step_type >::type subsampled_view(const any_image_view& src, int xStep, int yStep) { - return apply_operation(src,detail::subsampled_view_fn >::type>(point2(xStep,yStep))); +typename dynamic_xy_step_type >::type subsampled_view(const any_image_view& src, int xStep, int yStep) { + return apply_operation(src,detail::subsampled_view_fn >::type>(point2(xStep,yStep))); } namespace detail { @@ -156,8 +146,8 @@ struct nth_channel_view_type > { /// \ingroup ImageViewTransformationsNthChannel template inline // Models MPL Random Access Container of models of ImageViewConcept -typename nth_channel_view_type >::type nth_channel_view(const any_image_view& src, int n) { - return apply_operation(src,detail::nth_channel_view_fn >::type>(n)); +typename nth_channel_view_type >::type nth_channel_view(const any_image_view& src, int n) { + return apply_operation(src,detail::nth_channel_view_fn >::type>(n)); } namespace detail { @@ -176,7 +166,7 @@ struct color_converted_view_type,DstP,CC> { /// \brief overload of generic color_converted_view with user defined color-converter template inline // Models MPL Random Access Container of models of ImageViewConcept typename color_converted_view_type, DstP, CC>::type color_converted_view(const any_image_view& src, CC) { - return apply_operation(src,detail::color_converted_view_fn, DstP, CC>::type >()); + return apply_operation(src,detail::color_converted_view_fn, DstP, CC>::type >()); } /// \ingroup ImageViewTransformationsColorConvert @@ -189,8 +179,8 @@ struct color_converted_view_type,DstP> { /// \ingroup ImageViewTransformationsColorConvert /// \brief overload of generic color_converted_view with the default color-converter template inline // Models MPL Random Access Container of models of ImageViewConcept -typename color_converted_view_type, DstP>::type color_converted_view(const any_image_view& src) { - return apply_operation(src,detail::color_converted_view_fn, DstP>::type >()); +typename color_converted_view_type, DstP>::type color_converted_view(const any_image_view& src) { + return apply_operation(src,detail::color_converted_view_fn, DstP>::type >()); } @@ -199,15 +189,15 @@ typename color_converted_view_type, DstP>::type color_ /// These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp) template inline // Models MPL Random Access Container of models of ImageViewConcept typename color_converted_view_type, DstP, CC>::type any_color_converted_view(const any_image_view& src, CC) { - return apply_operation(src,detail::color_converted_view_fn, DstP, CC>::type >()); + return apply_operation(src,detail::color_converted_view_fn, DstP, CC>::type >()); } /// \ingroup ImageViewTransformationsColorConvert /// \brief overload of generic color_converted_view with the default color-converter /// These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp) template inline // Models MPL Random Access Container of models of ImageViewConcept -typename color_converted_view_type, DstP>::type any_color_converted_view(const any_image_view& src) { - return apply_operation(src,detail::color_converted_view_fn, DstP>::type >()); +typename color_converted_view_type, DstP>::type any_color_converted_view(const any_image_view& src) { + return apply_operation(src,detail::color_converted_view_fn, DstP>::type >()); } /// \} diff --git a/include/boost/gil/extension/dynamic_image/reduce.hpp b/include/boost/gil/extension/dynamic_image/reduce.hpp index 6e86faa991..2ab2589016 100644 --- a/include/boost/gil/extension/dynamic_image/reduce.hpp +++ b/include/boost/gil/extension/dynamic_image/reduce.hpp @@ -1,50 +1,41 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_GIL_REDUCE_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_GIL_REDUCE_HPP + +#ifdef BOOST_GIL_DOXYGEN_ONLY +#undef BOOST_GIL_REDUCE_CODE_BLOAT +#endif -#ifndef GIL_REDUCE_HPP -#define GIL_REDUCE_HPP +#ifdef BOOST_GIL_REDUCE_CODE_BLOAT + +#include + +#include +#include -#include -#include -#include #include -#include +#include +#include #include #include +#include +#include +#include #include -#include -#include - -#include "../../metafunctions.hpp" -#include "../../typedefs.hpp" -#include "dynamic_at_c.hpp" - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Constructs for static-to-dynamic integer convesion -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on May 4, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// - - -#ifdef GIL_REDUCE_CODE_BLOAT - // Max number of cases in the cross-expension of binary operation for it to be reduced as unary #define GIL_BINARY_REDUCE_LIMIT 226 namespace boost { namespace mpl { +// Constructs for static-to-dynamic integer convesion + /////////////////////////////////////////////////////// /// Mapping vector - represents the mapping of one type vector to another /// It is not a full-blown MPL Random Access Type sequence; just has at_c and size implemented @@ -89,7 +80,7 @@ namespace detail { typedef typename push_front::type type; }; - template + template struct copy_to_vector_impl { typedef vector::type> type; }; @@ -111,7 +102,7 @@ namespace boost { namespace gil { /////////////////////////////////////////////////////// -/// +/// /// unary_reduce, binary_reduce - given an MPL Random Access Sequence, /// dynamically specified index to that container, the bits of an instance of the corresponding type and /// a generic operation, invokes the operation on the given type @@ -122,7 +113,7 @@ namespace boost { namespace gil { /////////////////////////////////////////////////////// -/// +/// /// \brief Unary reduce. /// /// Given a set of types and an operation, reduces each type in the set (to reduced_t), then removes duplicates (to unique_t) @@ -172,7 +163,7 @@ struct unary_reduce : public unary_reduce_impl { /////////////////////////////////////////////////////// -/// +/// /// \brief Binary reduce. /// /// Given two sets of types, Types1 and Types2, first performs unary reduction on each. Then checks if the product of their sizes is above @@ -200,7 +191,7 @@ namespace detail { typedef mpl::cross_vector, pair_generator> BIN_TYPES; typedef unary_reduce bin_reduced_t; - + static unsigned short inline map_index(std::size_t index1, std::size_t index2) { unsigned short r1=Unary1::map_index(index1); unsigned short r2=Unary2::map_index(index2); @@ -233,7 +224,7 @@ struct binary_reduce { typedef unary_reduce unary1_t; typedef unary_reduce unary2_t; - static const std::size_t CROSS_SIZE = mpl::size::value * + static const std::size_t CROSS_SIZE = mpl::size::value * mpl::size::value; typedef detail::binary_reduce_implGIL_BINARY_REDUCE_LIMIT)> impl; @@ -255,7 +246,7 @@ BOOST_FORCEINLINE typename UnaryOp::result_type apply_operation(const variant -BOOST_FORCEINLINE typename BinaryOp::result_type apply_operation(const variant& arg1, const variant& arg2, BinaryOp op) { +BOOST_FORCEINLINE typename BinaryOp::result_type apply_operation(const variant& arg1, const variant& arg2, BinaryOp op) { return binary_reduce::template apply(arg1._bits, arg1._index, arg2._bits, arg2._index, op); } @@ -268,19 +259,19 @@ namespace boost { namespace mpl { /////////////////////////////////////////////////////// /// \brief Represents the virtual cross-product of the types generated from VecOfVecs. /// \ingroup CrossVector -/// INPUT: +/// INPUT: /// VecOfVecs - a vector of vector types. For example [ [A1,A2,A3], [B1,B2], [C1,C2,C3,C4] ] /// Each element must be a non-empty mpl vector /// TypeGen - a metafunction that generates a type from a vector of types, each of which can be /// selected from the corresponding vector in VecOfVecs. For example, [A1, B2, C4] -/// +/// /// Represents the virtual cross-product of the types generated from VecOfVecs. /// For example, [ TypeGen[A1,B1,C1], TypeGen[A2,B1,C1], TypeGen[A3,B1,C1], /// TypeGen[A1,B2,C1], TypeGen[A2,B2,C1], TypeGen[A3,B2,C1], /// TypeGen[A1,B1,C2], TypeGen[A2,B1,C2], TypeGen[A3,B1,C2], ... ] -/// +/// /// Models an immutable MPL Random Access Sequence -/// Traversal, random-access, etc, is defined, but mutable operations, +/// Traversal, random-access, etc, is defined, but mutable operations, /// such as push_back and pop_front are not supported /////////////////////////////////////////////////////// @@ -301,7 +292,7 @@ struct cross_iterator { /// \brief Dereferences a cross-vector iterator /// \ingroup CrossVectorIterator /// Creates a vector of the sizes of each type vector in VecOfVecs, then uses it as a basis -/// to represent the iterator's position K as a vector of indices. Extracts the corresponding type of +/// to represent the iterator's position K as a vector of indices. Extracts the corresponding type of /// each input vector and passes the element types to the type generation function, which returns the dereferenced type template struct deref > { @@ -413,13 +404,13 @@ template struct transform, OPP > { typedef typename lambda::type Op; struct adapter { - template + template struct apply { typedef typename TypeGen::template apply::type orig_t; typedef typename Op::template apply::type type; }; }; - typedef cross_vector type; + typedef cross_vector type; }; } } // boost::mpl @@ -460,9 +451,9 @@ namespace detail { }; template - struct reduce > + struct reduce > : public reduce_view_basic,view_is_basic >::value> {}; - + //////////////////////////////////////////////////////// //// //// Unary reduce_image operation. Splits into basic and non-basic images. @@ -491,7 +482,7 @@ namespace detail { }; template - struct reduce*, const image_view*> > + struct reduce*, const image_view*> > : public reduce_views_basic,image_view, mpl::and_ >, view_is_basic > >::value > {}; @@ -515,20 +506,20 @@ namespace detail { /* //////////////////////////////////////////////////////// //// - //// Color space binary reduce operation. Given a source and destination color spaces, + //// Color space binary reduce operation. Given a source and destination color spaces, //// returns a reduced source and destination color spaces that have the same mapping of channels //// //// Precondition: The two color spaces must be compatible (i.e. must have the same set of channels) //////////////////////////////////////////////////////// - template + template struct type_vec_to_integer_impl { typedef typename mpl::back::type last; typedef typename mpl::pop_back::type rest; static const int value = type_vec_to_integer_impl::value * Basis + last::value; }; - template + template struct type_vec_to_integer_impl { static const int value=0; }; @@ -608,7 +599,7 @@ namespace detail { typedef typename channel_order::type dst_order_t; typedef typename mpl::transform >::type mapping; static const int mapping_val = type_vec_to_integer::value; - + typedef typename reduce_color_spaces_impl::first_t _first_t; typedef typename reduce_color_spaces_impl::second_t _second_t; typedef typename mpl::and_, mpl::not_< color_space_is_base<_second_t> > > swap_t; @@ -644,12 +635,12 @@ namespace detail { }; */ // Incompatible views cannot be used in copy_pixels - will throw std::bad_cast - template + template struct reduce_copy_pixop_compat { typedef error_t type; }; - - // For compatible basic views, reduce their color spaces based on their channel mapping. + + // For compatible basic views, reduce their color spaces based on their channel mapping. // Make the source immutable and the destination mutable (they should already be that way) template struct reduce_copy_pixop_compat { @@ -661,10 +652,10 @@ namespace detail { typedef typename derived_view_type::type DV1; typedef typename derived_view_type::type DV2; - + typedef std::pair type; }; - + // The general 2D version branches into compatible and incompatible views template struct reduce_views_basic @@ -685,7 +676,7 @@ namespace detail { //// Reduce for get_dimensions (basic views and images have the same structure and the dimensions are contained at the beginning) //// //////////////////////////////////////////////////////// - + struct any_type_get_dimensions; template struct reduce_view_basic { typedef gray8_view_t type; }; template struct reduce_image_basic { typedef gray8_image_t type; }; @@ -695,13 +686,13 @@ namespace detail { //// Reduce for get_num_channels (only color space matters) //// //////////////////////////////////////////////////////// - + struct any_type_get_num_channels; - template struct reduce_view_basic { + template struct reduce_view_basic { typedef typename View::color_space_t::base Cs; typedef typename view_type::type>::type type; }; - template struct reduce_image_basic { + template struct reduce_image_basic { typedef typename Img::color_space_t::base Cs; typedef typename image_type::type>::type type; }; @@ -711,13 +702,13 @@ namespace detail { //// Reduce for resample_pixels (same as copy_pixels) //// //////////////////////////////////////////////////////// - + template struct resample_pixels_fn; - template + template struct reduce_view_basic, V, IsBasic> : public reduce_view_basic {}; - template + template struct reduce_views_basic, V1, V2, IsBasic> : public reduce_views_basic {}; //////////////////////////////////////////////////////// @@ -727,18 +718,18 @@ namespace detail { //// //////////////////////////////////////////////////////// - + template class copy_and_convert_pixels_fn; // the only thing for 1D reduce is making them all mutable... - template - struct reduce_view_basic, View, IsBasic> + template + struct reduce_view_basic, View, IsBasic> : public derived_view_type { }; // For 2D reduce, if they have the same channels and color spaces (i.e. the same pixels) then copy_and_convert is just copy. // In this case, reduce their common color space. In general make the first immutable and the second mutable - template + template struct reduce_views_basic, V1, V2, AreBasic> { typedef is_same Same; @@ -748,7 +739,7 @@ namespace detail { typedef typename derived_view_type, use_default, use_default, mpl::false_>::type DV1; typedef typename derived_view_type, use_default, use_default, mpl::true_ >::type DV2; - + typedef std::pair type; }; @@ -759,11 +750,11 @@ namespace detail { //fill_converted_pixels_fn //bind(gil::detail::copy_pixels_fn(), _1, dst) //bind(gil::detail::copy_pixels_fn(), src,_1) - + //bind(detail::copy_and_convert_pixels_fn(), _1, dst) //bind(detail::copy_and_convert_pixels_fn(), src, _1) //gil::detail::fill_pixels_fn(val) - + //detail::copy_construct_in_place_fn //detail::equal_to_fn::base_t> @@ -781,9 +772,8 @@ namespace detail { //detail::color_converted_view_fn, DstP>::type > } -} } // namespace boost::gil - -#endif // GIL_REDUCE_CODE_BLOAT +}} // namespace boost::gil +#endif // defined(BOOST_GIL_REDUCE_CODE_BLOAT) #endif diff --git a/include/boost/gil/extension/dynamic_image/variant.hpp b/include/boost/gil/extension/dynamic_image/variant.hpp index 06b39d6150..a0eb0f85db 100644 --- a/include/boost/gil/extension/dynamic_image/variant.hpp +++ b/include/boost/gil/extension/dynamic_image/variant.hpp @@ -1,45 +1,37 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_VARIANT_HPP +#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_VARIANT_HPP -#ifndef GIL_DYNAMICIMAGE_VARIANT_HPP -#define GIL_DYNAMICIMAGE_VARIANT_HPP +// TODO: Replace with C++17 std::variant? -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for run-time instantiated types -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 18, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include -#include "../../utilities.hpp" -#include -#include -#include -#include #include -#include +#include #include -#include +#include +#include #include #include -#include -#include -#include +#include +#include + +#include +#include +#include +#include namespace boost { namespace gil { -namespace detail { +// Support for run-time instantiated types + +namespace detail { template struct type_to_index; template struct reduce; struct destructor_op { @@ -65,21 +57,21 @@ It would be difficult to write a function that reads an image from file preservi type of the return value is only available at run time. It would be difficult to store images of different color spaces in the same container or apply operations on them uniformly. -The variant class addresses this deficiency. It allows for run-time instantiation of a class from a given set of allowed classes -specified at compile time. For example, the set of allowed classes may include 8-bit and 16-bit RGB and CMYK images. Such a variant +The variant class addresses this deficiency. It allows for run-time instantiation of a class from a given set of allowed classes +specified at compile time. For example, the set of allowed classes may include 8-bit and 16-bit RGB and CMYK images. Such a variant can be constructed with rgb8_image_t and then assigned a cmyk16_image_t. -The variant has a templated constructor, which allows us to construct it with any concrete type instantiation. It can also perform a generic +The variant has a templated constructor, which allows us to construct it with any concrete type instantiation. It can also perform a generic operation on the concrete type via a call to apply_operation. The operation must be provided as a function object whose application operator has a single parameter which can be instantiated with any of the allowed types of the variant. -variant breaks down the instantiated type into a non-templated underlying base type and a unique instantiation +variant breaks down the instantiated type into a non-templated underlying base type and a unique instantiation type identifier. In the most common implementation the concrete instantiation in stored 'in-place' - in 'bits_t'. bits_t contains sufficient space to fit the largest of the instantiated objects. GIL's variant is similar to boost::variant in spirit (hence we borrow the name from there) but it differs in several ways from the current boost implementation. Most notably, it does not take a variable number of template parameters but a single parameter defining the type enumeration. As -such it can be used more effectively in generic code. +such it can be used more effectively in generic code. The Types parameter specifies the set of allowable types. It models MPL Random Access Container */ @@ -161,7 +153,7 @@ namespace detail { struct equal_to_fn { const Bits& _dst; equal_to_fn(const Bits& dst) : _dst(dst) {} - + typedef bool result_type; template result_type operator()(const T& x) const { return x==*gil_reinterpret_cast_c(&_dst); @@ -177,21 +169,21 @@ namespace detail { } // When doSwap is true, swaps obj with the contents of the variant. obj will contain default-constructed instance after the call -template +template template variant::variant(T& obj, bool do_swap) { - _index=type_id(); - if (_index==NUM_TYPES) throw std::bad_cast(); + _index=type_id(); + if (_index==NUM_TYPES) throw std::bad_cast(); if (do_swap) { new(&_bits) T(); // default construct swap(obj, *gil_reinterpret_cast(&_bits)); - } else + } else detail::copy_construct_in_place(const_cast(obj), _bits); } -template +template void swap(variant& x, variant& y) { - std::swap(x._bits,y._bits); + std::swap(x._bits,y._bits); std::swap(x._index, y._index); } diff --git a/include/boost/gil/extension/io/bmp.hpp b/include/boost/gil/extension/io/bmp.hpp index d9242dde0c..5ea0d2bfa9 100644 --- a/include/boost/gil/extension/io/bmp.hpp +++ b/include/boost/gil/extension/io/bmp.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_HPP #define BOOST_GIL_EXTENSION_IO_BMP_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/bmp/detail/is_allowed.hpp b/include/boost/gil/extension/io/bmp/detail/is_allowed.hpp index fab24d58d7..1a9af1bc9c 100644 --- a/include/boost/gil/extension/io/bmp/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/bmp/detail/is_allowed.hpp @@ -1,23 +1,16 @@ -/* - Copyright 2009 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2009 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include namespace boost { namespace gil { namespace detail { diff --git a/include/boost/gil/extension/io/bmp/detail/read.hpp b/include/boost/gil/extension/io/bmp/detail/read.hpp index 09e5652885..4e9ccbdb56 100644 --- a/include/boost/gil/extension/io/bmp/detail/read.hpp +++ b/include/boost/gil/extension/io/bmp/detail/read.hpp @@ -1,40 +1,29 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include -#include -#include +#include +#include #include #include #include -#include -#include #include +#include +#include #include -#include -#include +#include +#include +#include + +#include namespace boost { namespace gil { diff --git a/include/boost/gil/extension/io/bmp/detail/reader_backend.hpp b/include/boost/gil/extension/io/bmp/detail/reader_backend.hpp index 589a5e3c4f..e84e22a34f 100644 --- a/include/boost/gil/extension/io/bmp/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/bmp/detail/reader_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// Color channel mask @@ -154,7 +143,7 @@ struct reader_backend< Device } else if (_info._header_size > bmp_header_size::_win32_info_size) { - // could be v4 or v5 + // could be v4 or v5 // see MSDN: Bitmap Header Types ( BITMAPV4HEADER or BITMAPV5HEADER ) _info._width = _io_dev.read_uint32(); @@ -248,9 +237,9 @@ struct reader_backend< Device color_mask _mask; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/bmp/detail/scanline_read.hpp b/include/boost/gil/extension/io/bmp/detail/scanline_read.hpp index fdc1e54f68..b23c3f991f 100644 --- a/include/boost/gil/extension/io/bmp/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/bmp/detail/scanline_read.hpp @@ -1,39 +1,28 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 - 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include +#include +#include #include #include #include -#include -#include #include +#include +#include #include #include -#include -#include +#include + +#include namespace boost { namespace gil { diff --git a/include/boost/gil/extension/io/bmp/detail/supported_types.hpp b/include/boost/gil/extension/io/bmp/detail/supported_types.hpp index 89765594aa..3b5bb06e1b 100644 --- a/include/boost/gil/extension/io/bmp/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/bmp/detail/supported_types.hpp @@ -1,34 +1,21 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - +#include #include #include -#include #include - #include +#include +#include namespace boost { namespace gil { namespace detail { @@ -76,7 +63,7 @@ struct bmp_read_support @@ -124,7 +111,7 @@ struct is_read_supported< Pixel > : mpl::bool_< detail::bmp_read_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type - >::is_supported + >::is_supported > { typedef detail::bmp_read_support< typename channel_type< Pixel >::type @@ -146,5 +133,4 @@ struct is_write_supported< Pixel } // namespace gil } // namespace boost - #endif diff --git a/include/boost/gil/extension/io/bmp/detail/write.hpp b/include/boost/gil/extension/io/bmp/detail/write.hpp index 08ea24bae0..c0032c5962 100644 --- a/include/boost/gil/extension/io/bmp/detail/write.hpp +++ b/include/boost/gil/extension/io/bmp/detail/write.hpp @@ -1,38 +1,26 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include +#include #include #include -#include - -#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif namespace detail { @@ -68,7 +56,7 @@ class writer< Device public: writer( const Device& io_dev - , const image_write_info< bmp_tag >& info + , const image_write_info< bmp_tag >& info ) : backend_t( io_dev , info @@ -116,8 +104,8 @@ class writer< Device */ std::size_t spn = ( view.width() * num_channels< View >::value + 3 ) & ~3; - std::size_t ofs = bmp_header_size::_size - + bmp_header_size::_win32_info_size + std::size_t ofs = bmp_header_size::_size + + bmp_header_size::_win32_info_size + entries * 4; std::size_t siz = ofs + spn * view.height(); @@ -220,9 +208,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/bmp/detail/writer_backend.hpp b/include/boost/gil/extension/io/bmp/detail/writer_backend.hpp index a5147859f8..9ae4eb64f0 100644 --- a/include/boost/gil/extension/io/bmp/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/bmp/detail/writer_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_BMP_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -56,9 +45,9 @@ struct writer_backend< Device image_write_info< bmp_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/bmp/old.hpp b/include/boost/gil/extension/io/bmp/old.hpp index b265ca1960..d783a9e2e2 100644 --- a/include/boost/gil/extension/io/bmp/old.hpp +++ b/include/boost/gil/extension/io/bmp/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_OLD_HPP #define BOOST_GIL_EXTENSION_IO_BMP_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { diff --git a/include/boost/gil/extension/io/bmp/read.hpp b/include/boost/gil/extension/io/bmp/read.hpp index e28c169bdf..b105c5772c 100644 --- a/include/boost/gil/extension/io/bmp/read.hpp +++ b/include/boost/gil/extension/io/bmp/read.hpp @@ -1,43 +1,30 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_READ_HPP #define BOOST_GIL_EXTENSION_IO_BMP_READ_HPP -#define BOOST_GIL_EXTENSION_IO_BMP_READ_ENABLED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#define BOOST_GIL_EXTENSION_IO_BMP_READ_ENABLED // TODO: Document, explain, review #include -#include #include #include +#include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/bmp/tags.hpp b/include/boost/gil/extension/io/bmp/tags.hpp index ec8c4a15f8..37921e1922 100644 --- a/include/boost/gil/extension/io/bmp/tags.hpp +++ b/include/boost/gil/extension/io/bmp/tags.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_BMP_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -110,7 +99,7 @@ struct image_read_info< bmp_tag > /// The compression method being used. See above for a list of possible values. bmp_compression::type _compression; - /// The image size. This is the size of the raw bitmap data (see below), + /// The image size. This is the size of the raw bitmap data (see below), /// and should not be confused with the file size. bmp_image_size::type _image_size; @@ -123,7 +112,7 @@ struct image_read_info< bmp_tag > /// The number of colors in the color palette, or 0 to default to 2^n - 1. bmp_num_colors::type _num_colors; - /// The number of important colors used, or 0 when every color is important; + /// The number of important colors used, or 0 when every color is important; /// generally ignored. bmp_num_important_colors::type _num_important_colors; diff --git a/include/boost/gil/extension/io/bmp/write.hpp b/include/boost/gil/extension/io/bmp/write.hpp index 634bf3bd89..49991c55e8 100644 --- a/include/boost/gil/extension/io/bmp/write.hpp +++ b/include/boost/gil/extension/io/bmp/write.hpp @@ -1,31 +1,19 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include #include #include - #include #endif diff --git a/include/boost/gil/extension/io/jpeg.hpp b/include/boost/gil/extension/io/jpeg.hpp index 8f4b5db410..0e52e57ac0 100644 --- a/include/boost/gil/extension/io/jpeg.hpp +++ b/include/boost/gil/extension/io/jpeg.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/jpeg/detail/base.hpp b/include/boost/gil/extension/io/jpeg/detail/base.hpp index 551c4759d1..b639462abd 100644 --- a/include/boost/gil/extension/io/jpeg/detail/base.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/base.hpp @@ -1,29 +1,21 @@ -/* - Copyright 2010 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_BASE_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_BASE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// #include -namespace boost { namespace gil { +#include -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) +namespace boost { namespace gil { + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) #pragma warning(disable:4324) //structure was padded due to __declspec(align()) #endif @@ -36,9 +28,9 @@ class jpeg_io_base jmp_buf _mark; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/jpeg/detail/is_allowed.hpp b/include/boost/gil/extension/io/jpeg/detail/is_allowed.hpp index cf8015492e..e2992dae71 100644 --- a/include/boost/gil/extension/io/jpeg/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/is_allowed.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2009 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2009 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { namespace detail { template< typename View > diff --git a/include/boost/gil/extension/io/jpeg/detail/read.hpp b/include/boost/gil/extension/io/jpeg/detail/read.hpp index f3f5a8afef..b9b713b9a5 100644 --- a/include/boost/gil/extension/io/jpeg/detail/read.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/read.hpp @@ -1,43 +1,32 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include #include +#include +#include #include #include -#include #include +#include #include -#include -#include +#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif /// @@ -144,7 +133,7 @@ class reader< Device { this->_scanline_length = this->_info._width * num_channels< rgb8_view_t >::value; - read_rows< rgb8_pixel_t >( view ); + read_rows< rgb8_pixel_t >( view ); break; } @@ -231,7 +220,7 @@ class reader< Device } }; -namespace detail { +namespace detail { struct jpeg_type_format_checker { @@ -321,9 +310,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/jpeg/detail/reader_backend.hpp b/include/boost/gil/extension/io/jpeg/detail/reader_backend.hpp index 517f9b0b83..72b9d61472 100644 --- a/include/boost/gil/extension/io/jpeg/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/reader_backend.hpp @@ -1,37 +1,27 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include +#include #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif -namespace detail { +namespace detail { /// /// Wrapper for libjpeg's decompress object. Implements value semantics. @@ -190,7 +180,7 @@ struct reader_backend< Device { return _settings; } - + /// Return image header info. const image_read_info< jpeg_tag >& get_info() { @@ -319,9 +309,9 @@ struct reader_backend< Device JOCTET buffer_[4096]; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/jpeg/detail/scanline_read.hpp b/include/boost/gil/extension/io/jpeg/detail/scanline_read.hpp index ee33154c61..6171811d8a 100644 --- a/include/boost/gil/extension/io/jpeg/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/scanline_read.hpp @@ -1,44 +1,33 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// -#include -#include +#include +#include +#include #include #include -#include #include +#include #include #include - -#include -#include -#include +#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif /// @@ -153,9 +142,9 @@ class scanline_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/jpeg/detail/supported_types.hpp b/include/boost/gil/extension/io/jpeg/detail/supported_types.hpp index 209a99f857..fdaf707364 100644 --- a/include/boost/gil/extension/io/jpeg/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/supported_types.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - #include #include +#include +#include + namespace boost { namespace gil { namespace detail { // Read support @@ -90,7 +79,7 @@ struct jpeg_write_support struct is_read_supported< Pixel , jpeg_tag - > + > : mpl::bool_< detail::jpeg_read_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type >::is_supported @@ -110,12 +99,10 @@ struct is_write_supported< Pixel : mpl::bool_< detail::jpeg_write_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type >::is_supported - > + > {}; - } // namespace gil } // namespace boost - #endif diff --git a/include/boost/gil/extension/io/jpeg/detail/write.hpp b/include/boost/gil/extension/io/jpeg/detail/write.hpp index f9d2abfb57..f03d4f7820 100644 --- a/include/boost/gil/extension/io/jpeg/detail/write.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/write.hpp @@ -1,43 +1,31 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include +#include +#include #include #include -#include - -#include -#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif -namespace detail { +namespace detail { struct jpeg_write_is_supported { @@ -184,9 +172,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/jpeg/detail/writer_backend.hpp b/include/boost/gil/extension/io/jpeg/detail/writer_backend.hpp index 962c46df69..d3dc3c6fbb 100644 --- a/include/boost/gil/extension/io/jpeg/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/jpeg/detail/writer_backend.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include @@ -26,13 +15,13 @@ namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif -namespace detail { +namespace detail { /// /// Wrapper for libjpeg's compress object. Implements value semantics. @@ -193,9 +182,9 @@ struct writer_backend< Device JOCTET buffer[buffer_size]; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/jpeg/old.hpp b/include/boost/gil/extension/io/jpeg/old.hpp index 3b3dd2a89b..96a5b674e7 100644 --- a/include/boost/gil/extension/io/jpeg/old.hpp +++ b/include/boost/gil/extension/io/jpeg/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_OLD_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -47,12 +36,12 @@ point2< std::ptrdiff_t > jpeg_read_dimensions( const String& filename ) /// \ingroup JPEG_IO /// \brief Loads the image specified by the given jpeg image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template< typename String , typename View > -inline +inline void jpeg_read_view( const String& filename , const View& view ) @@ -66,12 +55,12 @@ void jpeg_read_view( const String& filename /// \ingroup JPEG_IO /// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the JPEG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not /// compatible with the ones specified by Image template< typename String , typename Image > -inline +inline void jpeg_read_image( const String& filename , Image& img ) @@ -89,7 +78,7 @@ template< typename String , typename View , typename CC > -inline +inline void jpeg_read_and_convert_view( const String& filename , const View& view , CC cc @@ -108,7 +97,7 @@ void jpeg_read_and_convert_view( const String& filename template< typename String , typename View > -inline +inline void jpeg_read_and_convert_view( const String& filename , const View& view ) @@ -126,7 +115,7 @@ template< typename String , typename Image , typename CC > -inline +inline void jpeg_read_and_convert_image( const String& filename , Image& img , CC cc @@ -145,7 +134,7 @@ void jpeg_read_and_convert_image( const String& filename template< typename String , typename Image > -inline +inline void jpeg_read_and_convert_image( const String filename , Image& img ) diff --git a/include/boost/gil/extension/io/jpeg/read.hpp b/include/boost/gil/extension/io/jpeg/read.hpp index ada31ff5bf..f5bc2fff17 100644 --- a/include/boost/gil/extension/io/jpeg/read.hpp +++ b/include/boost/gil/extension/io/jpeg/read.hpp @@ -1,43 +1,30 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP -#define BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#define BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED // TODO: Document, explain, review #include -#include #include #include +#include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/jpeg/tags.hpp b/include/boost/gil/extension/io/jpeg/tags.hpp index 047b5cbfd5..a12c237df6 100644 --- a/include/boost/gil/extension/io/jpeg/tags.hpp +++ b/include/boost/gil/extension/io/jpeg/tags.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief All supported jpeg tags by the gil io extension. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - // taken from jpegxx - https://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/ijg_headers.hpp #ifndef BOOST_GIL_EXTENSION_IO_JPEG_C_LIB_COMPILED_AS_CPLUSPLUS extern "C" { @@ -32,11 +21,10 @@ #endif #endif -//jpeglib doesn't know about FILE -#include +#include // jpeglib doesn't know about FILE -#include #include +#include #ifndef BOOST_GIL_EXTENSION_IO_JPEG_C_LIB_COMPILED_AS_CPLUSPLUS } @@ -172,7 +160,7 @@ struct image_read_settings< jpeg_tag > : public image_read_settings_base , _dct_method( dct_method ) {} - /// The dct ( discrete cosine transformation ) method. + /// The dct ( discrete cosine transformation ) method. jpeg_dct_method::type _dct_method; }; @@ -205,7 +193,7 @@ struct image_write_info< jpeg_tag > /// The jpeg quality. jpeg_quality::type _quality; - /// The dct ( discrete cosine transformation ) method. + /// The dct ( discrete cosine transformation ) method. jpeg_dct_method::type _dct_method; /// Density conversion unit. @@ -237,7 +225,6 @@ struct image_write_info< jpeg_tag > }; - } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/jpeg/write.hpp b/include/boost/gil/extension/io/jpeg/write.hpp index e04967b0ec..e5c59a95cf 100644 --- a/include/boost/gil/extension/io/jpeg/write.hpp +++ b/include/boost/gil/extension/io/jpeg/write.hpp @@ -1,31 +1,19 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include #include #include - #include #endif diff --git a/include/boost/gil/extension/io/png.hpp b/include/boost/gil/extension/io/png.hpp index 648170b1c0..f035673801 100644 --- a/include/boost/gil/extension/io/png.hpp +++ b/include/boost/gil/extension/io/png.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_HPP #define BOOST_GIL_EXTENSION_IO_PNG_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/png/detail/base.hpp b/include/boost/gil/extension/io/png/detail/base.hpp index a58d033d10..7feb6f8f09 100644 --- a/include/boost/gil/extension/io/png/detail/base.hpp +++ b/include/boost/gil/extension/io/png/detail/base.hpp @@ -1,22 +1,13 @@ -/* - Copyright 2012 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). -*/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_BASE_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_BASE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include @@ -56,7 +47,7 @@ struct png_struct_info_wrapper png_ptr_wrapper* get() { return _png_ptr.get(); } const png_ptr_wrapper* get() const { return _png_ptr.get(); } - + png_structp get_struct() { return get()->_struct; } const png_structp get_struct() const { return get()->_struct; } diff --git a/include/boost/gil/extension/io/png/detail/is_allowed.hpp b/include/boost/gil/extension/io/png/detail/is_allowed.hpp index cf83dd5f02..ac1f9c1749 100644 --- a/include/boost/gil/extension/io/png/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/png/detail/is_allowed.hpp @@ -1,24 +1,14 @@ -/* - Copyright 2008 Christian Henning, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - +#include #include namespace boost { namespace gil { namespace detail { @@ -30,7 +20,7 @@ bool is_allowed( const image_read_info< png_tag >& info { typedef typename get_pixel_type< View >::type pixel_t; - typedef typename channel_traits< + typedef typename channel_traits< typename element_type< pixel_t >::type >::value_type channel_t; const png_num_channels::type dst_num_channels = num_channels< pixel_t >::value; diff --git a/include/boost/gil/extension/io/png/detail/read.hpp b/include/boost/gil/extension/io/png/detail/read.hpp index 9c4588c380..f14e32a1cf 100644 --- a/include/boost/gil/extension/io/png/detail/read.hpp +++ b/include/boost/gil/extension/io/png/detail/read.hpp @@ -1,43 +1,30 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include +#include +#include -#include - +#include // FIXME: Include what you use! #include -#include #include #include -#include +#include #include - -#include -#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -243,7 +230,7 @@ class reader< Device , typename View > void read_rows( const View& view ) - { + { typedef detail::row_buffer_helper_view< ImagePixel > row_buffer_helper_t; typedef typename row_buffer_helper_t::iterator_t it_t; @@ -434,9 +421,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/png/detail/reader_backend.hpp b/include/boost/gil/extension/io/png/detail/reader_backend.hpp index 914d4c7505..18085b8746 100644 --- a/include/boost/gil/extension/io/png/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/png/detail/reader_backend.hpp @@ -1,34 +1,23 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include - #include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif /// @@ -80,7 +69,7 @@ struct reader_backend< Device void read_header() { using boost::gil::detail::PNG_BYTES_TO_CHECK; - + // check the file's first few bytes byte_t buf[PNG_BYTES_TO_CHECK]; @@ -688,9 +677,9 @@ struct reader_backend< Device std::size_t _number_passes; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/png/detail/scanline_read.hpp b/include/boost/gil/extension/io/png/detail/scanline_read.hpp index 33b1dcba31..99374f164a 100644 --- a/include/boost/gil/extension/io/png/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/png/detail/scanline_read.hpp @@ -1,38 +1,26 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include +#include +#include // FIXME: Include what you use! #include -#include #include #include -#include +#include #include #include +#include -#include -#include - -namespace boost { namespace gil { +namespace boost { namespace gil { /// /// PNG Reader diff --git a/include/boost/gil/extension/io/png/detail/supported_types.hpp b/include/boost/gil/extension/io/png/detail/supported_types.hpp index 165e8f4877..ed98917ffc 100644 --- a/include/boost/gil/extension/io/png/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/png/detail/supported_types.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA #include #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA @@ -168,7 +157,7 @@ template< typename BitField struct png_write_support< packed_dynamic_channel_reference< BitField , 1 , Mutable - > + > , gray_t > : write_support_true , png_rw_support_base< 1 @@ -196,7 +185,7 @@ template< typename BitField struct png_write_support< packed_dynamic_channel_reference< BitField , 2 , Mutable - > + > , gray_t > : write_support_true , png_rw_support_base< 2 @@ -224,7 +213,7 @@ template< typename BitField struct png_write_support< packed_dynamic_channel_reference< BitField , 4 , Mutable - > + > , gray_t > : write_support_true , png_rw_support_base< 4 @@ -349,7 +338,7 @@ struct is_write_supported< Pixel : mpl::bool_< detail::png_write_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type >::is_supported - > + > { typedef detail::png_write_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type @@ -362,5 +351,4 @@ struct is_write_supported< Pixel } // namespace gil } // namespace boost - #endif diff --git a/include/boost/gil/extension/io/png/detail/write.hpp b/include/boost/gil/extension/io/png/detail/write.hpp index e571c09459..cf1ef2a2a7 100644 --- a/include/boost/gil/extension/io/png/detail/write.hpp +++ b/include/boost/gil/extension/io/png/detail/write.hpp @@ -1,39 +1,28 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include +#include #include #include #include #include -#include -#include - -#include - namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif namespace detail { @@ -41,7 +30,7 @@ namespace detail { struct png_write_is_supported { template< typename View > - struct apply + struct apply : public is_write_supported< typename get_pixel_type< View >::type , png_tag > @@ -56,7 +45,7 @@ struct png_write_is_supported template< typename Device > class writer< Device , png_tag - > + > : public writer_backend< Device , png_tag > @@ -191,7 +180,7 @@ class writer< Device void set_swap( typename enable_if< mpl::and_< mpl::not_< is_less_than_eight< Info > > , mpl::not_< is_equal_to_sixteen< Info > > > - >::type* /* ptr */ = 0 + >::type* /* ptr */ = 0 ) {} }; @@ -232,9 +221,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/png/detail/writer_backend.hpp b/include/boost/gil/extension/io/png/detail/writer_backend.hpp index e018df79ea..659be4fa36 100644 --- a/include/boost/gil/extension/io/png/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/png/detail/writer_backend.hpp @@ -1,38 +1,26 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_PNG_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - #include - #include #include +#include +#include + namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#pragma warning(disable:4611) //interaction between '_setjmp' and C++ object destruction is non-portable #endif /// @@ -82,7 +70,7 @@ struct writer_backend< Device , "png_writer: fail to call png_create_write_struct()" ); - // Allocate/initialize the image information data. REQUIRED + // Allocate/initialize the image information data. REQUIRED get()->_info = png_create_info_struct( get_struct() ); if( get_info() == NULL ) @@ -288,7 +276,7 @@ struct writer_backend< Device #ifndef BOOST_GIL_IO_PNG_1_4_OR_LOWER -#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED if( _info._valid_scale_factors ) { png_set_sCAL( get_struct() @@ -358,11 +346,11 @@ struct writer_backend< Device int sample_max = ( 1u << _info._bit_depth ); /* libpng doesn't reject a tRNS chunk with out-of-range samples */ - if( !( ( _info._color_type == PNG_COLOR_TYPE_GRAY + if( !( ( _info._color_type == PNG_COLOR_TYPE_GRAY && (int) _info._trans_values[0].gray > sample_max ) || ( _info._color_type == PNG_COLOR_TYPE_RGB - &&( (int) _info._trans_values[0].red > sample_max + &&( (int) _info._trans_values[0].red > sample_max || (int) _info._trans_values[0].green > sample_max || (int) _info._trans_values[0].blue > sample_max ) @@ -408,7 +396,7 @@ struct writer_backend< Device ); #ifdef BOOST_GIL_IO_PNG_DITHERING_SUPPORTED - // Dithering + // Dithering if( _info._set_dithering ) { png_set_dither( get_struct() @@ -506,9 +494,9 @@ struct writer_backend< Device image_write_info< png_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/png/old.hpp b/include/boost/gil/extension/io/png/old.hpp index 217633661e..342472b49f 100644 --- a/include/boost/gil/extension/io/png/old.hpp +++ b/include/boost/gil/extension/io/png/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_OLD_HPP #define BOOST_GIL_EXTENSION_IO_PNG_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -46,12 +35,12 @@ point2< std::ptrdiff_t > png_read_dimensions( const String& filename ) /// \ingroup PNG_IO /// \brief Loads the image specified by the given png image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the PNG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template< typename String , typename View > -inline +inline void png_read_view( const String& filename , const View& view ) @@ -65,12 +54,12 @@ void png_read_view( const String& filename /// \ingroup PNG_IO /// \brief Allocates a new image whose dimensions are determined by the given png image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the PNG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not /// compatible with the ones specified by Image template< typename String , typename Image > -inline +inline void png_read_image( const String& filename , Image& img ) @@ -88,7 +77,7 @@ template< typename String , typename View , typename CC > -inline +inline void png_read_and_convert_view( const String& filename , const View& view , CC cc @@ -107,7 +96,7 @@ void png_read_and_convert_view( const String& filename template< typename String , typename View > -inline +inline void png_read_and_convert_view( const String& filename , const View& view ) @@ -125,7 +114,7 @@ template< typename String , typename Image , typename CC > -inline +inline void png_read_and_convert_image( const String& filename , Image& img , CC cc @@ -144,7 +133,7 @@ void png_read_and_convert_image( const String& filename template< typename String , typename Image > -inline +inline void png_read_and_convert_image( const String filename , Image& img ) diff --git a/include/boost/gil/extension/io/png/read.hpp b/include/boost/gil/extension/io/png/read.hpp index 32bbd7e01b..db0cfeba74 100644 --- a/include/boost/gil/extension/io/png/read.hpp +++ b/include/boost/gil/extension/io/png/read.hpp @@ -1,43 +1,30 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNG_READ_HPP -#define BOOST_GIL_EXTENSION_IO_PNG_READ_ENABLED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#define BOOST_GIL_EXTENSION_IO_PNG_READ_ENABLED // TODO: Document, explain, review #include -#include #include #include +#include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/png/tags.hpp b/include/boost/gil/extension/io/png/tags.hpp index 79e3b489a0..d2fa4ddeda 100644 --- a/include/boost/gil/extension/io/png/tags.hpp +++ b/include/boost/gil/extension/io/png/tags.hpp @@ -1,23 +1,17 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_PNG_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include +#include #ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED #ifdef BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED @@ -47,11 +41,6 @@ #endif // PNG_LIBPNG_VER_MAJOR == 1 #endif // PNG_LIBPNG_VER_MINOR <= 4 -#include -#include - -#include - namespace boost { namespace gil { /// Defines png tag. @@ -94,7 +83,7 @@ struct png_num_channels : property_base< png_byte > {}; /// Defines type for physical scale property. struct png_scale : property_base< double > {}; -#else +#else /// Defines type for CIE chromacities property. struct png_chromacities_type : property_base< png_fixed_point > {}; @@ -207,7 +196,7 @@ struct png_compression_type : property_base< png_byte > static const type default_value = PNG_COMPRESSION_TYPE_BASE; }; -// compression level - default values taken from libpng manual. +// compression level - default values taken from libpng manual. // Look for png_set_compression_level struct png_compression_level : property_base< int > { @@ -326,7 +315,7 @@ struct png_info_base , _valid_file_gamma( 0 ) , _file_gamma ( 1.0 ) -#else +#else , _valid_cie_colors( 0 ) , _white_x ( 0 ) , _white_y ( 0 ) diff --git a/include/boost/gil/extension/io/png/write.hpp b/include/boost/gil/extension/io/png/write.hpp index 47d2a8ae78..9642ec4285 100644 --- a/include/boost/gil/extension/io/png/write.hpp +++ b/include/boost/gil/extension/io/png/write.hpp @@ -1,31 +1,19 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include -#include #include - +#include #include #endif diff --git a/include/boost/gil/extension/io/pnm.hpp b/include/boost/gil/extension/io/pnm.hpp index 8e69277fce..c0e3c3adcb 100644 --- a/include/boost/gil/extension/io/pnm.hpp +++ b/include/boost/gil/extension/io/pnm.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_HPP #define BOOST_GIL_EXTENSION_IO_PNM_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/pnm/detail/is_allowed.hpp b/include/boost/gil/extension/io/pnm/detail/is_allowed.hpp index 91be3091fa..30fd9693c4 100644 --- a/include/boost/gil/extension/io/pnm/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/pnm/detail/is_allowed.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2009 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2009 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { namespace detail { template< typename View > diff --git a/include/boost/gil/extension/io/pnm/detail/read.hpp b/include/boost/gil/extension/io/pnm/detail/read.hpp index 5f267ada5e..52a697e70f 100644 --- a/include/boost/gil/extension/io/pnm/detail/read.hpp +++ b/include/boost/gil/extension/io/pnm/detail/read.hpp @@ -1,45 +1,35 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include #include +#include +#include +#include // FIXME: Include what you use! #include -#include -#include #include -#include +#include #include +#include +#include #include -#include -#include +#include + +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -119,7 +109,7 @@ class reader< Device { this->_scanline_length = this->_info._width; - read_text_data< gray8_view_t >( view ); + read_text_data< gray8_view_t >( view ); break; } @@ -364,7 +354,7 @@ class reader< Device }; -namespace detail { +namespace detail { struct pnm_type_format_checker { @@ -455,9 +445,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/pnm/detail/reader_backend.hpp b/include/boost/gil/extension/io/pnm/detail/reader_backend.hpp index 01ab7a0aaa..2497ee2878 100644 --- a/include/boost/gil/extension/io/pnm/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/pnm/detail/reader_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -51,7 +40,7 @@ struct reader_backend< Device , _scanline_length( 0 ) { - read_header(); + read_header(); if( _settings._dim.x == 0 ) { @@ -182,9 +171,9 @@ struct reader_backend< Device std::size_t _scanline_length; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/pnm/detail/scanline_read.hpp b/include/boost/gil/extension/io/pnm/detail/scanline_read.hpp index b109528145..242d8b6097 100644 --- a/include/boost/gil/extension/io/pnm/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/pnm/detail/scanline_read.hpp @@ -1,41 +1,30 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#include +#include +#include +#include // FIXME: Include what you use! #include -#include -#include #include -#include +#include #include +#include +#include #include #include -#include -#include +#include +#include + +#include namespace boost { namespace gil { @@ -93,7 +82,7 @@ class scanline_reader< Device switch( this->_info._type ) { // reading mono text is reading grayscale but with only two values - case pnm_image_type::mono_asc_t::value: + case pnm_image_type::mono_asc_t::value: case pnm_image_type::gray_asc_t::value: { this->_scanline_length = this->_info._width; @@ -108,7 +97,7 @@ class scanline_reader< Device { this->_scanline_length = this->_info._width * num_channels< rgb8_view_t >::value; - _read_function = boost::mem_fn( &this_t::read_text_row ); + _read_function = boost::mem_fn( &this_t::read_text_row ); _skip_function = boost::mem_fn( &this_t::skip_text_row ); break; @@ -131,8 +120,8 @@ class scanline_reader< Device // gray8_image_t this->_scanline_length = this->_info._width; - _read_function = boost::mem_fn( &this_t::read_binary_byte_row ); - _skip_function = boost::mem_fn( &this_t::skip_binary_row ); + _read_function = boost::mem_fn( &this_t::read_binary_byte_row ); + _skip_function = boost::mem_fn( &this_t::skip_binary_row ); break; } @@ -142,7 +131,7 @@ class scanline_reader< Device // rgb8_image_t this->_scanline_length = this->_info._width * num_channels< rgb8_view_t >::value; - _read_function = boost::mem_fn( &this_t::read_binary_byte_row ); + _read_function = boost::mem_fn( &this_t::read_binary_byte_row ); _skip_function = boost::mem_fn( &this_t::skip_binary_row ); break; diff --git a/include/boost/gil/extension/io/pnm/detail/supported_types.hpp b/include/boost/gil/extension/io/pnm/detail/supported_types.hpp index 7bede91402..e7298b6020 100644 --- a/include/boost/gil/extension/io/pnm/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/pnm/detail/supported_types.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include -#include -#include - namespace boost { namespace gil { namespace detail { // Read Support @@ -142,5 +131,4 @@ struct is_write_supported< Pixel } // namespace gil } // namespace boost - #endif diff --git a/include/boost/gil/extension/io/pnm/detail/write.hpp b/include/boost/gil/extension/io/pnm/detail/write.hpp index f92307c9c8..79ee35fdc9 100644 --- a/include/boost/gil/extension/io/pnm/detail/write.hpp +++ b/include/boost/gil/extension/io/pnm/detail/write.hpp @@ -1,39 +1,27 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - #include +#include #include #include -#include +#include +#include -namespace boost { namespace gil { +namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif namespace detail { @@ -41,7 +29,7 @@ namespace detail { struct pnm_write_is_supported { template< typename View > - struct apply + struct apply : public is_write_supported< typename get_pixel_type< View >::type , pnm_tag > @@ -258,9 +246,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/pnm/detail/writer_backend.hpp b/include/boost/gil/extension/io/pnm/detail/writer_backend.hpp index 38672e6f71..a970da1aee 100644 --- a/include/boost/gil/extension/io/pnm/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/pnm/detail/writer_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_PNM_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -56,9 +45,9 @@ struct writer_backend< Device image_write_info< pnm_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/pnm/old.hpp b/include/boost/gil/extension/io/pnm/old.hpp index a9a1529ca0..d4bbfd3b84 100644 --- a/include/boost/gil/extension/io/pnm/old.hpp +++ b/include/boost/gil/extension/io/pnm/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_OLD_HPP #define BOOST_GIL_EXTENSION_IO_PNM_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -47,12 +36,12 @@ point2< std::ptrdiff_t > pnm_read_dimensions( const String& filename ) /// \ingroup PNM_IO /// \brief Loads the image specified by the given pnm image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the PNM library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template< typename String , typename View > -inline +inline void pnm_read_view( const String& filename , const View& view ) @@ -66,12 +55,12 @@ void pnm_read_view( const String& filename /// \ingroup PNM_IO /// \brief Allocates a new image whose dimensions are determined by the given pnm image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the PNM library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not /// compatible with the ones specified by Image template< typename String , typename Image > -inline +inline void pnm_read_image( const String& filename , Image& img ) @@ -89,7 +78,7 @@ template< typename String , typename View , typename CC > -inline +inline void pnm_read_and_convert_view( const String& filename , const View& view , CC cc @@ -108,7 +97,7 @@ void pnm_read_and_convert_view( const String& filename template< typename String , typename View > -inline +inline void pnm_read_and_convert_view( const String& filename , const View& view ) @@ -126,7 +115,7 @@ template< typename String , typename Image , typename CC > -inline +inline void pnm_read_and_convert_image( const String& filename , Image& img , CC cc @@ -145,7 +134,7 @@ void pnm_read_and_convert_image( const String& filename template< typename String , typename Image > -inline +inline void pnm_read_and_convert_image( const String filename , Image& img ) diff --git a/include/boost/gil/extension/io/pnm/read.hpp b/include/boost/gil/extension/io/pnm/read.hpp index 67ec2635d8..87b3d5cea9 100644 --- a/include/boost/gil/extension/io/pnm/read.hpp +++ b/include/boost/gil/extension/io/pnm/read.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_READ_HPP #define BOOST_GIL_EXTENSION_IO_PNM_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include @@ -26,16 +15,14 @@ #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/pnm/tags.hpp b/include/boost/gil/extension/io/pnm/tags.hpp index 2151c373ed..b49ca72b3c 100644 --- a/include/boost/gil/extension/io/pnm/tags.hpp +++ b/include/boost/gil/extension/io/pnm/tags.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_PNM_TAGS_HPP -#define BOOST_GIL_EXTENSION_IO_PNM_READ_ENABLED +#define BOOST_GIL_EXTENSION_IO_PNM_READ_ENABLED // TODO: Document, explain, review -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { /// Defines pnm tag. diff --git a/include/boost/gil/extension/io/pnm/write.hpp b/include/boost/gil/extension/io/pnm/write.hpp index 1a90483cd8..43e810b450 100644 --- a/include/boost/gil/extension/io/pnm/write.hpp +++ b/include/boost/gil/extension/io/pnm/write.hpp @@ -1,31 +1,19 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include -#include #include - +#include #include #endif diff --git a/include/boost/gil/extension/io/raw.hpp b/include/boost/gil/extension/io/raw.hpp index c3a3626c75..152fb2106e 100644 --- a/include/boost/gil/extension/io/raw.hpp +++ b/include/boost/gil/extension/io/raw.hpp @@ -1,24 +1,13 @@ -/* - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_HPP #define BOOST_GIL_EXTENSION_IO_RAW_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier tournaire \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #endif diff --git a/include/boost/gil/extension/io/raw/detail/device.hpp b/include/boost/gil/extension/io/raw/detail/device.hpp index 7f93336d51..d9c122c073 100644 --- a/include/boost/gil/extension/io/raw/detail/device.hpp +++ b/include/boost/gil/extension/io/raw/detail/device.hpp @@ -1,30 +1,21 @@ -/* - Copyright 2007-2012 Olivier Tournaire, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Olivier Tournaire +// Copyright 2007 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_DETAIL_DEVICE_HPP #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_DEVICE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier Tournaire \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - #include #include +#include + #include +#include namespace boost { namespace gil { namespace detail { @@ -107,7 +98,7 @@ class file_stream_device< raw_tag > : public raw_device_base , read_tag = read_tag() ) { - io_error_if( _processor_ptr.get()->open_file( file_name.c_str() ) != LIBRAW_SUCCESS + io_error_if( _processor_ptr.get()->open_file( file_name.c_str() ) != LIBRAW_SUCCESS , "file_stream_device: failed to open file" ); } @@ -119,7 +110,7 @@ class file_stream_device< raw_tag > : public raw_device_base , read_tag = read_tag() ) { - io_error_if( _processor_ptr.get()->open_file( file_name ) != LIBRAW_SUCCESS + io_error_if( _processor_ptr.get()->open_file( file_name ) != LIBRAW_SUCCESS , "file_stream_device: failed to open file" ); } diff --git a/include/boost/gil/extension/io/raw/detail/is_allowed.hpp b/include/boost/gil/extension/io/raw/detail/is_allowed.hpp index 852378abae..eb4959eca1 100644 --- a/include/boost/gil/extension/io/raw/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/raw/detail/is_allowed.hpp @@ -1,26 +1,14 @@ -/* - Copyright 2009 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2009 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier Tournaire \n -/// -/// \date 2011 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include -#include namespace boost { namespace gil { namespace detail { diff --git a/include/boost/gil/extension/io/raw/detail/read.hpp b/include/boost/gil/extension/io/raw/detail/read.hpp index 6406d6575e..24213dd61f 100644 --- a/include/boost/gil/extension/io/raw/detail/read.hpp +++ b/include/boost/gil/extension/io/raw/detail/read.hpp @@ -1,45 +1,34 @@ -/* - Copyright 2012 Olivier Tournaire, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Olivier Tournaire, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier Tournaire, Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include #include +#include +#include +#include #include #include #include -#include -#include #include +#include +#include #include -#include -#include -#include +#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif #define BUILD_INTERLEAVED_VIEW(color_layout, bits_per_pixel) \ @@ -249,9 +238,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/raw/detail/reader_backend.hpp b/include/boost/gil/extension/io/raw/detail/reader_backend.hpp index ad03a946f7..758a295029 100644 --- a/include/boost/gil/extension/io/raw/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/raw/detail/reader_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -50,7 +39,7 @@ struct reader_backend< Device , _info() , _scanline_length( 0 ) { - read_header(); + read_header(); if( _settings._dim.x == 0 ) { @@ -141,9 +130,9 @@ struct reader_backend< Device std::size_t _scanline_length; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/raw/detail/supported_types.hpp b/include/boost/gil/extension/io/raw/detail/supported_types.hpp index 4175db9571..4358028ca8 100644 --- a/include/boost/gil/extension/io/raw/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/raw/detail/supported_types.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_RAW_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier Tournaire \n -/// -/// \date 2011 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include +#include #include #include -#include +#include +#include namespace boost { namespace gil { namespace detail { diff --git a/include/boost/gil/extension/io/raw/read.hpp b/include/boost/gil/extension/io/raw/read.hpp index f670d68576..3e685f0285 100644 --- a/include/boost/gil/extension/io/raw/read.hpp +++ b/include/boost/gil/extension/io/raw/read.hpp @@ -1,40 +1,28 @@ -/* - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2013 Christian Henning +// Copyright 2012 Olivier Tournaire +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_READ_HPP #define BOOST_GIL_EXTENSION_IO_RAW_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Olivier Tournaire \n -/// -/// \date 2011 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/raw/tags.hpp b/include/boost/gil/extension/io/raw/tags.hpp index 684a24cbe0..4b232925a9 100644 --- a/include/boost/gil/extension/io/raw/tags.hpp +++ b/include/boost/gil/extension/io/raw/tags.hpp @@ -1,24 +1,14 @@ -/* - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_RAW_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_RAW_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief All supported raw tags by the gil io extension. -/// \author Olivier Tournaire \n -/// -/// \date 2011 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - +#include #ifndef BOOST_GIL_EXTENSION_IO_RAW_C_LIB_COMPILED_AS_CPLUSPLUS extern "C" { @@ -30,8 +20,6 @@ } #endif -#include - namespace boost { namespace gil { /// Defines tiff tag. diff --git a/include/boost/gil/extension/io/targa.hpp b/include/boost/gil/extension/io/targa.hpp index 8ff4cb9302..21d3f6c983 100644 --- a/include/boost/gil/extension/io/targa.hpp +++ b/include/boost/gil/extension/io/targa.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2010 Kenneth Riddile - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Kenneth Riddile +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/targa/detail/is_allowed.hpp b/include/boost/gil/extension/io/targa/detail/is_allowed.hpp index 0033ba6e54..11d6797743 100644 --- a/include/boost/gil/extension/io/targa/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/targa/detail/is_allowed.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2010 Kenneth Riddile - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Kenneth Riddile +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { namespace detail { template< typename View > diff --git a/include/boost/gil/extension/io/targa/detail/read.hpp b/include/boost/gil/extension/io/targa/detail/read.hpp index b208a679f4..9cd50cdaba 100644 --- a/include/boost/gil/extension/io/targa/detail/read.hpp +++ b/include/boost/gil/extension/io/targa/detail/read.hpp @@ -1,44 +1,32 @@ -/* - Copyright 2012 Kenneth Riddile, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Kenneth Riddile, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_READ_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile, Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - #include +#include +#include #include #include #include -#include -#include #include +#include +#include #include -#include -#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -80,7 +68,7 @@ class reader< Device , ConversionPolicy >() , backend_t( io_dev - , settings + , settings ) {} @@ -106,7 +94,7 @@ class reader< Device io_error_if( !detail::is_allowed< View >( this->_info, is_read_and_convert_t() ) , "Image types aren't compatible." ); - + switch( this->_info._image_type ) { case targa_image_type::_rgb: @@ -115,12 +103,12 @@ class reader< Device { io_error( "Inconsistent color map type and image type in targa file." ); } - + if( this->_info._color_map_length != 0 ) { io_error( "Non-indexed targa files containing a palette are not supported." ); } - + switch( this->_info._bits_per_pixel ) { case 24: @@ -159,7 +147,7 @@ class reader< Device break; } } - + break; } case targa_image_type::_rle_rgb: @@ -168,12 +156,12 @@ class reader< Device { io_error( "Inconsistent color map type and image type in targa file." ); } - + if( this->_info._color_map_length != 0 ) { io_error( "Non-indexed targa files containing a palette are not supported." ); } - + switch( this->_info._bits_per_pixel ) { case 24: @@ -206,7 +194,7 @@ class reader< Device break; } } - + break; } default: @@ -257,13 +245,13 @@ class reader< Device targa_depth::type bytes_per_pixel = this->_info._bits_per_pixel / 8; size_t image_size = this->_info._width * this->_info._height * bytes_per_pixel; byte_vector_t image_data( image_size ); - + this->_io_dev.seek( static_cast< long >( this->_info._offset )); - + for( size_t pixel = 0; pixel < image_size; ) { targa_offset::type current_byte = this->_io_dev.read_uint8(); - + if( current_byte & 0x80 ) // run length chunk (high bit = 1) { uint8_t chunk_length = current_byte - 127; @@ -272,7 +260,7 @@ class reader< Device { pixel_data[channel] = this->_io_dev.read_uint8(); } - + // Repeat the next pixel chunk_length times for( uint8_t i = 0; i < chunk_length; ++i, pixel += bytes_per_pixel ) { @@ -282,7 +270,7 @@ class reader< Device else // raw chunk { uint8_t chunk_length = current_byte + 1; - + // Write the next chunk_length pixels directly size_t pixels_written = chunk_length * bytes_per_pixel; this->_io_dev.read( &image_data[pixel], pixels_written ); @@ -304,7 +292,7 @@ class reader< Device } }; -namespace detail { +namespace detail { class targa_type_format_checker { @@ -407,9 +395,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/targa/detail/reader_backend.hpp b/include/boost/gil/extension/io/targa/detail/reader_backend.hpp index cbf216aacd..ab26562f04 100644 --- a/include/boost/gil/extension/io/targa/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/targa/detail/reader_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -50,7 +39,7 @@ struct reader_backend< Device , _settings( settings ) , _info() { - read_header(); + read_header(); if( _settings._dim.x == 0 ) { @@ -66,19 +55,19 @@ struct reader_backend< Device void read_header() { _info._header_size = targa_header_size::_size; - + _info._offset = _io_dev.read_uint8() + _info._header_size; - + _info._color_map_type = _io_dev.read_uint8(); _info._image_type = _io_dev.read_uint8(); - + _info._color_map_start = _io_dev.read_uint16(); _info._color_map_length = _io_dev.read_uint16(); _info._color_map_depth = _io_dev.read_uint8(); - + _info._x_origin = _io_dev.read_uint16(); _info._y_origin = _io_dev.read_uint16(); - + _info._width = _io_dev.read_uint16(); _info._height = _io_dev.read_uint16(); @@ -86,13 +75,13 @@ struct reader_backend< Device { io_error( "Invalid dimension for targa file" ); } - + _info._bits_per_pixel = _io_dev.read_uint8(); if( _info._bits_per_pixel != 24 && _info._bits_per_pixel != 32 ) { io_error( "Unsupported bit depth for targa file" ); } - + _info._descriptor = _io_dev.read_uint8(); // According to TGA specs, http://www.gamers.org/dEngine/quake3/TGA.txt, @@ -128,7 +117,7 @@ struct reader_backend< Device { _info._screen_origin_bit = true; } - + _info._valid = true; } @@ -165,9 +154,9 @@ struct reader_backend< Device image_read_info< targa_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/targa/detail/scanline_read.hpp b/include/boost/gil/extension/io/targa/detail/scanline_read.hpp index 7fbd0b05b0..c53cc14f34 100644 --- a/include/boost/gil/extension/io/targa/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/targa/detail/scanline_read.hpp @@ -1,37 +1,26 @@ -/* - Copyright 2012 Kenneth Riddile and 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Kenneth Riddile, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile and Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include +#include #include #include #include -#include -#include #include +#include +#include #include #include -#include -#include +#include namespace boost { namespace gil { @@ -75,9 +64,9 @@ class scanline_reader< Device // jump to scanline long offset = this->_info._offset + ( this->_info._height - 1 - pos ) * static_cast< long >( this->_scanline_length ); - + this->_io_dev.seek( offset ); - + read_row( dst ); } @@ -101,7 +90,7 @@ class scanline_reader< Device { io_error( "scanline reader cannot read indexed targa files." ); } - + if( this->_info._image_type != targa_image_type::_rgb ) { io_error( "scanline reader cannot read this targa image type." ); @@ -115,7 +104,7 @@ class scanline_reader< Device { io_error( "Inconsistent color map type and image type in targa file." ); } - + if( this->_info._color_map_length != 0 ) { io_error( "Non-indexed targa files containing a palette are not supported." ); @@ -125,7 +114,7 @@ class scanline_reader< Device { io_error( "scanline reader cannot read targa files which have screen origin bit set." ); } - + switch( this->_info._bits_per_pixel ) { case 24: @@ -144,7 +133,7 @@ class scanline_reader< Device break; } } - + break; } default: diff --git a/include/boost/gil/extension/io/targa/detail/supported_types.hpp b/include/boost/gil/extension/io/targa/detail/supported_types.hpp index 0cefcb4a5b..7a13495130 100644 --- a/include/boost/gil/extension/io/targa/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/targa/detail/supported_types.hpp @@ -1,32 +1,20 @@ -/* - Copyright 2010 Kenneth Riddile - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Kenneth Riddile +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - #include #include - #include +#include +#include + namespace boost { namespace gil { namespace detail { // Read support @@ -84,7 +72,7 @@ struct is_read_supported< Pixel > : mpl::bool_< detail::targa_read_support< typename channel_type< Pixel >::type , typename color_space_type< Pixel >::type - >::is_supported + >::is_supported > { typedef detail::targa_read_support< typename channel_type< Pixel >::type diff --git a/include/boost/gil/extension/io/targa/detail/write.hpp b/include/boost/gil/extension/io/targa/detail/write.hpp index 223c1b2161..5a4145cbc5 100644 --- a/include/boost/gil/extension/io/targa/detail/write.hpp +++ b/include/boost/gil/extension/io/targa/detail/write.hpp @@ -1,38 +1,26 @@ -/* - Copyright 2010-2012 Kenneth Riddile, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010-2012 Kenneth Riddile, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile, Christian Henning \n -/// -/// \date 2010-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include +#include #include #include -#include - -#include +#include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif namespace detail { @@ -187,9 +175,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // gil } // boost diff --git a/include/boost/gil/extension/io/targa/detail/writer_backend.hpp b/include/boost/gil/extension/io/targa/detail/writer_backend.hpp index 0dfec2c185..2d853e6314 100644 --- a/include/boost/gil/extension/io/targa/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/targa/detail/writer_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -56,9 +45,9 @@ struct writer_backend< Device image_write_info< targa_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/targa/old.hpp b/include/boost/gil/extension/io/targa/old.hpp index 05a3d680b5..83d3544a11 100644 --- a/include/boost/gil/extension/io/targa/old.hpp +++ b/include/boost/gil/extension/io/targa/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2010 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_OLD_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -47,12 +36,12 @@ point2< std::ptrdiff_t > targa_read_dimensions( const String& filename ) /// \ingroup BMP_IO /// \brief Loads the image specified by the given targa image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the BMP library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template< typename String , typename View > -inline +inline void targa_read_view( const String& filename , const View& view ) @@ -66,12 +55,12 @@ void targa_read_view( const String& filename /// \ingroup BMP_IO /// \brief Allocates a new image whose dimensions are determined by the given bmp image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the BMP library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not /// compatible with the ones specified by Image template< typename String , typename Image > -inline +inline void targa_read_image( const String& filename , Image& img ) @@ -89,7 +78,7 @@ template< typename String , typename View , typename CC > -inline +inline void targa_read_and_convert_view( const String& filename , const View& view , CC cc @@ -108,7 +97,7 @@ void targa_read_and_convert_view( const String& filename template< typename String , typename View > -inline +inline void targa_read_and_convert_view( const String& filename , const View& view ) @@ -126,7 +115,7 @@ template< typename String , typename Image , typename CC > -inline +inline void targa_read_and_convert_image( const String& filename , Image& img , CC cc @@ -145,7 +134,7 @@ void targa_read_and_convert_image( const String& filename template< typename String , typename Image > -inline +inline void targa_read_and_convert_image( const String filename , Image& img ) diff --git a/include/boost/gil/extension/io/targa/read.hpp b/include/boost/gil/extension/io/targa/read.hpp index 41caaa7d58..85bc51b3b5 100644 --- a/include/boost/gil/extension/io/targa/read.hpp +++ b/include/boost/gil/extension/io/targa/read.hpp @@ -1,41 +1,28 @@ -/* - Copyright 2010-2012 Kenneth Riddile and 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010-2012 Kenneth Riddile, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_READ_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile and Christian Henning \n -/// -/// \date 2010-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include -#include #include #include +#include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/targa/tags.hpp b/include/boost/gil/extension/io/targa/tags.hpp index dce128b32c..f56a1e20b4 100644 --- a/include/boost/gil/extension/io/targa/tags.hpp +++ b/include/boost/gil/extension/io/targa/tags.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2010 Kenneth Riddile - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Kenneth Riddile +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -95,40 +84,40 @@ struct image_read_info< targa_tag > /// The size of this header: targa_header_size::type _header_size; - + /// The offset, i.e. starting address, of the byte where the targa data can be found. targa_offset::type _offset; - + /// The type of color map used by the image, i.e. RGB or indexed. targa_color_map_type::type _color_map_type; - + /// The type of image data, i.e compressed, indexed, uncompressed RGB, etc. targa_image_type::type _image_type; - + /// Index of first entry in the color map table. targa_color_map_start::type _color_map_start; - + /// Number of entries in the color map table. targa_color_map_length::type _color_map_length; - + /// Bit depth for each color map entry. targa_color_map_depth::type _color_map_depth; - + /// X coordinate of the image origin. targa_origin_element::type _x_origin; - + /// Y coordinate of the image origin. targa_origin_element::type _y_origin; - + /// Width of the image in pixels. targa_dimension::type _width; - + /// Height of the image in pixels. targa_dimension::type _height; - + /// Bit depth of the image. targa_depth::type _bits_per_pixel; - + /// The targa image descriptor. targa_descriptor::type _descriptor; diff --git a/include/boost/gil/extension/io/targa/write.hpp b/include/boost/gil/extension/io/targa/write.hpp index 3edecc7d63..6ec423549d 100644 --- a/include/boost/gil/extension/io/targa/write.hpp +++ b/include/boost/gil/extension/io/targa/write.hpp @@ -1,31 +1,19 @@ -/* - Copyright 2010 Kenneth Riddile - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2010 Kenneth Riddile +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TARGA_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_TARGA_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Kenneth Riddile \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include -#include #include - +#include #include #endif diff --git a/include/boost/gil/extension/io/tiff.hpp b/include/boost/gil/extension/io/tiff.hpp index 0d7e6c8cd5..6af181b4e0 100644 --- a/include/boost/gil/extension/io/tiff.hpp +++ b/include/boost/gil/extension/io/tiff.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include diff --git a/include/boost/gil/extension/io/tiff/detail/device.hpp b/include/boost/gil/extension/io/tiff/detail/device.hpp index aebc9846c8..83c40dbcd3 100644 --- a/include/boost/gil/extension/io/tiff/detail/device.hpp +++ b/include/boost/gil/extension/io/tiff/detail/device.hpp @@ -1,25 +1,23 @@ -/* - Copyright 2007-2008 Andreas Pokorny, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Andreas Pokorny, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_DEVICE_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_DEVICE_HPP -#include +#include -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Andreas Pokorny, Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include + +#include +#include + +#include +#include // taken from jpegxx - https://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/ijg_headers.hpp #ifndef BOOST_GIL_EXTENSION_IO_TIFF_C_LIB_COMPILED_AS_CPLUSPLUS @@ -35,15 +33,6 @@ #include -#include -#include - -#include -#include -#include - -#include - namespace boost { namespace gil { namespace detail { template @@ -58,7 +47,7 @@ struct set_property_f { bool call_me(const typename Property:: type& value, std::shared_ptr& file) const; }; -template <> struct get_property_f <1> +template <> struct get_property_f <1> { // For single-valued properties template @@ -117,7 +106,7 @@ template <> struct set_property_f <2> bool call_me(typename Property:: type const & values, std::shared_ptr& file) const { typename mpl:: at >:: type const length = values. size (); - typename mpl:: at >:: type const pointer = & (values. front ()); + typename mpl:: at >:: type const pointer = & (values. front ()); return (1 == TIFFSetField( file.get() , Property:: tag , length @@ -153,9 +142,9 @@ class tiff_device_base return set_property_f ::value > ().template call_me (value, _tiff_file); } - // TIFFIsByteSwapped returns a non-zero value if the image data was in a different - // byte-order than the host machine. Zero is returned if the TIFF file and local - // host byte-orders are the same. Note that TIFFReadTile(), TIFFReadStrip() and TIFFReadScanline() + // TIFFIsByteSwapped returns a non-zero value if the image data was in a different + // byte-order than the host machine. Zero is returned if the TIFF file and local + // host byte-orders are the same. Note that TIFFReadTile(), TIFFReadStrip() and TIFFReadScanline() // functions already normally perform byte swapping to local host order if needed. bool are_bytes_swapped() { @@ -255,7 +244,7 @@ class tiff_device_base io_error_if( TIFFWriteScanline( _tiff_file.get() , &buffer.front() , row - , plane + , plane ) == -1 , "Write error" ); @@ -269,7 +258,7 @@ class tiff_device_base io_error_if( TIFFWriteScanline( _tiff_file.get() , buffer , row - , plane + , plane ) == -1 , "Write error" ); diff --git a/include/boost/gil/extension/io/tiff/detail/is_allowed.hpp b/include/boost/gil/extension/io/tiff/detail/is_allowed.hpp index d88413a63e..417a467c98 100644 --- a/include/boost/gil/extension/io/tiff/detail/is_allowed.hpp +++ b/include/boost/gil/extension/io/tiff/detail/is_allowed.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2008 Christian Henning, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2008 Christian Henning, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_IS_ALLOWED_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_IS_ALLOWED_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { namespace detail { typedef std::vector< tiff_bits_per_sample::type > channel_sizes_t; @@ -42,7 +31,7 @@ template< typename View, typename Channel > struct Format_Type< View template< typename View, typename Channel > struct Format_Type< View , Channel , typename boost::enable_if< mpl::and_< mpl::not_< typename is_bit_aligned< typename get_pixel_type< View >::type >::type > - , is_unsigned< Channel > + , is_unsigned< Channel > > >::type > @@ -54,7 +43,7 @@ template< typename View, typename Channel > struct Format_Type< View template< typename View, typename Channel > struct Format_Type< View , Channel , typename boost::enable_if< mpl::and_< mpl::not_< typename is_bit_aligned< typename get_pixel_type< View >::type >::type > - , is_signed< Channel > + , is_signed< Channel > > >::type > @@ -66,7 +55,7 @@ template< typename View, typename Channel > struct Format_Type< View template< typename View, typename Channel > struct Format_Type< View , Channel , typename boost::enable_if< mpl::and_< mpl::not_< typename is_bit_aligned< typename get_pixel_type< View >::type >::type > - , is_floating_point< Channel > + , is_floating_point< Channel > > >::type > diff --git a/include/boost/gil/extension/io/tiff/detail/log.hpp b/include/boost/gil/extension/io/tiff/detail/log.hpp index 965a576d28..2299ee9d1a 100644 --- a/include/boost/gil/extension/io/tiff/detail/log.hpp +++ b/include/boost/gil/extension/io/tiff/detail/log.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2009 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2009 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_LOG_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_LOG_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2009 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include extern "C" { #include "tiffio.h" } -#include - namespace boost { namespace gil { class tiff_no_log diff --git a/include/boost/gil/extension/io/tiff/detail/read.hpp b/include/boost/gil/extension/io/tiff/detail/read.hpp index 2471ff544e..e25c833a2f 100644 --- a/include/boost/gil/extension/io/tiff/detail/read.hpp +++ b/include/boost/gil/extension/io/tiff/detail/read.hpp @@ -1,23 +1,29 @@ -/* - Copyright 2007-2012 Christian Henning, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_READER_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_READER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include // taken from jpegxx - https://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/ijg_headers.hpp #ifndef BOOST_GIL_EXTENSION_IO_TIFF_C_LIB_COMPILED_AS_CPLUSPLUS @@ -31,29 +37,11 @@ } #endif -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -namespace boost { namespace gil { +namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif template < int K > @@ -157,8 +145,8 @@ class reader< Device { if( this->_info._photometric_interpretation == PHOTOMETRIC_PALETTE ) { - this->_scanline_length = this->_info._width - * num_channels< rgb16_view_t >::value + this->_scanline_length = this->_info._width + * num_channels< rgb16_view_t >::value * sizeof( channel_type::type ); // Steps: @@ -218,7 +206,7 @@ class reader< Device } } } - + private: template< typename View > @@ -442,7 +430,7 @@ class reader< Device , int plane ) { - ///@todo: why is + ///@todo: why is /// typedef Buffer row_buffer_helper_t; /// not working? I get compiler error with MSVC10. /// read_stripped_data IS working. @@ -565,7 +553,7 @@ class reader< Device , int plane ) { - ///@todo: why is + ///@todo: why is /// typedef Buffer row_buffer_helper_t; /// not working? I get compiler error with MSVC10. /// read_stripped_data IS working. @@ -643,7 +631,7 @@ class reader< Device it_t first = begin + this->_settings._top_left.x; it_t last = first + this->_settings._dim.x; // one after last element - // I don't think tiff allows for random access of row, that's why we need + // I don't think tiff allows for random access of row, that's why we need // to read and discard rows when reading subimages. skip_over_rows( row_buffer_helper.buffer() , plane @@ -653,7 +641,7 @@ class reader< Device std::ptrdiff_t row_end = row + this->_settings._dim.y; std::ptrdiff_t dst_row = 0; - for( + for( ; row < row_end ; ++row, ++dst_row ) @@ -791,9 +779,9 @@ class dynamic_image_reader< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/tiff/detail/reader_backend.hpp b/include/boost/gil/extension/io/tiff/detail/reader_backend.hpp index d2a308f7d7..6de7e61688 100644 --- a/include/boost/gil/extension/io/tiff/detail/reader_backend.hpp +++ b/include/boost/gil/extension/io/tiff/detail/reader_backend.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_READER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_READER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -144,7 +133,7 @@ struct reader_backend< Device { _io_dev.set_directory( settings._directory ); } - } + } public: @@ -163,9 +152,9 @@ struct reader_backend< Device rgb16_planar_view_t _palette; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/tiff/detail/scanline_read.hpp b/include/boost/gil/extension/io/tiff/detail/scanline_read.hpp index 7e7e2cc8b7..e07e391801 100644 --- a/include/boost/gil/extension/io/tiff/detail/scanline_read.hpp +++ b/include/boost/gil/extension/io/tiff/detail/scanline_read.hpp @@ -1,23 +1,31 @@ -/* - Copyright 2007-2012 Christian Henning, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SCANLINE_READ_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SCANLINE_READ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include // taken from jpegxx - https://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/ijg_headers.hpp #ifndef BOOST_GIL_EXTENSION_IO_TIFF_C_LIB_COMPILED_AS_CPLUSPLUS @@ -31,26 +39,6 @@ } #endif -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - namespace boost { namespace gil { /// @@ -88,7 +76,7 @@ class scanline_reader< Device void read( byte_t* dst, int pos ) { _read_function( this, dst, pos ); - } + } /// Skip over a scanline. void skip( byte_t* dst, int pos ) @@ -110,8 +98,8 @@ class scanline_reader< Device if( this->_info._photometric_interpretation == PHOTOMETRIC_PALETTE ) { - this->_scanline_length = this->_info._width - * num_channels< rgb16_view_t >::value + this->_scanline_length = this->_info._width + * num_channels< rgb16_view_t >::value * sizeof( channel_type::type ); this->_io_dev.get_field_defaulted( this->_red @@ -179,7 +167,7 @@ class scanline_reader< Device break; } - case 8: + case 8: { typedef channel_type< get_pixel_type< gray8_image_t::view_t >::type >::type channel_t; @@ -278,16 +266,16 @@ class scanline_reader< Device { switch( this->_info._bits_per_sample ) { - case 1: - case 2: + case 1: + case 2: case 4: - case 6: - case 8: - case 10: - case 12: - case 14: - case 16: - case 24: + case 6: + case 8: + case 10: + case 12: + case 14: + case 16: + case 24: case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; } default: { io_error( "Image type is not supported." ); } } @@ -303,14 +291,14 @@ class scanline_reader< Device { switch( this->_info._bits_per_sample ) { - case 2: - case 4: - case 8: - case 10: - case 12: - case 14: - case 16: - case 24: + case 2: + case 4: + case 8: + case 10: + case 12: + case 14: + case 16: + case 24: case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; } default: { io_error( "Image type is not supported." ); } } @@ -322,14 +310,14 @@ class scanline_reader< Device { switch( this->_info._bits_per_sample ) { - case 2: - case 4: - case 8: - case 10: - case 12: - case 14: - case 16: - case 24: + case 2: + case 4: + case 8: + case 10: + case 12: + case 14: + case 16: + case 24: case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; } default: { io_error( "Image type is not supported." ); } } @@ -346,14 +334,14 @@ class scanline_reader< Device { switch( this->_info._bits_per_sample ) { - case 2: - case 4: - case 8: - case 10: - case 12: - case 14: - case 16: - case 24: + case 2: + case 4: + case 8: + case 10: + case 12: + case 14: + case 16: + case 24: case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; } default: { io_error( "Image type is not supported." ); } } @@ -426,7 +414,7 @@ class scanline_reader< Device { read_n_bits_row< gray8_image_t::view_t >( dst, pos ); } - + void read_16_bits_index_image( byte_t* dst, int pos ) { read_n_bits_row< gray16_image_t::view_t >( dst, pos ); diff --git a/include/boost/gil/extension/io/tiff/detail/supported_types.hpp b/include/boost/gil/extension/io/tiff/detail/supported_types.hpp index 7e08dffb55..f654482670 100644 --- a/include/boost/gil/extension/io/tiff/detail/supported_types.hpp +++ b/include/boost/gil/extension/io/tiff/detail/supported_types.hpp @@ -1,37 +1,26 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SUPPORTED_TYPES_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SUPPORTED_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include -#include -#include - namespace boost{ namespace gil { namespace detail { // Read support -// TIFF virtually supports everything +// TIFF virtually supports everything struct tiff_read_support : read_support_true {}; @@ -46,13 +35,13 @@ struct tiff_write_support : write_support_true template< typename Pixel > struct is_read_supported< Pixel , tiff_tag - > + > : mpl::bool_< detail::tiff_read_support::is_supported > {}; template< typename Pixel > struct is_write_supported< Pixel , tiff_tag - > + > : mpl::bool_< detail::tiff_write_support::is_supported > {}; diff --git a/include/boost/gil/extension/io/tiff/detail/write.hpp b/include/boost/gil/extension/io/tiff/detail/write.hpp index 06b72858d8..a0e4645bb7 100644 --- a/include/boost/gil/extension/io/tiff/detail/write.hpp +++ b/include/boost/gil/extension/io/tiff/detail/write.hpp @@ -1,49 +1,37 @@ -/* - Copyright 2007-2012 Christian Henning, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include -extern "C" { -#include "tiff.h" -#include "tiffio.h" -} +#include +#include +#include + +#include #include #include #include -#include - -#include - -#include -#include -#include - -#include -#include +extern "C" { +#include "tiff.h" +#include "tiffio.h" +} namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif namespace detail { @@ -85,7 +73,7 @@ struct my_interleaved_pixel_iterator_type_from_pixel_reference< const bit_aligne struct tiff_write_is_supported { template< typename View > - struct apply + struct apply : public is_write_supported< typename get_pixel_type< View >::type , tiff_tag > @@ -226,7 +214,7 @@ class writer< Device // @todo: do optional bit swapping here if you need to... } } - + ///////////////////////////// template< typename View > @@ -239,9 +227,9 @@ class writer< Device typedef mpl::bool_::value> has_alpha_t; write_bit_aligned_view_to_dev(view, row_size_in_bytes, has_alpha_t()); - + } - + template< typename View> void write_tiled_data( const View& view , tiff_tile_width::type tw @@ -339,7 +327,7 @@ class writer< Device , it ); } - + ///////////////////////////// @@ -369,7 +357,7 @@ class writer< Device , static_cast< int >( tw ) , static_cast< int >( th ) ); - + typedef typename color_space_type::type colour_space_t; typedef mpl::bool_::value> has_alpha_t; @@ -453,9 +441,9 @@ class dynamic_image_writer< Device } }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/tiff/detail/writer_backend.hpp b/include/boost/gil/extension/io/tiff/detail/writer_backend.hpp index c7ed63a3e5..65b32942bd 100644 --- a/include/boost/gil/extension/io/tiff/detail/writer_backend.hpp +++ b/include/boost/gil/extension/io/tiff/detail/writer_backend.hpp @@ -1,33 +1,22 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_WRITER_BACKEND_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_WRITER_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif /// @@ -135,9 +124,9 @@ struct writer_backend< Device image_write_info< tiff_tag > _info; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/extension/io/tiff/old.hpp b/include/boost/gil/extension/io/tiff/old.hpp index d0fa548a37..93bf9e3f68 100644 --- a/include/boost/gil/extension/io/tiff/old.hpp +++ b/include/boost/gil/extension/io/tiff/old.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_OLD_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_OLD_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost { namespace gil { @@ -46,12 +35,12 @@ point2< std::ptrdiff_t > tiff_read_dimensions( const String& filename ) /// \ingroup TIFF_IO /// \brief Loads the image specified by the given tiff image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the TIFF library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template< typename String , typename View > -inline +inline void tiff_read_view( const String& filename , const View& view ) @@ -65,12 +54,12 @@ void tiff_read_view( const String& filename /// \ingroup TIFF_IO /// \brief Allocates a new image whose dimensions are determined by the given tiff image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the TIFF library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not /// compatible with the ones specified by Image template< typename String , typename Image > -inline +inline void tiff_read_image( const String& filename , Image& img ) @@ -88,7 +77,7 @@ template< typename String , typename View , typename CC > -inline +inline void tiff_read_and_convert_view( const String& filename , const View& view , CC cc @@ -107,7 +96,7 @@ void tiff_read_and_convert_view( const String& filename template< typename String , typename View > -inline +inline void tiff_read_and_convert_view( const String& filename , const View& view ) @@ -125,7 +114,7 @@ template< typename String , typename Image , typename CC > -inline +inline void tiff_read_and_convert_image( const String& filename , Image& img , CC cc @@ -144,7 +133,7 @@ void tiff_read_and_convert_image( const String& filename template< typename String , typename Image > -inline +inline void tiff_read_and_convert_image( const String filename , Image& img ) diff --git a/include/boost/gil/extension/io/tiff/read.hpp b/include/boost/gil/extension/io/tiff/read.hpp index 285a8bf331..af7b4bcef2 100644 --- a/include/boost/gil/extension/io/tiff/read.hpp +++ b/include/boost/gil/extension/io/tiff/read.hpp @@ -1,43 +1,30 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP -#define BOOST_GIL_EXTENSION_IO_TIFF_READ_ENABLED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#define BOOST_GIL_EXTENSION_IO_TIFF_READ_ENABLED // TODO: Document, explain, review #include -#include #include #include +#include #include #include -#include #include +#include #include - -#include -#include -#include #include #include - +#include +#include +#include #include #endif diff --git a/include/boost/gil/extension/io/tiff/tags.hpp b/include/boost/gil/extension/io/tiff/tags.hpp index 2242e969ea..fc21c48261 100644 --- a/include/boost/gil/extension/io/tiff/tags.hpp +++ b/include/boost/gil/extension/io/tiff/tags.hpp @@ -1,23 +1,16 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_TAGS_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_TAGS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief All supported tiff tags by the gil io extension. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include #include @@ -32,9 +25,6 @@ } #endif -#include -#include - namespace boost { namespace gil { /// Defines tiff tag. diff --git a/include/boost/gil/extension/io/tiff/write.hpp b/include/boost/gil/extension/io/tiff/write.hpp index 1969a951fe..a96470afc3 100644 --- a/include/boost/gil/extension/io/tiff/write.hpp +++ b/include/boost/gil/extension/io/tiff/write.hpp @@ -1,32 +1,19 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP #define BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include -#include #include - +#include #include - #endif diff --git a/include/boost/gil/extension/numeric/affine.hpp b/include/boost/gil/extension/numeric/affine.hpp index 6a77070063..c5ebaa1d52 100644 --- a/include/boost/gil/extension/numeric/affine.hpp +++ b/include/boost/gil/extension/numeric/affine.hpp @@ -1,27 +1,15 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_AFFINE_HPP #define BOOST_GIL_EXTENSION_NUMERIC_AFFINE_HPP #include // point2 -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief support for affine transformations -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { //////////////////////////////////////////////////////////////////////////////////////// @@ -74,7 +62,7 @@ concept MappingFunctionConcept { typename mapping_traits::result_type; where PointNDConcept; template { where PointNDConcept } - result_type transform(MapFn&, const Domain& src); + result_type transform(MapFn&, const Domain& src); }; */ @@ -88,6 +76,6 @@ struct mapping_traits > { template BOOST_FORCEINLINE point2 transform(const matrix3x2& mat, const point2& src) { return src * mat; } -} } // namespace boost::gil +}} // namespace boost::gil -#endif // BOOST_GIL_EXTENSION_NUMERIC_AFFINE_HPP +#endif diff --git a/include/boost/gil/extension/numeric/algorithm.hpp b/include/boost/gil/extension/numeric/algorithm.hpp index de36591cb9..8dd2850857 100644 --- a/include/boost/gil/extension/numeric/algorithm.hpp +++ b/include/boost/gil/extension/numeric/algorithm.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_ALGORITHM_HPP #define BOOST_GIL_EXTENSION_NUMERIC_ALGORITHM_HPP -/*! -/// \file -/// \brief Numeric algorithms -/// \author Hailin Jin and Lubomir Bourdev \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -*/ +#include +#include +#include #include #include -#include #include -#include -#include - namespace boost { namespace gil { /// \brief Returns the reference proxy associated with a type that has a \p "reference" member typedef. @@ -46,7 +35,7 @@ BinaryFunction for_each(Iterator1 first1,Iterator1 last1,Iterator2 first2,Binary template inline DstIterator assign_pixels(SrcIterator src,SrcIterator src_end,DstIterator dst) { for_each(src,src_end,dst,pixel_assigns_t::value_type>::type, - typename pixel_proxy::value_type>::type>()); + typename pixel_proxy::value_type>::type>()); return dst+(src_end-src); } @@ -55,8 +44,8 @@ template struct inner_product_k_t { template - static _Tp apply(_InputIterator1 __first1, - _InputIterator2 __first2, _Tp __init, + static _Tp apply(_InputIterator1 __first1, + _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); @@ -69,8 +58,8 @@ template <> struct inner_product_k_t<0> { template - static _Tp apply(_InputIterator1 __first1, - _InputIterator2 __first2, _Tp __init, + static _Tp apply(_InputIterator1 __first1, + _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { return __init; @@ -83,9 +72,9 @@ template BOOST_FORCEINLINE -_Tp inner_product_k(_InputIterator1 __first1, +_Tp inner_product_k(_InputIterator1 __first1, _InputIterator2 __first2, - _Tp __init, + _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { return detail::inner_product_k_t::template apply(__first1,__first2,__init, @@ -152,6 +141,6 @@ inline void view_multiplies_scalar(const SrcView& src,const Scalar& scalar,const } } -} } // namespace boost::gil +}} // namespace boost::gil -#endif // BOOST_GIL_EXTENSION_NUMERIC_ALGORITHM_HPP +#endif diff --git a/include/boost/gil/extension/numeric/channel_numeric_operations.hpp b/include/boost/gil/extension/numeric/channel_numeric_operations.hpp index 4ac5fff970..d456f06eba 100644 --- a/include/boost/gil/extension/numeric/channel_numeric_operations.hpp +++ b/include/boost/gil/extension/numeric/channel_numeric_operations.hpp @@ -1,34 +1,25 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP #define BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP -/*! -/// \file -/// \brief Structures for channel-wise numeric operations -/// \author Hailin Jin and Lubomir Bourdev \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -/// Currently defined structures: -/// channel_plus_t (+), channel_minus_t (-), -/// channel_multiplies_t (*), channel_divides_t (/), -/// channel_plus_scalar_t (+s), channel_minus_scalar_t (-s), -/// channel_multiplies_scalar_t (*s), channel_divides_scalar_t (/s), -/// channel_halves_t (/=2), channel_zeros_t (=0), channel_assigns_t (=) -*/ - #include namespace boost { namespace gil { +// Structures for channel-wise numeric operations +// Currently defined structures: +// channel_plus_t (+), channel_minus_t (-), +// channel_multiplies_t (*), channel_divides_t (/), +// channel_plus_scalar_t (+s), channel_minus_scalar_t (-s), +// channel_multiplies_scalar_t (*s), channel_divides_scalar_t (/s), +// channel_halves_t (/=2), channel_zeros_t (=0), channel_assigns_t (=) + /// \ingroup ChannelNumericOperations /// structure for adding one channel to another /// this is a generic implementation; user should specialize it for better performance @@ -151,6 +142,6 @@ struct channel_assigns_t : public std::binary_function +#include +#include +#include +#include -#include -#include #include -#include +#include +#include #include - -#include -#include -#include -#include -#include +#include namespace boost { namespace gil { +// 2D seperable convolutions and correlations + /// \ingroup ImageAlgorithms /// Boundary options for 1D correlations/convolutions enum convolve_boundary_option { convolve_option_output_ignore, /// do nothing to the output convolve_option_output_zero, /// set the output to zero - convolve_option_extend_padded, /// assume the source boundaries to be padded already + convolve_option_extend_padded, /// assume the source boundaries to be padded already convolve_option_extend_zero, /// assume the source boundaries to be zero convolve_option_extend_constant /// assume the source boundaries to be the boundary value }; @@ -82,7 +72,7 @@ void correlate_rows_imp(const SrcView& src, const Kernel& ker, const DstView& ds correlator(&buffer.front(),&buffer.front()+width+1-ker.size(), ker.begin(),it_dst); it_dst+=width+1-ker.size(); - if (option==convolve_option_output_zero) + if (option==convolve_option_output_zero) std::fill_n(it_dst,ker.right_size(),dst_zero); } } @@ -213,6 +203,6 @@ void convolve_cols_fixed(const SrcView& src, const Kernel& ker, const DstView& d convolve_rows_fixed(transposed_view(src),ker,transposed_view(dst),option); } -} } // namespace boost::gil +}} // namespace boost::gil -#endif // BOOST_GIL_EXTENSION_NUMERIC_CONVOLVE_HPP +#endif diff --git a/include/boost/gil/extension/numeric/kernel.hpp b/include/boost/gil/extension/numeric/kernel.hpp index f02ed1d1b4..000d17094b 100644 --- a/include/boost/gil/extension/numeric/kernel.hpp +++ b/include/boost/gil/extension/numeric/kernel.hpp @@ -1,35 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP #define BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP -/*! -/// \file -/// \brief Definitions of 1D fixed-size and variable-size kernels and related operations -/// \author Hailin Jin and Lubomir Bourdev \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -*/ +#include -#include -#include -#include #include -#include +#include +#include +#include #include - -#include +#include namespace boost { namespace gil { +// Definitions of 1D fixed-size and variable-size kernels and related operations + namespace detail { /// \brief kernel adaptor for one-dimensional cores @@ -80,7 +71,7 @@ class kernel_1d_fixed : public detail::kernel_1d_adaptor > { public: kernel_1d_fixed() {} explicit kernel_1d_fixed(std::size_t center_in) : parent_t(center_in) {} - + template explicit kernel_1d_fixed(FwdIterator elements, std::size_t center_in) : parent_t(center_in) { detail::copy_n(elements,Size,this->begin()); @@ -97,7 +88,6 @@ inline Kernel reverse_kernel(const Kernel& kernel) { return result; } +}} // namespace boost::gil -} } // namespace boost::gil - -#endif // BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP +#endif diff --git a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp index 2950480943..cc055f39b1 100644 --- a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp +++ b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp @@ -1,38 +1,29 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_PIXEL_NUMERIC_OPERATIONS_HPP #define BOOST_GIL_EXTENSION_NUMERIC_PIXEL_NUMERIC_OPERATIONS_HPP -/*! -/// \file -/// \brief Structures for pixel-wise numeric operations -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -/// Currently defined structures: -/// pixel_plus_t (+), pixel_minus_t (-) -/// pixel_multiplies_scalar_t (*), pixel_divides_scalar_t (/) -/// pixel_halves_t (/=2), pixel_zeros_t (=0) -/// pixel_assigns_t (=) -*/ - -#include +#include -#include #include +#include -#include +#include namespace boost { namespace gil { +// Structures for pixel-wise numeric operations +// Currently defined structures: +// pixel_plus_t (+), pixel_minus_t (-) +// pixel_multiplies_scalar_t (*), pixel_divides_scalar_t (/) +// pixel_halves_t (/=2), pixel_zeros_t (=0) +// pixel_assigns_t (=) + /// \ingroup PixelNumericOperations /// \brief construct for adding two pixels template ::type, Scalar, - typename channel_type::type>(), + typename channel_type::type>(), std::placeholders::_1, s)); return result; } @@ -178,6 +169,6 @@ struct pixel_assigns_t { } }; -} } // namespace boost::gil +}} // namespace boost::gil -#endif // BOOST_GIL_EXTENSION_NUMERIC_PIXEL_NUMERIC_OPERATIONS_HPP +#endif diff --git a/include/boost/gil/extension/numeric/resample.hpp b/include/boost/gil/extension/numeric/resample.hpp index ec619d57a1..e2e63a11e0 100644 --- a/include/boost/gil/extension/numeric/resample.hpp +++ b/include/boost/gil/extension/numeric/resample.hpp @@ -1,35 +1,24 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_RESAMPLE_HPP #define BOOST_GIL_EXTENSION_NUMERIC_RESAMPLE_HPP -#include -#include - -#include - #include +#include -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief support for generic image resampling -/// NOTE: The code is for example use only. It is not optimized for performance -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include namespace boost { namespace gil { +// Support for generic image resampling +// NOTE: The code is for example use only. It is not optimized for performance + /////////////////////////////////////////////////////////////////////////// //// //// resample_pixels: set each pixel in the destination view as the result of a sampling function over the transformed coordinates of the source view @@ -61,7 +50,7 @@ void resample_pixels(const SrcView& src_view, const DstView& dst_view, const Map /////////////////////////////////////////////////////////////////////////// //// -//// resample_pixels when one or both image views are run-time instantiated. +//// resample_pixels when one or both image views are run-time instantiated. //// /////////////////////////////////////////////////////////////////////////// @@ -72,8 +61,8 @@ namespace detail { Sampler _sampler; resample_pixels_fn(const MapFn& dst_to_src, const Sampler& sampler) : _dst_to_src(dst_to_src), _sampler(sampler) {} - template BOOST_FORCEINLINE void apply_compatible(const SrcView& src, const DstView& dst) const { - resample_pixels(src, dst, _dst_to_src, _sampler); + template BOOST_FORCEINLINE void apply_compatible(const SrcView& src, const DstView& dst) const { + resample_pixels(src, dst, _dst_to_src, _sampler); } }; } @@ -97,7 +86,7 @@ void resample_pixels(const V1& src, const any_image_view& dst, const Map /// \brief resample_pixels when both the source and the destination are run-time specified /// If invoked on incompatible views, throws std::bad_cast() /// \ingroup ImageAlgorithms -template +template void resample_pixels(const any_image_view& src, const any_image_view& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) { apply_operation(src,dst,detail::resample_pixels_fn(dst_to_src,sampler)); } @@ -111,8 +100,8 @@ void resample_pixels(const any_image_view& src, const any_image_view -void resample_subimage(const SrcMetaView& src, const DstMetaView& dst, +template +void resample_subimage(const SrcMetaView& src, const DstMetaView& dst, double src_min_x, double src_min_y, double src_max_x, double src_max_y, double angle, const Sampler& sampler=Sampler()) { @@ -121,8 +110,8 @@ void resample_subimage(const SrcMetaView& src, const DstMetaView& dst, double dst_width = std::max((double)(dst.width()-1),1); double dst_height = std::max((double)(dst.height()-1),1); - matrix3x2 mat = - matrix3x2::get_translate(-dst_width/2.0, -dst_height/2.0) * + matrix3x2 mat = + matrix3x2::get_translate(-dst_width/2.0, -dst_height/2.0) * matrix3x2::get_scale(src_width / dst_width, src_height / dst_height)* matrix3x2::get_rotate(-angle)* matrix3x2::get_translate(src_min_x + src_width/2.0, src_min_y + src_height/2.0); @@ -135,7 +124,7 @@ void resample_subimage(const SrcMetaView& src, const DstMetaView& dst, //// /////////////////////////////////////////////////////////////////////////// -template +template void resize_view(const SrcMetaView& src, const DstMetaView& dst, const Sampler& sampler=Sampler()) { resample_subimage(src,dst,0.0,0.0,(double)src.width(),(double)src.height(),0.0,sampler); } diff --git a/include/boost/gil/extension/numeric/sampler.hpp b/include/boost/gil/extension/numeric/sampler.hpp index 494611a314..c4da3e3205 100644 --- a/include/boost/gil/extension/numeric/sampler.hpp +++ b/include/boost/gil/extension/numeric/sampler.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). -*/ - -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_NUMERIC_SAMPLER_HPP #define BOOST_GIL_EXTENSION_NUMERIC_SAMPLER_HPP -#include - #include - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Nearest-neighbor and bilinear image samplers. -/// NOTE: The code is for example use only. It is not optimized for performance -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include namespace boost { namespace gil { +// Nearest-neighbor and bilinear image samplers. +// NOTE: The code is for example use only. It is not optimized for performance + /////////////////////////////////////////////////////////////////////////// //// //// resample_pixels: set each pixel in the destination view as the result of a sampling function over the transformed coordinates of the source view @@ -96,7 +85,7 @@ struct add_dst_mul_src { }; } // namespace detail -/// \brief A sampler that sets the destination pixel as the bilinear interpolation of the four closest pixels from the source. +/// \brief A sampler that sets the destination pixel as the bilinear interpolation of the four closest pixels from the source. /// If outside the bounds, it doesn't change the destination /// \ingroup ImageAlgorithms struct bilinear_sampler {}; @@ -109,7 +98,7 @@ bool sample(bilinear_sampler, const SrcView& src, const point2& p, DstP& resu point2 p0(ifloor(p.x), ifloor(p.y)); // the closest integer coordinate top left from p point2 frac(p.x-p0.x, p.y-p0.y); - if (p0.x < -1 || p0.y < -1 || p0.x>=src.width() || p0.y>=src.height()) + if (p0.x < -1 || p0.y < -1 || p0.x>=src.width() || p0.y>=src.height()) { return false; } @@ -194,7 +183,6 @@ bool sample(bilinear_sampler, const SrcView& src, const point2& p, DstP& resu return true; } -} // namespace gil -} // namespace boost +}} // namespace boost::gil -#endif // BOOST_GIL_EXTENSION_NUMERIC_SAMPLER_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_converters.hpp b/include/boost/gil/extension/toolbox/color_converters.hpp index 5286ac14d6..6f1a0dcb33 100644 --- a/include/boost/gil/extension/toolbox/color_converters.hpp +++ b/include/boost/gil/extension/toolbox/color_converters.hpp @@ -1,25 +1,14 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file color_converters.hpp -/// \brief Color converters for toolbox extension. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp b/include/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp index 1cfc873ac6..7890eb03f5 100644 --- a/include/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp +++ b/include/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_GRAY_TO_RGBA_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_GRAY_TO_RGBA_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost{ namespace gil { @@ -42,8 +31,6 @@ struct default_color_converter_impl } }; -} // namespace gil -} // namespace boost - -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_GRAY_TO_RGBA_HPP +}} // namespace boost::gil +#endif diff --git a/include/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp b/include/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp index e4daa6570b..ccce774e48 100644 --- a/include/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp +++ b/include/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost{ namespace gil { namespace detail { @@ -40,4 +29,4 @@ struct rgb_to_luminance_fn< double, double, double, GrayChannelValue > } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces.hpp b/include/boost/gil/extension/toolbox/color_spaces.hpp index acb3a9dea3..d34af0b64a 100644 --- a/include/boost/gil/extension/toolbox/color_spaces.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file color_spaces.hpp -/// \brief Color spaces for toolbox extension. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include @@ -26,4 +15,4 @@ #include #include -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/cmyka.hpp b/include/boost/gil/extension/toolbox/color_spaces/cmyka.hpp index e6c3572b92..8631aa6656 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/cmyka.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/cmyka.hpp @@ -1,30 +1,20 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_CMYKA_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_CMYKA_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file cmyka.hpp -/// \brief Support for cmyka color space. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include #include - #include +#include #include +#include + namespace boost{ namespace gil { /// \ingroup ColorSpaceModel @@ -49,8 +39,8 @@ GIL_DEFINE_ALL_TYPEDEFS(32f, float32_t, cmyka) // void operator()(const P1& src, P2& dst) const { // typedef typename channel_type::type T1; // default_color_converter_impl()( -// pixel(channel_multiply(get_color(src,cyan_t()), get_color(src,alpha_t())), -// channel_multiply(get_color(src,magenta_t()),get_color(src,alpha_t())), +// pixel(channel_multiply(get_color(src,cyan_t()), get_color(src,alpha_t())), +// channel_multiply(get_color(src,magenta_t()),get_color(src,alpha_t())), // channel_multiply(get_color(src,yellow_t()), get_color(src,alpha_t())), // channel_multiply(get_color(src,black_t()), get_color(src,alpha_t()))) // ,dst); @@ -62,8 +52,8 @@ struct default_color_converter_impl { void operator()(const P1& src, P2& dst) const { typedef typename channel_type::type T1; default_color_converter_impl()( - pixel(get_color(src,cyan_t()), - get_color(src,magenta_t()), + pixel(get_color(src,cyan_t()), + get_color(src,magenta_t()), get_color(src,yellow_t()), get_color(src,black_t())) ,dst); @@ -83,4 +73,4 @@ struct default_color_converter_impl { } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_CMYKA_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp b/include/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp index 2cb80c4ae3..0ada701a44 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp @@ -1,30 +1,20 @@ -/* - Copyright 2012 Andreas Pokorny - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Andreas Pokorny +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_GRAY_ALPHA_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_GRAY_ALPHA_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file gray_alpha.hpp -/// \brief Support for gray_alpha color space. -/// \author Andreas Pokorny \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - #include #include #include +#include +#include + namespace boost{ namespace gil { typedef mpl::vector2 gray_alpha_t; @@ -72,15 +62,15 @@ struct default_color_converter_impl { void operator()(const P1& src, P2& dst) const { get_color(dst,red_t()) = channel_convert::type>( - channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); get_color(dst,green_t()) = channel_convert::type>( - channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); get_color(dst,blue_t()) = channel_convert::type>( - channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); } }; @@ -92,7 +82,7 @@ struct default_color_converter_impl { void operator()(const P1& src, P2& dst) const { get_color(dst,gray_color_t()) = channel_convert::type>( - channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) ); } }; @@ -100,4 +90,4 @@ struct default_color_converter_impl { } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_GRAY_ALPHA_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/hsl.hpp b/include/boost/gil/extension/toolbox/color_spaces/hsl.hpp index d5fb48e3f4..a2e6a1e040 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/hsl.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/hsl.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSL_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSL_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file hsl.hpp -/// \brief Support for HSL color space -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost{ namespace gil { @@ -265,4 +254,4 @@ struct default_color_converter_impl } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSL_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/hsv.hpp b/include/boost/gil/extension/toolbox/color_spaces/hsv.hpp index b2e99ec981..823755057c 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/hsv.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/hsv.hpp @@ -1,28 +1,22 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file hsv.hpp -/// \brief Support for HSV color space -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include +#include + +#include +#include + namespace boost{ namespace gil { /// \addtogroup ColorNameModel @@ -234,4 +228,4 @@ struct default_color_converter_impl } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/lab.hpp b/include/boost/gil/extension/toolbox/color_spaces/lab.hpp index 140c79f763..ec5d955d31 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/lab.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/lab.hpp @@ -1,27 +1,19 @@ -/* - Copyright 2012 Chung-Lin Wen - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Chung-Lin Wen +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_LAB_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_LAB_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file lab.hpp -/// \brief Support for CIE Lab color space -/// \author Chung-Lin Wen \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include // FIXME: Include what you use, not everything, even in extensions! #include +#include // FIXME: Include what you use, not everything, even in extensions! + +#include + namespace boost{ namespace gil { /// \addtogroup ColorNameModel @@ -175,4 +167,4 @@ struct default_color_converter_impl } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_LAB_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/color_spaces/xyz.hpp b/include/boost/gil/extension/toolbox/color_spaces/xyz.hpp index a9973adf82..637002d81d 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/xyz.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/xyz.hpp @@ -1,26 +1,17 @@ -/* - Copyright 2012 Chung-Lin Wen, Davide Anastasia - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Chung-Lin Wen, Davide Anastasia +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_XYZ_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_XYZ_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file xyz.hpp -/// \brief Support for CIE XYZ color space -/// \author Chung-Lin Wen, Davide Anastasia \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include +#include + namespace boost{ namespace gil { /// \addtogroup ColorNameModel diff --git a/include/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp b/include/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp index e8e282f6a5..2021682348 100644 --- a/include/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp +++ b/include/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp @@ -1,31 +1,22 @@ -/* - Copyright 2013 Juan V. Puertos G-Cluster, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2013 Juan V. Puertos G-Cluster, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_YCBCR_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_YCBCR_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file ycbcr.hpp -/// \brief Support for ycbcr ITU.BT-601 color space -/// \author Juan V. Puertos G-Cluster 2013 \n -/// -/// \date 2013 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include // FIXME: Include what you use! -#include #include #include #include -#include -#include +#include namespace boost{ namespace gil { diff --git a/include/boost/gil/extension/toolbox/dynamic_images.hpp b/include/boost/gil/extension/toolbox/dynamic_images.hpp index 366d98b99d..17c4ca34cd 100644 --- a/include/boost/gil/extension/toolbox/dynamic_images.hpp +++ b/include/boost/gil/extension/toolbox/dynamic_images.hpp @@ -1,29 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file dynamic_images.hpp -/// \brief Generic io functions for dealing with dynamic images. -/// \author Hailin Jin, Lubomir Bourdev, and Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include namespace boost { namespace gil { @@ -119,7 +107,6 @@ struct color_space_type< any_image_pixel_t > typedef any_image_color_space_t type; }; +}} // namespace boost::gil -} } // namespace boost::gil - -#endif // BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/image_types.hpp b/include/boost/gil/extension/toolbox/image_types.hpp index 94d52fad63..4d21f1f7c4 100644 --- a/include/boost/gil/extension/toolbox/image_types.hpp +++ b/include/boost/gil/extension/toolbox/image_types.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file image_types.hpp -/// \brief Image Types for toolbox extension. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/image_types/indexed_image.hpp b/include/boost/gil/extension/toolbox/image_types/indexed_image.hpp index c413f67533..01af3d7bb1 100644 --- a/include/boost/gil/extension/toolbox/image_types/indexed_image.hpp +++ b/include/boost/gil/extension/toolbox/image_types/indexed_image.hpp @@ -1,30 +1,23 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_INDEXED_IMAGE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_INDEXED_IMAGE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file indexed_image.hpp -/// \brief Indexed Image extension -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include + +#include +#include #include #include -#include -#include - +#include +#include namespace boost{ namespace gil { @@ -389,4 +382,4 @@ void fill_pixels( const indexed_image_view< Locator >& view } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_INDEXED_IMAGE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/image_types/subchroma_image.hpp b/include/boost/gil/extension/toolbox/image_types/subchroma_image.hpp index e98abe0f1c..10a3ba09a9 100644 --- a/include/boost/gil/extension/toolbox/image_types/subchroma_image.hpp +++ b/include/boost/gil/extension/toolbox/image_types/subchroma_image.hpp @@ -1,32 +1,24 @@ -/* - Copyright 2013 Christian Henning and Juan V. Puertos - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2013 Christian Henning and Juan V. Puertos +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_SUBCHROMA_IMAGE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_SUBCHROMA_IMAGE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file subchroma_image.hpp -/// \brief Subchroma Image extension -/// \author Christian Henning and Juan V. Puertos\n -/// -/// \date 2013 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include #include +#include #include #include -#include +#include +#include namespace boost{ namespace gil { @@ -574,4 +566,4 @@ typename subchroma_image< Pixel } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_SUBCHROMA_IMAGE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions.hpp b/include/boost/gil/extension/toolbox/metafunctions.hpp index 1912ed0023..16d7ee0184 100644 --- a/include/boost/gil/extension/toolbox/metafunctions.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file metafunctions.hpp -/// \brief Header for toolbox's metafunctions. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include #include @@ -28,4 +17,4 @@ #include #include -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/channel_type.hpp b/include/boost/gil/extension/toolbox/metafunctions/channel_type.hpp index 13550b43e3..a2489a7cc6 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/channel_type.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/channel_type.hpp @@ -1,42 +1,29 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_CHANNEL_TYPE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_CHANNEL_TYPE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file channel_type.hpp -/// \brief channel_type metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include +#include +#include +#include #include #include -#include - -#include -#include +#include +#include namespace boost{ namespace gil { /// channel_type metafunction -/// \brief Generates the channel type for +/// \brief Generates the channel type for -template +template struct gen_chan_ref { typedef packed_dynamic_channel_reference< B @@ -45,25 +32,25 @@ struct gen_chan_ref > type; }; -//! This implementation works for bit_algined_pixel_reference -//! with a homogeneous channel layout. -//! The result type will be a packed_dynamic_channel_reference, since the -//! offset info will be missing. +//! This implementation works for bit_algined_pixel_reference +//! with a homogeneous channel layout. +//! The result type will be a packed_dynamic_channel_reference, since the +//! offset info will be missing. // bit_aligned_pixel_reference -template -struct channel_type< bit_aligned_pixel_reference > +template +struct channel_type< bit_aligned_pixel_reference > : lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > > , gen_chan_ref< B, C, L, M > > {}; -template -struct channel_type > +template +struct channel_type > : lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > > , gen_chan_ref< B, C, L, M > > {}; -template +template struct gen_chan_ref_p { typedef packed_dynamic_channel_reference< B @@ -92,8 +79,8 @@ struct channel_type< packed_pixel< BitField > > {}; -template -struct channel_type< const packed_pixel< B, C, L > > +template +struct channel_type< const packed_pixel< B, C, L > > : lazy_enable_if< is_homogeneous > , gen_chan_ref_p< B, C, L > > @@ -108,4 +95,4 @@ struct channel_type< any_image_pixel_t > } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_CHANNEL_TYPE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/channel_view.hpp b/include/boost/gil/extension/toolbox/metafunctions/channel_view.hpp index 4d42ff3ac1..454155b05d 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/channel_view.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/channel_view.hpp @@ -1,23 +1,12 @@ -/* - Copyright 2010 Fabien Castan, 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_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP_INCLUDED -#define BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP_INCLUDED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file channel_view.hpp -/// \brief Helper to generate channel_view type. -/// \author Fabien Castan, Christian Henning \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2010 Fabien Castan, Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP +#define BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP #include @@ -76,4 +65,4 @@ typename channel_view_type< Channel } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP_INCLUDED +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp b/include/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp index 08318a768f..3721c4939b 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_NUM_BITS_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_NUM_BITS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file get_num_bits.hpp -/// \brief get_num_bits metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include @@ -61,7 +50,7 @@ struct get_num_bits< const packed_channel_value< N > > : mpl::int_< N > template< typename T > struct get_num_bits< T - , typename enable_if< mpl::and_< is_integral< T > + , typename enable_if< mpl::and_< is_integral< T > , mpl::not_< is_class< T > > > >::type @@ -71,4 +60,4 @@ struct get_num_bits< T } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_NUM_BITS_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp b/include/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp index dc0876c1ae..59710c3079 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file get_pixel_type.hpp -/// \brief get_pixel_type metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include namespace boost{ namespace gil { /// get_pixel_type metafunction -/// \brief Depending on Image this function generates either +/// \brief Depending on Image this function generates either /// the pixel type or the reference type in case /// the image is bit_aligned. template< typename View > @@ -43,4 +32,4 @@ struct get_pixel_type< any_image_view< ImageViewTypes > > } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp b/include/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp deleted file mode 100644 index 927a2194c7..0000000000 --- a/include/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2010 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED -#define BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Definitions of is_bit_aligned, is_homogeneous, and is_similar metafunctions and -/// some other goodies. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - - -#include - -#include - -namespace boost { namespace gil { - - -/// other goodies - - - - - -} // namespace gil -} // namespace boost - -#endif // BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED diff --git a/include/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp b/include/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp index 369f8cbab5..87a7e8a8f3 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_BIT_ALIGNED_TYPE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_BIT_ALIGNED_TYPE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file is_bit_aligned.hpp -/// \brief is_bit_aligned metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost{ namespace gil { @@ -29,19 +18,19 @@ namespace boost{ namespace gil { template< typename PixelRef > struct is_bit_aligned : mpl::false_{}; -template +template struct is_bit_aligned > : mpl::true_{}; -template +template struct is_bit_aligned > : mpl::true_{}; -template +template struct is_bit_aligned > : mpl::true_{}; -template +template struct is_bit_aligned > : mpl::true_{}; } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_BIT_ALIGNED_TYPE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp b/include/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp index 9770d2bb2b..586afa44f1 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_HOMOGENEOUS_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_HOMOGENEOUS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file is_homogeneous.hpp -/// \brief is_homogeneous metafunction -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - #include +#include +#include namespace boost{ namespace gil { @@ -58,8 +47,8 @@ struct is_homogeneous_impl_p {}; // for packed_pixel template -struct is_homogeneous > - : is_homogeneous_impl_p< C +struct is_homogeneous > + : is_homogeneous_impl_p< C , typename mpl::at_c< C, 0 >::type , 1 , mpl::size< C >::type::value @@ -68,8 +57,8 @@ struct is_homogeneous > template< typename B , typename C , typename L - > -struct is_homogeneous< const packed_pixel< B, C, L > > + > +struct is_homogeneous< const packed_pixel< B, C, L > > : is_homogeneous_impl_p< C , typename mpl::at_c::type , 1 @@ -77,17 +66,17 @@ struct is_homogeneous< const packed_pixel< B, C, L > > > {}; // for bit_aligned_pixel_reference -template -struct is_homogeneous > +template +struct is_homogeneous > : is_homogeneous_impl::type,1,mpl::size::type::value> {}; -template -struct is_homogeneous > +template +struct is_homogeneous > : is_homogeneous_impl::type,1,mpl::size::type::value> {}; } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_HOMOGENEOUS_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/is_similar.hpp b/include/boost/gil/extension/toolbox/metafunctions/is_similar.hpp index 74af5c915d..9ac2fbd0bb 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/is_similar.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/is_similar.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file is_similar.hpp -/// \brief is_similar metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include namespace boost{ namespace gil { @@ -40,4 +29,4 @@ struct is_similar< packed_channel_reference< B, I, S, M > } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp b/include/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp index cff9a49bb7..709b4d9954 100644 --- a/include/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp +++ b/include/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp @@ -1,35 +1,24 @@ -/* - Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file pixel_bit_size.hpp -/// \brief pixel_bit_size metafunction. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - #include #include +#include +#include + namespace boost{ namespace gil { /// pixel_bit_size metafunctions /// \brief Accumulates the all channel size. -/// +/// /// \code /// typedef bit_aligned_image5_type< 16, 16, 16, 8, 8, devicen_layout_t< 5 > >::type image_t; /// const int size = pixel_bit_size::value; @@ -37,19 +26,19 @@ namespace boost{ namespace gil { template< typename PixelRef > struct pixel_bit_size : mpl::int_<0> {}; -template +template struct pixel_bit_size > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus >::type::value >{}; -template +template struct pixel_bit_size > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus >::type::value >{}; -template +template struct pixel_bit_size > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus >::type::value >{}; -template +template struct pixel_bit_size > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus >::type::value >{}; } // namespace gil } // namespace boost -#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP +#endif diff --git a/include/boost/gil/extension/toolbox/toolbox.hpp b/include/boost/gil/extension/toolbox/toolbox.hpp index 07f10736db..557af11c9e 100644 --- a/include/boost/gil/extension/toolbox/toolbox.hpp +++ b/include/boost/gil/extension/toolbox/toolbox.hpp @@ -1,29 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP #define BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file toolbox.hpp -/// \brief Main header for toolbox extension. -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include +#include #include #include -#include - -#endif // BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP +#endif diff --git a/include/boost/gil/gil_all.hpp b/include/boost/gil/gil_all.hpp deleted file mode 100644 index 5092d9e987..0000000000 --- a/include/boost/gil/gil_all.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_ALL_HPP -#define GIL_ALL_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Includes all GIL files for convenience -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "channel_algorithm.hpp" -#include "algorithm.hpp" -#include "pixel.hpp" -#include "packed_pixel.hpp" -#include "planar_pixel_reference.hpp" -#include "planar_pixel_iterator.hpp" -#include "pixel_iterator_adaptor.hpp" -#include "step_iterator.hpp" -#include "iterator_from_2d.hpp" -#include "image.hpp" -#include "image_view_factory.hpp" -#include "typedefs.hpp" -#include "metafunctions.hpp" -#include "color_convert.hpp" -#include "device_n.hpp" -#include "virtual_locator.hpp" -#include "bit_aligned_pixel_iterator.hpp" -// Uncomment this line to help in porting your code from an older version of GIL -//#include "deprecated.hpp" - -#endif diff --git a/include/boost/gil/gray.hpp b/include/boost/gil/gray.hpp index 89cb212c48..e27ca17bcb 100644 --- a/include/boost/gil/gray.hpp +++ b/include/boost/gil/gray.hpp @@ -1,30 +1,18 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_GRAY_H -#define GIL_GRAY_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for grayscale color space and variants -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on March 8, 2006 -//////////////////////////////////////////////////////////////////////////////////////// - -#include "utilities.hpp" -#include +// +// 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 +// +#ifndef BOOST_GIL_GRAY_HPP +#define BOOST_GIL_GRAY_HPP + #include #include +#include + +#include namespace boost { namespace gil { diff --git a/include/boost/gil/image.hpp b/include/boost/gil/image.hpp index 7b759e955b..c1b2f106a1 100644 --- a/include/boost/gil/image.hpp +++ b/include/boost/gil/image.hpp @@ -1,45 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_IMAGE_H -#define GIL_IMAGE_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Templated image -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include +// +// 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 +// +#ifndef BOOST_GIL_IMAGE_HPP +#define BOOST_GIL_IMAGE_HPP + +#include +#include +#include +#include #include #include -#include - -#include "image_view.hpp" -#include "metafunctions.hpp" -#include "algorithm.hpp" +#include +#include namespace boost { namespace gil { -//#ifdef _MSC_VER -//#pragma warning(push) -//#pragma warning(disable : 4244) // conversion from 'gil::image::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) -//#endif - //////////////////////////////////////////////////////////////////////////////////////// /// \ingroup ImageModel PixelBasedModel /// \brief container interface over image view. Models ImageConcept, PixelBasedConcept @@ -501,10 +482,6 @@ struct channel_mapping_type > : public channel_mappi template struct is_planar > : public mpl::bool_ {}; -//#ifdef _MSC_VER -//#pragma warning(pop) -//#endif - -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/image_view.hpp b/include/boost/gil/image_view.hpp index eb8ee4c257..34fd3da6fc 100644 --- a/include/boost/gil/image_view.hpp +++ b/include/boost/gil/image_view.hpp @@ -1,34 +1,17 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_IMAGE_VIEW_H -#define GIL_IMAGE_VIEW_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief image view class -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_IMAGE_VIEW_HPP +#define BOOST_GIL_IMAGE_VIEW_HPP + +#include #include #include -#include "iterator_from_2d.hpp" - -//#ifdef _MSC_VER -//#pragma warning(push) -//#pragma warning(disable : 4244) // conversion from 'gil::image::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) -//#endif namespace boost { namespace gil { @@ -245,10 +228,6 @@ struct transposed_type > { typedef image_view::type> type; }; -} } // namespace boost::gil - -//#ifdef _MSC_VER -//#pragma warning(pop) -//#endif +}} // namespace boost::gil #endif diff --git a/include/boost/gil/image_view_factory.hpp b/include/boost/gil/image_view_factory.hpp index 2c5fe0a566..de5dc1a51e 100644 --- a/include/boost/gil/image_view_factory.hpp +++ b/include/boost/gil/image_view_factory.hpp @@ -1,34 +1,23 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_IMAGE_VIEW_FACTORY_HPP -#define GIL_IMAGE_VIEW_FACTORY_HPP - -/*! -/// \file -/// \brief Methods for constructing image views from raw data or other image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on March 9, 2007 -/// Methods for creating shallow image views from raw pixel data or from other image views - -/// flipping horizontally or vertically, axis-aligned rotation, a subimage, subsampled -/// or n-th channel image view. Derived image views are shallow copies and are fast to construct. -*/ +// +// 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 +// +#ifndef BOOST_GIL_IMAGE_VIEW_FACTORY_HPP +#define BOOST_GIL_IMAGE_VIEW_FACTORY_HPP + +#include +#include +#include #include #include -#include "metafunctions.hpp" -#include "gray.hpp" -#include "color_convert.hpp" + +/// Methods for creating shallow image views from raw pixel data or from other image views - +/// flipping horizontally or vertically, axis-aligned rotation, a subimage, subsampled +/// or n-th channel image view. Derived image views are shallow copies and are fast to construct. /// \defgroup ImageViewConstructors Image View From Raw Data /// \ingroup ImageViewAlgorithm diff --git a/include/boost/gil/io/base.hpp b/include/boost/gil/io/base.hpp index fddfa45c8e..9748cfcfc5 100644 --- a/include/boost/gil/io/base.hpp +++ b/include/boost/gil/io/base.hpp @@ -1,46 +1,34 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_BASE_HPP #define BOOST_GIL_IO_BASE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#include -#include +#include -#include -#include #include #include +#include +#include +#include +#include -#include +#include +#include -#include -#include +#include +#include +#include namespace boost { namespace gil { struct format_tag {}; -template< typename Property > +template< typename Property > struct property_base { typedef Property type; @@ -84,11 +72,11 @@ struct image_read_settings_base }; /** - * Boolean meta function, mpl::true_ if the pixel type \a PixelType is supported + * Boolean meta function, mpl::true_ if the pixel type \a PixelType is supported * by the image format identified with \a FormatTag. * \todo the name is_supported is to generic, pick something more IO realted. */ -// Depending on image type the parameter Pixel can be a reference type +// Depending on image type the parameter Pixel can be a reference type // for bit_aligned images or a pixel for byte images. template< typename Pixel, typename FormatTag > struct is_read_supported {}; template< typename Pixel, typename FormatTag > struct is_write_supported {}; @@ -96,7 +84,7 @@ template< typename Pixel, typename FormatTag > struct is_write_supported {}; namespace detail { -template< typename Property > +template< typename Property > struct property_base { typedef Property type; diff --git a/include/boost/gil/io/bit_operations.hpp b/include/boost/gil/io/bit_operations.hpp index 245c7458d2..8b0e98ad9c 100644 --- a/include/boost/gil/io/bit_operations.hpp +++ b/include/boost/gil/io/bit_operations.hpp @@ -1,24 +1,13 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_BIT_OPERATIONS_HPP #define BOOST_GIL_IO_BIT_OPERATIONS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include @@ -107,7 +96,7 @@ struct mirror_bits< Buffer return result; } - + private: bool _apply_operation; diff --git a/include/boost/gil/io/conversion_policies.hpp b/include/boost/gil/io/conversion_policies.hpp index 079e478ee2..d419aab6f1 100644 --- a/include/boost/gil/io/conversion_policies.hpp +++ b/include/boost/gil/io/conversion_policies.hpp @@ -1,31 +1,21 @@ -/* - Copyright 2007-2008 Andreas Pokorny, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny +// +// 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 +// #ifndef BOOST_GIL_IO_CONVERSION_POLICIES_HPP #define BOOST_GIL_IO_CONVERSION_POLICIES_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Andreas Pokorny, Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include namespace boost{namespace gil{ namespace detail { -struct read_and_no_convert +struct read_and_no_convert { public: typedef void* color_converter_type; @@ -38,7 +28,7 @@ struct read_and_no_convert , OutIterator /* out */ , typename disable_if< typename pixels_are_compatible< typename std::iterator_traits::value_type , typename std::iterator_traits::value_type - >::type + >::type >::type* /* ptr */ = 0 ) { @@ -53,7 +43,7 @@ struct read_and_no_convert , OutIterator out , typename enable_if< typename pixels_are_compatible< typename std::iterator_traits::value_type , typename std::iterator_traits::value_type - >::type + >::type >::type* /* ptr */ = 0 ) { diff --git a/include/boost/gil/io/device.hpp b/include/boost/gil/io/device.hpp index 24f9ff4ae6..7f180120ac 100644 --- a/include/boost/gil/io/device.hpp +++ b/include/boost/gil/io/device.hpp @@ -1,40 +1,28 @@ -/* - Copyright 2007-2012 Andreas Pokorny, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny +// +// 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 +// #ifndef BOOST_GIL_IO_DEVICE_HPP #define BOOST_GIL_IO_DEVICE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Andreas Pokorny, Christian Henning \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include +#include #include #include -#include +#include #include namespace boost { namespace gil { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif - namespace detail { template < typename T > struct buff_item @@ -47,7 +35,6 @@ template <> struct buff_item< void > static const unsigned int size = 1; }; - /*! * Implements the IODevice concept c.f. to \ref IODevice required by Image libraries like * libjpeg and libpng. @@ -307,7 +294,7 @@ class file_stream_device ); return pos; - } + } void flush() { @@ -340,7 +327,7 @@ class file_stream_device { fclose( file ); } - } + } private: @@ -744,9 +731,9 @@ struct is_dynamic_image_writer< dynamic_image_writer< Device } // namespace detail -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace gil } // namespace boost diff --git a/include/boost/gil/io/dynamic_io_new.hpp b/include/boost/gil/io/dynamic_io_new.hpp index 47632283e1..79ec66f48e 100644 --- a/include/boost/gil/io/dynamic_io_new.hpp +++ b/include/boost/gil/io/dynamic_io_new.hpp @@ -1,28 +1,19 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - +// +// 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 +// #ifndef BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP #define BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP -/// \file -/// \brief Generic io functions for dealing with dynamic images -// -/// \author Hailin Jin and Lubomir Bourdev \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated May 30, 2006 +#include + +#include #include #include -#include -#include namespace boost { namespace gil { diff --git a/include/boost/gil/io/error.hpp b/include/boost/gil/io/error.hpp index 4920e8fc05..074cdf3bbe 100644 --- a/include/boost/gil/io/error.hpp +++ b/include/boost/gil/io/error.hpp @@ -1,36 +1,25 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_ERROR_HPP #define BOOST_GIL_IO_ERROR_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2010 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - namespace boost { namespace gil { -inline +inline void io_error( const char* descr ) { throw std::ios_base::failure( descr ); } -inline +inline void io_error_if( bool expr, const char* descr ) { - if( expr ) + if( expr ) io_error( descr ); } diff --git a/include/boost/gil/io/get_read_device.hpp b/include/boost/gil/io/get_read_device.hpp index 547fbb7cb8..70e4064f51 100644 --- a/include/boost/gil/io/get_read_device.hpp +++ b/include/boost/gil/io/get_read_device.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_GET_READ_DEVICE_HPP #define BOOST_GIL_IO_GET_READ_DEVICE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include -#include -#include - namespace boost { namespace gil { template< typename T diff --git a/include/boost/gil/io/get_reader.hpp b/include/boost/gil/io/get_reader.hpp index 858e86583b..4222bf929a 100644 --- a/include/boost/gil/io/get_reader.hpp +++ b/include/boost/gil/io/get_reader.hpp @@ -1,25 +1,14 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_GET_READER_HPP #define BOOST_GIL_IO_GET_READER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "get_read_device.hpp" +#include namespace boost { namespace gil { diff --git a/include/boost/gil/io/get_write_device.hpp b/include/boost/gil/io/get_write_device.hpp index 638e595093..189dea773d 100644 --- a/include/boost/gil/io/get_write_device.hpp +++ b/include/boost/gil/io/get_write_device.hpp @@ -1,28 +1,18 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_GET_WRITE_DEVICE_HPP #define BOOST_GIL_IO_GET_WRITE_DEVICE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include -#include -#include namespace boost { namespace gil { diff --git a/include/boost/gil/io/get_writer.hpp b/include/boost/gil/io/get_writer.hpp index 85ef72b71a..d693043499 100644 --- a/include/boost/gil/io/get_writer.hpp +++ b/include/boost/gil/io/get_writer.hpp @@ -1,25 +1,14 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_GET_WRITER_HPP #define BOOST_GIL_IO_GET_WRITER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include "get_write_device.hpp" +#include namespace boost { namespace gil { diff --git a/include/boost/gil/io/io.hpp b/include/boost/gil/io/io.hpp index f581e3a245..86c32e7541 100644 --- a/include/boost/gil/io/io.hpp +++ b/include/boost/gil/io/io.hpp @@ -1,35 +1,24 @@ -/* - Copyright 2007-2008 Christian Henning, Andreas Pokorny - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning, Andreas Pokorny +// +// 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 +// #ifndef BOOST_GIL_IO_IO_HPP #define BOOST_GIL_IO_IO_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -/*! +/*! * \page iobackend Adding a new io backend * \section Overview of backend requirements * To add support for a new IO backend the following is required: * - a format tag, to identify the image format, derived from boost::gil::format_tag - * - boolean meta function is_supported must be implemented for + * - boolean meta function is_supported must be implemented for * the new format tag * - explicit specialisation of image_read_info must be provided, containing * runtime information available before/at reading the image - * - explicit specialisation of image_write_info must be provided, containing - * runtime encoding parameters for writing an image + * - explicit specialisation of image_write_info must be provided, containing + * runtime encoding parameters for writing an image * - An image reader must be specialized: * \code * template @@ -37,7 +26,7 @@ * { * reader( IODevice & device ) * reader( IODevice & device, typename ConversionPolicy::color_converter_type const& cc ) - * image_read_info get_info(); + * image_read_info get_info(); * template * void read_image( Image &, point_t const& top_left ); * template @@ -57,28 +46,28 @@ * }; * \endcode * - * Or instead of the items above implement overloads of read_view, read_and_convert_view, read_image, + * Or instead of the items above implement overloads of read_view, read_and_convert_view, read_image, * read_and_convert_image, write_view and read_image_info. * - * \section ConversionPolicy Interface of the ConversionPolicy + * \section ConversionPolicy Interface of the ConversionPolicy * There are two different conversion policies in use, when reading images: - * read_and_convert and read_and_no_convert. ColorConverter - * can be a user defined color converter. - * - * \code + * read_and_convert and read_and_no_convert. ColorConverter + * can be a user defined color converter. + * + * \code * struct ConversionPolicy * { * template - * void read( InputIterator in_begin, InputIterator in_end, + * void read( InputIterator in_begin, InputIterator in_end, * OutputIterator out_end ); * }; * \endcode * - * Methods like read_view and read_image are supposed to bail out with an - * exception instead of converting the image + * Methods like read_view and read_image are supposed to bail out with an + * exception instead of converting the image * * \section IODevice Concept of IO Device - * A Device is simply an object used to read and write data to and from a stream. + * A Device is simply an object used to read and write data to and from a stream. * The IODevice was added as a template paramter to be able to replace the file_name * access functionality. This is only an interim solution, as soon as boost provides * a good IO library, interfaces/constraints provided by that library could be used. @@ -94,13 +83,13 @@ * \endcode * * For the time being a boolean meta function must be specialized: - * \code + * \code * namespace boost{namespace gil{namespace detail{ - * template - * struct detail::is_input_device; + * template + * struct detail::is_input_device; * }}} * \endcode - * + * */ #endif diff --git a/include/boost/gil/io/make_backend.hpp b/include/boost/gil/io/make_backend.hpp index c18775c2e6..e0a4a1f5dd 100644 --- a/include/boost/gil/io/make_backend.hpp +++ b/include/boost/gil/io/make_backend.hpp @@ -1,28 +1,18 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_BACKEND_HPP #define BOOST_GIL_IO_MAKE_BACKEND_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include "get_reader.hpp" - namespace boost { namespace gil { template< typename String @@ -63,7 +53,7 @@ make_reader_backend( const std::wstring& file_name typedef typename get_read_device< std::wstring , FormatTag >::type device_t; - + const char* str = detail::convert_to_native_string( file_name ); device_t device( str diff --git a/include/boost/gil/io/make_dynamic_image_reader.hpp b/include/boost/gil/io/make_dynamic_image_reader.hpp index 05c47d04d4..ffc9bd2735 100644 --- a/include/boost/gil/io/make_dynamic_image_reader.hpp +++ b/include/boost/gil/io/make_dynamic_image_reader.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP #define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { template< typename String diff --git a/include/boost/gil/io/make_dynamic_image_writer.hpp b/include/boost/gil/io/make_dynamic_image_writer.hpp index f4e21407dd..6610a613ed 100644 --- a/include/boost/gil/io/make_dynamic_image_writer.hpp +++ b/include/boost/gil/io/make_dynamic_image_writer.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP #define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { template< typename String diff --git a/include/boost/gil/io/make_reader.hpp b/include/boost/gil/io/make_reader.hpp index 3782e46f34..1ae2386a8f 100644 --- a/include/boost/gil/io/make_reader.hpp +++ b/include/boost/gil/io/make_reader.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_READER_HPP #define BOOST_GIL_IO_MAKE_READER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { template< typename String diff --git a/include/boost/gil/io/make_scanline_reader.hpp b/include/boost/gil/io/make_scanline_reader.hpp index c3bf6c1012..6142f52167 100644 --- a/include/boost/gil/io/make_scanline_reader.hpp +++ b/include/boost/gil/io/make_scanline_reader.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP #define BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { template< typename String diff --git a/include/boost/gil/io/make_writer.hpp b/include/boost/gil/io/make_writer.hpp index 9c266ddf65..46fe4153a5 100644 --- a/include/boost/gil/io/make_writer.hpp +++ b/include/boost/gil/io/make_writer.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2012 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_MAKE_WRITER_HPP #define BOOST_GIL_IO_MAKE_WRITER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - namespace boost { namespace gil { template< typename String diff --git a/include/boost/gil/io/path_spec.hpp b/include/boost/gil/io/path_spec.hpp index 4686d7495c..09949bffb3 100644 --- a/include/boost/gil/io/path_spec.hpp +++ b/include/boost/gil/io/path_spec.hpp @@ -1,34 +1,23 @@ -/* - Copyright 2007-2008 Andreas Pokorny, 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Andreas Pokorny, Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_PATH_SPEC_HPP #define BOOST_GIL_IO_PATH_SPEC_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Andreas Pokorny, Christian Henning \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -#include - #ifdef BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #define BOOST_FILESYSTEM_VERSION 3 #include #endif // BOOST_GIL_IO_ADD_FS_PATH_SUPPORT +#include + +#include +#include + namespace boost { namespace gil { namespace detail { template struct is_supported_path_spec : mpl::false_ {}; diff --git a/include/boost/gil/io/read_and_convert_image.hpp b/include/boost/gil/io/read_and_convert_image.hpp index a1ba856bf2..1a4a81601e 100644 --- a/include/boost/gil/io/read_and_convert_image.hpp +++ b/include/boost/gil/io/read_and_convert_image.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP #define BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - #include +#include #include #include -#include + +#include +#include +#include namespace boost{ namespace gil { diff --git a/include/boost/gil/io/read_and_convert_view.hpp b/include/boost/gil/io/read_and_convert_view.hpp index 51f913eced..87bef4b135 100644 --- a/include/boost/gil/io/read_and_convert_view.hpp +++ b/include/boost/gil/io/read_and_convert_view.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP #define BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - #include +#include #include #include -#include + +#include +#include +#include namespace boost{ namespace gil { @@ -140,7 +129,7 @@ void read_and_convert_view( const String& file_name /// \param file_name File name. Must satisfy is_supported_path_spec metafunction. /// \param view The image view in which the data is read into. /// \param cc Color converter function object. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \throw std::ios_base::failure template < typename String , typename View @@ -177,7 +166,7 @@ void read_and_convert_view( const String& file_name /// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. /// \param view The image view in which the data is read into. /// \param cc Color converter function object. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \throw std::ios_base::failure template < typename Device , typename View @@ -286,7 +275,7 @@ void read_and_convert_view( Device& device /// \brief Reads and color-converts an image view. No memory is allocated. /// \param file_name File name. Must satisfy is_supported_path_spec metafunction. /// \param view The image view in which the data is read into. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \throw std::ios_base::failure template < typename String , typename View @@ -320,7 +309,7 @@ void read_and_convert_view( const String& file_name /// \brief Reads and color-converts an image view. No memory is allocated. /// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. /// \param view The image view in which the data is read into. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \throw std::ios_base::failure template < typename Device , typename View diff --git a/include/boost/gil/io/read_image.hpp b/include/boost/gil/io/read_image.hpp index 5f2b3c4681..63700846be 100644 --- a/include/boost/gil/io/read_image.hpp +++ b/include/boost/gil/io/read_image.hpp @@ -1,35 +1,24 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_READ_IMAGE_HPP #define BOOST_GIL_IO_READ_IMAGE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include - #include #include +#include #include #include -#include + +#include +#include +#include +#include namespace boost{ namespace gil { diff --git a/include/boost/gil/io/read_image_info.hpp b/include/boost/gil/io/read_image_info.hpp index a3c7e54f3e..4fe54ad012 100644 --- a/include/boost/gil/io/read_image_info.hpp +++ b/include/boost/gil/io/read_image_info.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_READ_IMAGE_INFO_HPP #define BOOST_GIL_IO_READ_IMAGE_INFO_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - #include #include #include +#include +#include +#include + namespace boost{ namespace gil { /// \ingroup IO @@ -58,7 +47,7 @@ read_image_info( Device& file /// \brief Returns the image format backend. Backend is format specific. /// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \return image_read_info object dependent on the image format. /// \throw std::ios_base::failure template< typename Device @@ -91,7 +80,7 @@ read_image_info( Device& file template< typename String , typename FormatTag > -inline +inline typename get_reader_backend< String , FormatTag >::type @@ -108,13 +97,13 @@ read_image_info( const String& file_name /// \brief Returns the image format backend. Backend is format specific. /// \param file_name File name. Must satisfy is_supported_path_spec metafunction. -/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. /// \return image_read_info object dependent on the image format. /// \throw std::ios_base::failure template< typename String , typename FormatTag > -inline +inline typename get_reader_backend< String , FormatTag >::type diff --git a/include/boost/gil/io/read_view.hpp b/include/boost/gil/io/read_view.hpp index 1a03733a3a..736dbea156 100644 --- a/include/boost/gil/io/read_view.hpp +++ b/include/boost/gil/io/read_view.hpp @@ -1,32 +1,21 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_READ_VIEW_HPP #define BOOST_GIL_IO_READ_VIEW_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include #include #include #include -#include -#include -#include - namespace boost{ namespace gil { /// \ingroup IO diff --git a/include/boost/gil/io/reader_base.hpp b/include/boost/gil/io/reader_base.hpp index 1a7966d6cf..a2100faf4e 100644 --- a/include/boost/gil/io/reader_base.hpp +++ b/include/boost/gil/io/reader_base.hpp @@ -1,30 +1,19 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_READER_BASE_HPP #define BOOST_GIL_IO_READER_BASE_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include -namespace boost { namespace gil { +namespace boost { namespace gil { /// Reader Base Class -/// +/// /// It provides some basic functionality which is shared for all readers. /// For instance, it recreates images when necessary. It checks whether /// user supplied coordinates are valid. diff --git a/include/boost/gil/io/row_buffer_helper.hpp b/include/boost/gil/io/row_buffer_helper.hpp index f9ab1e13ed..e61a76de89 100644 --- a/include/boost/gil/io/row_buffer_helper.hpp +++ b/include/boost/gil/io/row_buffer_helper.hpp @@ -1,30 +1,17 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP #define BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Helper for having one read implementation used for -/// bit_aligned and byte images. -/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - #include #include - namespace boost { namespace gil { namespace detail { template< typename Pixel @@ -67,10 +54,10 @@ struct row_buffer_helper< Pixel row_buffer_helper( std::size_t width , bool in_bytes ) - : _c( ( width + : _c( ( width * pixel_bit_size< pixel_type >::value ) - >> 3 + >> 3 ) , _r( width @@ -127,16 +114,16 @@ struct row_buffer_helper< Pixel row_buffer_helper( std::size_t width , bool in_bytes ) - : _c( ( width + : _c( ( width * num_channels< pixel_type >::type::value * channel_type< pixel_type >::type::num_bits ) - >> 3 + >> 3 ) , _r( width - * num_channels< pixel_type >::type::value - * channel_type< pixel_type >::type::num_bits + * num_channels< pixel_type >::type::value + * channel_type< pixel_type >::type::num_bits - ( _c << 3 ) ) { @@ -190,14 +177,14 @@ struct row_buffer_helper_view : row_buffer_helper< typename View::value_type > template< typename View > struct row_buffer_helper_view< View - , typename enable_if< typename is_bit_aligned< typename View::value_type + , typename enable_if< typename is_bit_aligned< typename View::value_type >::type >::type > : row_buffer_helper< typename View::reference > { row_buffer_helper_view( std::size_t width , bool in_bytes - ) + ) : row_buffer_helper< typename View::reference >( width , in_bytes ) diff --git a/include/boost/gil/io/scanline_read_iterator.hpp b/include/boost/gil/io/scanline_read_iterator.hpp index 3f812b9fa7..79cea81e27 100644 --- a/include/boost/gil/io/scanline_read_iterator.hpp +++ b/include/boost/gil/io/scanline_read_iterator.hpp @@ -1,28 +1,17 @@ -/* - Copyright 2012 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP #define BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning -/// -/// \date 2012 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include - #include namespace boost { namespace gil { diff --git a/include/boost/gil/io/typedefs.hpp b/include/boost/gil/io/typedefs.hpp index 294fb2eabd..5774d4f265 100644 --- a/include/boost/gil/io/typedefs.hpp +++ b/include/boost/gil/io/typedefs.hpp @@ -1,36 +1,25 @@ -/* - Copyright 2007-2008 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2008 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_IO_TYPEDEFS_HPP #define BOOST_GIL_IO_TYPEDEFS_HPP -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning \n -/// -/// \date 2007-2008 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include - -#include +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +#include +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA #include #include -#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA -#include -#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA +#include + +#include -namespace boost { namespace gil { +namespace boost { namespace gil { struct double_zero { static double apply() { return 0.0; } }; struct double_one { static double apply() { return 1.0; } }; @@ -43,7 +32,7 @@ typedef point2< std::ptrdiff_t > point_t; } // namespace gil } // namespace boost -namespace boost { +namespace boost { template<> struct is_floating_point : mpl::true_ {}; template<> struct is_floating_point : mpl::true_ {}; diff --git a/include/boost/gil/io/write_view.hpp b/include/boost/gil/io/write_view.hpp index 16d496ef1a..51530bfe35 100644 --- a/include/boost/gil/io/write_view.hpp +++ b/include/boost/gil/io/write_view.hpp @@ -1,24 +1,21 @@ -/* - Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev +// +// 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 +// #ifndef BOOST_GIL_IO_WRITE_VIEW_HPP #define BOOST_GIL_IO_WRITE_VIEW_HPP -#include -#include -#include -#include - #include +#include #include #include -#include + +#include +#include +#include //////////////////////////////////////////////////////////////////////////////////////// /// \file diff --git a/include/boost/gil/iterator_from_2d.hpp b/include/boost/gil/iterator_from_2d.hpp index 069598c427..7b72b05383 100644 --- a/include/boost/gil/iterator_from_2d.hpp +++ b/include/boost/gil/iterator_from_2d.hpp @@ -1,34 +1,25 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_ITERATOR_FROM_2D_HPP +#define BOOST_GIL_ITERATOR_FROM_2D_HPP + +#include +#include +#include - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_ITERATOR_FROM_2D_H -#define GIL_ITERATOR_FROM_2D_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel step iterator, pixel image iterator and pixel dereference iterator -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 18, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include -#include -#include "gil_concept.hpp" -#include "pixel_iterator.hpp" -#include "locator.hpp" namespace boost { namespace gil { +/// pixel step iterator, pixel image iterator and pixel dereference iterator + //////////////////////////////////////////////////////////////////////////////////////// /// /// ITERATOR FROM 2D ADAPTOR diff --git a/include/boost/gil/locator.hpp b/include/boost/gil/locator.hpp index 50d78f740e..160ea5bca8 100644 --- a/include/boost/gil/locator.hpp +++ b/include/boost/gil/locator.hpp @@ -1,36 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated +// +// 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 +// +#ifndef BOOST_GIL_LOCATOR_HPP +#define BOOST_GIL_LOCATOR_HPP + +#include - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_LOCATOR_H -#define GIL_LOCATOR_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel 2D locator -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n September 20, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include #include -#include "pixel_iterator.hpp" - -//////////////////////////////////////////////////////////////////////////////////////// -/// Pixel 2D LOCATOR -//////////////////////////////////////////////////////////////////////////////////////// +#include namespace boost { namespace gil { + +/// Pixel 2D locator + //forward declarations template std::ptrdiff_t memunit_step(const P*); template P* memunit_advanced(const P* p, std::ptrdiff_t diff); diff --git a/include/boost/gil/metafunctions.hpp b/include/boost/gil/metafunctions.hpp index 8640b236cd..f67cd81bbd 100644 --- a/include/boost/gil/metafunctions.hpp +++ b/include/boost/gil/metafunctions.hpp @@ -1,29 +1,16 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_METAFUNCTIONS_HPP -#define GIL_METAFUNCTIONS_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief metafunctions that construct types or return type properties -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// -/// \date 2005-2007 \n Last updated on February 6, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_METAFUNCTIONS_HPP +#define BOOST_GIL_METAFUNCTIONS_HPP + +#include +#include -#include #include #include #include @@ -34,8 +21,8 @@ #include #include #include -#include "gil_concept.hpp" -#include "channel.hpp" + +#include namespace boost { namespace gil { @@ -486,9 +473,6 @@ class derived_image_type { typedef typename image_type::type type; }; - - - -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/packed_pixel.hpp b/include/boost/gil/packed_pixel.hpp index d171ae7f80..9777f44b13 100644 --- a/include/boost/gil/packed_pixel.hpp +++ b/include/boost/gil/packed_pixel.hpp @@ -1,36 +1,27 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_PACKED_PIXEL_H -#define GIL_PACKED_PIXEL_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief A model of a heterogeneous pixel whose channels are bit ranges. For example 16-bit RGB in '565' format -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2009 \n Last updated on February 20, 2009 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_PACKED_PIXEL_HPP +#define BOOST_GIL_PACKED_PIXEL_HPP + +#include -#include #include #include #include #include -#include "pixel.hpp" + +#include namespace boost { namespace gil { +/// A model of a heterogeneous pixel whose channels are bit ranges. +/// For example 16-bit RGB in '565' format. + /// \defgroup ColorBaseModelPackedPixel packed_pixel /// \ingroup ColorBaseModel /// \brief A heterogeneous color base whose elements are reference proxies to channels in a pixel. Models ColorBaseValueConcept. This class is used to model packed pixels, such as 16-bit packed RGB. diff --git a/include/boost/gil/pixel.hpp b/include/boost/gil/pixel.hpp index 066642ab2d..ee7c5c5286 100644 --- a/include/boost/gil/pixel.hpp +++ b/include/boost/gil/pixel.hpp @@ -1,38 +1,27 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_PIXEL_H -#define GIL_PIXEL_H +// +// 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 +// +#ifndef BOOST_GIL_PIXEL_HPP +#define BOOST_GIL_PIXEL_HPP + +#include +#include +#include +#include +#include +#include -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel class and related utilities -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 28, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// - -#include #include -#include #include #include #include -#include "color_base.hpp" -#include "gil_concept.hpp" -#include "channel.hpp" -#include "metafunctions.hpp" -#include "utilities.hpp" -#include "color_base_algorithm.hpp" +#include + +#include namespace boost { namespace gil { @@ -206,10 +195,11 @@ struct channel_type > { typedef ChannelValue type; }; -} } // namespace boost::gil +}} // namespace boost::gil namespace boost { template struct has_trivial_constructor > : public has_trivial_constructor {}; } + #endif diff --git a/include/boost/gil/pixel_iterator.hpp b/include/boost/gil/pixel_iterator.hpp index d60d165b0e..c5a5e1cf36 100644 --- a/include/boost/gil/pixel_iterator.hpp +++ b/include/boost/gil/pixel_iterator.hpp @@ -1,32 +1,19 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_PIXEL_ITERATOR_H -#define GIL_PIXEL_ITERATOR_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel iterator support -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n May 16, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_PIXEL_ITERATOR_HPP +#define BOOST_GIL_PIXEL_ITERATOR_HPP + +#include +#include +#include #include #include -#include "gil_concept.hpp" -#include "utilities.hpp" -#include "pixel.hpp" namespace boost { namespace gil { diff --git a/include/boost/gil/pixel_iterator_adaptor.hpp b/include/boost/gil/pixel_iterator_adaptor.hpp index 2851205bdb..3783c5136c 100644 --- a/include/boost/gil/pixel_iterator_adaptor.hpp +++ b/include/boost/gil/pixel_iterator_adaptor.hpp @@ -1,40 +1,26 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_PIXEL_ITERATOR_ADAPTOR_H -#define GIL_PIXEL_ITERATOR_ADAPTOR_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel step iterator, pixel image iterator and pixel dereference iterator -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 16, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP +#define BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP + +#include +#include -#include #include -#include "gil_concept.hpp" -#include "pixel_iterator.hpp" -namespace boost { namespace gil { +#include +namespace boost { namespace gil { /// \defgroup PixelIteratorModelDerefPtr dereference_iterator_adaptor /// \ingroup PixelIteratorModel /// \brief An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept - /// \ingroup PixelIteratorModelDerefPtr PixelBasedModel /// \brief An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept @@ -202,6 +188,6 @@ struct iterator_add_deref,Der } }; -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/planar_pixel_iterator.hpp b/include/boost/gil/planar_pixel_iterator.hpp index 5ac10d29b5..856b3d3fbf 100644 --- a/include/boost/gil/planar_pixel_iterator.hpp +++ b/include/boost/gil/planar_pixel_iterator.hpp @@ -1,32 +1,20 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated +// +// 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 +// +#ifndef BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP +#define BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP + +#include +#include - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_PLANAR_PTR_H -#define GIL_PLANAR_PTR_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief planar pixel pointer class -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include -#include "pixel.hpp" -#include "step_iterator.hpp" namespace boost { namespace gil { //forward declaration (as this file is included in planar_pixel_reference.hpp) diff --git a/include/boost/gil/planar_pixel_reference.hpp b/include/boost/gil/planar_pixel_reference.hpp index 55f405ef63..e020650bab 100644 --- a/include/boost/gil/planar_pixel_reference.hpp +++ b/include/boost/gil/planar_pixel_reference.hpp @@ -1,42 +1,29 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://stlab.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_PLANAR_REF_H -#define GIL_PLANAR_REF_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief planar pixel reference class -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 28, 2006 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP +#define BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP + +#include +#include +#include +#include +#include #include -#include "gil_concept.hpp" -#include "color_base.hpp" -#include "channel.hpp" -#include "pixel.hpp" -#include "planar_pixel_iterator.hpp" namespace boost { namespace gil { -/// \defgroup ColorBaseModelPlanarRef planar_pixel_reference +/// \defgroup ColorBaseModelPlanarRef planar_pixel_reference /// \ingroup ColorBaseModel /// \brief A homogeneous color base whose element is a channel reference. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. /// This class is used as a reference proxy to a planar pixel. -/// \defgroup PixelModelPlanarRef planar_pixel_reference +/// \defgroup PixelModelPlanarRef planar_pixel_reference /// \ingroup PixelModel /// \brief A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. @@ -45,9 +32,9 @@ namespace boost { namespace gil { /// \brief A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept /// /// A reference to a planar pixel is a proxy class containing references to each of the corresponding channels. -/// +/// template // ChannelReference is a channel reference (const or mutable) -struct planar_pixel_reference +struct planar_pixel_reference : public detail::homogeneous_color_base,mpl::size::value> { typedef detail::homogeneous_color_base,mpl::size::value> parent_t; private: @@ -63,7 +50,7 @@ struct planar_pixel_reference planar_pixel_reference(ChannelReference v0, ChannelReference v1) : parent_t(v0,v1) {} planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2) : parent_t(v0,v1,v2) {} planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3) : parent_t(v0,v1,v2,v3) {} - planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4) : parent_t(v0,v1,v2,v3,v4) {} +planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4) : parent_t(v0,v1,v2,v3,v4) {} planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4, ChannelReference v5) : parent_t(v0,v1,v2,v3,v4,v5) {} template planar_pixel_reference(const P& p) : parent_t(p) { check_compatible

();} @@ -160,7 +147,7 @@ struct channel_type > { typedef typename channel_traits::value_type type; }; -} } // namespace boost::gil +}} // namespace boost::gil namespace std { // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified. @@ -177,7 +164,6 @@ void swap(const boost::gil::planar_pixel_reference x, R& y) { boost::gil::swap_proxy::value_type>(x,y); } - /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline @@ -185,13 +171,13 @@ void swap(typename boost::gil::planar_pixel_reference::value_type& x, con boost::gil::swap_proxy::value_type>(x,y); } - /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(const boost::gil::planar_pixel_reference x, const boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } + } // namespace std #endif diff --git a/include/boost/gil/position_iterator.hpp b/include/boost/gil/position_iterator.hpp index df97611c15..747123c1ac 100644 --- a/include/boost/gil/position_iterator.hpp +++ b/include/boost/gil/position_iterator.hpp @@ -1,29 +1,16 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_POSITION_ITERATOR_HPP -#define GIL_POSITION_ITERATOR_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Locator for virtual image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_POSITION_ITERATOR_HPP +#define BOOST_GIL_POSITION_ITERATOR_HPP + +#include #include -#include "locator.hpp" namespace boost { namespace gil { diff --git a/include/boost/gil/premultiply.hpp b/include/boost/gil/premultiply.hpp index eb865d3af1..e0a472b4b4 100644 --- a/include/boost/gil/premultiply.hpp +++ b/include/boost/gil/premultiply.hpp @@ -1,44 +1,42 @@ -/* - Copyright 2014 - 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). -*/ - -/*************************************************************************************************/ - +// +// Copyright 2014 Bill Gallafent +// +// 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 +// #ifndef BOOST_GIL_PREMULTIPLY_HPP #define BOOST_GIL_PREMULTIPLY_HPP -#include - #include + #include namespace boost { namespace gil { template -struct channel_premultiply { - channel_premultiply (SrcP const & src, DstP & dst) - : src_ (src), dst_ (dst) +struct channel_premultiply +{ + channel_premultiply(SrcP const & src, DstP & dst) + : src_(src), dst_(dst) {} template - void operator () (Channel c) const { + void operator()(Channel c) const + { // @todo: need to do a “channel_convert” too, in case the channel types aren't the same? - get_color (dst_, Channel()) = channel_multiply(get_color(src_,Channel()), alpha_or_max(src_)); + get_color(dst_, Channel()) = channel_multiply(get_color(src_,Channel()), alpha_or_max(src_)); } SrcP const & src_; DstP & dst_; }; - namespace detail { template void assign_alpha_if(mpl::true_, SrcP const &src, DstP &dst) { - get_color (dst,alpha_t()) = alpha_or_max (src); + get_color(dst,alpha_t()) = alpha_or_max(src); }; template @@ -48,22 +46,25 @@ namespace detail }; } -struct premultiply { +struct premultiply +{ template - void operator()(const SrcP& src, DstP& dst) const { + void operator()(const SrcP& src, DstP& dst) const + { typedef typename color_space_type::type src_colour_space_t; typedef typename color_space_type::type dst_colour_space_t; - typedef typename mpl:: remove :: type src_colour_channels; + typedef typename mpl::remove ::type src_colour_channels; typedef mpl::bool_::value> has_alpha_t; - mpl:: for_each ( channel_premultiply (src, dst) ); + mpl::for_each(channel_premultiply(src, dst)); detail::assign_alpha_if(has_alpha_t(), src, dst); } }; template // Destination pixel value (models PixelValueConcept) -class premultiply_deref_fn { +class premultiply_deref_fn +{ public: typedef premultiply_deref_fn const_t; typedef DstP value_type; @@ -73,15 +74,17 @@ class premultiply_deref_fn { typedef reference result_type; BOOST_STATIC_CONSTANT(bool, is_mutable=false); - result_type operator()(argument_type srcP) const { + result_type operator()(argument_type srcP) const + { result_type dstP; - premultiply () (srcP,dstP); + premultiply()(srcP,dstP); return dstP; } }; template -struct premultiplied_view_type { +struct premultiplied_view_type +{ private: typedef typename SrcView::const_t::reference src_pix_ref; // const reference to pixel in SrcView typedef premultiply_deref_fn deref_t; // the dereference adaptor that performs color conversion @@ -92,11 +95,11 @@ struct premultiplied_view_type { }; template inline -typename premultiplied_view_type::type premultiply_view(const View& src) { +typename premultiplied_view_type::type premultiply_view(const View& src) +{ return premultiplied_view_type::make(src); } - } -} +}} // namespace boost::gil -#endif // BOOST_GIL_PREMULTIPLY_HPP +#endif diff --git a/include/boost/gil/promote_integral.hpp b/include/boost/gil/promote_integral.hpp index 82441d4c3b..ea7868ba51 100644 --- a/include/boost/gil/promote_integral.hpp +++ b/include/boost/gil/promote_integral.hpp @@ -16,16 +16,16 @@ #ifndef BOOST_GIL_PROMOTE_INTEGRAL_HPP #define BOOST_GIL_PROMOTE_INTEGRAL_HPP -#include -#include -#include - #include #include #include #include #include +#include +#include +#include + namespace boost { namespace gil { diff --git a/include/boost/gil/rgb.hpp b/include/boost/gil/rgb.hpp index d2e6e9ea05..15d2291710 100644 --- a/include/boost/gil/rgb.hpp +++ b/include/boost/gil/rgb.hpp @@ -1,31 +1,20 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_RGB_HPP +#define BOOST_GIL_RGB_HPP + +#include +#include - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_RGB_H -#define GIL_RGB_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for RGB color space and variants -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on October 10, 2007 -//////////////////////////////////////////////////////////////////////////////////////// - -#include #include #include -#include "metafunctions.hpp" -#include "planar_pixel_iterator.hpp" + +#include namespace boost { namespace gil { @@ -64,6 +53,6 @@ planar_rgb_view(std::size_t width, std::size_t height, rowsize_in_bytes)); } -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/rgba.hpp b/include/boost/gil/rgba.hpp index d5e20b7587..ec4fcf5b0c 100644 --- a/include/boost/gil/rgba.hpp +++ b/include/boost/gil/rgba.hpp @@ -1,29 +1,20 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -/*************************************************************************************************/ - -#ifndef GIL_RGBA_H -#define GIL_RGBA_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Support for RGBA color space and variants -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on October 10, 2007 -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_RGBA_HPP +#define BOOST_GIL_RGBA_HPP + +#include +#include -#include #include -#include "rgb.hpp" -#include "planar_pixel_iterator.hpp" +#include + +#include namespace boost { namespace gil { @@ -50,13 +41,14 @@ inline typename type_from_x_iterator >::view_t planar_rgba_view(std::size_t width, std::size_t height, IC r, IC g, IC b, IC a, - std::ptrdiff_t rowsize_in_bytes) { + std::ptrdiff_t rowsize_in_bytes) +{ typedef typename type_from_x_iterator >::view_t RView; return RView(width, height, typename RView::locator(planar_pixel_iterator(r,g,b,a), rowsize_in_bytes)); } -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/step_iterator.hpp b/include/boost/gil/step_iterator.hpp index 4903faf46c..afc465f745 100644 --- a/include/boost/gil/step_iterator.hpp +++ b/include/boost/gil/step_iterator.hpp @@ -1,33 +1,21 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 +// +#ifndef BOOST_GIL_STEP_ITERATOR_HPP +#define BOOST_GIL_STEP_ITERATOR_HPP + +#include +#include +#include - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_STEP_ITERATOR_H -#define GIL_STEP_ITERATOR_H - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief pixel step iterator -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 18, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include -#include "utilities.hpp" -#include "pixel_iterator.hpp" -#include "pixel_iterator_adaptor.hpp" namespace boost { namespace gil { @@ -35,7 +23,6 @@ namespace boost { namespace gil { /// \ingroup PixelIteratorModel /// \brief Iterators that allow for specifying the step between two adjacent values - namespace detail { /// \ingroup PixelIteratorModelStepPtr @@ -314,6 +301,6 @@ typename dynamic_x_step_type::type make_step_iterator(const I& it, std::ptrdi return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor::type()); } -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/typedefs.hpp b/include/boost/gil/typedefs.hpp index 60f4b855fa..a608874abf 100644 --- a/include/boost/gil/typedefs.hpp +++ b/include/boost/gil/typedefs.hpp @@ -9,20 +9,15 @@ #ifndef BOOST_GIL_TYPEDEFS_HPP #define BOOST_GIL_TYPEDEFS_HPP -/// \file -/// \brief Useful public typedefs -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated +#include +#include +#include +#include +#include #include #include -#include "cmyk.hpp" -#include "device_n.hpp" -#include "gray.hpp" -#include "rgb.hpp" -#include "rgba.hpp" - // B - bits size/signedness, CM - channel model, CS - colour space, LAYOUT - pixel layout // Example: B = '8', CM = 'uint8_t', CS = 'bgr, LAYOUT='bgr_layout_t' #define GIL_DEFINE_BASE_TYPEDEFS_INTERNAL(B, CM, CS, LAYOUT) \ diff --git a/include/boost/gil/utilities.hpp b/include/boost/gil/utilities.hpp index 2e804514f4..f32ad318e0 100644 --- a/include/boost/gil/utilities.hpp +++ b/include/boost/gil/utilities.hpp @@ -1,17 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ +// +// 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 +// +#ifndef BOOST_GIL_UTILITIES_HPP +#define BOOST_GIL_UTILITIES_HPP -#ifndef GIL_UTILITIES_H -#define GIL_UTILITIES_H +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -19,28 +24,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Various utilities not specific to the image library. Some are non-standard STL extensions or generic iterator adaptors -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on September 18, 2007 -/// -/// -//////////////////////////////////////////////////////////////////////////////////////// namespace boost { namespace gil { +/// Various utilities not specific to the image library. +/// Some are non-standard STL extensions or generic iterator adaptors + /** \addtogroup PointModel @@ -168,12 +157,12 @@ inline point2 iceil (const point2& p) { return point2 -inline T align(T val, std::size_t alignment) { - return val+(alignment - val%alignment)%alignment; +template +inline T align(T val, std::size_t alignment) { + return val+(alignment - val%alignment)%alignment; } -/// \brief Helper base class for pixel dereference adaptors. +/// \brief Helper base class for pixel dereference adaptors. /// \ingroup PixelDereferenceAdaptorModel /// template class deref_compose : public deref_base< deref_compose, - typename D1::value_type, typename D1::reference, typename D1::const_reference, + typename D1::value_type, typename D1::reference, typename D1::const_reference, typename D2::argument_type, typename D1::result_type, D1::is_mutable && D2::is_mutable> { public: @@ -267,8 +256,6 @@ struct identity { const T& operator()(const T& val) const { return val; } }; -/*************************************************************************************************/ - /// \brief plus function object whose arguments may be of different type. template struct plus_asymmetric { @@ -280,8 +267,6 @@ struct plus_asymmetric { } }; -/*************************************************************************************************/ - /// \brief operator++ wrapped in a function object template struct inc { @@ -290,8 +275,6 @@ struct inc { T operator()(T x) const { return ++x; } }; -/*************************************************************************************************/ - /// \brief operator-- wrapped in a function object template struct dec { @@ -300,16 +283,14 @@ struct dec { T operator()(T x) const { return --x; } }; -/// \brief Returns the index corresponding to the first occurrance of a given given type in +/// \brief Returns the index corresponding to the first occurrance of a given given type in // a given MPL RandomAccessSequence (or size if the type is not present) template -struct type_to_index - : public mpl::distance::type, +struct type_to_index + : public mpl::distance::type, typename mpl::find::type>::type {}; } // namespace detail - - /// \ingroup ColorSpaceAndLayoutModel /// \brief Represents a color space and ordering of channels in memory template ::value> > @@ -336,6 +317,6 @@ inline bool big_endian() { return !little_endian(); } -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/include/boost/gil/version.hpp b/include/boost/gil/version.hpp index 660f97e970..a0dab675b0 100644 --- a/include/boost/gil/version.hpp +++ b/include/boost/gil/version.hpp @@ -1,27 +1,22 @@ // // Copyright (c) 2018 Christian Henning (chhenning at gmail dot com) // -// 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) +// 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 // -// Official repository: https://github.com/boostorg/gil -// - -#ifndef BOOST_GIL_VERSION_HPP +#ifndef BOOST_BOOST_GIL_VERSION_HPP #define BOOST_GIL_VERSION_HPP -/** @def BOOST_GIL_API_VERSION - Identifies the API version of gil. - This is a simple integer that is incremented by one every - time a set of code changes is merged to the develop branch. -*/ +/// @def BOOST_GIL_API_VERSION +/// Identifies the API version of gil. +/// This is a simple integer that is incremented by one every +/// time a set of code changes is merged to the develop branch. #define BOOST_GIL_VERSION 22 -/** -// BOOST_GIL_LIB_VERSION must be defined to be the same as BOOST_GIL_VERSION -// but as a *string* in the form "x_y[_z]" where x is the major version -// number, y is the minor version number, and z is the patch level if not 0. -*/ +// BOOST_GIL_LIB_VERSION must be defined to be the same as BOOST_GIL_VERSION +// but as a *string* in the form "x_y[_z]" where x is the major version +// number, y is the minor version number, and z is the patch level if not 0. #define BOOST_GIL_LIB_VERSION "2_2" -#endif \ No newline at end of file +#endif diff --git a/include/boost/gil/virtual_locator.hpp b/include/boost/gil/virtual_locator.hpp index 2e858f3b2c..44997d559d 100644 --- a/include/boost/gil/virtual_locator.hpp +++ b/include/boost/gil/virtual_locator.hpp @@ -1,29 +1,16 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -#ifndef GIL_VIRTUAL_LOCATOR_HPP -#define GIL_VIRTUAL_LOCATOR_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief Locator for virtual image views -/// \author Lubomir Bourdev and Hailin Jin \n -/// Adobe Systems Incorporated -/// \date 2005-2007 \n Last updated on February 12, 2007 -/// -//////////////////////////////////////////////////////////////////////////////////////// +// +// 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 +// +#ifndef BOOST_GIL_VIRTUAL_LOCATOR_HPP +#define BOOST_GIL_VIRTUAL_LOCATOR_HPP + +#include #include -#include "position_iterator.hpp" namespace boost { namespace gil { @@ -131,6 +118,6 @@ struct transposed_type > { typedef virtual_2d_locator type; }; -} } // namespace boost::gil +}} // namespace boost::gil #endif diff --git a/io/test/all_formats_test.cpp b/io/test/all_formats_test.cpp index 4d91ae5817..7050b5721b 100644 --- a/io/test/all_formats_test.cpp +++ b/io/test/all_formats_test.cpp @@ -1,14 +1,11 @@ -/* - 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). -*/ - -// Test will include all format's headers and load and write some images. -// This test is more of a compilation test. - - +// +// Copyright 2013 Christian Henning +// +// 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 +// +#define BOOST_TEST_MODULE all_formats_test #include #include #include @@ -16,11 +13,14 @@ #include #include -#define BOOST_TEST_MODULE all_formats_test #include #include + #include "paths.hpp" +// Test will include all format's headers and load and write some images. +// This test is more of a compilation test. + using namespace std; using namespace boost::gil; namespace fs = boost::filesystem; diff --git a/io/test/bmp_old_test.cpp b/io/test/bmp_old_test.cpp index 5e473364ac..db7e97dadb 100644 --- a/io/test/bmp_old_test.cpp +++ b/io/test/bmp_old_test.cpp @@ -1,16 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE bmp_old_test_module -#include - #include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/bmp_read_test.cpp b/io/test/bmp_read_test.cpp index 83fa0c05d3..aaa5936367 100644 --- a/io/test/bmp_read_test.cpp +++ b/io/test/bmp_read_test.cpp @@ -1,20 +1,19 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE bmp_read_test_module -#include -#include - #include #include -#include "scanline_read_test.hpp" +#include +#include #include "paths.hpp" +#include "scanline_read_test.hpp" using namespace std; using namespace boost::gil; @@ -74,11 +73,11 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) read_image( bmp_in + "g01bw.bmp", img, tag_t() ); } - // g01wb.bmp - white and black palette (#FFFFFF,#000000). + // g01wb.bmp - white and black palette (#FFFFFF,#000000). // Should look the same as g01bw, not inverted. { rgba8_image_t img; - + read_image( bmp_in + "g01wb.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -89,7 +88,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g01bg.bmp - blue and green palette (#4040FF,#40FF40) { rgba8_image_t img; - + read_image( bmp_in + "g01bg.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -100,7 +99,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g01p1.bmp - 1-color (blue) palette (#4040FF) { rgba8_image_t img; - + read_image( bmp_in + "g01p1.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -111,7 +110,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g04.bmp - basic 4bpp (16 color) image { rgba8_image_t img; - + read_image( bmp_in + "g04.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -122,7 +121,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g04rle.bmp - RLE compressed. { rgb8_image_t img; - + read_image( bmp_in + "g04rle.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -133,7 +132,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g04p4.bmp - 4-color grayscale palette { rgba8_image_t img; - + read_image( bmp_in + "g04p4.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -144,7 +143,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08.bmp - basic 8bpp (256 color) image { rgba8_image_t img; - + read_image( bmp_in + "g08.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -155,7 +154,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08p256.bmp - biClrUsed=256, biClrImportant=0 [=256] { rgba8_image_t img; - + read_image( bmp_in + "g08p256.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -166,7 +165,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08pi256.bmp - biClrUsed=256, biClrImportant=256 { rgba8_image_t img; - + read_image( bmp_in + "g08pi256.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -174,12 +173,12 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) write( img, "g08pi256.bmp" ); } - // g08pi64.bmp - biClrUsed=256, biClrImportant=64. It's barely possible that some - // sophisticated viewers may display this image in grayscale, if there are a + // g08pi64.bmp - biClrUsed=256, biClrImportant=64. It's barely possible that some + // sophisticated viewers may display this image in grayscale, if there are a // limited number of colors available. { rgba8_image_t img; - + read_image( bmp_in + "g08pi64.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -190,7 +189,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08rle.bmp - RLE compressed. { rgb8_image_t img; - + read_image( bmp_in + "g08rle.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -198,12 +197,12 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) write( img, "g08rle.bmp" ); } - // g08os2.bmp - OS/2-style bitmap. This is an obsolete variety of BMP - // that is still encountered sometimes. It has 3-byte palette + // g08os2.bmp - OS/2-style bitmap. This is an obsolete variety of BMP + // that is still encountered sometimes. It has 3-byte palette // entries (instead of 4), and 16-bit width/height fields (instead of 32). { rgb8_image_t img; - + read_image( bmp_in + "g08os2.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -214,7 +213,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08res22.bmp - resolution 7874x7874 pixels/meter (200x200 dpi) { rgba8_image_t img; - + read_image( bmp_in + "g08res22.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -225,7 +224,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08res11.bmp - resolution 3937x3937 pixels/meter (100x100 dpi) { rgba8_image_t img; - + read_image( bmp_in + "g08res11.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -233,13 +232,13 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) write( img, "g08res11.bmp" ); } - // g08res21.bmp resolution 7874x3937 pixels/meter (200x100 dpi). - // Some programs (e.g. Imaging for Windows) may display this image - // stretched vertically, which is the optimal thing to do if the + // g08res21.bmp resolution 7874x3937 pixels/meter (200x100 dpi). + // Some programs (e.g. Imaging for Windows) may display this image + // stretched vertically, which is the optimal thing to do if the // program is primarily a viewer, rather than an editor. { rgba8_image_t img; - + read_image( bmp_in + "g08res21.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -250,7 +249,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08s0.bmp - bits size not given (set to 0). This is legal for uncompressed bitmaps. { rgba8_image_t img; - + read_image( bmp_in + "g08s0.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -258,11 +257,11 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) write( img, "g08s0.bmp" ); } - // g08offs.bmp - bfOffBits in header not set to the usual value. + // g08offs.bmp - bfOffBits in header not set to the usual value. // There are 100 extra unused bytes between palette and bits. { rgba8_image_t img; - + read_image( bmp_in + "g08offs.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -273,7 +272,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08w126.bmp - size 126x63 (right and bottom slightly clipped) { rgba8_image_t img; - + read_image( bmp_in + "g08w126.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 126u ); BOOST_CHECK_EQUAL( view( img ).height(), 63u ); @@ -284,7 +283,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08w125.bmp - size 125x62 { rgba8_image_t img; - + read_image( bmp_in + "g08w125.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 125u ); BOOST_CHECK_EQUAL( view( img ).height(), 62u ); @@ -295,7 +294,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08w124.bmp - size 124x61 { rgba8_image_t img; - + read_image( bmp_in + "g08w124.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 124u ); BOOST_CHECK_EQUAL( view( img ).height(), 61u ); @@ -306,7 +305,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g08p64.bmp - 64-color grayscale palette { rgba8_image_t img; - + read_image( bmp_in + "g08p64.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -317,7 +316,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g16def555.bmp - 15-bit color (1 bit wasted), biCompression=BI_RGB (no bitfields, defaults to 5-5-5) { rgb8_image_t img; - + read_image( bmp_in + "g16def555.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -328,7 +327,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g16bf555.bmp - 15-bit color, biCompression=BI_BITFIELDS (bitfields indicate 5-5-5) { rgb8_image_t img; - + read_image( bmp_in + "g16bf555.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -339,7 +338,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g16bf565.bmp - 16-bit color, biCompression=BI_BITFIELDS (bitfields indicate 5-6-5) { rgb8_image_t img; - + read_image( bmp_in + "g16bf565.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -350,7 +349,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g24.bmp - 24-bit color (BGR) { rgb8_image_t img; - + read_image( bmp_in + "g24.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -361,7 +360,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // g32def.bmp - 24-bit color (8 bits wasted), biCompression=BI_RGB (no bitfields, defaults to BGRx) { rgba8_image_t img; - + read_image( bmp_in + "g32def.bmp", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 127u ); BOOST_CHECK_EQUAL( view( img ).height(), 64u ); @@ -389,7 +388,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_image_iterator_test ) // g01bw.bmp - black and white palette (#000000,#FFFFFF) test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g01bw.bmp" ).c_str() ); - // g01wb.bmp - white and black palette (#FFFFFF,#000000). + // g01wb.bmp - white and black palette (#FFFFFF,#000000). // Should look the same as g01bw, not inverted. test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g01wb.bmp" ).c_str() ); @@ -418,16 +417,16 @@ BOOST_AUTO_TEST_CASE( read_reference_images_image_iterator_test ) // g08pi256.bmp - biClrUsed=256, biClrImportant=256 test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08pi256.bmp" ).c_str() ); - // g08pi64.bmp - biClrUsed=256, biClrImportant=64. It's barely possible that some - // sophisticated viewers may display this image in grayscale, if there are a + // g08pi64.bmp - biClrUsed=256, biClrImportant=64. It's barely possible that some + // sophisticated viewers may display this image in grayscale, if there are a // limited number of colors available. test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08pi64.bmp" ).c_str() ); // not supported // g08rle.bmp - RLE compressed. - // g08os2.bmp - OS/2-style bitmap. This is an obsolete variety of BMP - // that is still encountered sometimes. It has 3-byte palette + // g08os2.bmp - OS/2-style bitmap. This is an obsolete variety of BMP + // that is still encountered sometimes. It has 3-byte palette // entries (instead of 4), and 16-bit width/height fields (instead of 32). test_scanline_reader< rgb8_image_t, bmp_tag >( string( bmp_in + "g08os2.bmp" ).c_str() ); @@ -437,16 +436,16 @@ BOOST_AUTO_TEST_CASE( read_reference_images_image_iterator_test ) // g08res11.bmp - resolution 3937x3937 pixels/meter (100x100 dpi) test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08res11.bmp" ).c_str() ); - // g08res21.bmp resolution 7874x3937 pixels/meter (200x100 dpi). - // Some programs (e.g. Imaging for Windows) may display this image - // stretched vertically, which is the optimal thing to do if the + // g08res21.bmp resolution 7874x3937 pixels/meter (200x100 dpi). + // Some programs (e.g. Imaging for Windows) may display this image + // stretched vertically, which is the optimal thing to do if the // program is primarily a viewer, rather than an editor. test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08res21.bmp" ).c_str() ); // g08s0.bmp - bits size not given (set to 0). This is legal for uncompressed bitmaps. test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08s0.bmp" ).c_str() ); - // g08offs.bmp - bfOffBits in header not set to the usual value. + // g08offs.bmp - bfOffBits in header not set to the usual value. // There are 100 extra unused bytes between palette and bits. test_scanline_reader< rgba8_image_t, bmp_tag >( string( bmp_in + "g08offs.bmp" ).c_str() ); diff --git a/io/test/bmp_test.cpp b/io/test/bmp_test.cpp index 1756c5f366..eb0eaf5e6d 100644 --- a/io/test/bmp_test.cpp +++ b/io/test/bmp_test.cpp @@ -1,22 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE bmp_test -#include - #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT - -#include - +#define BOOST_FILESYSTEM_VERSION 3 #include #include -#define BOOST_FILESYSTEM_VERSION 3 #include +#include + +#include #include "mandel_view.hpp" #include "paths.hpp" @@ -73,7 +71,7 @@ BOOST_AUTO_TEST_CASE( read_image_info_using_string ) backend_t backend = read_image_info( file , tag_t() ); - + BOOST_CHECK_EQUAL( backend._info._width , 1000 ); BOOST_CHECK_EQUAL( backend._info._height, 600 ); } @@ -116,7 +114,7 @@ BOOST_AUTO_TEST_CASE( read_image_test ) { FILE* file = fopen( bmp_filename.c_str(), "rb" ); - + rgb8_image_t img; read_image( file, img, tag_t() ); @@ -157,7 +155,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_image_test ) { FILE* file = fopen( bmp_filename.c_str(), "rb" ); - + rgb8_image_t img; read_and_convert_image( file, img, tag_t() ); @@ -182,7 +180,7 @@ BOOST_AUTO_TEST_CASE( read_view_test ) { FILE* file = fopen( bmp_filename.c_str(), "rb" ); - + rgb8_image_t img( 1000, 600 ); read_view( file, view( img ), tag_t() ); } @@ -204,7 +202,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_view_test ) { FILE* file = fopen( bmp_filename.c_str(), "rb" ); - + rgb8_image_t img( 1000, 600 ); read_and_convert_view( file , view( img ) @@ -220,7 +218,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) string filename( bmp_out + "write_test_string.bmp" ); write_view( filename - , create_mandel_view( 1000, 600 + , create_mandel_view( 1000, 600 , rgb8_pixel_t( 0, 0, 255 ) , rgb8_pixel_t( 0, 255, 0 ) ) @@ -234,7 +232,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) ofstream out( filename.c_str(), ios::binary ); write_view( out - , create_mandel_view( 1000, 600 + , create_mandel_view( 1000, 600 , rgb8_pixel_t( 0, 0, 255 ) , rgb8_pixel_t( 0, 255, 0 ) ) @@ -246,9 +244,9 @@ BOOST_AUTO_TEST_CASE( write_view_test ) string filename( bmp_out + "write_test_file.bmp" ); FILE* file = fopen( filename.c_str(), "wb" ); - + write_view( file - , create_mandel_view( 1000, 600 + , create_mandel_view( 1000, 600 , rgb8_pixel_t( 0, 0, 255 ) , rgb8_pixel_t( 0, 255, 0 ) ) @@ -264,7 +262,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) FILE* file = fopen( filename.c_str(), "wb" ); write_view( file - , create_mandel_view( 1000, 600 + , create_mandel_view( 1000, 600 , rgb8_pixel_t( 0, 0, 255 ) , rgb8_pixel_t( 0, 255, 0 ) ) diff --git a/io/test/bmp_write_test.cpp b/io/test/bmp_write_test.cpp index 693703cdec..a2d8e9a11f 100644 --- a/io/test/bmp_write_test.cpp +++ b/io/test/bmp_write_test.cpp @@ -1,18 +1,17 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE bmp_write_test_module -#include - #include - #include #include +#include + #include "cmp_view.hpp" #include "color_space_write_test.hpp" #include "mandel_view.hpp" diff --git a/io/test/cmp_view.hpp b/io/test/cmp_view.hpp index dec4357d3d..4be0848d03 100644 --- a/io/test/cmp_view.hpp +++ b/io/test/cmp_view.hpp @@ -1,22 +1,12 @@ -/* - 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_CMP_VIEW_HPP -#define BOOST_GIL_IO_UNIT_TEST_CMP_VIEW_HPP - -//////////////////////////////////////////////////////////////////////////////////////// -/// \file -/// \brief -/// \author Christian Henning -/// -/// \date 2013 \n -/// -//////////////////////////////////////////////////////////////////////////////////////// - +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_CMP_VIEW_HPP +#define BOOST_GIL_IO_TEST_CMP_VIEW_HPP #include @@ -48,4 +38,4 @@ void cmp_view( const View_1& v1 } } -#endif // BOOST_GIL_IO_UNIT_TEST_CMP_VIEW_HPP +#endif diff --git a/io/test/color_space_write_test.hpp b/io/test/color_space_write_test.hpp index 6318adf83a..02c6311330 100644 --- a/io/test/color_space_write_test.hpp +++ b/io/test/color_space_write_test.hpp @@ -1,17 +1,17 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_COLOR_SPACE_WRITE_TEST_HPP +#define BOOST_GIL_IO_TEST_COLOR_SPACE_WRITE_TEST_HPP -#ifndef BOOST_GIL_IO_UNIT_TEST_COLOR_SPACE_WRITE_TEST_HPP -#define BOOST_GIL_IO_UNIT_TEST_COLOR_SPACE_WRITE_TEST_HPP +#include #include -#include - #include "cmp_view.hpp" template< typename Tag > @@ -43,4 +43,4 @@ void color_space_write_test( const std::string& file_name_1 #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES } -#endif // BOOST_GIL_IO_UNIT_TEST_COLOR_SPACE_WRITE_TEST_HPP +#endif diff --git a/io/test/jpeg_old_test.cpp b/io/test/jpeg_old_test.cpp index ec17c9bd64..c52c48145a 100644 --- a/io/test/jpeg_old_test.cpp +++ b/io/test/jpeg_old_test.cpp @@ -1,16 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE jpeg_old_test_module -#include - #include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/jpeg_read_test.cpp b/io/test/jpeg_read_test.cpp index c236575548..86067e1f14 100644 --- a/io/test/jpeg_read_test.cpp +++ b/io/test/jpeg_read_test.cpp @@ -1,16 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE jpeg_read_test_module -#include - #include #include +#include + #include "paths.hpp" #include "scanline_read_test.hpp" @@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE( read_pixel_density_test ) backend_t backend = read_image_info( jpeg_in + "EddDawson/36dpi.jpg" , tag_t() ); - + rgb8_image_t img; read_image( jpeg_in + "EddDawson/36dpi.jpg", img, jpeg_tag() ); diff --git a/io/test/jpeg_test.cpp b/io/test/jpeg_test.cpp index 510ab30307..669425c649 100644 --- a/io/test/jpeg_test.cpp +++ b/io/test/jpeg_test.cpp @@ -1,22 +1,23 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE jpeg_test -#include #define BOOST_FILESYSTEM_VERSION 3 -#include - -#include +#define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #include -#define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #include +#include +#include + +#include + #include "mandel_view.hpp" #include "paths.hpp" #include "subimage_test.hpp" @@ -68,7 +69,7 @@ BOOST_AUTO_TEST_CASE( read_image_info_test ) typedef get_reader_backend< FILE* , tag_t >::type backend_t; - + backend_t backend = boost::gil::read_image_info( file , tag_t() ); @@ -113,7 +114,7 @@ BOOST_AUTO_TEST_CASE( read_image_test ) { FILE* file = fopen( jpeg_filename.c_str(), "rb" ); - + rgb8_image_t img; read_image( file, img, tag_t() ); @@ -168,7 +169,7 @@ BOOST_AUTO_TEST_CASE( read_view_test ) { FILE* file = fopen( jpeg_filename.c_str(), "rb" ); - + rgb8_image_t img( 1000, 600 ); read_view( file, view( img ), tag_t() ); } @@ -229,7 +230,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) { std::string filename( jpeg_out + "write_test_file.jpg" ); FILE* file = fopen( filename.c_str(), "wb" ); - + write_view( file , create_mandel_view( 320, 240 , rgb8_pixel_t( 0, 0, 255 ) diff --git a/io/test/jpeg_write_test.cpp b/io/test/jpeg_write_test.cpp index 0c9b7981b6..85e2b1bb18 100644 --- a/io/test/jpeg_write_test.cpp +++ b/io/test/jpeg_write_test.cpp @@ -1,16 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE jpeg_write_test_module -#include - #include #include +#include + #include "color_space_write_test.hpp" #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/make.cpp b/io/test/make.cpp index 389145502f..8509607e6a 100644 --- a/io/test/make.cpp +++ b/io/test/make.cpp @@ -1,22 +1,21 @@ -/* - 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). -*/ - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT - -#include - #define BOOST_FILESYSTEM_VERSION 3 -#include #include #include +#include +#include + +#include + #include "paths.hpp" using namespace std; diff --git a/io/test/mandel_view.hpp b/io/test/mandel_view.hpp index 6e2414b68d..cc2135f89f 100644 --- a/io/test/mandel_view.hpp +++ b/io/test/mandel_view.hpp @@ -1,12 +1,12 @@ -/* - 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_MANDEL_HPP -#define BOOST_GIL_IO_UNIT_TEST_MANDEL_HPP +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_MANDEL_HPP +#define BOOST_GIL_IO_TEST_MANDEL_HPP #include @@ -94,4 +94,4 @@ typename mandel_view< Pixel >::type create_mandel_view( unsigned int width ); } -#endif // BOOST_GIL_IO_UNIT_TEST_MANDEL_HPP +#endif // BOOST_GIL_IO_TEST_MANDEL_HPP diff --git a/io/test/paths.hpp b/io/test/paths.hpp index 6c8e025b79..564e3b12b4 100644 --- a/io/test/paths.hpp +++ b/io/test/paths.hpp @@ -1,12 +1,12 @@ -/* - 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_PATHS_HPP -#define BOOST_GIL_IO_UNIT_TEST_PATHS_HPP +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_PATHS_HPP +#define BOOST_GIL_IO_TEST_PATHS_HPP #include @@ -46,4 +46,4 @@ static const std::string raw_filename ( raw_in + "RAW_CANON_D30_SRGB.CRW" static const std::string targa_filename( targa_in + "24BPP_compressed.tga" ); static const std::string tiff_filename ( tiff_in + "test.tif" ); -#endif // BOOST_GIL_IO_UNIT_TEST_PATHS_HPP +#endif // BOOST_GIL_IO_TEST_PATHS_HPP diff --git a/io/test/png_file_format_test.cpp b/io/test/png_file_format_test.cpp index c67a7fa5fd..75e0ba989c 100644 --- a/io/test/png_file_format_test.cpp +++ b/io/test/png_file_format_test.cpp @@ -1,21 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE png_file_format_test_module -#include - #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #define BOOST_GIL_IO_ENABLE_GRAY_ALPHA - #define BOOST_FILESYSTEM_VERSION 3 -#include #include +#include +#include + #include "paths.hpp" using namespace std; @@ -31,9 +30,9 @@ BOOST_AUTO_TEST_SUITE( gil_io_png_tests ) // Test will loop through the "in" folder to read and convert // the png's to rgb8_image_t's. Which then will be written in // the "out" folder. -// +// // The file name structure is as followed: -// +// // g04i2c08.png // || |||+---- bit-depth // || ||+----- color-type (descriptive) @@ -56,7 +55,7 @@ BOOST_AUTO_TEST_CASE( file_format_test ) ; ++dir_itr ) { - if ( fs::is_regular( dir_itr->status() ) + if ( fs::is_regular( dir_itr->status() ) && ( fs::extension( dir_itr->path() ) == ".PNG" )) { rgb8_image_t img; diff --git a/io/test/png_old_test.cpp b/io/test/png_old_test.cpp index a7e9353da4..24db9e42c8 100644 --- a/io/test/png_old_test.cpp +++ b/io/test/png_old_test.cpp @@ -1,16 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE png_old_test_module -#include - #include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/png_read_test.cpp b/io/test/png_read_test.cpp index 8a26275b82..cecb0fedaf 100644 --- a/io/test/png_read_test.cpp +++ b/io/test/png_read_test.cpp @@ -1,21 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE png_read_test_module -#include - #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #define BOOST_GIL_IO_ENABLE_GRAY_ALPHA - #define BOOST_FILESYSTEM_VERSION 3 -#include #include +#include +#include + #include #include @@ -254,126 +253,126 @@ BOOST_AUTO_TEST_CASE( BASIc_format_interlaced_test ) BOOST_AUTO_TEST_CASE( odd_sizes_test ) { - // S01I3P01 - 1x1 paletted file, interlaced + // S01I3P01 - 1x1 paletted file, interlaced test_file< rgb8_image_t >( "S01I3P01.PNG" ); - // S01N3P01 - 1x1 paletted file, no interlacing + // S01N3P01 - 1x1 paletted file, no interlacing test_file< rgb8_image_t >( "S01N3P01.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S01N3P01.PNG" ); - // S02I3P01 - 2x2 paletted file, interlaced + // S02I3P01 - 2x2 paletted file, interlaced test_file< rgb8_image_t >( "S02I3P01.PNG" ); - // S02N3P01 - 2x2 paletted file, no interlacing + // S02N3P01 - 2x2 paletted file, no interlacing test_file< rgb8_image_t >( "S02N3P01.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S02N3P01.PNG" ); - // S03I3P01 - 3x3 paletted file, interlaced + // S03I3P01 - 3x3 paletted file, interlaced test_file< rgb8_image_t >( "S03I3P01.PNG" ); - // S03N3P01 - 3x3 paletted file, no interlacing + // S03N3P01 - 3x3 paletted file, no interlacing test_file< rgb8_image_t >( "S03N3P01.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S03N3P01.PNG" ); - // S04I3P01 - 4x4 paletted file, interlaced + // S04I3P01 - 4x4 paletted file, interlaced test_file< rgb8_image_t >( "S04I3P01.PNG" ); - // S04N3P01 - 4x4 paletted file, no interlacing + // S04N3P01 - 4x4 paletted file, no interlacing test_file< rgb8_image_t >( "S04N3P01.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S04N3P01.PNG" ); - // S05I3P02 - 5x5 paletted file, interlaced + // S05I3P02 - 5x5 paletted file, interlaced test_file< rgb8_image_t >( "S05I3P02.PNG" ); - // S05N3P02 - 5x5 paletted file, no interlacing + // S05N3P02 - 5x5 paletted file, no interlacing test_file< rgb8_image_t >( "S05N3P02.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S05N3P02.PNG" ); - // S06I3P02 - 6x6 paletted file, interlaced + // S06I3P02 - 6x6 paletted file, interlaced test_file< rgb8_image_t >( "S06I3P02.PNG" ); - // S06N3P02 - 6x6 paletted file, no interlacing + // S06N3P02 - 6x6 paletted file, no interlacing test_file< rgb8_image_t >( "S06N3P02.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S06N3P02.PNG" ); - // S07I3P02 - 7x7 paletted file, interlaced + // S07I3P02 - 7x7 paletted file, interlaced test_file< rgb8_image_t >( "S07I3P02.PNG" ); - // S07N3P02 - 7x7 paletted file, no interlacing + // S07N3P02 - 7x7 paletted file, no interlacing test_file< rgb8_image_t >( "S07N3P02.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S07N3P02.PNG" ); - // S08I3P02 - 8x8 paletted file, interlaced + // S08I3P02 - 8x8 paletted file, interlaced test_file< rgb8_image_t >( "S08I3P02.PNG" ); - // S08N3P02 - 8x8 paletted file, no interlacing + // S08N3P02 - 8x8 paletted file, no interlacing test_file< rgb8_image_t >( "S08N3P02.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S08N3P02.PNG" ); - // S09I3P02 - 9x9 paletted file, interlaced + // S09I3P02 - 9x9 paletted file, interlaced test_file< rgb8_image_t >( "S09I3P02.PNG" ); - // S09N3P02 - 9x9 paletted file, no interlacing + // S09N3P02 - 9x9 paletted file, no interlacing test_file< rgb8_image_t >( "S09N3P02.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S09N3P02.PNG" ); - // S32I3P04 - 32x32 paletted file, interlaced + // S32I3P04 - 32x32 paletted file, interlaced test_file< rgb8_image_t >( "S32I3P04.PNG" ); - // S32N3P04 - 32x32 paletted file, no interlacing + // S32N3P04 - 32x32 paletted file, no interlacing test_file< rgb8_image_t >( "S32N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S32N3P04.PNG" ); - // S33I3P04 - 33x33 paletted file, interlaced + // S33I3P04 - 33x33 paletted file, interlaced test_file< rgb8_image_t >( "S33I3P04.PNG" ); - // S33N3P04 - 33x33 paletted file, no interlacing + // S33N3P04 - 33x33 paletted file, no interlacing test_file< rgb8_image_t >( "S33N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S33N3P04.PNG" ); - // S34I3P04 - 34x34 paletted file, interlaced + // S34I3P04 - 34x34 paletted file, interlaced test_file< rgb8_image_t >( "S34I3P04.PNG" ); - // S34N3P04 - 34x34 paletted file, no interlacing + // S34N3P04 - 34x34 paletted file, no interlacing test_file< rgb8_image_t >( "S34N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S34N3P04.PNG" ); - // S35I3P04 - 35x35 paletted file, interlaced + // S35I3P04 - 35x35 paletted file, interlaced test_file< rgb8_image_t >( "S35I3P04.PNG" ); - // S35N3P04 - 35x35 paletted file, no interlacing + // S35N3P04 - 35x35 paletted file, no interlacing test_file< rgb8_image_t >( "S35N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S35N3P04.PNG" ); - // S36I3P04 - 36x36 paletted file, interlaced + // S36I3P04 - 36x36 paletted file, interlaced test_file< rgb8_image_t >( "S36I3P04.PNG" ); - // S36N3P04 - 36x36 paletted file, no interlacing + // S36N3P04 - 36x36 paletted file, no interlacing test_file< rgb8_image_t >( "S36N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S36N3P04.PNG" ); - // S37I3P04 - 37x37 paletted file, interlaced + // S37I3P04 - 37x37 paletted file, interlaced test_file< rgb8_image_t >( "S37I3P04.PNG" ); - // S37N3P04 - 37x37 paletted file, no interlacing + // S37N3P04 - 37x37 paletted file, no interlacing test_file< rgb8_image_t >( "S37N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S37N3P04.PNG" ); - // S38I3P04 - 38x38 paletted file, interlaced + // S38I3P04 - 38x38 paletted file, interlaced test_file< rgb8_image_t >( "S38I3P04.PNG" ); - // S38N3P04 - 38x38 paletted file, no interlacing + // S38N3P04 - 38x38 paletted file, no interlacing test_file< rgb8_image_t >( "S38N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S38N3P04.PNG" ); - // S39I3P04 - 39x39 paletted file, interlaced + // S39I3P04 - 39x39 paletted file, interlaced test_file< rgb8_image_t >( "S39I3P04.PNG" ); - // S39N3P04 - 39x39 paletted file, no interlacing + // S39N3P04 - 39x39 paletted file, no interlacing test_file< rgb8_image_t >( "S39N3P04.PNG" ); test_png_scanline_reader< rgb8_image_t >( "S39N3P04.PNG" ); - // S40I3P04 - 40x40 paletted file, interlaced + // S40I3P04 - 40x40 paletted file, interlaced test_file< rgb8_image_t >( "S40I3P04.PNG" ); // S40N3P04 - 40x40 paletted file, no interlacing @@ -383,25 +382,25 @@ BOOST_AUTO_TEST_CASE( odd_sizes_test ) BOOST_AUTO_TEST_CASE( background_test ) { - // BGAI4A08 - 8 bit grayscale, alpha, no background chunk, interlaced + // BGAI4A08 - 8 bit grayscale, alpha, no background chunk, interlaced test_file< gray_alpha8_image_t >( "BGAI4A08.PNG" ); - // BGAI4A16 - 16 bit grayscale, alpha, no background chunk, interlaced + // BGAI4A16 - 16 bit grayscale, alpha, no background chunk, interlaced test_file< gray_alpha16_image_t >( "BGAI4A16.PNG" ); - // BGAN6A08 - 3x8 bits rgb color, alpha, no background chunk + // BGAN6A08 - 3x8 bits rgb color, alpha, no background chunk test_file< rgba8_image_t >( "BGAN6A08.PNG" ); - // BGAN6A16 - 3x16 bits rgb color, alpha, no background chunk + // BGAN6A16 - 3x16 bits rgb color, alpha, no background chunk test_file< rgba16_image_t >( "BGAN6A16.PNG" ); - // BGBN4A08 - 8 bit grayscale, alpha, black background chunk + // BGBN4A08 - 8 bit grayscale, alpha, black background chunk test_file< gray_alpha8_image_t >( "BGBN4A08.PNG" ); - // BGGN4A16 - 16 bit grayscale, alpha, gray background chunk + // BGGN4A16 - 16 bit grayscale, alpha, gray background chunk test_file< gray_alpha16_image_t >( "BGGN4A16.PNG" ); - // BGWN6A08 - 3x8 bits rgb color, alpha, white background chunk + // BGWN6A08 - 3x8 bits rgb color, alpha, white background chunk test_file< rgba8_image_t >( "BGWN6A08.PNG" ); // BGYN6A16 - 3x16 bits rgb color, alpha, yellow background chunk @@ -410,41 +409,41 @@ BOOST_AUTO_TEST_CASE( background_test ) BOOST_AUTO_TEST_CASE( transparency_test ) { - // TBBN1G04 - transparent, black background chunk + // TBBN1G04 - transparent, black background chunk // file missing //test_file< gray_alpha8_image_t >( "TBBN1G04.PNG" ); - // TBBN2C16 - transparent, blue background chunk + // TBBN2C16 - transparent, blue background chunk test_file< rgba16_image_t >( "TBBN2C16.PNG" ); - // TBBN3P08 - transparent, black background chunk + // TBBN3P08 - transparent, black background chunk test_file< rgba8_image_t >( "TBBN3P08.PNG" ); - // TBGN2C16 - transparent, green background chunk + // TBGN2C16 - transparent, green background chunk test_file< rgba16_image_t >( "TBGN2C16.PNG" ); - // TBGN3P08 - transparent, light-gray background chunk + // TBGN3P08 - transparent, light-gray background chunk test_file< rgba8_image_t >( "TBGN3P08.PNG" ); - // TBRN2C08 - transparent, red background chunk + // TBRN2C08 - transparent, red background chunk test_file< rgba8_image_t >( "TBRN2C08.PNG" ); - // TBWN1G16 - transparent, white background chunk + // TBWN1G16 - transparent, white background chunk test_file< gray_alpha16_image_t >( "TBWN0G16.PNG" ); - // TBWN3P08 - transparent, white background chunk + // TBWN3P08 - transparent, white background chunk test_file< rgba8_image_t >( "TBWN3P08.PNG" ); - // TBYN3P08 - transparent, yellow background chunk + // TBYN3P08 - transparent, yellow background chunk test_file< rgba8_image_t >( "TBYN3P08.PNG" ); - // TP0N1G08 - not transparent for reference (logo on gray) + // TP0N1G08 - not transparent for reference (logo on gray) test_file< gray8_image_t >( "TP0N0G08.PNG" ); - // TP0N2C08 - not transparent for reference (logo on gray) + // TP0N2C08 - not transparent for reference (logo on gray) test_file< rgb8_image_t >( "TP0N2C08.PNG" ); - // TP0N3P08 - not transparent for reference (logo on gray) + // TP0N3P08 - not transparent for reference (logo on gray) test_file< rgb8_image_t >( "TP0N3P08.PNG" ); // TP1N3P08 - transparent, but no background chunk @@ -453,55 +452,55 @@ BOOST_AUTO_TEST_CASE( transparency_test ) BOOST_AUTO_TEST_CASE( gamma_test ) { - // G03N0G16 - grayscale, file-gamma = 0.35 + // G03N0G16 - grayscale, file-gamma = 0.35 test_file< gray16_image_t >( "G03N0G16.PNG" ); - // G03N2C08 - color, file-gamma = 0.35 + // G03N2C08 - color, file-gamma = 0.35 test_file< rgb8_image_t >( "G03N2C08.PNG" ); - // G03N3P04 - paletted, file-gamma = 0.35 + // G03N3P04 - paletted, file-gamma = 0.35 test_file< rgb8_image_t >( "G03N3P04.PNG" ); - // G04N0G16 - grayscale, file-gamma = 0.45 + // G04N0G16 - grayscale, file-gamma = 0.45 test_file< gray16_image_t >( "G04N0G16.PNG" ); - // G04N2C08 - color, file-gamma = 0.45 + // G04N2C08 - color, file-gamma = 0.45 test_file< rgb8_image_t >( "G04N2C08.PNG" ); - // G04N3P04 - paletted, file-gamma = 0.45 + // G04N3P04 - paletted, file-gamma = 0.45 test_file< rgb8_image_t >( "G04N3P04.PNG" ); - // G05N0G16 - grayscale, file-gamma = 0.55 + // G05N0G16 - grayscale, file-gamma = 0.55 test_file< gray16_image_t >( "G05N0G16.PNG" ); - // G05N2C08 - color, file-gamma = 0.55 + // G05N2C08 - color, file-gamma = 0.55 test_file< rgb8_image_t >( "G05N2C08.PNG" ); - // G05N3P04 - paletted, file-gamma = 0.55 + // G05N3P04 - paletted, file-gamma = 0.55 test_file< rgb8_image_t >( "G05N3P04.PNG" ); - // G07N0G16 - grayscale, file-gamma = 0.70 + // G07N0G16 - grayscale, file-gamma = 0.70 test_file< gray16_image_t >( "G07N0G16.PNG" ); - // G07N2C08 - color, file-gamma = 0.70 + // G07N2C08 - color, file-gamma = 0.70 test_file< rgb8_image_t >( "G07N2C08.PNG" ); - // G07N3P04 - paletted, file-gamma = 0.70 + // G07N3P04 - paletted, file-gamma = 0.70 test_file< rgb8_image_t >( "G07N3P04.PNG" ); - // G10N0G16 - grayscale, file-gamma = 1.00 + // G10N0G16 - grayscale, file-gamma = 1.00 test_file< gray16_image_t >( "G10N0G16.PNG" ); - // G10N2C08 - color, file-gamma = 1.00 + // G10N2C08 - color, file-gamma = 1.00 test_file< rgb8_image_t >( "G10N2C08.PNG" ); - // G10N3P04 - paletted, file-gamma = 1.00 + // G10N3P04 - paletted, file-gamma = 1.00 test_file< rgb8_image_t >( "G10N3P04.PNG" ); - // G25N0G16 - grayscale, file-gamma = 2.50 + // G25N0G16 - grayscale, file-gamma = 2.50 test_file< gray16_image_t >( "G25N0G16.PNG" ); - // G25N2C08 - color, file-gamma = 2.50 + // G25N2C08 - color, file-gamma = 2.50 test_file< rgb8_image_t >( "G25N2C08.PNG" ); // G25N3P04 - paletted, file-gamma = 2.50 diff --git a/io/test/png_test.cpp b/io/test/png_test.cpp index 42a123e4f0..fbd98a1a98 100644 --- a/io/test/png_test.cpp +++ b/io/test/png_test.cpp @@ -1,23 +1,22 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE png_test -#include - -#include - -#include - //#define BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED //#define BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED + +#include #include +#include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" #include "subimage_test.hpp" @@ -64,7 +63,7 @@ BOOST_AUTO_TEST_CASE( read_image_info_using_string ) { FILE* file = fopen( png_filename.c_str(), "rb" ); - + typedef get_reader_backend< FILE* , tag_t >::type backend_t; @@ -100,7 +99,7 @@ BOOST_AUTO_TEST_CASE( read_image_test ) { FILE* file = fopen( png_filename.c_str(), "rb" ); - + rgba8_image_t img; read_image( file, img, tag_t() ); @@ -139,7 +138,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_image_test ) { FILE* file = fopen( png_filename.c_str(), "rb" ); - + rgb8_image_t img; read_and_convert_image( file, img, tag_t() ); @@ -164,7 +163,7 @@ BOOST_AUTO_TEST_CASE( read_view_test ) { FILE* file = fopen( png_filename.c_str(), "rb" ); - + rgba8_image_t img( 1000, 600 ); read_view( file, view( img ), tag_t() ); } @@ -186,7 +185,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_view_test ) { FILE* file = fopen( png_filename.c_str(), "rb" ); - + rgb8_image_t img( 1000, 600 ); read_and_convert_view( file @@ -243,7 +242,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) string filename( png_out + "write_test_file.png" ); FILE* file = fopen( filename.c_str(), "wb" ); - + write_view( file , create_mandel_view( 320, 240 , rgb8_pixel_t( 0, 0, 255 ) diff --git a/io/test/png_write_test.cpp b/io/test/png_write_test.cpp index 01908735c3..6769596352 100644 --- a/io/test/png_write_test.cpp +++ b/io/test/png_write_test.cpp @@ -1,22 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE png_read_test_module -#include - #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #define BOOST_GIL_IO_ENABLE_GRAY_ALPHA - - #define BOOST_FILESYSTEM_VERSION 3 -#include #include +#include +#include + #include #include diff --git a/io/test/pnm_old_test.cpp b/io/test/pnm_old_test.cpp index 8cf46b4815..4d16c301d0 100644 --- a/io/test/pnm_old_test.cpp +++ b/io/test/pnm_old_test.cpp @@ -1,10 +1,10 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE pnm_old_test_module #include diff --git a/io/test/pnm_read_test.cpp b/io/test/pnm_read_test.cpp index 21f539985e..2b2a3df2fa 100644 --- a/io/test/pnm_read_test.cpp +++ b/io/test/pnm_read_test.cpp @@ -1,15 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE pnm_read_test_module -#include #include +#include + #include "paths.hpp" #include "scanline_read_test.hpp" @@ -64,7 +65,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p1.pnm { gray8_image_t img; - + read_image( pnm_in + "p1.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 200u ); BOOST_CHECK_EQUAL( view( img ).height(), 200u ); @@ -77,7 +78,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p2.pnm { gray8_image_t img; - + read_image( pnm_in + "p2.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 200u ); BOOST_CHECK_EQUAL( view( img ).height(), 200u ); @@ -90,7 +91,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p3.pnm { rgb8_image_t img; - + read_image( pnm_in + "p3.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 256u ); BOOST_CHECK_EQUAL( view( img ).height(), 256u ); @@ -103,7 +104,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p4.pnm { gray1_image_t img; - + read_image( pnm_in + "p4.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 200u ); BOOST_CHECK_EQUAL( view( img ).height(), 200u ); @@ -116,7 +117,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p5.pnm { gray8_image_t img; - + read_image( pnm_in + "p5.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 200u ); BOOST_CHECK_EQUAL( view( img ).height(), 200u ); @@ -129,7 +130,7 @@ BOOST_AUTO_TEST_CASE( read_reference_images_test ) // p6.pnm { rgb8_image_t img; - + read_image( pnm_in + "p6.pnm", img, tag_t() ); BOOST_CHECK_EQUAL( view( img ).width() , 256u ); BOOST_CHECK_EQUAL( view( img ).height(), 256u ); diff --git a/io/test/pnm_test.cpp b/io/test/pnm_test.cpp index ce68e3c1e4..71048798f7 100644 --- a/io/test/pnm_test.cpp +++ b/io/test/pnm_test.cpp @@ -1,20 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE pnm_test -#include - -#include #include #include +#include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" #include "subimage_test.hpp" @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE( read_image_info_using_string ) { FILE* file = fopen( pnm_filename.c_str(), "rb" ); - + typedef get_reader_backend< FILE* , tag_t >::type backend_t; @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE( read_image_test ) { FILE* file = fopen( pnm_filename.c_str(), "rb" ); - + rgb8_image_t img; read_image( file, img, tag_t() ); @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_image_test ) { FILE* file = fopen( pnm_filename.c_str(), "rb" ); - + rgb8_image_t img; read_and_convert_image( file, img, tag_t() ); @@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE( read_view_test ) { FILE* file = fopen( pnm_filename.c_str(), "rb" ); - + rgb8_image_t img( 256, 256 ); read_view( file, view( img ), tag_t() ); } @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_view_test ) { FILE* file = fopen( pnm_filename.c_str(), "rb" ); - + rgb8_image_t img( 256, 256 ); read_and_convert_view( file @@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) string filename( pnm_out + "write_test_file.pnm" ); FILE* file = fopen( filename.c_str(), "wb" ); - + write_view( file , create_mandel_view( 320, 240 , rgb8_pixel_t( 0, 0, 255 ) diff --git a/io/test/pnm_write_test.cpp b/io/test/pnm_write_test.cpp index 8b5cbcc0ba..9c94fdc1d7 100644 --- a/io/test/pnm_write_test.cpp +++ b/io/test/pnm_write_test.cpp @@ -1,15 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE pnm_write_test_module -#include #include +#include + #include "color_space_write_test.hpp" #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/raw_test.cpp b/io/test/raw_test.cpp index 7b94ce45f9..019e2be8c6 100644 --- a/io/test/raw_test.cpp +++ b/io/test/raw_test.cpp @@ -1,22 +1,21 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE raw_test -#include - +#define BOOST_FILESYSTEM_VERSION 3 #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT -#include - #include #include -#define BOOST_FILESYSTEM_VERSION 3 #include +#include + +#include #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/scanline_read_test.hpp b/io/test/scanline_read_test.hpp index dc1b50b148..3495798439 100644 --- a/io/test/scanline_read_test.hpp +++ b/io/test/scanline_read_test.hpp @@ -1,12 +1,12 @@ -/* - 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_SCANLINE_READ_TEST_HPP -#define BOOST_GIL_IO_UNIT_TEST_SCANLINE_READ_TEST_HPP +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_SCANLINE_READ_TEST_HPP +#define BOOST_GIL_IO_TEST_SCANLINE_READ_TEST_HPP #include @@ -58,4 +58,4 @@ void test_scanline_reader( const char* file_name ) cmp_view( view( dst ), view( img ) ); } -#endif // BOOST_GIL_IO_UNIT_TEST_SCANLINE_READ_TEST_HPP +#endif // BOOST_GIL_IO_TEST_SCANLINE_READ_TEST_HPP diff --git a/io/test/subimage_test.hpp b/io/test/subimage_test.hpp index 045e3c23b8..0fe8ed2aac 100644 --- a/io/test/subimage_test.hpp +++ b/io/test/subimage_test.hpp @@ -1,12 +1,12 @@ -/* - 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 +// +// Copyright 2013 Christian Henning +// +// 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 +// +#ifndef BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP +#define BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP #include @@ -48,4 +48,4 @@ void run_subimage_test( string filename ); } -#endif // BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP +#endif // BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP diff --git a/io/test/targa_old_test.cpp b/io/test/targa_old_test.cpp index a596da885e..214ab9b18c 100644 --- a/io/test/targa_old_test.cpp +++ b/io/test/targa_old_test.cpp @@ -1,16 +1,17 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE targa_old_test_module -#include #include #include +#include + #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/targa_read_test.cpp b/io/test/targa_read_test.cpp index f486add829..b3c9238213 100644 --- a/io/test/targa_read_test.cpp +++ b/io/test/targa_read_test.cpp @@ -1,17 +1,18 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE targa_read_test_module -#include -#include #include #include +#include +#include + #include "paths.hpp" #include "scanline_read_test.hpp" diff --git a/io/test/targa_test.cpp b/io/test/targa_test.cpp index f6bc0745f0..83a0ae7b86 100644 --- a/io/test/targa_test.cpp +++ b/io/test/targa_test.cpp @@ -1,21 +1,20 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE targa_test -#include - #define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT -#include - #include #include #include +#include + +#include #include "mandel_view.hpp" #include "paths.hpp" @@ -58,14 +57,14 @@ BOOST_AUTO_TEST_CASE( read_image_info_using_string ) backend_t backend = read_image_info( in , tag_t() ); - + BOOST_CHECK_EQUAL( backend._info._width , 124 ); BOOST_CHECK_EQUAL( backend._info._height, 124 ); } { FILE* file = fopen( targa_filename.c_str(), "rb" ); - + typedef get_reader_backend< FILE* , tag_t >::type backend_t; @@ -116,7 +115,7 @@ BOOST_AUTO_TEST_CASE( read_image_test ) { FILE* file = fopen( targa_filename.c_str(), "rb" ); - + rgb8_image_t img; read_image( file, img, tag_t() ); @@ -147,7 +146,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_image_test ) { FILE* file = fopen( targa_filename.c_str(), "rb" ); - + rgb8_image_t img; read_and_convert_image( file, img, tag_t() ); @@ -172,7 +171,7 @@ BOOST_AUTO_TEST_CASE( read_view_test ) { FILE* file = fopen( targa_filename.c_str(), "rb" ); - + rgb8_image_t img( 124, 124 ); read_view( file, view( img ), tag_t() ); } @@ -194,7 +193,7 @@ BOOST_AUTO_TEST_CASE( read_and_convert_view_test ) { FILE* file = fopen( targa_filename.c_str(), "rb" ); - + rgb8_image_t img( 124, 124 ); read_and_convert_view( file , view( img ) @@ -226,7 +225,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) string filename( targa_out + "write_test_file.tga" ); FILE* file = fopen( filename.c_str(), "wb" ); - + write_view( file , create_mandel_view( 124, 124 , rgb8_pixel_t( 0, 0, 255 ) diff --git a/io/test/targa_write_test.cpp b/io/test/targa_write_test.cpp index 992ea71d10..0642700605 100644 --- a/io/test/targa_write_test.cpp +++ b/io/test/targa_write_test.cpp @@ -1,18 +1,18 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE targa_write_test_module -#include #include - #include #include +#include + #include "color_space_write_test.hpp" #include "mandel_view.hpp" #include "paths.hpp" diff --git a/io/test/test.cpp b/io/test/test.cpp index 0510fbf3f2..d36a87c22a 100644 --- a/io/test/test.cpp +++ b/io/test/test.cpp @@ -1,9 +1,9 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MAIN #include diff --git a/io/test/tiff_file_format_test.cpp b/io/test/tiff_file_format_test.cpp index 6990af1627..9591f71b1c 100644 --- a/io/test/tiff_file_format_test.cpp +++ b/io/test/tiff_file_format_test.cpp @@ -1,21 +1,16 @@ -/* - 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). -*/ - -/************************************************** - * - * This test file will read and write various - * tiff formats. - * - **************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_file_format_test_module -#include #include +#include + #include "paths.hpp" #include "scanline_read_test.hpp" diff --git a/io/test/tiff_old_test.cpp b/io/test/tiff_old_test.cpp index 7bea336b63..8ef1b81ad0 100644 --- a/io/test/tiff_old_test.cpp +++ b/io/test/tiff_old_test.cpp @@ -1,26 +1,22 @@ -/* - 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). -*/ - -/************************************************** - * - * This test file will only test the old library's - * interface. It's more of a compile time test - * than a runtime test. - * - **************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_old_test_module -#include #include #include +#include + #include "paths.hpp" +// This test file will only test the old library's interface. +// It's more of a compile time test than a runtime test. + using namespace std; using namespace boost; using namespace gil; diff --git a/io/test/tiff_subimage_test.cpp b/io/test/tiff_subimage_test.cpp index 91e1791d5b..4b8dfe9709 100644 --- a/io/test/tiff_subimage_test.cpp +++ b/io/test/tiff_subimage_test.cpp @@ -1,15 +1,16 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_subimage_test_module -#include #include +#include + #include #include @@ -74,7 +75,7 @@ BOOST_AUTO_TEST_CASE( subimage_test_8 ) read_image( tiff_in_GM + "tiger-minisblack-strip-08.tif", img1, settings ); read_image( tiff_in_GM + "tiger-minisblack-tile-08.tif" , img2, settings ); read_image( tiff_in_GM + "tiger-minisblack-strip-08.tif", img3, tag_t() ); - + BOOST_CHECK( equal_pixels( const_view( img1 ), const_view( img2 ))); BOOST_CHECK( equal_pixels( const_view( img1 ), subimage_view( view( img3 ), top_left, dim ))); } @@ -91,7 +92,7 @@ BOOST_AUTO_TEST_CASE( subimage_test_16 ) read_image( tiff_in_GM + "tiger-minisblack-strip-16.tif", img1, settings ); read_image( tiff_in_GM + "tiger-minisblack-tile-16.tif" , img2, settings ); read_image( tiff_in_GM + "tiger-minisblack-strip-16.tif", img3, tag_t() ); - + BOOST_CHECK( equal_pixels( const_view( img1 ), const_view( img2 ))); BOOST_CHECK( equal_pixels( const_view( img1 ), subimage_view( view( img3 ), top_left, dim ))); } @@ -109,7 +110,7 @@ BOOST_AUTO_TEST_CASE( subimage_test_32 ) read_image( tiff_in_GM + "tiger-minisblack-strip-32.tif", img1, settings ); read_image( tiff_in_GM + "tiger-minisblack-tile-32.tif" , img2, settings ); read_image( tiff_in_GM + "tiger-minisblack-strip-32.tif", img3, tag_t() ); - + BOOST_CHECK( equal_pixels( const_view( img1 ), const_view( img2 ))); BOOST_CHECK( equal_pixels( const_view( img1 ), subimage_view( view( img3 ), top_left, dim ))); } diff --git a/io/test/tiff_test.cpp b/io/test/tiff_test.cpp index e4bba3c170..4d312cd503 100644 --- a/io/test/tiff_test.cpp +++ b/io/test/tiff_test.cpp @@ -1,28 +1,19 @@ -/* - 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). -*/ - - -/************************************************** - * - * This test file will only test the library's - * interface. It's more of a compile time test - * than a runtime test. - * - **************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #define BOOST_TEST_MODULE tiff_test -#include - -#define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #define BOOST_FILESYSTEM_VERSION 3 -#include +#define BOOST_GIL_IO_ADD_FS_PATH_SUPPORT #include +#include +#include + #include #include @@ -30,6 +21,9 @@ #include "paths.hpp" #include "subimage_test.hpp" +// This test file will only test the library's interface. +// It's more of a compile time test than a runtime test. + using namespace std; using namespace boost; using namespace gil; @@ -81,7 +75,7 @@ BOOST_AUTO_TEST_CASE( read_image_info_test ) backend_t backend = read_image_info( file , tag_t() ); - + BOOST_CHECK_EQUAL( backend._info._width , 1000u ); BOOST_CHECK_EQUAL( backend._info._height, 600u ); } @@ -264,7 +258,7 @@ BOOST_AUTO_TEST_CASE( write_view_test ) { string filename( tiff_out + "write_test_tiff.tif" ); TIFF* file = TIFFOpen( filename.c_str(), "w" ); - + write_view( file , create_mandel_view( 320, 240 , rgb8_pixel_t( 0, 0, 255 ) @@ -348,7 +342,7 @@ BOOST_AUTO_TEST_CASE( subimage_test ) BOOST_AUTO_TEST_CASE( dynamic_image_test ) { - // This test has been disabled for now because of + // This test has been disabled for now because of // compilation issues with MSVC10. typedef mpl::vector< gray8_image_t diff --git a/io/test/tiff_tiled_float_test.cpp b/io/test/tiff_tiled_float_test.cpp index 5c41faa41a..4d19931933 100644 --- a/io/test/tiff_tiled_float_test.cpp +++ b/io/test/tiff_tiled_float_test.cpp @@ -1,20 +1,16 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test float tiled tiff reading - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_float_test_module -#include #include + +#include + #include "paths.hpp" using namespace std; diff --git a/io/test/tiff_tiled_minisblack_test_1-10.cpp b/io/test/tiff_tiled_minisblack_test_1-10.cpp index d522418bb7..a328a913b8 100644 --- a/io/test/tiff_tiled_minisblack_test_1-10.cpp +++ b/io/test/tiff_tiled_minisblack_test_1-10.cpp @@ -1,17 +1,12 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff reading - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_test_1_10_module + #include #include "tiff_tiled_read_macros.hpp" diff --git a/io/test/tiff_tiled_minisblack_test_11-20.cpp b/io/test/tiff_tiled_minisblack_test_11-20.cpp index 93fd24c0a9..2893eb22f0 100644 --- a/io/test/tiff_tiled_minisblack_test_11-20.cpp +++ b/io/test/tiff_tiled_minisblack_test_11-20.cpp @@ -1,20 +1,15 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff writing - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_test_11_20_module #include #include + #include "tiff_tiled_read_macros.hpp" BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests ) diff --git a/io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp b/io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp index 7628fe9ac8..a8edba86d8 100644 --- a/io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp +++ b/io/test/tiff_tiled_minisblack_test_21-31_32-64.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff reading - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_test_21_31_32_64_module #include diff --git a/io/test/tiff_tiled_minisblack_write_test_1-10.cpp b/io/test/tiff_tiled_minisblack_write_test_1-10.cpp index 77d10a0393..98693ae01b 100644 --- a/io/test/tiff_tiled_minisblack_write_test_1-10.cpp +++ b/io/test/tiff_tiled_minisblack_write_test_1-10.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff writing - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_write_test_1_10_module #include diff --git a/io/test/tiff_tiled_minisblack_write_test_11-20.cpp b/io/test/tiff_tiled_minisblack_write_test_11-20.cpp index 2a7ec42bd2..67e23f94f1 100644 --- a/io/test/tiff_tiled_minisblack_write_test_11-20.cpp +++ b/io/test/tiff_tiled_minisblack_write_test_11-20.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff writing - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_write_test_11_20_module #include diff --git a/io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp b/io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp index f2919d824b..347b6c8eb4 100644 --- a/io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp +++ b/io/test/tiff_tiled_minisblack_write_test_21-31_32-64.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test gray tiled tiff writing - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_miniblack_write_test_21_31_32_64_module #include diff --git a/io/test/tiff_tiled_palette_test_1-8.cpp b/io/test/tiff_tiled_palette_test_1-8.cpp index 1b213786c9..25b4d9544f 100644 --- a/io/test/tiff_tiled_palette_test_1-8.cpp +++ b/io/test/tiff_tiled_palette_test_1-8.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test palette tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_palette_test_1_8_module #include diff --git a/io/test/tiff_tiled_palette_test_8-16.cpp b/io/test/tiff_tiled_palette_test_8-16.cpp index ad87c8b0bd..0dad9f4d2a 100644 --- a/io/test/tiff_tiled_palette_test_8-16.cpp +++ b/io/test/tiff_tiled_palette_test_8-16.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test palette tiled tiff reading - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_palette_test_8_16_module #include diff --git a/io/test/tiff_tiled_palette_write_test_1-8.cpp b/io/test/tiff_tiled_palette_write_test_1-8.cpp index 34e73f6679..93002b4b89 100644 --- a/io/test/tiff_tiled_palette_write_test_1-8.cpp +++ b/io/test/tiff_tiled_palette_write_test_1-8.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test palette tiled tiff writing - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_palette_write_test_1_8_module #include diff --git a/io/test/tiff_tiled_palette_write_test_8-16.cpp b/io/test/tiff_tiled_palette_write_test_8-16.cpp index 3c2a4c6eab..b59b536eda 100644 --- a/io/test/tiff_tiled_palette_write_test_8-16.cpp +++ b/io/test/tiff_tiled_palette_write_test_8-16.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test palette tiled tiff writing - * - *******************************************************/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_palette_write_test_8_16_module #include diff --git a/io/test/tiff_tiled_read_macros.hpp b/io/test/tiff_tiled_read_macros.hpp index a079469fcd..c25987eb56 100644 --- a/io/test/tiff_tiled_read_macros.hpp +++ b/io/test/tiff_tiled_read_macros.hpp @@ -1,23 +1,23 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_TIFF_TILED_READ_MACROS_HPP #define BOOST_GIL_TIFF_TILED_READ_MACROS_HPP +#include +#include + +#include #include #include #include #include #include -#include -#include -#include - #include "paths.hpp" typedef boost::gil::tiff_tag tag_t; diff --git a/io/test/tiff_tiled_rgb_contig_test_1-10.cpp b/io/test/tiff_tiled_rgb_contig_test_1-10.cpp index d4e1247946..469e18b4c8 100644 --- a/io/test/tiff_tiled_rgb_contig_test_1-10.cpp +++ b/io/test/tiff_tiled_rgb_contig_test_1-10.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB contig tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_test_1_10_module #include diff --git a/io/test/tiff_tiled_rgb_contig_test_11-20.cpp b/io/test/tiff_tiled_rgb_contig_test_11-20.cpp index 017cf9aa92..df796d7862 100644 --- a/io/test/tiff_tiled_rgb_contig_test_11-20.cpp +++ b/io/test/tiff_tiled_rgb_contig_test_11-20.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB contig tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_test_11_20_module #include diff --git a/io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp b/io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp index 80fbad77ca..b8c73460ab 100644 --- a/io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp +++ b/io/test/tiff_tiled_rgb_contig_test_21-31_32_64.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB contig tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_test_21_31_32_64_module #include diff --git a/io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp b/io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp index 53dc76c442..682d8ee2c4 100644 --- a/io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp +++ b/io/test/tiff_tiled_rgb_contig_write_test_1-10.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test rgb contig tiled tiff writing - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_write_test_1_10_module #include diff --git a/io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp b/io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp index 3f1c7c02d3..3da9172b07 100644 --- a/io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp +++ b/io/test/tiff_tiled_rgb_contig_write_test_11-20.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test rgb contig tiled tiff writing - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_write_test_11_20_module #include diff --git a/io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp b/io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp index 1002f99007..4992f2a57e 100644 --- a/io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp +++ b/io/test/tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test rgb contig tiled tiff writing - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_write_test_21_31_32_64_module #include diff --git a/io/test/tiff_tiled_rgb_planar_test_1-10.cpp b/io/test/tiff_tiled_rgb_planar_test_1-10.cpp index 934f956b15..797d4d66fb 100644 --- a/io/test/tiff_tiled_rgb_planar_test_1-10.cpp +++ b/io/test/tiff_tiled_rgb_planar_test_1-10.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB planar tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_planar_test_1_10_module #include diff --git a/io/test/tiff_tiled_rgb_planar_test_11-20.cpp b/io/test/tiff_tiled_rgb_planar_test_11-20.cpp index 880c03c62e..d118c9e0b8 100644 --- a/io/test/tiff_tiled_rgb_planar_test_11-20.cpp +++ b/io/test/tiff_tiled_rgb_planar_test_11-20.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB planar tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_planar_test_11_20_module #include diff --git a/io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp b/io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp index 9ce62f332a..a4991f6033 100644 --- a/io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp +++ b/io/test/tiff_tiled_rgb_planar_test_21-31_32_64.cpp @@ -1,15 +1,10 @@ -/* - 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). -*/ - -/******************************************************** - * - * This test file will test RGB planar tiled tiff reading - * - *******************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_rgb_planar_test_21_31_32_64_module #include diff --git a/io/test/tiff_tiled_test.cpp b/io/test/tiff_tiled_test.cpp index bd63d9cf71..d330bd3444 100644 --- a/io/test/tiff_tiled_test.cpp +++ b/io/test/tiff_tiled_test.cpp @@ -1,16 +1,10 @@ -/* - 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). -*/ - - -/************************************************** - * - * This test file will test tiled tiff reading - * - **************************************************/ +// +// Copyright 2013 Christian Henning +// +// 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 +// //#define BOOST_TEST_MODULE tiff_tiled_test_module #include diff --git a/io/test/tiff_tiled_write_macros.hpp b/io/test/tiff_tiled_write_macros.hpp index 10c4d762bf..6c843c7797 100644 --- a/io/test/tiff_tiled_write_macros.hpp +++ b/io/test/tiff_tiled_write_macros.hpp @@ -1,25 +1,25 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 +// #ifndef BOOST_GIL_TIFF_TILED_WRITE_MACROS_HPP #define BOOST_GIL_TIFF_TILED_WRITE_MACROS_HPP -#include #include #include -#include "paths.hpp" - +#include #include #include #include #include #include +#include "paths.hpp" + typedef boost::gil::tiff_tag tag_t; #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES diff --git a/io/test/tiff_write_test.cpp b/io/test/tiff_write_test.cpp index b349b5fba9..420e84c658 100644 --- a/io/test/tiff_write_test.cpp +++ b/io/test/tiff_write_test.cpp @@ -1,18 +1,16 @@ -/* - 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). -*/ - - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 - #include #include +#include + #include "color_space_write_test.hpp" #include "mandel_view.hpp" #include "paths.hpp" diff --git a/test/channel.cpp b/test/channel.cpp index eae2a33bca..d0adb792a3 100644 --- a/test/channel.cpp +++ b/test/channel.cpp @@ -1,25 +1,21 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -// channel.cpp : Tests channel // +// 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 +#include +#include #include #include #include -#include -#include -#include -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated #endif @@ -221,12 +217,12 @@ class packed_dynamic_reference_core { template -void test_channel_value() { +void test_channel_value() { do_test >().test_all(); } template -void test_channel_reference() { +void test_channel_reference() { do_test >().test_all(); } @@ -273,12 +269,12 @@ struct channel_archetype { // convertible to a scalar operator std::uint8_t() const { return 0; } - + channel_archetype& operator++() { return *this; } channel_archetype& operator--() { return *this; } channel_archetype operator++(int) { return *this; } channel_archetype operator--(int) { return *this; } - + template channel_archetype operator+=(Scalar) { return *this; } template channel_archetype operator-=(Scalar) { return *this; } template channel_archetype operator*=(Scalar) { return *this; } @@ -384,7 +380,7 @@ int main() } } -// TODO: +// TODO: // - provide algorithm performance overloads for scoped channel and packed channels // - Update concepts and documentation // - What to do about pointer types?! diff --git a/test/channel/channel_concepts.cpp b/test/channel/channel_concepts.cpp index bdf580d4d0..60bb34e4b0 100644 --- a/test/channel/channel_concepts.cpp +++ b/test/channel/channel_concepts.cpp @@ -6,7 +6,7 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // -#include +#include #include #define BOOST_TEST_MODULE test_channel_concepts diff --git a/test/channel/channel_test_fixture.hpp b/test/channel/channel_test_fixture.hpp index e8fe49febf..31457656ab 100644 --- a/test/channel/channel_test_fixture.hpp +++ b/test/channel/channel_test_fixture.hpp @@ -7,7 +7,7 @@ // http://www.boost.org/LICENSE_1_0.txt // #include -#include +#include #include #include #include diff --git a/test/image.cpp b/test/image.cpp index 47bb36945b..0fc126e97d 100644 --- a/test/image.cpp +++ b/test/image.cpp @@ -1,30 +1,29 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. - */ - +// +// 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 +// #ifdef _MSC_VER #pragma warning(disable : 4244) // conversion from 'gil::image::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) #pragma warning(disable : 4503) // decorated name length exceeded, name was truncated #endif -#include -#include +#include + +#include +#include +#include +#include + #include #include #include #include #include -#include -#include -#include -#include -#include +#include +#include using namespace boost::gil; using namespace std; @@ -543,7 +542,7 @@ int main(int argc, char* argv[]) std::ifstream file_is_there(local_name.c_str()); if (!file_is_there) throw std::runtime_error("Unable to open gil_reference_checksums.txt"); - + test_image(local_name.c_str()); return EXIT_SUCCESS; diff --git a/test/image_view/image_view_concepts.cpp b/test/image_view/image_view_concepts.cpp index 846295dde2..67987ff53e 100644 --- a/test/image_view/image_view_concepts.cpp +++ b/test/image_view/image_view_concepts.cpp @@ -5,7 +5,7 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // -#include +#include #include #include diff --git a/test/performance.cpp b/test/performance.cpp index a03dc730af..c76d71280f 100644 --- a/test/performance.cpp +++ b/test/performance.cpp @@ -1,52 +1,36 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - -/*************************************************************************************************/ - -/// \file -/// \brief GIL performance test suite -/// \date 2007 \n Last updated on February 12, 2007 -/// -/// Available tests: -/// fill_pixels() on rgb8_image_t with rgb8_pixel_t -/// fill_pixels() on rgb8_planar_image_t with rgb8_pixel_t -/// fill_pixels() on rgb8_image_t with bgr8_pixel_t -/// fill_pixels() on rgb8_planar_image_t with bgr8_pixel_t -/// for_each_pixel() on rgb8_image_t -/// for_each_pixel() on rgb8_planar_t -/// copy_pixels() between rgb8_image_t and rgb8_image_t -/// copy_pixels() between rgb8_image_t and bgr8_image_t -/// copy_pixels() between rgb8_planar_image_t and rgb8_planar_image_t -/// copy_pixels() between rgb8_image_t and rgb8_planar_image_t -/// copy_pixels() between rgb8_planar_image_t and rgb8_image_t -/// transform_pixels() between rgb8_image_t and rgb8_image_t -/// transform_pixels() between rgb8_planar_image_t and rgb8_planar_image_t -/// transform_pixels() between rgb8_planar_image_t and rgb8_image_t -/// transform_pixels() between rgb8_image_t and rgb8_planar_image_t +// +// 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 + +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +// GIL performance test suite +// +// Available tests: +// fill_pixels() on rgb8_image_t with rgb8_pixel_t +// fill_pixels() on rgb8_planar_image_t with rgb8_pixel_t +// fill_pixels() on rgb8_image_t with bgr8_pixel_t +// fill_pixels() on rgb8_planar_image_t with bgr8_pixel_t +// for_each_pixel() on rgb8_image_t +// for_each_pixel() on rgb8_planar_t +// copy_pixels() between rgb8_image_t and rgb8_image_t +// copy_pixels() between rgb8_image_t and bgr8_image_t +// copy_pixels() between rgb8_planar_image_t and rgb8_planar_image_t +// copy_pixels() between rgb8_image_t and rgb8_planar_image_t +// copy_pixels() between rgb8_planar_image_t and rgb8_image_t +// transform_pixels() between rgb8_image_t and rgb8_image_t +// transform_pixels() between rgb8_planar_image_t and rgb8_planar_image_t +// transform_pixels() between rgb8_planar_image_t and rgb8_image_t +// transform_pixels() between rgb8_image_t and rgb8_planar_image_t using namespace boost::gil; diff --git a/test/pixel.cpp b/test/pixel.cpp index 514ecde86e..b6e333c710 100644 --- a/test/pixel.cpp +++ b/test/pixel.cpp @@ -1,38 +1,22 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). +// +// 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 - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Testing pixel references and values, pixel operations, color conversion using namespace boost::gil; using std::swap; @@ -40,11 +24,11 @@ using namespace boost; void error_if(bool condition); -struct increment { - template void operator()(Incrementable& x) const { ++x; } +struct increment { + template void operator()(Incrementable& x) const { ++x; } }; -struct prev { - template +struct prev { + template typename channel_traits::value_type operator()(const Subtractable& x) const { return x-1; } }; struct set_to_one{ int operator()() const { return 1; } }; @@ -116,10 +100,10 @@ struct do_basic_test : public C1, public C2 { typedef typename boost::add_reference::type p1_ref; test_swap( boost::mpl::bool_< - pixel_reference_is_mutable::value && + pixel_reference_is_mutable::value && boost::is_same::value> ()); } - + void test_swap(boost::mpl::false_) {} void test_swap(boost::mpl::true_) { // test swap @@ -166,8 +150,8 @@ class reference_core : public value_core, - reference_core, + value_core, + reference_core, value_core, reference_core, value_core, @@ -227,13 +211,13 @@ struct ccv2 { Pixel1 p1; pixel2_mutable p2; - + color_convert_impl(p1._pixel, p2._pixel); } }; struct ccv1 { - template + template void operator()(Pixel) { mpl::for_each(ccv2()); } @@ -243,7 +227,7 @@ void test_color_convert() { for_each(ccv1()); } -void test_packed_pixel() { +void test_packed_pixel() { typedef packed_pixel_type, rgb_layout_t>::type rgb565_pixel_t; boost::function_requires >(); @@ -261,12 +245,12 @@ void test_packed_pixel() { get_color(r565,red_t()) = channel_convert::type>(get_color(rgb_full,red_t())); get_color(r565,green_t()) = channel_convert::type>(get_color(rgb_full,green_t())); get_color(r565,blue_t()) = channel_convert::type>(get_color(rgb_full,blue_t())); - error_if(r565 != rgb565_pixel_t((uint16_t)65535)); - + error_if(r565 != rgb565_pixel_t((uint16_t)65535)); + // rgb565 is compatible with bgr556. Test interoperability boost::function_requires >(); - do_basic_test, value_core >(r565).test_heterogeneous(); + do_basic_test, value_core >(r565).test_heterogeneous(); color_convert(r565,rgb_full); color_convert(rgb_full,r565); @@ -276,8 +260,8 @@ void test_packed_pixel() { typedef const bit_aligned_pixel_reference, rgb_layout_t, true> rgb121_ref_t; typedef rgb121_ref_t::value_type rgb121_pixel_t; rgb121_pixel_t p121; - do_basic_test, reference_core >(p121).test_heterogeneous(); - do_basic_test, reference_core >(p121).test_heterogeneous(); + do_basic_test, reference_core >(p121).test_heterogeneous(); + do_basic_test, reference_core >(p121).test_heterogeneous(); BOOST_STATIC_ASSERT((pixel_reference_is_proxy::value)); BOOST_STATIC_ASSERT((pixel_reference_is_proxy::value)); @@ -304,10 +288,10 @@ void test_pixel() { test_packed_pixel(); rgb8_pixel_t rgb8(1,2,3); - do_basic_test, reference_core >(rgb8).test_all(); - do_basic_test, reference_core >(rgb8).test_all(); - do_basic_test, reference_core >(rgb8).test_all(); - do_basic_test, reference_core >(rgb8).test_all(); + do_basic_test, reference_core >(rgb8).test_all(); + do_basic_test, reference_core >(rgb8).test_all(); + do_basic_test, reference_core >(rgb8).test_all(); + do_basic_test, reference_core >(rgb8).test_all(); test_color_convert(); diff --git a/test/pixel_iterator.cpp b/test/pixel_iterator.cpp index 25394bf78f..5c47da998a 100644 --- a/test/pixel_iterator.cpp +++ b/test/pixel_iterator.cpp @@ -1,38 +1,24 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -// pixel_iterator.cpp : Tests GIL iterators // +// 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 + +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include using namespace boost::gil; using namespace std; -void test_pixel_iterator() { +void test_pixel_iterator() +{ boost::function_requires > >(); boost::function_requires >(); diff --git a/test/recreate_image.cpp b/test/recreate_image.cpp index 9c019da759..a3af12187e 100644 --- a/test/recreate_image.cpp +++ b/test/recreate_image.cpp @@ -1,33 +1,27 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ -// image_test.cpp : // - +// 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 +// #ifdef _MSC_VER //#pragma warning(disable : 4244) // conversion from 'gil::image::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same) #pragma warning(disable : 4503) // decorated name length exceeded, name was truncated #endif +#include +#include +#include +#include +#include -#include -#include #include #include #include #include -#include -#include -#include -#include - -#include +#include +#include using namespace boost::gil; using namespace std; @@ -102,11 +96,11 @@ BOOST_AUTO_TEST_CASE(recreate_image_test) BOOST_AUTO_TEST_SUITE_END() -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) #pragma warning(disable:4127) //conditional expression is constant #endif -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif diff --git a/test/sample_image.cpp b/test/sample_image.cpp index 8a89df2c53..bbcdf01794 100644 --- a/test/sample_image.cpp +++ b/test/sample_image.cpp @@ -1,13 +1,10 @@ -/* - Copyright 2005-2007 Adobe Systems Incorporated - - 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). - - See http://opensource.adobe.com/gil for most recent version including documentation. -*/ - +// +// 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 unsigned char halfdome[][3174]={ diff --git a/toolbox/test/channel_type.cpp b/toolbox/test/channel_type.cpp index a2edf1b434..0b5b597738 100644 --- a/toolbox/test/channel_type.cpp +++ b/toolbox/test/channel_type.cpp @@ -1,16 +1,15 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 #include - #include -#include - using namespace boost; using namespace gil; diff --git a/toolbox/test/channel_view.cpp b/toolbox/test/channel_view.cpp index 9473aebbe6..f3970778e3 100644 --- a/toolbox/test/channel_view.cpp +++ b/toolbox/test/channel_view.cpp @@ -1,17 +1,16 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 +#include #include - #include -#include -#include - using namespace boost; using namespace gil; diff --git a/toolbox/test/cmyka.cpp b/toolbox/test/cmyka.cpp index fb7473f66d..a514179ea3 100644 --- a/toolbox/test/cmyka.cpp +++ b/toolbox/test/cmyka.cpp @@ -1,16 +1,15 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 #include - #include -#include - using namespace boost; using namespace gil; diff --git a/toolbox/test/get_num_bits.cpp b/toolbox/test/get_num_bits.cpp index 0e4f7b451f..3b8b7d8913 100644 --- a/toolbox/test/get_num_bits.cpp +++ b/toolbox/test/get_num_bits.cpp @@ -1,18 +1,17 @@ -/* - 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). -*/ - -#include - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 #include #include +#include +#include + using namespace boost; using namespace gil; diff --git a/toolbox/test/get_pixel_type.cpp b/toolbox/test/get_pixel_type.cpp index 1998000988..ef17c38a62 100644 --- a/toolbox/test/get_pixel_type.cpp +++ b/toolbox/test/get_pixel_type.cpp @@ -1,17 +1,16 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 +#include #include - #include -#include -#include - using namespace boost; using namespace gil; @@ -22,7 +21,7 @@ BOOST_AUTO_TEST_CASE( get_pixel_type_test ) { typedef bit_aligned_image3_type< 4, 15, 4, rgb_layout_t >::type image_t; BOOST_STATIC_ASSERT(( is_same< get_pixel_type< image_t::view_t >::type - , image_t::view_t::reference + , image_t::view_t::reference >::value )); } diff --git a/toolbox/test/gray_alpha.cpp b/toolbox/test/gray_alpha.cpp index 05409f65b9..f2e9132f12 100644 --- a/toolbox/test/gray_alpha.cpp +++ b/toolbox/test/gray_alpha.cpp @@ -1,16 +1,15 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 #include - #include -#include - using namespace boost; using namespace gil; diff --git a/toolbox/test/gray_to_rgba.cpp b/toolbox/test/gray_to_rgba.cpp index f61cb2ce1b..90d5cbb168 100644 --- a/toolbox/test/gray_to_rgba.cpp +++ b/toolbox/test/gray_to_rgba.cpp @@ -1,10 +1,10 @@ -/* - 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). -*/ - +// +// Copyright 2013 Christian Henning +// +// 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 #include @@ -23,7 +23,6 @@ BOOST_AUTO_TEST_CASE( gray_to_rgba_test ) rgba8_pixel_t b; color_convert( a, b ); - } BOOST_AUTO_TEST_SUITE_END() diff --git a/toolbox/test/hsl_hsv_test.cpp b/toolbox/test/hsl_hsv_test.cpp index 4d289e2e85..9027c34441 100644 --- a/toolbox/test/hsl_hsv_test.cpp +++ b/toolbox/test/hsl_hsv_test.cpp @@ -1,12 +1,10 @@ -/* - 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). -*/ - -/// \brief Unit test for hsl and hsv color spaces - +// +// Copyright 2013 Christian Henning +// +// 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 #include #include @@ -42,7 +40,7 @@ BOOST_AUTO_TEST_CASE( hsl_hsv_test ) hsl32f_view_t::x_iterator hsl_x_it = view( hsl_img ).row_begin( y ); hsv32f_view_t::x_iterator hsv_x_it = view( hsv_img ).row_begin( y ); - float v = static_cast( height - y ) + float v = static_cast( height - y ) / height; for( size_t x = 0; x < width; x++ ) diff --git a/toolbox/test/indexed_image_test.cpp b/toolbox/test/indexed_image_test.cpp index 5507fdc34d..69c7500785 100644 --- a/toolbox/test/indexed_image_test.cpp +++ b/toolbox/test/indexed_image_test.cpp @@ -1,17 +1,14 @@ -/* - 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). -*/ - -/// \brief Unit test for indexed_image type. - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 #include +#include using namespace std; using namespace boost; @@ -34,7 +31,7 @@ BOOST_AUTO_TEST_CASE( index_image_test ) image_t img( 640, 480, 256 ); - + #if __cplusplus >= 201103L generate_pixels( img.get_indices_view() , [] () -> uint8_t @@ -62,7 +59,7 @@ BOOST_AUTO_TEST_CASE( index_image_test ) for( image_t::indices_view_t::iterator it = indices.begin(); it != indices.end(); ++it ) { - static uint8_t i = 0; + static uint8_t i = 0; i = ( i == 256 ) ? 0 : ++i; *it = gray8_pixel_t( i ); @@ -71,7 +68,7 @@ BOOST_AUTO_TEST_CASE( index_image_test ) image_t::palette_view_t colors = img.get_palette_view(); for( image_t::palette_view_t::iterator it = colors.begin(); it != colors.end(); ++it ) { - static uint8_t i = 0; + static uint8_t i = 0; i = ( i == 256 ) ? 0 : ++i; *it = rgb8_pixel_t( i, i, i ); @@ -113,7 +110,7 @@ BOOST_AUTO_TEST_CASE( index_image_test ) image_t::indices_view_t indices = img.get_indices_view(); for( image_t::indices_view_t::iterator it = indices.begin(); it != indices.end(); ++it ) { - static uint8_t i = 0; + static uint8_t i = 0; i = ( i == 256 ) ? 0 : ++i; *it = gray8_pixel_t( i ); @@ -122,7 +119,7 @@ BOOST_AUTO_TEST_CASE( index_image_test ) image_t::palette_view_t colors = img.get_palette_view(); for( image_t::palette_view_t::iterator it = colors.begin(); it != colors.end(); ++it ) { - static uint8_t i = 0; + static uint8_t i = 0; i = ( i == 256 ) ? 0 : ++i; *it = rgb8_pixel_t( i, i, i ); diff --git a/toolbox/test/is_bit_aligned.cpp b/toolbox/test/is_bit_aligned.cpp index 144bee9fb5..9e9b43c4bc 100644 --- a/toolbox/test/is_bit_aligned.cpp +++ b/toolbox/test/is_bit_aligned.cpp @@ -1,17 +1,16 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// +// 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 +#include #include - #include -#include -#include - using namespace boost; using namespace gil; diff --git a/toolbox/test/is_homogeneous.cpp b/toolbox/test/is_homogeneous.cpp index aa47b62afd..05390c0ea7 100644 --- a/toolbox/test/is_homogeneous.cpp +++ b/toolbox/test/is_homogeneous.cpp @@ -1,15 +1,15 @@ -/* - 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). -*/ - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 #include +#include + using namespace boost; using namespace gil; diff --git a/toolbox/test/is_similar.cpp b/toolbox/test/is_similar.cpp index 15dbfadd79..bfc7a9a655 100644 --- a/toolbox/test/is_similar.cpp +++ b/toolbox/test/is_similar.cpp @@ -1,15 +1,15 @@ -/* - 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). -*/ - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 #include +#include + using namespace boost; using namespace gil; @@ -17,6 +17,7 @@ BOOST_AUTO_TEST_SUITE( toolbox_tests ) BOOST_AUTO_TEST_CASE( is_similar_test ) { + // TODO: fill the test } BOOST_AUTO_TEST_SUITE_END() diff --git a/toolbox/test/lab_test.cpp b/toolbox/test/lab_test.cpp index 15c559e8ab..e072790911 100644 --- a/toolbox/test/lab_test.cpp +++ b/toolbox/test/lab_test.cpp @@ -1,25 +1,23 @@ -/* - 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). -*/ - -/// \file lab_test.cpp -/// \brief Unit test for LAB Colorspace -/// \author Davide Anastasia +// +// Copyright 2013 Christian Henning +// Copyright 2013 Davide Anastasia +// +// 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 +#include #include -#define TEST_CHECK_CLOSE(a, b) \ - BOOST_CHECK_CLOSE(a, b, 0.0005f) - #include -#include -#include using namespace boost; +#define TEST_CHECK_CLOSE(a, b) \ + BOOST_CHECK_CLOSE(a, b, 0.0005f) + BOOST_AUTO_TEST_SUITE( toolbox_tests ) BOOST_AUTO_TEST_CASE( Lab_to_XYZ_Test1 ) diff --git a/toolbox/test/pixel_bit_size.cpp b/toolbox/test/pixel_bit_size.cpp index 9e3d6128f5..29256301a1 100644 --- a/toolbox/test/pixel_bit_size.cpp +++ b/toolbox/test/pixel_bit_size.cpp @@ -1,15 +1,15 @@ -/* - 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). -*/ - -#include - +// +// Copyright 2013 Christian Henning +// +// 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 #include +#include + using namespace boost; using namespace gil; diff --git a/toolbox/test/rgb_to_luminance.cpp b/toolbox/test/rgb_to_luminance.cpp index b18ecb5b1b..54d6b9bcf7 100644 --- a/toolbox/test/rgb_to_luminance.cpp +++ b/toolbox/test/rgb_to_luminance.cpp @@ -1,15 +1,16 @@ -/* - 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). -*/ - -#include - +// +// Copyright 2013 Christian Henning +// Copyright 2013 Davide Anastasia +// +// 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 #include +#include + using namespace boost; using namespace gil; diff --git a/toolbox/test/xyz_test.cpp b/toolbox/test/xyz_test.cpp index be2c2faa7f..26f0cebbb6 100644 --- a/toolbox/test/xyz_test.cpp +++ b/toolbox/test/xyz_test.cpp @@ -1,21 +1,19 @@ -/* - 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). -*/ +// +// Copyright 2013 Christian Henning +// Copyright 2013 Davide Anastasia +// +// 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 +#include -/// \file xyz_test.cpp -/// \brief Unit test for XYZ Colorspace -/// \author Davide Anastasia +#include #include #include #include -#include -#include - -#include using namespace boost; using namespace std;