summaryrefslogtreecommitdiff
path: root/boost/gil
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:21:30 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:21:30 +0900
commitd6a306e745acfee00e81ccaf3324a2a03516db41 (patch)
tree145a26368608982f40ebb0f4836185c44abb9ae4 /boost/gil
parent5ce2ccf2f23c6d3de4c79f216f57ca6f2a18ed16 (diff)
downloadboost-d6a306e745acfee00e81ccaf3324a2a03516db41.tar.gz
boost-d6a306e745acfee00e81ccaf3324a2a03516db41.tar.bz2
boost-d6a306e745acfee00e81ccaf3324a2a03516db41.zip
Imported Upstream version 1.69.0upstream/1.69.0
Diffstat (limited to 'boost/gil')
-rw-r--r--boost/gil/algorithm.hpp67
-rw-r--r--boost/gil/bit_aligned_pixel_iterator.hpp44
-rw-r--r--boost/gil/bit_aligned_pixel_reference.hpp102
-rw-r--r--boost/gil/channel.hpp168
-rw-r--r--boost/gil/channel_algorithm.hpp52
-rw-r--r--boost/gil/cmyk.hpp39
-rw-r--r--boost/gil/color_base.hpp41
-rw-r--r--boost/gil/color_base_algorithm.hpp140
-rw-r--r--boost/gil/color_convert.hpp63
-rw-r--r--boost/gil/concepts.hpp (renamed from boost/gil/gil_concept.hpp)381
-rw-r--r--boost/gil/deprecated.hpp38
-rw-r--r--boost/gil/device_n.hpp42
-rw-r--r--boost/gil/extension/dynamic_image/algorithm.hpp32
-rw-r--r--boost/gil/extension/dynamic_image/any_image.hpp86
-rw-r--r--boost/gil/extension/dynamic_image/any_image_view.hpp64
-rw-r--r--boost/gil/extension/dynamic_image/apply_operation.hpp54
-rw-r--r--boost/gil/extension/dynamic_image/apply_operation_base.hpp47
-rw-r--r--boost/gil/extension/dynamic_image/dynamic_at_c.hpp55
-rw-r--r--boost/gil/extension/dynamic_image/dynamic_image_all.hpp44
-rw-r--r--boost/gil/extension/dynamic_image/image_view_factory.hpp167
-rw-r--r--boost/gil/extension/dynamic_image/reduce.hpp146
-rw-r--r--boost/gil/extension/dynamic_image/variant.hpp81
-rw-r--r--boost/gil/extension/io/bmp.hpp25
-rw-r--r--boost/gil/extension/io/bmp/detail/is_allowed.hpp27
-rw-r--r--boost/gil/extension/io/bmp/detail/read.hpp43
-rw-r--r--boost/gil/extension/io/bmp/detail/reader_backend.hpp39
-rw-r--r--boost/gil/extension/io/bmp/detail/scanline_read.hpp39
-rw-r--r--boost/gil/extension/io/bmp/detail/supported_types.hpp38
-rw-r--r--boost/gil/extension/io/bmp/detail/write.hpp50
-rw-r--r--boost/gil/extension/io/bmp/detail/writer_backend.hpp37
-rw-r--r--boost/gil/extension/io/bmp/old.hpp45
-rw-r--r--boost/gil/extension/io/bmp/read.hpp39
-rw-r--r--boost/gil/extension/io/bmp/tags.hpp29
-rw-r--r--boost/gil/extension/io/bmp/write.hpp26
-rw-r--r--boost/gil/extension/io/jpeg.hpp25
-rw-r--r--boost/gil/extension/io/jpeg/detail/base.hpp38
-rw-r--r--boost/gil/extension/io/jpeg/detail/is_allowed.hpp25
-rw-r--r--boost/gil/extension/io/jpeg/detail/read.hpp53
-rw-r--r--boost/gil/extension/io/jpeg/detail/reader_backend.hpp58
-rw-r--r--boost/gil/extension/io/jpeg/detail/scanline_read.hpp49
-rw-r--r--boost/gil/extension/io/jpeg/detail/supported_types.hpp37
-rw-r--r--boost/gil/extension/io/jpeg/detail/write.hpp50
-rw-r--r--boost/gil/extension/io/jpeg/detail/writer_backend.hpp39
-rw-r--r--boost/gil/extension/io/jpeg/old.hpp61
-rw-r--r--boost/gil/extension/io/jpeg/read.hpp39
-rw-r--r--boost/gil/extension/io/jpeg/tags.hpp35
-rw-r--r--boost/gil/extension/io/jpeg/write.hpp26
-rw-r--r--boost/gil/extension/io/png.hpp25
-rw-r--r--boost/gil/extension/io/png/detail/base.hpp25
-rw-r--r--boost/gil/extension/io/png/detail/is_allowed.hpp28
-rw-r--r--boost/gil/extension/io/png/detail/read.hpp51
-rw-r--r--boost/gil/extension/io/png/detail/reader_backend.hpp43
-rw-r--r--boost/gil/extension/io/png/detail/scanline_read.hpp38
-rw-r--r--boost/gil/extension/io/png/detail/supported_types.hpp34
-rw-r--r--boost/gil/extension/io/png/detail/write.hpp51
-rw-r--r--boost/gil/extension/io/png/detail/writer_backend.hpp56
-rw-r--r--boost/gil/extension/io/png/old.hpp60
-rw-r--r--boost/gil/extension/io/png/read.hpp39
-rw-r--r--boost/gil/extension/io/png/tags.hpp39
-rw-r--r--boost/gil/extension/io/png/write.hpp28
-rw-r--r--boost/gil/extension/io/pnm.hpp25
-rw-r--r--boost/gil/extension/io/pnm/detail/is_allowed.hpp25
-rw-r--r--boost/gil/extension/io/pnm/detail/read.hpp58
-rw-r--r--boost/gil/extension/io/pnm/detail/reader_backend.hpp39
-rw-r--r--boost/gil/extension/io/pnm/detail/scanline_read.hpp55
-rw-r--r--boost/gil/extension/io/pnm/detail/supported_types.hpp30
-rw-r--r--boost/gil/extension/io/pnm/detail/write.hpp48
-rw-r--r--boost/gil/extension/io/pnm/detail/writer_backend.hpp37
-rw-r--r--boost/gil/extension/io/pnm/old.hpp61
-rw-r--r--boost/gil/extension/io/pnm/read.hpp35
-rw-r--r--boost/gil/extension/io/pnm/tags.hpp29
-rw-r--r--boost/gil/extension/io/pnm/write.hpp28
-rw-r--r--boost/gil/extension/io/raw.hpp25
-rw-r--r--boost/gil/extension/io/raw/detail/device.hpp35
-rw-r--r--boost/gil/extension/io/raw/detail/is_allowed.hpp26
-rw-r--r--boost/gil/extension/io/raw/detail/read.hpp51
-rw-r--r--boost/gil/extension/io/raw/detail/reader_backend.hpp39
-rw-r--r--boost/gil/extension/io/raw/detail/supported_types.hpp31
-rw-r--r--boost/gil/extension/io/raw/read.hpp36
-rw-r--r--boost/gil/extension/io/raw/tags.hpp28
-rw-r--r--boost/gil/extension/io/targa.hpp25
-rw-r--r--boost/gil/extension/io/targa/detail/is_allowed.hpp25
-rw-r--r--boost/gil/extension/io/targa/detail/read.hpp76
-rw-r--r--boost/gil/extension/io/targa/detail/reader_backend.hpp55
-rw-r--r--boost/gil/extension/io/targa/detail/scanline_read.hpp47
-rw-r--r--boost/gil/extension/io/targa/detail/supported_types.hpp34
-rw-r--r--boost/gil/extension/io/targa/detail/write.hpp44
-rw-r--r--boost/gil/extension/io/targa/detail/writer_backend.hpp37
-rw-r--r--boost/gil/extension/io/targa/old.hpp61
-rw-r--r--boost/gil/extension/io/targa/read.hpp37
-rw-r--r--boost/gil/extension/io/targa/tags.hpp49
-rw-r--r--boost/gil/extension/io/targa/write.hpp28
-rw-r--r--boost/gil/extension/io/tiff.hpp25
-rw-r--r--boost/gil/extension/io/tiff/detail/device.hpp57
-rw-r--r--boost/gil/extension/io/tiff/detail/is_allowed.hpp33
-rw-r--r--boost/gil/extension/io/tiff/detail/log.hpp27
-rw-r--r--boost/gil/extension/io/tiff/detail/read.hpp86
-rw-r--r--boost/gil/extension/io/tiff/detail/reader_backend.hpp39
-rw-r--r--boost/gil/extension/io/tiff/detail/scanline_read.hpp138
-rw-r--r--boost/gil/extension/io/tiff/detail/supported_types.hpp35
-rw-r--r--boost/gil/extension/io/tiff/detail/write.hpp74
-rw-r--r--boost/gil/extension/io/tiff/detail/writer_backend.hpp39
-rw-r--r--boost/gil/extension/io/tiff/old.hpp60
-rw-r--r--boost/gil/extension/io/tiff/read.hpp39
-rw-r--r--boost/gil/extension/io/tiff/tags.hpp30
-rw-r--r--boost/gil/extension/io/tiff/write.hpp29
-rw-r--r--boost/gil/extension/numeric/affine.hpp69
-rw-r--r--boost/gil/extension/numeric/algorithm.hpp50
-rw-r--r--boost/gil/extension/numeric/channel_numeric_operations.hpp46
-rw-r--r--boost/gil/extension/numeric/convolve.hpp53
-rw-r--r--boost/gil/extension/numeric/kernel.hpp45
-rw-r--r--boost/gil/extension/numeric/pixel_numeric_operations.hpp62
-rw-r--r--boost/gil/extension/numeric/resample.hpp55
-rw-r--r--boost/gil/extension/numeric/sampler.hpp57
-rw-r--r--boost/gil/extension/toolbox/color_converters.hpp27
-rw-r--r--boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp31
-rw-r--r--boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp27
-rw-r--r--boost/gil/extension/toolbox/color_spaces.hpp27
-rw-r--r--boost/gil/extension/toolbox/color_spaces/cmyka.hpp40
-rw-r--r--boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp41
-rw-r--r--boost/gil/extension/toolbox/color_spaces/hsl.hpp27
-rw-r--r--boost/gil/extension/toolbox/color_spaces/hsv.hpp34
-rw-r--r--boost/gil/extension/toolbox/color_spaces/lab.hpp32
-rw-r--r--boost/gil/extension/toolbox/color_spaces/xyz.hpp27
-rw-r--r--boost/gil/extension/toolbox/color_spaces/ycbcr.hpp74
-rw-r--r--boost/gil/extension/toolbox/dynamic_images.hpp34
-rw-r--r--boost/gil/extension/toolbox/image_types.hpp27
-rw-r--r--boost/gil/extension/toolbox/image_types/indexed_image.hpp44
-rw-r--r--boost/gil/extension/toolbox/image_types/subchroma_image.hpp77
-rw-r--r--boost/gil/extension/toolbox/metafunctions.hpp27
-rw-r--r--boost/gil/extension/toolbox/metafunctions/channel_type.hpp65
-rw-r--r--boost/gil/extension/toolbox/metafunctions/channel_view.hpp31
-rw-r--r--boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp32
-rw-r--r--boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp29
-rw-r--r--boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp42
-rw-r--r--boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp35
-rw-r--r--boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp47
-rw-r--r--boost/gil/extension/toolbox/metafunctions/is_similar.hpp27
-rw-r--r--boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp43
-rw-r--r--boost/gil/extension/toolbox/toolbox.hpp30
-rw-r--r--boost/gil/gil_all.hpp46
-rw-r--r--boost/gil/gil_config.hpp60
-rw-r--r--boost/gil/gray.hpp39
-rw-r--r--boost/gil/image.hpp58
-rw-r--r--boost/gil/image_view.hpp100
-rw-r--r--boost/gil/image_view_factory.hpp92
-rw-r--r--boost/gil/io/base.hpp54
-rw-r--r--boost/gil/io/bit_operations.hpp29
-rw-r--r--boost/gil/io/conversion_policies.hpp33
-rw-r--r--boost/gil/io/device.hpp49
-rw-r--r--boost/gil/io/dynamic_io_new.hpp30
-rw-r--r--boost/gil/io/error.hpp37
-rw-r--r--boost/gil/io/get_read_device.hpp29
-rw-r--r--boost/gil/io/get_reader.hpp27
-rw-r--r--boost/gil/io/get_write_device.hpp28
-rw-r--r--boost/gil/io/get_writer.hpp27
-rw-r--r--boost/gil/io/io.hpp63
-rw-r--r--boost/gil/io/make_backend.hpp30
-rw-r--r--boost/gil/io/make_dynamic_image_reader.hpp27
-rw-r--r--boost/gil/io/make_dynamic_image_writer.hpp27
-rw-r--r--boost/gil/io/make_reader.hpp27
-rw-r--r--boost/gil/io/make_scanline_reader.hpp27
-rw-r--r--boost/gil/io/make_writer.hpp27
-rw-r--r--boost/gil/io/path_spec.hpp35
-rw-r--r--boost/gil/io/read_and_convert_image.hpp36
-rw-r--r--boost/gil/io/read_and_convert_view.hpp44
-rw-r--r--boost/gil/io/read_image.hpp37
-rw-r--r--boost/gil/io/read_image_info.hpp42
-rw-r--r--boost/gil/io/read_view.hpp33
-rw-r--r--boost/gil/io/reader_base.hpp29
-rw-r--r--boost/gil/io/row_buffer_helper.hpp70
-rw-r--r--boost/gil/io/scanline_read_iterator.hpp30
-rw-r--r--boost/gil/io/typedefs.hpp48
-rw-r--r--boost/gil/io/write_view.hpp28
-rw-r--r--boost/gil/iterator_from_2d.hpp57
-rw-r--r--boost/gil/locator.hpp49
-rw-r--r--boost/gil/metafunctions.hpp49
-rw-r--r--boost/gil/packed_pixel.hpp42
-rw-r--r--boost/gil/pixel.hpp53
-rw-r--r--boost/gil/pixel_iterator.hpp40
-rw-r--r--boost/gil/pixel_iterator_adaptor.hpp45
-rw-r--r--boost/gil/planar_pixel_iterator.hpp43
-rw-r--r--boost/gil/planar_pixel_reference.hpp59
-rw-r--r--boost/gil/point.hpp277
-rw-r--r--boost/gil/position_iterator.hpp35
-rw-r--r--boost/gil/premultiply.hpp117
-rw-r--r--boost/gil/promote_integral.hpp8
-rw-r--r--boost/gil/rgb.hpp42
-rw-r--r--boost/gil/rgba.hpp45
-rw-r--r--boost/gil/step_iterator.hpp44
-rw-r--r--boost/gil/typedefs.hpp20
-rw-r--r--boost/gil/utilities.hpp337
-rw-r--r--boost/gil/version.hpp27
-rw-r--r--boost/gil/virtual_locator.hpp37
194 files changed, 3887 insertions, 5763 deletions
diff --git a/boost/gil/algorithm.hpp b/boost/gil/algorithm.hpp
index 5c81594501..4857aa2df6 100644
--- a/boost/gil/algorithm.hpp
+++ b/boost/gil/algorithm.hpp
@@ -1,53 +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 <boost/gil/bit_aligned_pixel_iterator.hpp>
+#include <boost/gil/color_base_algorithm.hpp>
+#include <boost/gil/concepts.hpp>
+#include <boost/gil/image_view.hpp>
+#include <boost/gil/image_view_factory.hpp>
-#ifndef GIL_ALGORITHM_HPP
-#define GIL_ALGORITHM_HPP
+#include <boost/config.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/or.hpp>
+#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
-#include <algorithm>
#include <iterator>
#include <memory>
#include <typeinfo>
-#include <boost/config.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/or.hpp>
-
-#include "gil_config.hpp"
-#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<V,Alloc>::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 <typename ChannelPtr, typename ColorSpace>
struct planar_pixel_iterator;
@@ -374,7 +355,7 @@ void fill(boost::gil::iterator_from_2d<IL> first, boost::gil::iterator_from_2d<I
std::ptrdiff_t n=last-first;
while (n>0) {
std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
- fill_n(first.x(), numToDo, val);
+ std::fill_n(first.x(), numToDo, val);
first+=numToDo;
n-=numToDo;
}
@@ -765,7 +746,7 @@ F for_each_pixel(const V& img, F fun) {
return std::for_each(img.begin().x(), img.end().x(), fun);
} else {
for (std::ptrdiff_t y=0; y<img.height(); ++y)
- fun = std::for_each(img.row_begin(y),img.row_end(y),fun);
+ std::for_each(img.row_begin(y),img.row_end(y),fun);
return fun;
}
}
@@ -1034,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/boost/gil/bit_aligned_pixel_iterator.hpp b/boost/gil/bit_aligned_pixel_iterator.hpp
index 6427d46cd2..1f8ece424b 100644
--- a/boost/gil/bit_aligned_pixel_iterator.hpp
+++ b/boost/gil/bit_aligned_pixel_iterator.hpp
@@ -1,38 +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 <functional>
+//
+// 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 <boost/gil/bit_aligned_pixel_reference.hpp>
+#include <boost/gil/pixel_iterator.hpp>
#include <boost/config.hpp>
#include <boost/iterator/iterator_facade.hpp>
-#include "gil_config.hpp"
-#include "bit_aligned_pixel_reference.hpp"
-#include "pixel_iterator.hpp"
+#include <functional>
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/boost/gil/bit_aligned_pixel_reference.hpp b/boost/gil/bit_aligned_pixel_reference.hpp
index 219f6d5369..35f85f8043 100644
--- a/boost/gil/bit_aligned_pixel_reference.hpp
+++ b/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 <functional>
+#include <boost/gil/pixel.hpp>
+#include <boost/gil/channel.hpp>
#include <boost/config.hpp>
#include <boost/mpl/accumulate.hpp>
@@ -33,18 +20,19 @@
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/vector.hpp>
-#include "gil_config.hpp"
-#include "pixel.hpp"
-#include "channel.hpp"
+#include <functional>
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 <int RangeSize, bool Mutable>
class bit_range {
public:
@@ -57,7 +45,7 @@ private:
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 <bool M> bit_range(const bit_range<RangeSize,M>& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
@@ -89,12 +77,12 @@ public:
};
-/// \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
@@ -107,7 +95,7 @@ typedef const bit_aligned_pixel_reference<unsigned char, mpl::vector3_c<int,1,2,
// create the pixel reference at bit offset 2
// (i.e. red = [2], green = [3,4], blue = [5,6,7] bits)
-rgb123_ref_t ref(&data, 2);
+rgb123_ref_t ref(&data, 2);
get_color(ref, red_t()) = 1;
assert(data == 0x04);
get_color(ref, green_t()) = 3;
@@ -120,12 +108,12 @@ assert(data == 0xFC);
/// \brief Heterogeneous pixel reference corresponding to non-byte-aligned bit range. Models ColorBaseConcept, PixelConcept, PixelBasedConcept
template <typename BitField,
typename ChannelBitSizes, // MPL integral vector defining the number of bits for each channel. For example, for 565RGB, vector_c<int,5,6,5>
- typename Layout,
+ typename Layout,
bool IsMutable>
struct bit_aligned_pixel_reference {
BOOST_STATIC_CONSTANT(int, bit_size = (mpl::accumulate<ChannelBitSizes, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value));
typedef boost::gil::bit_range<bit_size,IsMutable> bit_range_t;
- typedef BitField bitfield_t;
+ typedef BitField bitfield_t;
typedef typename mpl::if_c<IsMutable,unsigned char*,const unsigned char*>::type data_ptr_t;
typedef Layout layout_t;
@@ -153,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 <typename P> const bit_aligned_pixel_reference& operator=(const P& p) const { assign(p, mpl::bool_<is_pixel<P>::value>()); return *this; }
+ template <typename P> const bit_aligned_pixel_reference& operator=(const P& p) const { assign(p, mpl::bool_<is_pixel<P>::value>()); return *this; }
- template <typename P> bool operator==(const P& p) const { return equal(p, mpl::bool_<is_pixel<P>::value>()); }
+ template <typename P> bool operator==(const P& p) const { return equal(p, mpl::bool_<is_pixel<P>::value>()); }
template <typename P> bool operator!=(const P& p) const { return !(*this==p); }
const bit_aligned_pixel_reference* operator->() const { return this; }
@@ -167,8 +155,8 @@ private:
template <typename Pixel> static void check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,bit_aligned_pixel_reference> >(); }
- template <typename Pixel> void assign(const Pixel& p, mpl::true_) const { check_compatible<Pixel>(); static_copy(p,*this); }
- template <typename Pixel> bool equal(const Pixel& p, mpl::true_) const { check_compatible<Pixel>(); return static_equal(*this,p); }
+ template <typename Pixel> void assign(const Pixel& p, mpl::true_) const { check_compatible<Pixel>(); static_copy(p,*this); }
+ template <typename Pixel> bool equal(const Pixel& p, mpl::true_) const { check_compatible<Pixel>(); return static_equal(*this,p); }
private:
static void check_gray() { BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
@@ -180,24 +168,24 @@ private:
// ColorBasedConcept
/////////////////////////////
-template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
+template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
struct kth_element_type<bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,IsMutable>, K> {
public:
typedef const packed_dynamic_channel_reference<BitField, mpl::at_c<ChannelBitSizes,K>::type::value, IsMutable> type;
};
-template <typename B, typename C, typename L, bool M, int K>
+template <typename B, typename C, typename L, bool M, int K>
struct kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
: public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
-template <typename B, typename C, typename L, bool M, int K>
+template <typename B, typename C, typename L, bool M, int K>
struct kth_element_const_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
: public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
namespace detail {
// returns sum of IntegralVector[0] ... IntegralVector[K-1]
- template <typename IntegralVector, int K>
+ template <typename IntegralVector, int K>
struct sum_k : public mpl::plus<sum_k<IntegralVector,K-1>, typename mpl::at_c<IntegralVector,K-1>::type > {};
template <typename IntegralVector> struct sum_k<IntegralVector,0> : public mpl::int_<0> {};
@@ -206,7 +194,7 @@ namespace detail {
// at_c required by MutableColorBaseConcept
template <int K, typename BitField, typename ChannelBitSizes, typename L, bool Mutable> inline
typename kth_element_reference_type<bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable>,K>::type
-at_c(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable>& p) {
+at_c(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable>& p) {
typedef bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable> pixel_t;
typedef typename kth_element_reference_type<pixel_t,K>::type channel_t;
typedef typename pixel_t::bit_range_t bit_range_t;
@@ -214,7 +202,7 @@ at_c(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable>& p) {
bit_range_t bit_range(p.bit_range());
bit_range.bit_advance(detail::sum_k<ChannelBitSizes,K>::value);
- return channel_t(bit_range.current_byte(), bit_range.bit_offset());
+ return channel_t(bit_range.current_byte(), bit_range.bit_offset());
}
/////////////////////////////
@@ -222,7 +210,7 @@ at_c(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,L,Mutable>& p) {
/////////////////////////////
/// Metafunction predicate that flags bit_aligned_pixel_reference as a model of PixelConcept. Required by PixelConcept
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
struct is_pixel<bit_aligned_pixel_reference<B,C,L,M> > : public mpl::true_{};
/////////////////////////////
@@ -232,15 +220,15 @@ struct is_pixel<bit_aligned_pixel_reference<B,C,L,M> > : public mpl::true_{};
template <typename B, typename C, typename L, bool M>
struct color_space_type<bit_aligned_pixel_reference<B,C,L,M> > {
typedef typename L::color_space_t type;
-};
+};
template <typename B, typename C, typename L, bool M>
struct channel_mapping_type<bit_aligned_pixel_reference<B,C,L,M> > {
typedef typename L::channel_mapping_t type;
-};
+};
template <typename B, typename C, typename L, bool M>
-struct is_planar<bit_aligned_pixel_reference<B,C,L,M> > : mpl::false_ {};
+struct is_planar<bit_aligned_pixel_reference<B,C,L,M> > : mpl::false_ {};
/////////////////////////////
// pixel_reference_type
@@ -256,7 +244,7 @@ namespace detail {
}
// Constructs a homogeneous bit_aligned_pixel_reference given a channel reference
-template <typename BitField, int NumBits, typename Layout>
+template <typename BitField, int NumBits, typename Layout>
struct pixel_reference_type<const packed_dynamic_channel_reference<BitField,NumBits,false>, Layout, false, false> {
private:
typedef typename mpl::size<typename Layout::color_space_t>::type size_t;
@@ -266,7 +254,7 @@ public:
};
// Same but for the mutable case. We cannot combine the mutable and read-only cases because this triggers ambiguity
-template <typename BitField, int NumBits, typename Layout>
+template <typename BitField, int NumBits, typename Layout>
struct pixel_reference_type<const packed_dynamic_channel_reference<BitField,NumBits,true>, Layout, false, true> {
private:
typedef typename mpl::size<typename Layout::color_space_t>::type size_t;
@@ -279,27 +267,27 @@ public:
namespace std {
// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
-// swap with 'left bias':
+// swap with 'left bias':
// - swap between proxy and anything
// - swap between value type and proxy
// - swap between proxy and proxy
// Having three overloads allows us to swap between different (but compatible) models of PixelConcept
template <typename B, typename C, typename L, typename R> inline
-void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, R& y) {
- boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
+void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, R& y) {
+ boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
}
template <typename B, typename C, typename L> inline
-void swap(typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type& x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
- boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
+void swap(typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type& x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
+ boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
}
template <typename B, typename C, typename L> inline
-void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
- boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
+void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
+ boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
}
} // namespace std
#endif
diff --git a/boost/gil/channel.hpp b/boost/gil/channel.hpp
index 84ed48bf8c..0ec67aeea6 100644
--- a/boost/gil/channel.hpp
+++ b/boost/gil/channel.hpp
@@ -1,64 +1,78 @@
-/*
- 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 <limits>
-#include <cassert>
-#include <cstdint>
+//
+// 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 <boost/gil/utilities.hpp>
#include <boost/config.hpp>
+#include <boost/config/pragma_message.hpp>
#include <boost/integer/integer_mask.hpp>
#include <boost/type_traits/remove_cv.hpp>
-#include "gil_config.hpp"
-#include "utilities.hpp"
+#include <cassert>
+#include <cstdint>
+#include <limits>
+#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
+/// non-word memory boundary, unaligned access may result in performance improvement.
+/// \warning Unfortunately, this optimization may be a C/C++ strict aliasing rules
+/// violation, if accessed data buffer has effective type that cannot be aliased
+/// without leading to undefined behaviour.
+#define BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
+#endif
-namespace boost { namespace gil {
+#ifdef BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
+#if defined(sun) || defined(__sun) || \ // SunOS
+ defined(__osf__) || defined(__osf) || \ // Tru64
+ defined(_hpux) || defined(hpux) || \ // HP-UX
+ defined(__arm__) || defined(__ARM_ARCH) || \ // ARM
+ defined(_AIX) // AIX
+#error Unaligned access strictly disabled for some UNIX platforms or ARM architecture
+#elif defined(__i386__) || defined(__x86_64__) || defined(__vax__)
+ // The check for little-endian architectures that tolerate unaligned memory
+ // accesses is just an optimization. Nothing will break if it fails to detect
+ // a suitable architecture.
+ //
+ // Unfortunately, this optimization may be a C/C++ strict aliasing rules violation
+ // if accessed data buffer has effective type that cannot be aliased
+ // without leading to undefined behaviour.
+BOOST_PRAGMA_MESSAGE("CAUTION: Unaligned access tolerated on little-endian may cause undefined behaviour")
+#else
+#error Unaligned access disabled for unknown platforms and architectures
+#endif
+#endif // defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
+namespace boost { namespace gil {
///////////////////////////////////////////
//// channel_traits
-////
+////
//// \ingroup ChannelModel
//// \class channel_traits
//// \brief defines properties of channels, such as their range and associated types
////
//// The channel traits must be defined for every model of ChannelConcept
//// Default traits are provided. For built-in types the default traits use
-//// built-in pointer and reference and the channel range is the physical
+//// built-in pointer and reference and the channel range is the physical
//// range of the type. For classes, the default traits forward the associated types
//// and range to the class.
-////
+////
///////////////////////////////////////////
namespace detail {
template <typename T, bool is_class> struct channel_traits_impl;
// channel traits for custom class
- template <typename T>
+ template <typename T>
struct channel_traits_impl<T, true> {
typedef typename T::value_type value_type;
typedef typename T::reference reference;
@@ -71,7 +85,7 @@ namespace detail {
};
// channel traits implementation for built-in integral or floating point channel type
- template <typename T>
+ template <typename T>
struct channel_traits_impl<T, false> {
typedef T value_type;
typedef T& reference;
@@ -84,7 +98,7 @@ namespace detail {
};
// channel traits implementation for constant built-in scalar or floating point type
- template <typename T>
+ template <typename T>
struct channel_traits_impl<const T, false> : public channel_traits_impl<T, false> {
typedef const T& reference;
typedef const T* pointer;
@@ -103,7 +117,7 @@ struct channel_traits {
typedef ... pointer;
typedef ... const_reference;
typedef ... const_pointer;
-
+
static const bool is_mutable;
static value_type min_value();
static value_type max_value();
@@ -212,12 +226,12 @@ struct float_point_one
namespace detail {
// returns the smallest fast unsigned integral type that has at least NumBits bits
template <int NumBits>
- struct min_fast_uint : public mpl::if_c< (NumBits<=8),
- uint_least8_t,
- typename mpl::if_c< (NumBits<=16),
- uint_least16_t,
- typename mpl::if_c< (NumBits<=32),
- uint_least32_t,
+ struct min_fast_uint : public mpl::if_c< (NumBits<=8),
+ uint_least8_t,
+ typename mpl::if_c< (NumBits<=16),
+ uint_least16_t,
+ typename mpl::if_c< (NumBits<=32),
+ uint_least32_t,
uintmax_t
>::type
>::type
@@ -340,10 +354,10 @@ protected:
typedef typename detail::num_value_fn< NumBits >::type num_value_t;
typedef typename detail::max_value_fn< NumBits >::type max_value_t;
-
+
static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
-
+
#if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
@@ -360,7 +374,7 @@ protected:
private:
void set(integer_t value) const { // can this be done faster??
- this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
+ this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
}
integer_t get() const { return derived().get(); }
const Derived& derived() const { return static_cast<const Derived&>(*this); }
@@ -384,19 +398,19 @@ assert(data == 6); // == 3<<1 == 6
*/
template <typename BitField, // A type that holds the bits of the pixel from which the channel is referenced. Typically an integral type, like std::uint16_t
- int FirstBit, int NumBits,// Defines the sequence of bits in the data value that contain the channel
- bool Mutable> // true if the reference is mutable
+ int FirstBit, int NumBits,// Defines the sequence of bits in the data value that contain the channel
+ bool Mutable> // true if the reference is mutable
class packed_channel_reference;
template <typename BitField, // A type that holds the bits of the pixel from which the channel is referenced. Typically an integral type, like std::uint16_t
- int NumBits, // Defines the sequence of bits in the data value that contain the channel
- bool Mutable> // true if the reference is mutable
+ int NumBits, // Defines the sequence of bits in the data value that contain the channel
+ bool Mutable> // true if the reference is mutable
class packed_dynamic_channel_reference;
/// \ingroup PackedChannelReferenceModel
/// \brief A constant subbyte channel reference whose bit offset is fixed at compile time. Models ChannelConcept
template <typename BitField, int FirstBit, int NumBits>
-class packed_channel_reference<BitField,FirstBit,NumBits,false>
+class packed_channel_reference<BitField,FirstBit,NumBits,false>
: public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,false>,BitField,NumBits,false> {
typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,false>,BitField,NumBits,false> parent_t;
friend class packed_channel_reference<BitField,FirstBit,NumBits,true>;
@@ -421,7 +435,7 @@ public:
/// \ingroup PackedChannelReferenceModel
/// \brief A mutable subbyte channel reference whose bit offset is fixed at compile time. Models ChannelConcept
template <typename BitField, int FirstBit, int NumBits>
-class packed_channel_reference<BitField,FirstBit,NumBits,true>
+class packed_channel_reference<BitField,FirstBit,NumBits,true>
: public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true> {
typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true> parent_t;
friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
@@ -455,7 +469,7 @@ private:
namespace std {
// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
-// swap with 'left bias':
+// swap with 'left bias':
// - swap between proxy and anything
// - swap between value type and proxy
// - swap between proxy and proxy
@@ -463,24 +477,23 @@ namespace std {
/// \ingroup PackedChannelReferenceModel
/// \brief swap for packed_channel_reference
template <typename BF, int FB, int NB, bool M, typename R> inline
-void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, R& y) {
- boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
+void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, R& y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
}
/// \ingroup PackedChannelReferenceModel
/// \brief swap for packed_channel_reference
template <typename BF, int FB, int NB, bool M> inline
-void swap(typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type& x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
- boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
+void swap(typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type& x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
}
-
/// \ingroup PackedChannelReferenceModel
/// \brief swap for packed_channel_reference
template <typename BF, int FB, int NB, bool M> inline
-void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
- boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
+void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
}
} // namespace std
@@ -506,7 +519,7 @@ assert(data == 6); // == (3<<1)
/// \brief Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept
/// Same as packed_channel_reference, except that the offset is a runtime parameter
/// \ingroup PackedChannelDynamicReferenceModel
-template <typename BitField, int NumBits>
+template <typename BitField, int NumBits>
class packed_dynamic_channel_reference<BitField,NumBits,false>
: public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false> {
typedef detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false> parent_t;
@@ -526,7 +539,7 @@ public:
unsigned first_bit() const { return _first_bit; }
- integer_t get() const {
+ integer_t get() const {
const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
}
@@ -535,7 +548,7 @@ public:
/// \brief Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept
/// Same as packed_channel_reference, except that the offset is a runtime parameter
/// \ingroup PackedChannelDynamicReferenceModel
-template <typename BitField, int NumBits>
+template <typename BitField, int NumBits>
class packed_dynamic_channel_reference<BitField,NumBits,true>
: public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true> {
typedef detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true> parent_t;
@@ -556,26 +569,26 @@ public:
const packed_dynamic_channel_reference& operator=(const const_reference& ref) const { set_unsafe(ref.get()); return *this; }
template <typename BitField1, int FirstBit1, bool Mutable1>
- const packed_dynamic_channel_reference& operator=(const packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1>& ref) const
+ const packed_dynamic_channel_reference& operator=(const packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1>& ref) const
{ set_unsafe(ref.get()); return *this; }
unsigned first_bit() const { return _first_bit; }
- integer_t get() const {
+ integer_t get() const {
const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
}
- void set_unsafe(integer_t value) const {
+ void set_unsafe(integer_t value) const {
const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
- this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
+ this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
}
};
} } // 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.
-// swap with 'left bias':
+// swap with 'left bias':
// - swap between proxy and anything
// - swap between value type and proxy
// - swap between proxy and proxy
@@ -584,24 +597,23 @@ namespace std {
/// \ingroup PackedChannelDynamicReferenceModel
/// \brief swap for packed_dynamic_channel_reference
template <typename BF, int NB, bool M, typename R> inline
-void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
- boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
+void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
}
/// \ingroup PackedChannelDynamicReferenceModel
/// \brief swap for packed_dynamic_channel_reference
template <typename BF, int NB, bool M> inline
-void swap(typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type& x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
- boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
+void swap(typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type& x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
}
-
/// \ingroup PackedChannelDynamicReferenceModel
/// \brief swap for packed_dynamic_channel_reference
template <typename BF, int NB, bool M> inline
-void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
- boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
+void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
+ boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
}
} // namespace std
@@ -616,7 +628,7 @@ struct is_integral<gil::packed_channel_reference<BitField,FirstBit,NumBits,IsMut
template <typename BitField, int NumBits, bool IsMutable>
struct is_integral<gil::packed_dynamic_channel_reference<BitField,NumBits,IsMutable> > : public mpl::true_ {};
-template <typename BaseChannelValue, typename MinVal, typename MaxVal>
+template <typename BaseChannelValue, typename MinVal, typename MaxVal>
struct is_integral<gil::scoped_channel_value<BaseChannelValue,MinVal,MaxVal> > : public is_integral<BaseChannelValue> {};
} // namespace boost
diff --git a/boost/gil/channel_algorithm.hpp b/boost/gil/channel_algorithm.hpp
index 20cc8a78ac..31456575a5 100644
--- a/boost/gil/channel_algorithm.hpp
+++ b/boost/gil/channel_algorithm.hpp
@@ -1,48 +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 <boost/gil/channel.hpp>
+#include <boost/gil/promote_integral.hpp>
+#include <boost/gil/typedefs.hpp>
- Use, modification and distribution are subject to the 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 <boost/config.hpp>
#include <boost/mpl/less.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/type_traits.hpp>
-#include "gil_config.hpp"
-#include "channel.hpp"
-#include "promote_integral.hpp"
-#include "typedefs.hpp"
-
#include <limits>
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
@@ -541,10 +519,6 @@ inline typename channel_traits<Channel>::value_type channel_invert(Channel x) {
return inverted_x;
}
-//#ifdef _MSC_VER
-//#pragma warning(pop)
-//#endif
-
} } // namespace boost::gil
#endif
diff --git a/boost/gil/cmyk.hpp b/boost/gil/cmyk.hpp
index 6efeeef438..0fd3f40984 100644
--- a/boost/gil/cmyk.hpp
+++ b/boost/gil/cmyk.hpp
@@ -1,34 +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 <boost/gil/metafunctions.hpp>
- 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 <cstddef>
-
-#include <boost/config.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
-#include "gil_config.hpp"
-#include "metafunctions.hpp"
+#include <cstddef>
namespace boost { namespace gil {
diff --git a/boost/gil/color_base.hpp b/boost/gil/color_base.hpp
index 1d43cc28ee..6ea5dbc7e4 100644
--- a/boost/gil/color_base.hpp
+++ b/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 <cassert>
+//
+// 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 <boost/gil/utilities.hpp>
+#include <boost/gil/concepts.hpp>
#include <boost/config.hpp>
#include <boost/mpl/range_c.hpp>
@@ -31,9 +18,7 @@
#include <boost/type_traits.hpp>
#include <boost/utility/enable_if.hpp>
-#include "gil_config.hpp"
-#include "utilities.hpp"
-#include "gil_concept.hpp"
+#include <cassert>
namespace boost { namespace gil {
diff --git a/boost/gil/color_base_algorithm.hpp b/boost/gil/color_base_algorithm.hpp
index 0a9f52be5e..2a81cc9b70 100644
--- a/boost/gil/color_base_algorithm.hpp
+++ b/boost/gil/color_base_algorithm.hpp
@@ -1,42 +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 <algorithm>
+//
+// 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 <boost/gil/concepts.hpp>
+#include <boost/gil/utilities.hpp>
#include <boost/config.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/contains.hpp>
#include <boost/type_traits.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/mpl/contains.hpp>
-#include <boost/mpl/at.hpp>
-#include "gil_config.hpp"
-#include "gil_concept.hpp"
-#include "utilities.hpp"
+#include <algorithm>
namespace boost { namespace gil {
-
///////////////////////////////////////
///
/// size: Semantic channel size
@@ -88,7 +72,7 @@ bgr432_pixel_t red_pixel(0,0,0);
// Set the red channel to 100%
red_channel_reference_t red_channel = semantic_at_c<0>(red_pixel);
-red_channel = channel_traits<red_channel_reference_t>::max_value();
+red_channel = channel_traits<red_channel_reference_t>::max_value();
\endcode
*/
@@ -119,16 +103,16 @@ template <typename ColorBase, int K> struct kth_semantic_element_const_reference
/// \ingroup ColorBaseAlgorithmSemanticAtC
template <int K, typename ColorBase> inline
typename disable_if<is_const<ColorBase>,typename kth_semantic_element_reference_type<ColorBase,K>::type>::type
-semantic_at_c(ColorBase& p) {
- return kth_semantic_element_reference_type<ColorBase,K>::get(p);
+semantic_at_c(ColorBase& p) {
+ return kth_semantic_element_reference_type<ColorBase,K>::get(p);
}
/// \brief A constant accessor to the K-th semantic element of a color base
/// \ingroup ColorBaseAlgorithmSemanticAtC
template <int K, typename ColorBase> inline
typename kth_semantic_element_const_reference_type<ColorBase,K>::type
-semantic_at_c(const ColorBase& p) {
- return kth_semantic_element_const_reference_type<ColorBase,K>::get(p);
+semantic_at_c(const ColorBase& p) {
+ return kth_semantic_element_const_reference_type<ColorBase,K>::get(p);
}
///////////////////////////////////////
@@ -151,7 +135,7 @@ void set_red_to_max(Pixel& pixel) {
BOOST_STATIC_ASSERT((contains_color<Pixel, red_t>::value));
typedef typename color_element_type<Pixel, red_t>::type red_channel_t;
- get_color(pixel, red_t()) = channel_traits<red_channel_t>::max_value();
+ get_color(pixel, red_t()) = channel_traits<red_channel_t>::max_value();
}
\endcode
*/
@@ -181,14 +165,14 @@ struct color_element_const_reference_type : public kth_semantic_element_const_re
/// \brief Mutable accessor to the element associated with a given color name
/// \ingroup ColorBaseAlgorithmColor
-template <typename ColorBase, typename Color>
+template <typename ColorBase, typename Color>
typename color_element_reference_type<ColorBase,Color>::type get_color(ColorBase& cb, Color=Color()) {
return color_element_reference_type<ColorBase,Color>::get(cb);
}
/// \brief Constant accessor to the element associated with a given color name
/// \ingroup ColorBaseAlgorithmColor
-template <typename ColorBase, typename Color>
+template <typename ColorBase, typename Color>
typename color_element_const_reference_type<ColorBase,Color>::type get_color(const ColorBase& cb, Color=Color()) {
return color_element_const_reference_type<ColorBase,Color>::get(cb);
}
@@ -230,64 +214,78 @@ namespace detail {
// compile-time recursion for per-element operations on color bases
template <int N>
-struct element_recursion {
- //static_equal
+struct element_recursion
+{
+
+#if defined(BOOST_GCC)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
template <typename P1,typename P2>
- static bool static_equal(const P1& p1, const P2& p2) {
+ static bool static_equal(const P1& p1, const P2& p2)
+ {
return element_recursion<N-1>::static_equal(p1,p2) &&
- semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
+ semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
}
- //static_copy
+
template <typename P1,typename P2>
- static void static_copy(const P1& p1, P2& p2) {
+ static void static_copy(const P1& p1, P2& p2)
+ {
element_recursion<N-1>::static_copy(p1,p2);
semantic_at_c<N-1>(p2)=semantic_at_c<N-1>(p1);
}
- //static_fill
+
template <typename P,typename T2>
- static void static_fill(P& p, T2 v) {
+ static void static_fill(P& p, T2 v)
+ {
element_recursion<N-1>::static_fill(p,v);
semantic_at_c<N-1>(p)=v;
}
- //static_generate
- template <typename Dst,typename Op>
- static void static_generate(Dst& dst, Op op) {
+
+ template <typename Dst,typename Op>
+ static void static_generate(Dst& dst, Op op)
+ {
element_recursion<N-1>::static_generate(dst,op);
semantic_at_c<N-1>(dst)=op();
}
+#if defined(BOOST_GCC)
+#pragma GCC diagnostic pop
+#endif
+
//static_for_each with one source
- template <typename P1,typename Op>
+ template <typename P1,typename Op>
static Op static_for_each(P1& p1, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,op));
op2(semantic_at_c<N-1>(p1));
return op2;
}
- template <typename P1,typename Op>
+ template <typename P1,typename Op>
static Op static_for_each(const P1& p1, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,op));
op2(semantic_at_c<N-1>(p1));
return op2;
}
//static_for_each with two sources
- template <typename P1,typename P2,typename Op>
+ template <typename P1,typename P2,typename Op>
static Op static_for_each(P1& p1, P2& p2, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
return op2;
}
- template <typename P1,typename P2,typename Op>
+ template <typename P1,typename P2,typename Op>
static Op static_for_each(P1& p1, const P2& p2, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
return op2;
}
- template <typename P1,typename P2,typename Op>
+ template <typename P1,typename P2,typename Op>
static Op static_for_each(const P1& p1, P2& p2, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
return op2;
}
- template <typename P1,typename P2,typename Op>
+ template <typename P1,typename P2,typename Op>
static Op static_for_each(const P1& p1, const P2& p2, Op op) {
Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
@@ -343,13 +341,13 @@ struct element_recursion {
return op2;
}
//static_transform with one source
- template <typename P1,typename Dst,typename Op>
+ template <typename P1,typename Dst,typename Op>
static Op static_transform(P1& src, Dst& dst, Op op) {
Op op2(element_recursion<N-1>::static_transform(src,dst,op));
semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
return op2;
}
- template <typename P1,typename Dst,typename Op>
+ template <typename P1,typename Dst,typename Op>
static Op static_transform(const P1& src, Dst& dst, Op op) {
Op op2(element_recursion<N-1>::static_transform(src,dst,op));
semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
@@ -425,16 +423,16 @@ template <int N>
struct min_max_recur {
template <typename P> static typename element_const_reference_type<P>::type max_(const P& p) {
return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
- }
+ }
template <typename P> static typename element_reference_type<P>::type max_( P& p) {
return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
- }
+ }
template <typename P> static typename element_const_reference_type<P>::type min_(const P& p) {
return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
- }
+ }
template <typename P> static typename element_reference_type<P>::type min_( P& p) {
return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
- }
+ }
};
// termination condition of the compile-time recursion for min/max element
@@ -481,7 +479,7 @@ typename element_reference_type<P>::type static_min( P& p) { return d
/// \}
/**
-\defgroup ColorBaseAlgorithmEqual static_equal
+\defgroup ColorBaseAlgorithmEqual static_equal
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::equal. Pairs the elements semantically
@@ -504,7 +502,7 @@ bool static_equal(const P1& p1, const P2& p2) { return detail::element_recursion
/// \}
/**
-\defgroup ColorBaseAlgorithmCopy static_copy
+\defgroup ColorBaseAlgorithmCopy static_copy
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::copy. Pairs the elements semantically
@@ -527,7 +525,7 @@ void static_copy(const Src& src, Dst& dst) { detail::element_recursion<size<Dst
/// \}
/**
-\defgroup ColorBaseAlgorithmFill static_fill
+\defgroup ColorBaseAlgorithmFill static_fill
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::fill.
@@ -545,7 +543,7 @@ void static_fill(P& p, const V& v) { detail::element_recursion<size<P>::value>:
/// \}
/**
-\defgroup ColorBaseAlgorithmGenerate static_generate
+\defgroup ColorBaseAlgorithmGenerate static_generate
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::generate.
@@ -571,7 +569,7 @@ void static_generate(P1& dst,Op op) { detail::element_recur
/// \}
/**
-\defgroup ColorBaseAlgorithmTransform static_transform
+\defgroup ColorBaseAlgorithmTransform static_transform
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::transform. Pairs the elements semantically
@@ -621,15 +619,15 @@ Op static_transform(const P2& p2,const P3& p3,Dst& dst,Op op) { return detail::e
/// \}
/**
-\defgroup ColorBaseAlgorithmForEach static_for_each
+\defgroup ColorBaseAlgorithmForEach static_for_each
\ingroup ColorBaseAlgorithm
\brief Equivalent to std::for_each. Pairs the elements semantically
Example: Use static_for_each to increment a planar pixel iterator
\code
-struct increment {
- template <typename Incrementable>
- void operator()(Incrementable& x) const { ++x; }
+struct increment {
+ template <typename Incrementable>
+ void operator()(Incrementable& x) const { ++x; }
};
template <typename ColorBase>
diff --git a/boost/gil/color_convert.hpp b/boost/gil/color_convert.hpp
index 841c45f14d..2a5a30e5fe 100644
--- a/boost/gil/color_convert.hpp
+++ b/boost/gil/color_convert.hpp
@@ -1,46 +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 <boost/gil/channel_algorithm.hpp>
+#include <boost/gil/cmyk.hpp>
+#include <boost/gil/color_base_algorithm.hpp>
+#include <boost/gil/gray.hpp>
+#include <boost/gil/metafunctions.hpp>
+#include <boost/gil/pixel.hpp>
+#include <boost/gil/rgb.hpp>
+#include <boost/gil/rgba.hpp>
+#include <boost/gil/utilities.hpp>
+
+#include <algorithm>
#include <functional>
-#include <boost/config.hpp>
-
-#include "gil_config.hpp"
-#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 <typename P> struct channel_type;
diff --git a/boost/gil/gil_concept.hpp b/boost/gil/concepts.hpp
index 2366683705..89baf766a5 100644
--- a/boost/gil/gil_concept.hpp
+++ b/boost/gil/concepts.hpp
@@ -1,35 +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://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 <functional>
-#include "gil_config.hpp"
-#include <boost/type_traits.hpp>
-#include <boost/utility/enable_if.hpp>
+#include <boost/config.hpp>
#include <boost/concept_check.hpp>
+#include <boost/core/ignore_unused.hpp>
#include <boost/iterator/iterator_concepts.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/size.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <cstdint>
+#include <iterator>
+#include <utility>
namespace boost { namespace gil {
@@ -38,8 +28,8 @@ namespace boost { namespace gil {
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#endif
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-#pragma warning(push)
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
#pragma warning(disable:4510) //default constructor could not be generated
#pragma warning(disable:4512) //assignment operator could not be generated
#pragma warning(disable:4610) //can never be instantiated - user defined constructor required
@@ -49,9 +39,9 @@ template <typename T> struct channel_traits;
template <typename P> struct is_pixel;
template <typename dstT, typename srcT>
typename channel_traits<dstT>::value_type channel_convert(const srcT& val);
-template <typename T> class point2;
-template <std::size_t K, typename T> const T& axis_value(const point2<T>& p);
-template <std::size_t K, typename T> T& axis_value( point2<T>& p);
+template <typename T> class point;
+template <std::size_t K, typename T> const T& axis_value(point<T> const& p);
+template <std::size_t K, typename T> T& axis_value(point<T>& p);
template <typename ColorBase, int K> struct kth_element_type;
template <typename ColorBase, int K> struct kth_element_reference_type;
template <typename ColorBase, int K> struct kth_element_const_reference_type;
@@ -82,11 +72,11 @@ typename add_reference<typename add_const<E>::type>::type at_c(const detail::hom
template <typename P, typename C, typename L> struct packed_pixel;
template <int K, typename P, typename C, typename L>
-typename kth_element_reference_type<packed_pixel<P,C,L>, K>::type
+typename kth_element_reference_type<packed_pixel<P,C,L>, K>::type
at_c(packed_pixel<P,C,L>& p);
template <int K, typename P, typename C, typename L>
-typename kth_element_const_reference_type<packed_pixel<P,C,L>,K>::type
+typename kth_element_const_reference_type<packed_pixel<P,C,L>,K>::type
at_c(const packed_pixel<P,C,L>& p);
template <typename B, typename C, typename L, bool M> struct bit_aligned_pixel_reference;
@@ -117,7 +107,7 @@ struct remove_const_and_reference : public remove_const<typename remove_referenc
#define GIL_CLASS_REQUIRE(type_var, ns, concept) BOOST_CLASS_REQUIRE(type_var, ns, concept);
template <typename C> void gil_function_requires() { function_requires<C>(); }
#else
- #define GIL_CLASS_REQUIRE(T,NS,C)
+ #define GIL_CLASS_REQUIRE(T,NS,C)
template <typename C> void gil_function_requires() {}
#endif
@@ -125,7 +115,7 @@ struct remove_const_and_reference : public remove_const<typename remove_referenc
/**
\code
auto concept DefaultConstructible<typename T> {
- T::T();
+ T::T();
};
\endcode
*/
@@ -156,7 +146,7 @@ struct CopyConstructible {
\code
auto concept Assignable<typename T, typename U = T> {
typename result_type;
- result_type operator=(T&, U);
+ result_type operator=(T&, U);
};
\endcode
*/
@@ -170,7 +160,7 @@ struct Assignable {
/**
\code
auto concept EqualityComparable<typename T, typename U = T> {
- bool operator==(T x, T y);
+ bool operator==(T x, T y);
bool operator!=(T x, T y) { return !(x==y); }
};
\endcode
@@ -216,7 +206,7 @@ struct Swappable {
/// \ingroup BasicConcepts
/**
\code
-auto concept Regular<typename T> : DefaultConstructible<T>, CopyConstructible<T>, EqualityComparable<T>,
+auto concept Regular<typename T> : DefaultConstructible<T>, CopyConstructible<T>, EqualityComparable<T>,
Assignable<T>, Swappable<T> {};
\endcode
*/
@@ -225,7 +215,7 @@ template <typename T>
struct Regular {
void constraints() {
gil_function_requires< boost::DefaultConstructibleConcept<T> >();
- gil_function_requires< boost::CopyConstructibleConcept<T> >();
+ gil_function_requires< boost::CopyConstructibleConcept<T> >();
gil_function_requires< boost::EqualityComparableConcept<T> >(); // ==, !=
gil_function_requires< boost::AssignableConcept<T> >();
gil_function_requires< Swappable<T> >();
@@ -249,19 +239,19 @@ struct Metafunction {
////////////////////////////////////////////////////////////////////////////////////////
//
// POINT CONCEPTS
-//
+//
////////////////////////////////////////////////////////////////////////////////////////
/// \brief N-dimensional point concept
/// \ingroup PointConcept
/**
\code
-concept PointNDConcept<typename T> : Regular<T> {
+concept PointNDConcept<typename T> : Regular<T> {
// the type of a coordinate along each axis
template <size_t K> struct axis; where Metafunction<axis>;
-
+
const size_t num_dimensions;
-
+
// accessor/modifier of the value of each axis.
template <size_t K> const typename axis<K>::type& T::axis_value() const;
template <size_t K> typename axis<K>::type& T::axis_value();
@@ -282,7 +272,7 @@ struct PointNDConcept {
axis_value<0>(point)=ft;
LT lt=axis_value<N-1>(point);
axis_value<N-1>(point)=lt;
-
+
// value_type v=point[0]; ignore_unused_variable_warning(v);
}
P point;
@@ -292,7 +282,7 @@ struct PointNDConcept {
/// \ingroup PointConcept
/**
\code
-concept Point2DConcept<typename T> : PointNDConcept<T> {
+concept Point2DConcept<typename T> : PointNDConcept<T> {
where num_dimensions == 2;
where SameType<axis<0>::type, axis<1>::type>;
@@ -321,7 +311,7 @@ struct Point2DConcept {
//
// ITERATOR MUTABILITY CONCEPTS
//
-// Taken from boost's concept_check.hpp. Isolating mutability to result in faster compile time
+// Taken from boost's concept_check.hpp. Isolating mutability to result in faster compile time
//
////////////////////////////////////////////////////////////////////////////////////////
@@ -421,12 +411,12 @@ struct ChannelMappingConcept {
/// \ingroup ChannelConcept
/// \brief A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture.
-/**
+/**
For example, in the RGB color space, using 8-bit unsigned channels, the color red is defined as [255 0 0], which means maximum of Red, and no Green and Blue.
-
+
Built-in scalar types, such as \p int and \p float, are valid GIL channels. In more complex scenarios, channels may be represented as bit ranges or even individual bits.
In such cases special classes are needed to represent the value and reference to a channel.
-
+
Channels have a traits class, \p channel_traits, which defines their associated types as well as their operating ranges.
\code
@@ -446,8 +436,8 @@ concept ChannelConcept<typename T> : EqualityComparable<T> {
template <typename T>
struct ChannelConcept {
void constraints() {
- gil_function_requires< boost::EqualityComparableConcept<T> >();
-
+ gil_function_requires< boost::EqualityComparableConcept<T> >();
+
typedef typename channel_traits<T>::value_type v;
typedef typename channel_traits<T>::reference r;
typedef typename channel_traits<T>::pointer p;
@@ -490,11 +480,11 @@ struct MutableChannelConcept {
}
};
-/// \brief A channel that supports default construction.
+/// \brief A channel that supports default construction.
/// \ingroup ChannelConcept
/**
\code
-concept ChannelValueConcept<ChannelConcept T> : Regular<T> {};
+concept ChannelValueConcept<ChannelConcept T> : Regular<T> {};
\endcode
*/
template <typename T>
@@ -518,7 +508,7 @@ BOOST_STATIC_ASSERT((channels_are_compatible<uint8_t, const uint8_t&>::value));
\endcode
*/
template <typename T1, typename T2> // Models GIL Pixel
-struct channels_are_compatible
+struct channels_are_compatible
: public is_same<typename channel_traits<T1>::value_type, typename channel_traits<T2>::value_type> {};
/// \brief Channels are compatible if their associated value types (ignoring constness and references) are the same
@@ -571,7 +561,7 @@ struct ChannelConvertibleConcept {
/// \ingroup ColorBaseConcept
/// \brief A color base is a container of color elements (such as channels, channel references or channel pointers)
-/**
+/**
The most common use of color base is in the implementation of a pixel, in which case the color
elements are channel values. The color base concept, however, can be used in other scenarios. For example, a planar pixel has channels that are not
contiguous in memory. Its reference is a proxy class that uses a color base whose elements are channel references. Its iterator uses a color base
@@ -589,22 +579,22 @@ the corresponding semantic element.
\code
concept ColorBaseConcept<typename T> : CopyConstructible<T>, EqualityComparable<T> {
// a GIL layout (the color space and element permutation)
- typename layout_t;
-
+ typename layout_t;
+
// The type of K-th element
template <int K> struct kth_element_type; where Metafunction<kth_element_type>;
-
+
// The result of at_c
- template <int K> struct kth_element_const_reference_type; where Metafunction<kth_element_const_reference_type>;
-
+ template <int K> struct kth_element_const_reference_type; where Metafunction<kth_element_const_reference_type>;
+
template <int K> kth_element_const_reference_type<T,K>::type at_c(T);
// Copy-constructible and equality comparable with other compatible color bases
- template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+ template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
T::T(T2);
- template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+ template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
bool operator==(const T&, const T2&);
- template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+ template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
bool operator!=(const T&, const T2&);
};
@@ -623,7 +613,7 @@ struct ColorBaseConcept {
typedef typename ColorBase::layout_t::channel_mapping_t channel_mapping_t;
// TODO: channel_mapping_t must be an MPL RandomAccessSequence
- static const std::size_t num_elements = size<ColorBase>::value;
+ static const int num_elements = size<ColorBase>::value;
typedef typename kth_element_type<ColorBase,num_elements-1>::type TN;
typedef typename kth_element_const_reference_type<ColorBase,num_elements-1>::type CR;
@@ -641,15 +631,15 @@ struct ColorBaseConcept {
/// \ingroup ColorBaseConcept
/// \brief Color base which allows for modifying its elements
-/**
+/**
\code
concept MutableColorBaseConcept<ColorBaseConcept T> : Assignable<T>, Swappable<T> {
template <int K> struct kth_element_reference_type; where Metafunction<kth_element_reference_type>;
template <int K> kth_element_reference_type<kth_element_type<T,K>::type>::type at_c(T);
-
- template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+
+ template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
T& operator=(T&, const T2&);
};
\endcode
@@ -661,7 +651,7 @@ struct MutableColorBaseConcept {
gil_function_requires< Assignable<ColorBase> >();
gil_function_requires< Swappable<ColorBase> >();
- typedef typename kth_element_reference_type<ColorBase, 0>::type CR;
+ typedef typename kth_element_reference_type<ColorBase, 0>::type CR;
CR r=gil::at_c<0>(cb);
gil::at_c<0>(cb)=r;
@@ -672,7 +662,7 @@ struct MutableColorBaseConcept {
/// \ingroup ColorBaseConcept
/// \brief Color base that also has a default-constructor. Refines Regular
-/**
+/**
\code
concept ColorBaseValueConcept<typename T> : MutableColorBaseConcept<T>, Regular<T> {
};
@@ -688,11 +678,11 @@ struct ColorBaseValueConcept {
/// \ingroup ColorBaseConcept
/// \brief Color base whose elements all have the same type
-/**
+/**
\code
concept HomogeneousColorBaseConcept<ColorBaseConcept CB> {
// For all K in [0 ... size<C1>::value-1):
- // where SameType<kth_element_type<CB,K>::type, kth_element_type<CB,K+1>::type>;
+ // where SameType<kth_element_type<CB,K>::type, kth_element_type<CB,K+1>::type>;
kth_element_const_reference_type<CB,0>::type dynamic_at_c(const CB&, std::size_t n) const;
};
\endcode
@@ -703,13 +693,13 @@ struct HomogeneousColorBaseConcept {
void constraints() {
gil_function_requires< ColorBaseConcept<ColorBase> >();
- static const std::size_t num_elements = size<ColorBase>::value;
+ static const int num_elements = size<ColorBase>::value;
- typedef typename kth_element_type<ColorBase,0>::type T0;
- typedef typename kth_element_type<ColorBase,num_elements-1>::type TN;
+ typedef typename kth_element_type<ColorBase,0>::type T0;
+ typedef typename kth_element_type<ColorBase,num_elements-1>::type TN;
BOOST_STATIC_ASSERT((is_same<T0,TN>::value)); // better than nothing
- typedef typename kth_element_const_reference_type<ColorBase,0>::type CRef0;
+ typedef typename kth_element_const_reference_type<ColorBase,0>::type CRef0;
CRef0 e0=dynamic_at_c(cb,0);
}
ColorBase cb;
@@ -717,7 +707,7 @@ struct HomogeneousColorBaseConcept {
/// \ingroup ColorBaseConcept
/// \brief Homogeneous color base that allows for modifying its elements
-/**
+/**
\code
concept MutableHomogeneousColorBaseConcept<ColorBaseConcept CB> : HomogeneousColorBaseConcept<CB> {
@@ -740,7 +730,7 @@ struct MutableHomogeneousColorBaseConcept {
/// \ingroup ColorBaseConcept
/// \brief Homogeneous color base that also has a default constructor. Refines Regular.
-/**
+/**
\code
concept HomogeneousColorBaseValueConcept<typename T> : MutableHomogeneousColorBaseConcept<T>, Regular<T> {
@@ -759,7 +749,7 @@ struct HomogeneousColorBaseValueConcept {
/// \ingroup ColorBaseConcept
/// \brief Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise.
-/**
+/**
\code
concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2> {
@@ -773,7 +763,7 @@ concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2> {
template <typename ColorBase1, typename ColorBase2>
struct ColorBasesCompatibleConcept {
void constraints() {
- BOOST_STATIC_ASSERT((is_same<typename ColorBase1::layout_t::color_space_t,
+ BOOST_STATIC_ASSERT((is_same<typename ColorBase1::layout_t::color_space_t,
typename ColorBase2::layout_t::color_space_t>::value));
// typedef typename kth_semantic_element_type<ColorBase1,0>::type e1;
// typedef typename kth_semantic_element_type<ColorBase2,0>::type e2;
@@ -813,11 +803,11 @@ struct ColorBasesCompatibleConcept {
/**
\code
concept PixelBasedConcept<typename T> {
- typename color_space_type<T>;
+ typename color_space_type<T>;
where Metafunction<color_space_type<T> >;
where ColorSpaceConcept<color_space_type<T>::type>;
- typename channel_mapping_type<T>;
- where Metafunction<channel_mapping_type<T> >;
+ typename channel_mapping_type<T>;
+ where Metafunction<channel_mapping_type<T> >;
where ChannelMappingConcept<channel_mapping_type<T>::type>;
typename is_planar<T>;
where Metafunction<is_planar<T> >;
@@ -847,7 +837,7 @@ struct PixelBasedConcept {
/**
\code
concept HomogeneousPixelBasedConcept<PixelBasedConcept T> {
- typename channel_type<T>;
+ typename channel_type<T>;
where Metafunction<channel_type<T> >;
where ChannelConcept<channel_type<T>::type>;
};
@@ -858,7 +848,7 @@ struct HomogeneousPixelBasedConcept {
void constraints() {
gil_function_requires<PixelBasedConcept<P> >();
typedef typename channel_type<P>::type channel_t;
- gil_function_requires<ChannelConcept<channel_t> >();
+ gil_function_requires<ChannelConcept<channel_t> >();
}
};
@@ -867,23 +857,23 @@ struct HomogeneousPixelBasedConcept {
/// \ingroup PixelConcept
/**
\code
-concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P> {
+concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P> {
where is_pixel<P>::type::value==true;
// where for each K [0..size<P>::value-1]:
// ChannelConcept<kth_element_type<P,K> >;
-
+
typename P::value_type; where PixelValueConcept<value_type>;
typename P::reference; where PixelConcept<reference>;
typename P::const_reference; where PixelConcept<const_reference>;
static const bool P::is_mutable;
- template <PixelConcept P2> where { PixelConcept<P,P2> }
+ template <PixelConcept P2> where { PixelConcept<P,P2> }
P::P(P2);
- template <PixelConcept P2> where { PixelConcept<P,P2> }
+ template <PixelConcept P2> where { PixelConcept<P,P2> }
bool operator==(const P&, const P2&);
- template <PixelConcept P2> where { PixelConcept<P,P2> }
+ template <PixelConcept P2> where { PixelConcept<P,P2> }
bool operator!=(const P&, const P2&);
-};
+};
\endcode
*/
@@ -928,7 +918,7 @@ struct MutablePixelConcept {
/// \ingroup PixelConcept
/**
\code
-concept HomogeneousPixelConcept<PixelConcept P> : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P> {
+concept HomogeneousPixelConcept<PixelConcept P> : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P> {
P::template element_const_reference_type<P>::type operator[](P p, std::size_t i) const { return dynamic_at_c(p,i); }
};
\endcode
@@ -948,7 +938,7 @@ struct HomogeneousPixelConcept {
/// \ingroup PixelConcept
/**
\code
-concept MutableHomogeneousPixelConcept<HomogeneousPixelConcept P> : MutableHomogeneousColorBaseConcept<P> {
+concept MutableHomogeneousPixelConcept<HomogeneousPixelConcept P> : MutableHomogeneousColorBaseConcept<P> {
P::template element_reference_type<P>::type operator[](P p, std::size_t i) { return dynamic_at_c(p,i); }
};
\endcode
@@ -971,7 +961,7 @@ struct MutableHomogeneousPixelConcept {
\code
concept PixelValueConcept<PixelConcept P> : Regular<P> {
where SameType<value_type,P>;
-};
+};
\endcode
*/
template <typename P>
@@ -988,7 +978,7 @@ struct PixelValueConcept {
\code
concept HomogeneousPixelValueConcept<HomogeneousPixelConcept P> : Regular<P> {
where SameType<value_type,P>;
-};
+};
\endcode
*/
template <typename P>
@@ -1002,11 +992,11 @@ struct HomogeneousPixelValueConcept {
namespace detail {
template <typename P1, typename P2, int K>
- struct channels_are_pairwise_compatible : public
+ struct channels_are_pairwise_compatible : public
mpl::and_<channels_are_pairwise_compatible<P1,P2,K-1>,
channels_are_compatible<typename kth_semantic_element_reference_type<P1,K>::type,
typename kth_semantic_element_reference_type<P2,K>::type> > {};
-
+
template <typename P1, typename P2>
struct channels_are_pairwise_compatible<P1,P2,-1> : public mpl::true_ {};
}
@@ -1016,9 +1006,9 @@ namespace detail {
/// Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another.
/// \ingroup PixelAlgorithm
template <typename P1, typename P2> // Models GIL Pixel
-struct pixels_are_compatible
- : public mpl::and_<typename color_spaces_are_compatible<typename color_space_type<P1>::type,
- typename color_space_type<P2>::type>::type,
+struct pixels_are_compatible
+ : public mpl::and_<typename color_spaces_are_compatible<typename color_space_type<P1>::type,
+ typename color_space_type<P2>::type>::type,
detail::channels_are_pairwise_compatible<P1,P2,num_channels<P1>::value-1> > {};
/// \brief Concept for pixel compatibility
@@ -1091,11 +1081,11 @@ concept PixelDereferenceAdaptorConcept<boost::UnaryFunctionConcept D>
template <typename D>
struct PixelDereferenceAdaptorConcept {
void constraints() {
- gil_function_requires< boost::UnaryFunctionConcept<D,
- typename remove_const_and_reference<typename D::result_type>::type,
+ gil_function_requires< boost::UnaryFunctionConcept<D,
+ typename remove_const_and_reference<typename D::result_type>::type,
typename D::argument_type> >();
gil_function_requires< boost::DefaultConstructibleConcept<D> >();
- gil_function_requires< boost::CopyConstructibleConcept<D> >();
+ gil_function_requires< boost::CopyConstructibleConcept<D> >();
gil_function_requires< boost::AssignableConcept<D> >();
gil_function_requires<PixelConcept<typename remove_const_and_reference<typename D::result_type>::type> >();
@@ -1141,7 +1131,7 @@ concept HasDynamicXStepTypeConcept<typename T> {
\endcode
*/
template <typename T>
-struct HasDynamicXStepTypeConcept {
+struct HasDynamicXStepTypeConcept {
void constraints() {
typedef typename dynamic_x_step_type<T>::type type;
}
@@ -1158,7 +1148,7 @@ concept HasDynamicYStepTypeConcept<typename T> {
\endcode
*/
template <typename T>
-struct HasDynamicYStepTypeConcept {
+struct HasDynamicYStepTypeConcept {
void constraints() {
typedef typename dynamic_y_step_type<T>::type type;
}
@@ -1176,7 +1166,7 @@ concept HasTransposedTypeConcept<typename T> {
\endcode
*/
template <typename T>
-struct HasTransposedTypeConcept {
+struct HasTransposedTypeConcept {
void constraints() {
typedef typename transposed_type<T>::type type;
}
@@ -1197,22 +1187,22 @@ GIL's iterators must also provide the following metafunctions:
\code
concept PixelIteratorConcept<typename Iterator> : boost_concepts::RandomAccessTraversalConcept<Iterator>, PixelBasedConcept<Iterator> {
where PixelValueConcept<value_type>;
- typename const_iterator_type<It>::type;
+ typename const_iterator_type<It>::type;
where PixelIteratorConcept<const_iterator_type<It>::type>;
- static const bool iterator_is_mutable<It>::type::value;
+ static const bool iterator_is_mutable<It>::type::value;
static const bool is_iterator_adaptor<It>::type::value; // is it an iterator adaptor
};
\endcode
*/
template <typename Iterator>
-struct PixelIteratorConcept {
+struct PixelIteratorConcept {
void constraints() {
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator> >();
gil_function_requires<PixelBasedConcept<Iterator> >();
-
+
typedef typename std::iterator_traits<Iterator>::value_type value_type;
gil_function_requires<PixelValueConcept<value_type> >();
-
+
typedef typename const_iterator_type<Iterator>::type const_t;
static const bool is_mut = iterator_is_mutable<Iterator>::type::value; ignore_unused_variable_warning(is_mut);
@@ -1356,8 +1346,8 @@ concept IteratorAdaptorConcept<boost_concepts::ForwardTraversalConcept Iterator>
typename iterator_adaptor_get_base<Iterator>;
where Metafunction<iterator_adaptor_get_base<Iterator> >;
where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
-
- typename another_iterator;
+
+ typename another_iterator;
typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
where boost_concepts::ForwardTraversalConcept<another_iterator>;
where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
@@ -1419,18 +1409,18 @@ struct MutableIteratorAdaptorConcept {
/// \brief N-dimensional locator over immutable values
/**
\code
-concept RandomAccessNDLocatorConcept<Regular Loc> {
+concept RandomAccessNDLocatorConcept<Regular Loc> {
typename value_type; // value over which the locator navigates
typename reference; // result of dereferencing
typename difference_type; where PointNDConcept<difference_type>; // return value of operator-.
typename const_t; // same as Loc, but operating over immutable values
typename cached_location_t; // type to store relative location (for efficient repeated access)
typename point_t = difference_type;
-
+
static const size_t num_dimensions; // dimensionality of the locator
where num_dimensions = point_t::num_dimensions;
-
- // The difference_type and iterator type along each dimension. The iterators may only differ in
+
+ // The difference_type and iterator type along each dimension. The iterators may only differ in
// difference_type. Their value_type must be the same as Loc::value_type
template <size_t D> struct axis {
typename coord_t = point_t::axis<D>::coord_t;
@@ -1443,19 +1433,19 @@ concept RandomAccessNDLocatorConcept<Regular Loc> {
typename type; where RandomAccessNDLocatorConcept<type>;
static type make(const Loc& loc, const Deref& deref);
};
-
+
Loc& operator+=(Loc&, const difference_type&);
Loc& operator-=(Loc&, const difference_type&);
Loc operator+(const Loc&, const difference_type&);
Loc operator-(const Loc&, const difference_type&);
-
+
reference operator*(const Loc&);
reference operator[](const Loc&, const difference_type&);
-
- // Storing relative location for faster repeated access and accessing it
+
+ // Storing relative location for faster repeated access and accessing it
cached_location_t Loc::cache_location(const difference_type&) const;
reference operator[](const Loc&,const cached_location_t&);
-
+
// Accessing iterators along a given dimension at the current location or at a given offset
template <size_t D> axis<D>::iterator& Loc::axis_iterator();
template <size_t D> axis<D>::iterator const& Loc::axis_iterator() const;
@@ -1475,7 +1465,7 @@ struct RandomAccessNDLocatorConcept {
typedef typename Loc::const_t const_t; // same as this type, but over const values
typedef typename Loc::point_t point_t; // same as difference_type
static const std::size_t N=Loc::num_dimensions; ignore_unused_variable_warning(N);
-
+
typedef typename Loc::template axis<0>::iterator first_it_type;
typedef typename Loc::template axis<N-1>::iterator last_it_type;
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type> >();
@@ -1516,12 +1506,12 @@ struct RandomAccessNDLocatorConcept {
concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc> {
where num_dimensions==2;
where Point2DConcept<point_t>;
-
+
typename x_iterator = axis<0>::iterator;
typename y_iterator = axis<1>::iterator;
typename x_coord_t = axis<0>::coord_t;
typename y_coord_t = axis<1>::coord_t;
-
+
// Only available to locators that have dynamic step in Y
//Loc::Loc(const Loc& loc, y_coord_t);
@@ -1529,14 +1519,14 @@ concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc> {
//Loc::Loc(const Loc& loc, x_coord_t, y_coord_t, bool transposed=false);
x_iterator& Loc::x();
- x_iterator const& Loc::x() const;
+ x_iterator const& Loc::x() const;
y_iterator& Loc::y();
- y_iterator const& Loc::y() const;
-
+ y_iterator const& Loc::y() const;
+
x_iterator Loc::x_at(const difference_type&) const;
y_iterator Loc::y_at(const difference_type&) const;
Loc Loc::xy_at(const difference_type&) const;
-
+
// x/y versions of all methods that can take difference type
x_iterator Loc::x_at(x_coord_t, y_coord_t) const;
y_iterator Loc::y_at(x_coord_t, y_coord_t) const;
@@ -1658,7 +1648,7 @@ namespace detail {
/// \brief N-dimensional locator over mutable pixels
/**
\code
-concept MutableRandomAccessNDLocatorConcept<RandomAccessNDLocatorConcept Loc> {
+concept MutableRandomAccessNDLocatorConcept<RandomAccessNDLocatorConcept Loc> {
where Mutable<reference>;
};
\endcode
@@ -1731,7 +1721,7 @@ concept RandomAccessNDImageViewConcept<Regular View> {
typename point_t; where PointNDConcept<point_t>; // N-dimensional point
typename locator; where RandomAccessNDLocatorConcept<locator>; // N-dimensional locator.
typename iterator; where RandomAccessTraversalConcept<iterator>; // 1-dimensional iterator over all values
- typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>;
+ typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>;
typename size_type; // the return value of size()
// Equivalent to RandomAccessNDLocatorConcept::axis
@@ -1749,10 +1739,10 @@ concept RandomAccessNDImageViewConcept<Regular View> {
};
static const size_t num_dimensions = point_t::num_dimensions;
-
+
// Create from a locator at the top-left corner and dimensions
View::View(const locator&, const point_type&);
-
+
size_type View::size() const; // total number of elements
reference operator[](View, const difference_type&) const; // 1-dimensional reference
iterator View::begin() const;
@@ -1777,15 +1767,17 @@ struct RandomAccessNDImageViewConcept {
typedef typename View::value_type value_type;
typedef typename View::reference reference; // result of dereferencing
+ typedef typename View::pointer pointer;
typedef typename View::difference_type difference_type; // result of operator-(1d_iterator,1d_iterator)
typedef typename View::const_t const_t; // same as this type, but over const values
typedef typename View::point_t point_t; // N-dimensional point
typedef typename View::locator locator; // N-dimensional locator
typedef typename View::iterator iterator;
+ typedef typename View::const_iterator const_iterator;
typedef typename View::reverse_iterator reverse_iterator;
typedef typename View::size_type size_type;
static const std::size_t N=View::num_dimensions;
-
+
gil_function_requires<RandomAccessNDLocatorConcept<locator> >();
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator> >();
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator> >();
@@ -1822,7 +1814,7 @@ struct RandomAccessNDImageViewConcept {
rit=view.rbegin();
rit=view.rend();
- reference r1=view[d]; ignore_unused_variable_warning(r1); // 1D access
+ reference r1=view[d]; ignore_unused_variable_warning(r1); // 1D access
reference r2=view(p); ignore_unused_variable_warning(r2); // 2D access
// get 1-D iterator of any dimension at a given pixel location
@@ -1847,10 +1839,10 @@ concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View> {
typename x_coord_t = axis<0>::coord_t;
typename y_coord_t = axis<1>::coord_t;
typename xy_locator = locator;
-
+
x_coord_t View::width() const;
y_coord_t View::height() const;
-
+
// X-navigation
x_iterator View::x_at(const point_t&) const;
x_iterator View::row_begin(y_coord_t) const;
@@ -1860,11 +1852,11 @@ concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View> {
y_iterator View::y_at(const point_t&) const;
y_iterator View::col_begin(x_coord_t) const;
y_iterator View::col_end (x_coord_t) const;
-
+
// navigating in 2D
xy_locator View::xy_at(const point_t&) const;
- // (x,y) versions of all methods taking point_t
+ // (x,y) versions of all methods taking point_t
View::View(x_coord_t,y_coord_t,const locator&);
iterator View::at(x_coord_t,y_coord_t) const;
reference operator()(View,x_coord_t,y_coord_t) const;
@@ -1921,6 +1913,92 @@ struct RandomAccess2DImageViewConcept {
View view;
};
+/// \brief GIL view as Collection.
+///
+/// \see https://www.boost.org/libs/utility/Collection.html
+template <typename View>
+struct CollectionImageViewConcept
+{
+ void constraints()
+ {
+ using value_type = typename View::value_type;
+ using iterator = typename View::iterator;
+ using const_iterator = typename View::const_iterator;
+ using reference = typename View::reference;
+ using const_reference = typename View::const_reference;
+ using pointer = typename View::pointer;
+ using difference_type = typename View::difference_type;
+ using size_type= typename View::size_type;
+
+ iterator i;
+ i = view1.begin();
+ i = view2.end();
+
+ const_iterator ci;
+ ci = view1.begin();
+ ci = view2.end();
+
+ size_type s;
+ s = view1.size();
+ s = view2.size();
+ boost::ignore_unused(s);
+
+ view1.empty();
+
+ view1.swap(view2);
+ }
+ View view1;
+ View view2;
+};
+
+/// \brief GIL view as ForwardCollection.
+///
+/// \see https://www.boost.org/libs/utility/Collection.html
+template <typename View>
+struct ForwardCollectionImageViewConcept
+{
+ void constraints()
+ {
+ gil_function_requires<CollectionImageViewConcept<View>>();
+
+ using reference = typename View::reference;
+ using const_reference = typename View::const_reference;
+
+ reference r = view.front();
+ boost::ignore_unused(r);
+
+ const_reference cr = view.front();
+ boost::ignore_unused(cr);
+ }
+ View view;
+};
+
+/// \brief GIL view as ReversibleCollection.
+///
+/// \see https://www.boost.org/libs/utility/Collection.html
+template <typename View>
+struct ReversibleCollectionImageViewConcept
+{
+ void constraints()
+ {
+ gil_function_requires<CollectionImageViewConcept<View>>();
+
+ using reverse_iterator = typename View::reverse_iterator;
+ using reference = typename View::reference;
+ using const_reference = typename View::const_reference;
+
+ reverse_iterator i;
+ i = view.rbegin();
+ i = view.rend();
+
+ reference r = view.back();
+ boost::ignore_unused(r);
+
+ const_reference cr = view.back();
+ boost::ignore_unused(cr);
+ }
+ View view;
+};
/// \ingroup PixelImageViewConcept
/// \brief GIL's 2-dimensional view over immutable GIL pixels
@@ -1928,10 +2006,10 @@ struct RandomAccess2DImageViewConcept {
\code
concept ImageViewConcept<RandomAccess2DImageViewConcept View> {
where PixelValueConcept<value_type>;
- where PixelIteratorConcept<x_iterator>;
+ where PixelIteratorConcept<x_iterator>;
where PixelIteratorConcept<y_iterator>;
where x_coord_t == y_coord_t;
-
+
typename coord_t = x_coord_t;
std::size_t View::num_channels() const;
@@ -1945,7 +2023,7 @@ struct ImageViewConcept {
// TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
gil_function_requires<PixelLocatorConcept<typename View::xy_locator> >();
-
+
BOOST_STATIC_ASSERT((is_same<typename View::x_coord_t, typename View::y_coord_t>::value));
typedef typename View::coord_t coord_t; // 1D difference type (same for all dimensions)
@@ -1978,7 +2056,7 @@ namespace detail {
template <typename View> // preconditions: View Models RandomAccessNDImageViewConcept
struct RandomAccess2DImageViewIsMutableConcept {
- void constraints() {
+ void constraints() {
gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View> >();
typename View::x_coord_t xd=0; ignore_unused_variable_warning(xd);
typename View::y_coord_t yd=0; ignore_unused_variable_warning(yd);
@@ -1990,7 +2068,7 @@ namespace detail {
template <typename View> // preconditions: View Models ImageViewConcept
struct PixelImageViewIsMutableConcept {
- void constraints() {
+ void constraints() {
gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View> >();
}
};
@@ -2065,7 +2143,6 @@ struct ViewsCompatibleConcept {
}
};
-
////////////////////////////////////////////////////////////////////////////////////////
///
/// IMAGE CONCEPTS
@@ -2086,7 +2163,7 @@ concept RandomAccessNDImageConcept<typename Img> : Regular<Img> {
Img::Img(point_t dims, std::size_t alignment=1);
Img::Img(point_t dims, value_type fill_value, std::size_t alignment);
-
+
void Img::recreate(point_t new_dims, std::size_t alignment=1);
void Img::recreate(point_t new_dims, value_type fill_value, std::size_t alignment);
@@ -2133,13 +2210,13 @@ struct RandomAccessNDImageConcept {
concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Img> {
typename x_coord_t = const_view_t::x_coord_t;
typename y_coord_t = const_view_t::y_coord_t;
-
+
Img::Img(x_coord_t width, y_coord_t height, std::size_t alignment=1);
Img::Img(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
x_coord_t Img::width() const;
y_coord_t Img::height() const;
-
+
void Img::recreate(x_coord_t width, y_coord_t height, std::size_t alignment=1);
void Img::recreate(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
};
@@ -2171,7 +2248,7 @@ struct RandomAccess2DImageConcept {
/// \ingroup ImageConcept
/// \brief 2-dimensional image whose value type models PixelValueConcept
/**
-\code
+\code
concept ImageConcept<RandomAccess2DImageConcept Img> {
where MutableImageViewConcept<view_t>;
typename coord_t = view_t::coord_t;
@@ -2192,9 +2269,9 @@ struct ImageConcept {
Img img;
};
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-#pragma warning(pop)
-#endif
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC diagnostic pop
diff --git a/boost/gil/deprecated.hpp b/boost/gil/deprecated.hpp
index 84f08fef1a..77459d2c72 100644
--- a/boost/gil/deprecated.hpp
+++ b/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 <cstddef>
+/// 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/boost/gil/device_n.hpp b/boost/gil/device_n.hpp
index 830f6866d4..1334687b85 100644
--- a/boost/gil/device_n.hpp
+++ b/boost/gil/device_n.hpp
@@ -1,36 +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 <boost/gil/metafunctions.hpp>
+#include <boost/gil/utilities.hpp>
- 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 <cstddef>
-
-#include <boost/type_traits.hpp>
#include <boost/config.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
+#include <boost/type_traits.hpp>
-#include "gil_config.hpp"
-#include "utilities.hpp"
-#include "metafunctions.hpp"
+#include <cstddef>
namespace boost { namespace gil {
diff --git a/boost/gil/extension/dynamic_image/algorithm.hpp b/boost/gil/extension/dynamic_image/algorithm.hpp
index abd5776b0e..1043e76766 100644
--- a/boost/gil/extension/dynamic_image/algorithm.hpp
+++ b/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 <boost/gil/extension/dynamic_image/any_image.hpp>
+
+#include <boost/gil/algorithm.hpp>
+
#include <boost/bind.hpp>
////////////////////////////////////////////////////////////////////////////////////////
@@ -168,6 +166,6 @@ void fill_pixels(const any_image_view<Types>& img_view, const Value& val) {
}
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/extension/dynamic_image/any_image.hpp b/boost/gil/extension/dynamic_image/any_image.hpp
index 3c4445ff10..66d0e47fcd 100644
--- a/boost/gil/extension/dynamic_image/any_image.hpp
+++ b/boost/gil/extension/dynamic_image/any_image.hpp
@@ -1,37 +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_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 <boost/gil/extension/dynamic_image/any_image_view.hpp>
-#ifndef GIL_DYNAMICIMAGE_ANY_IMAGE_HPP
-#define GIL_DYNAMICIMAGE_ANY_IMAGE_HPP
+#include <boost/gil/image.hpp>
-////////////////////////////////////////////////////////////////////////////////////////
-/// \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 <boost/config.hpp>
-//#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)
-#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 boost { namespace gil {
@@ -43,13 +28,15 @@ namespace detail {
template <typename T> struct get_const_view_t { typedef typename T::const_view_t type; };
template <typename Images> struct images_get_const_views_t : public mpl::transform<Images, get_const_view_t<mpl::_1> > {};
- struct recreate_image_fnobj {
+ struct recreate_image_fnobj
+ {
typedef void result_type;
- const point2<std::ptrdiff_t>& _dimensions;
+ point<std::ptrdiff_t> const& _dimensions;
unsigned _alignment;
- recreate_image_fnobj(const point2<std::ptrdiff_t>& dims, unsigned alignment) : _dimensions(dims), _alignment(alignment) {}
- template <typename Image> result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
+ recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment) : _dimensions(dims), _alignment(alignment) {}
+ template <typename Image>
+ result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
};
template <typename AnyView> // Models AnyViewConcept
@@ -68,7 +55,7 @@ namespace detail {
////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageModel
/// \brief Represents a run-time specified image. Note it does NOT model ImageConcept
-///
+///
/// Represents an image whose type (color space, layout, planar/interleaved organization, etc) can be specified at run time.
/// It is the runtime equivalent of \p image.
/// Some of the requirements of ImageConcept, such as the \p value_type typedef cannot be fulfilled, since the language does not allow runtime type specification.
@@ -83,7 +70,7 @@ public:
typedef any_image_view<typename detail::images_get_views_t<ImageTypes>::type> view_t;
typedef std::ptrdiff_t x_coord_t;
typedef std::ptrdiff_t y_coord_t;
- typedef point2<std::ptrdiff_t> point_t;
+ typedef point<std::ptrdiff_t> point_t;
any_image() : parent_t() {}
template <typename T> explicit any_image(const T& obj) : parent_t(obj) {}
@@ -95,8 +82,15 @@ public:
any_image& operator=(const any_image& v) { parent_t::operator=((const parent_t&)v); return *this;}
template <typename Types> any_image& operator=(const any_image<Types>& v) { parent_t::operator=((const variant<Types>&)v); return *this;}
- void recreate(const point_t& dims, unsigned alignment=1) { apply_operation(*this,detail::recreate_image_fnobj(dims,alignment)); }
- void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) { recreate(point2<std::ptrdiff_t>(width,height),alignment); }
+ void recreate(const point_t& dims, unsigned alignment=1)
+ {
+ apply_operation(*this,detail::recreate_image_fnobj(dims,alignment));
+ }
+
+ void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
+ {
+ recreate({width, height}, alignment);
+ }
std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); }
point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); }
@@ -112,25 +106,21 @@ public:
/// \brief Returns the non-constant-pixel view of any image. The returned view is any view.
template <typename Types> BOOST_FORCEINLINE // Models ImageVectorConcept
-typename any_image<Types>::view_t view(any_image<Types>& anyImage) {
+typename any_image<Types>::view_t view(any_image<Types>& anyImage) {
return apply_operation(anyImage, detail::any_image_get_view<typename any_image<Types>::view_t>());
}
/// \brief Returns the constant-pixel view of any image. The returned view is any view.
template <typename Types> BOOST_FORCEINLINE // Models ImageVectorConcept
-typename any_image<Types>::const_view_t const_view(const any_image<Types>& anyImage) {
+typename any_image<Types>::const_view_t const_view(const any_image<Types>& anyImage) {
return apply_operation(anyImage, detail::any_image_get_const_view<typename any_image<Types>::const_view_t>());
}
///@}
-} } // namespace boost::gil
+}} // namespace boost::gil
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-#pragma warning(pop)
-#endif
-
-//#ifdef _MSC_VER
-//#pragma warning(pop)
-//#endif
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
#endif
diff --git a/boost/gil/extension/dynamic_image/any_image_view.hpp b/boost/gil/extension/dynamic_image/any_image_view.hpp
index a99e8baaea..7c9bfa08b7 100644
--- a/boost/gil/extension/dynamic_image/any_image_view.hpp
+++ b/boost/gil/extension/dynamic_image/any_image_view.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_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"
+//
+// 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
+
+#include <boost/gil/extension/dynamic_image/variant.hpp>
+
+#include <boost/gil/image.hpp>
+#include <boost/gil/image_view.hpp>
+#include <boost/gil/point.hpp>
namespace boost { namespace gil {
@@ -36,13 +24,21 @@ template <typename View> struct dynamic_xy_step_type;
template <typename View> struct dynamic_xy_step_transposed_type;
namespace detail {
- struct any_type_get_num_channels { // works for both image_view and image
+
+ // works for both image_view and image
+ struct any_type_get_num_channels
+ {
typedef int result_type;
- template <typename T> result_type operator()(const T&) const { return num_channels<T>::value; }
+ template <typename T>
+ result_type operator()(const T&) const { return num_channels<T>::value; }
};
- struct any_type_get_dimensions { // works for both image_view and image
- typedef point2<std::ptrdiff_t> result_type;
- template <typename T> result_type operator()(const T& v) const { return v.dimensions(); }
+
+ // works for both image_view and image
+ struct any_type_get_dimensions
+ {
+ using result_type = point<std::ptrdiff_t>;
+ template <typename T>
+ result_type operator()(const T& v) const { return v.dimensions(); }
};
}
@@ -67,7 +63,7 @@ public:
typedef any_image_view<typename detail::views_get_const_t<ImageViewTypes>::type> const_t;
typedef std::ptrdiff_t x_coord_t;
typedef std::ptrdiff_t y_coord_t;
- typedef point2<std::ptrdiff_t> point_t;
+ typedef point<std::ptrdiff_t> point_t;
any_image_view() : parent_t() {}
template <typename T> explicit any_image_view(const T& obj) : parent_t(obj) {}
@@ -112,6 +108,6 @@ struct dynamic_xy_step_transposed_type<any_image_view<IVTypes> > {
typedef any_image_view<typename mpl::transform<IVTypes, dynamic_xy_step_transposed_type<mpl::_1> >::type> type;
};
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/extension/dynamic_image/apply_operation.hpp b/boost/gil/extension/dynamic_image/apply_operation.hpp
index beb79bad77..cebca61ce8 100644
--- a/boost/gil/extension/dynamic_image/apply_operation.hpp
+++ b/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 <boost/gil/extension/dynamic_image/apply_operation_base.hpp>
+#include <boost/gil/extension/dynamic_image/variant.hpp>
+
+#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 <boost/gil/extension/dynamic_image/reduce.hpp>
-#ifndef GIL_REDUCE_CODE_BLOAT
+#else
namespace boost { namespace gil {
@@ -50,12 +46,8 @@ typename BinaryOp::result_type apply_operation(const variant<Types1>& arg1, cons
return apply_operation_base<Types1,Types2>(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/boost/gil/extension/dynamic_image/apply_operation_base.hpp b/boost/gil/extension/dynamic_image/apply_operation_base.hpp
index 2204a93b01..1cf21a36ce 100644
--- a/boost/gil/extension/dynamic_image/apply_operation_base.hpp
+++ b/boost/gil/extension/dynamic_image/apply_operation_base.hpp
@@ -1,38 +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 "../../gil_config.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 <boost/gil/utilities.hpp>
+
+#include <boost/config.hpp>
#include <boost/mpl/begin.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/size.hpp>
#include <boost/preprocessor/repeat.hpp>
-////////////////////////////////////////////////////////////////////////////////////////
-/// \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):
@@ -179,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/boost/gil/extension/dynamic_image/dynamic_at_c.hpp b/boost/gil/extension/dynamic_image/dynamic_at_c.hpp
index 93ab5cdeb6..1de9f248f1 100644
--- a/boost/gil/extension/dynamic_image/dynamic_at_c.hpp
+++ b/boost/gil/extension/dynamic_image/dynamic_at_c.hpp
@@ -1,36 +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 "../../gil_config.hpp"
-#include <cassert>
-#include <stdexcept>
#include <boost/mpl/at.hpp>
#include <boost/mpl/size.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
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <cassert>
+#include <stdexcept>
namespace boost { namespace gil {
+// Constructs for static-to-dynamic integer convesion
+
#define GIL_AT_C_VALUE(z, N, text) mpl::at_c<IntTypes,S+N>::type::value,
#define GIL_DYNAMIC_AT_C_LIMIT 226 // size of the maximum vector to handle
@@ -69,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<IntTypes,ValueType>(index);
- case 1: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT ,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT);
+ case 1: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT ,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT);
};
throw;
}
@@ -84,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<IntTypes,ValueType>(index);
case 1: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT);
- case 2: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*2,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*2);
+ case 2: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*2,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*2);
};
throw;
}
@@ -99,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<IntTypes,ValueType>(index);
case 1: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT ,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT);
- case 2: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*2,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*2);
- case 3: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*3,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*3);
+ case 2: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*2,GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*2);
+ case 3: return at_c_fn<GIL_DYNAMIC_AT_C_LIMIT*3,REM >::template apply<IntTypes,ValueType>(index - GIL_DYNAMIC_AT_C_LIMIT*3);
};
throw;
}
@@ -115,16 +102,16 @@ namespace detail {
///
////////////////////////////////////////////////////////////////////////////////////
-template <typename IntTypes, typename ValueType> inline
-ValueType at_c(std::size_t index) {
+template <typename IntTypes, typename ValueType> inline
+ValueType at_c(std::size_t index) {
const std::size_t Size=mpl::size<IntTypes>::value;
return detail::at_c::at_c_impl<Size/GIL_DYNAMIC_AT_C_LIMIT>::template apply<IntTypes,ValueType>(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/boost/gil/extension/dynamic_image/dynamic_image_all.hpp b/boost/gil/extension/dynamic_image/dynamic_image_all.hpp
index 99cab1fe74..0fa2d39012 100644
--- a/boost/gil/extension/dynamic_image/dynamic_image_all.hpp
+++ b/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 <boost/gil/extension/dynamic_image/algorithm.hpp>
+#include <boost/gil/extension/dynamic_image/any_image.hpp>
+#include <boost/gil/extension/dynamic_image/apply_operation.hpp>
+#include <boost/gil/extension/dynamic_image/variant.hpp>
+#include <boost/gil/extension/dynamic_image/image_view_factory.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use!
#endif
diff --git a/boost/gil/extension/dynamic_image/image_view_factory.hpp b/boost/gil/extension/dynamic_image/image_view_factory.hpp
index 69ac4f681d..f46e24a2bf 100644
--- a/boost/gil/extension/dynamic_image/image_view_factory.hpp
+++ b/boost/gil/extension/dynamic_image/image_view_factory.hpp
@@ -1,32 +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_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 <boost/gil/extension/dynamic_image/any_image_view.hpp>
-/*************************************************************************************************/
-
-#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 <boost/gil/image_view_factory.hpp>
+#include <boost/gil/point.hpp>
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 <typename Result> struct flipped_up_down_view_fn {
typedef Result result_type;
@@ -52,18 +43,40 @@ template <typename Result> struct rotated180_view_fn {
typedef Result result_type;
template <typename View> result_type operator()(const View& src) const { return result_type(rotated180_view(src)); }
};
-template <typename Result> struct subimage_view_fn {
+
+template <typename Result>
+struct subimage_view_fn
+{
typedef Result result_type;
- subimage_view_fn(const point2<std::ptrdiff_t>& topleft, const point2<std::ptrdiff_t>& dimensions) : _topleft(topleft), _size2(dimensions) {}
- point2<std::ptrdiff_t> _topleft,_size2;
- template <typename View> result_type operator()(const View& src) const { return result_type(subimage_view(src,_topleft,_size2)); }
+ subimage_view_fn(point_t const& topleft, point_t const& dimensions)
+ : _topleft(topleft), _size2(dimensions)
+ {}
+
+ template <typename View>
+ result_type operator()(const View& src) const
+ {
+ return result_type(subimage_view(src,_topleft,_size2));
+ }
+
+ point_t _topleft;
+ point_t _size2;
};
-template <typename Result> struct subsampled_view_fn {
+
+template <typename Result>
+struct subsampled_view_fn
+{
typedef Result result_type;
- subsampled_view_fn(const point2<std::ptrdiff_t>& step) : _step(step) {}
- point2<std::ptrdiff_t> _step;
- template <typename View> result_type operator()(const View& src) const { return result_type(subsampled_view(src,_step)); }
+ subsampled_view_fn(point_t const& step) : _step(step) {}
+
+ template <typename View>
+ result_type operator()(const View& src) const
+ {
+ return result_type(subsampled_view(src,_step));
+ }
+
+ point_t _step;
};
+
template <typename Result> struct nth_channel_view_fn {
typedef Result result_type;
nth_channel_view_fn(int n) : _n(n) {}
@@ -84,62 +97,86 @@ template <typename DstP, typename Result, typename CC = default_color_converter>
/// \ingroup ImageViewTransformationsFlipUD
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_y_step_type<any_image_view<ViewTypes> >::type flipped_up_down_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::flipped_up_down_view_fn<typename dynamic_y_step_type<any_image_view<ViewTypes> >::type>());
+typename dynamic_y_step_type<any_image_view<ViewTypes> >::type flipped_up_down_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::flipped_up_down_view_fn<typename dynamic_y_step_type<any_image_view<ViewTypes> >::type>());
}
/// \ingroup ImageViewTransformationsFlipLR
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_x_step_type<any_image_view<ViewTypes> >::type flipped_left_right_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::flipped_left_right_view_fn<typename dynamic_x_step_type<any_image_view<ViewTypes> >::type>());
+typename dynamic_x_step_type<any_image_view<ViewTypes> >::type flipped_left_right_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::flipped_left_right_view_fn<typename dynamic_x_step_type<any_image_view<ViewTypes> >::type>());
}
/// \ingroup ImageViewTransformationsTransposed
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type transposed_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::tranposed_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
+typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type transposed_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::tranposed_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
}
/// \ingroup ImageViewTransformations90CW
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type rotated90cw_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::rotated90cw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
+typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type rotated90cw_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::rotated90cw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
}
/// \ingroup ImageViewTransformations90CCW
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type rotated90ccw_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::rotated90ccw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
+typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type rotated90ccw_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::rotated90ccw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<ViewTypes> >::type>());
}
/// \ingroup ImageViewTransformations180
-template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type rotated180_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::rotated180_view_fn<typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type>());
+/// Models MPL Random Access Container of models of ImageViewConcept
+template <typename ViewTypes>
+inline auto rotated180_view(const any_image_view<ViewTypes>& src)
+ -> typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type
+{
+ using step_type = typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type;
+ return apply_operation(src, detail::rotated180_view_fn<step_type>());
}
/// \ingroup ImageViewTransformationsSubimage
-template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-any_image_view<ViewTypes> subimage_view(const any_image_view<ViewTypes>& src, const point2<std::ptrdiff_t>& topleft, const point2<std::ptrdiff_t>& dimensions) {
- return apply_operation(src,detail::subimage_view_fn<any_image_view<ViewTypes> >(topleft,dimensions));
+/// // Models MPL Random Access Container of models of ImageViewConcept
+template <typename ViewTypes>
+inline auto subimage_view(any_image_view<ViewTypes> const& src,
+ point_t const& topleft, point_t const& dimensions)
+ -> any_image_view<ViewTypes>
+{
+ using subimage_view_fn = detail::subimage_view_fn<any_image_view<ViewTypes>>;
+ return apply_operation(src, subimage_view_fn(topleft, dimensions));
}
/// \ingroup ImageViewTransformationsSubimage
-template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-any_image_view<ViewTypes> subimage_view(const any_image_view<ViewTypes>& src, int xMin, int yMin, int width, int height) {
- return apply_operation(src,detail::subimage_view_fn<any_image_view<ViewTypes> >(point2<std::ptrdiff_t>(xMin,yMin),point2<std::ptrdiff_t>(width,height)));
+/// Models MPL Random Access Container of models of ImageViewConcept
+template <typename ViewTypes>
+inline auto subimage_view(any_image_view<ViewTypes> const& src,
+ int xMin, int yMin, int width, int height)
+ -> any_image_view<ViewTypes>
+{
+ using subimage_view_fn = detail::subimage_view_fn<any_image_view<ViewTypes>>;
+ return apply_operation(src, subimage_view_fn(point_t(xMin, yMin),point_t(width, height)));
}
/// \ingroup ImageViewTransformationsSubsampled
-template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type subsampled_view(const any_image_view<ViewTypes>& src, const point2<std::ptrdiff_t>& step) {
- return apply_operation(src,detail::subsampled_view_fn<typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type>(step));
+/// Models MPL Random Access Container of models of ImageViewConcept
+template <typename ViewTypes>
+inline auto subsampled_view(any_image_view<ViewTypes> const& src, point_t const& step)
+ -> typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type
+{
+ using step_type = typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type;
+ using subsampled_view = detail::subsampled_view_fn<step_type>;
+ return apply_operation(src, subsampled_view(step));
}
/// \ingroup ImageViewTransformationsSubsampled
-template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type subsampled_view(const any_image_view<ViewTypes>& src, int xStep, int yStep) {
- return apply_operation(src,detail::subsampled_view_fn<typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type>(point2<std::ptrdiff_t>(xStep,yStep)));
+/// Models MPL Random Access Container of models of ImageViewConcept
+template <typename ViewTypes>
+inline auto subsampled_view(any_image_view<ViewTypes> const& src, int xStep, int yStep)
+ -> typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type
+{
+ using step_type = typename dynamic_xy_step_type<any_image_view<ViewTypes>>::type;
+ using subsampled_view_fn = detail::subsampled_view_fn<step_type>;
+ return apply_operation(src, subsampled_view_fn(point_t(xStep, yStep)));
}
namespace detail {
@@ -156,8 +193,8 @@ struct nth_channel_view_type<any_image_view<ViewTypes> > {
/// \ingroup ImageViewTransformationsNthChannel
template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename nth_channel_view_type<any_image_view<ViewTypes> >::type nth_channel_view(const any_image_view<ViewTypes>& src, int n) {
- return apply_operation(src,detail::nth_channel_view_fn<typename nth_channel_view_type<any_image_view<ViewTypes> >::type>(n));
+typename nth_channel_view_type<any_image_view<ViewTypes> >::type nth_channel_view(const any_image_view<ViewTypes>& src, int n) {
+ return apply_operation(src,detail::nth_channel_view_fn<typename nth_channel_view_type<any_image_view<ViewTypes> >::type>(n));
}
namespace detail {
@@ -176,7 +213,7 @@ struct color_converted_view_type<any_image_view<ViewTypes>,DstP,CC> {
/// \brief overload of generic color_converted_view with user defined color-converter
template <typename DstP, typename ViewTypes, typename CC> inline // Models MPL Random Access Container of models of ImageViewConcept
typename color_converted_view_type<any_image_view<ViewTypes>, DstP, CC>::type color_converted_view(const any_image_view<ViewTypes>& src, CC) {
- return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP, CC>::type >());
+ return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP, CC>::type >());
}
/// \ingroup ImageViewTransformationsColorConvert
@@ -189,8 +226,8 @@ struct color_converted_view_type<any_image_view<ViewTypes>,DstP> {
/// \ingroup ImageViewTransformationsColorConvert
/// \brief overload of generic color_converted_view with the default color-converter
template <typename DstP, typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type color_converted_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type >());
+typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type color_converted_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type >());
}
@@ -199,15 +236,15 @@ typename color_converted_view_type<any_image_view<ViewTypes>, 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 <typename DstP, typename ViewTypes, typename CC> inline // Models MPL Random Access Container of models of ImageViewConcept
typename color_converted_view_type<any_image_view<ViewTypes>, DstP, CC>::type any_color_converted_view(const any_image_view<ViewTypes>& src, CC) {
- return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP, CC>::type >());
+ return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, 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 <typename DstP, typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
-typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type any_color_converted_view(const any_image_view<ViewTypes>& src) {
- return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type >());
+typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type any_color_converted_view(const any_image_view<ViewTypes>& src) {
+ return apply_operation(src,detail::color_converted_view_fn<DstP,typename color_converted_view_type<any_image_view<ViewTypes>, DstP>::type >());
}
/// \}
diff --git a/boost/gil/extension/dynamic_image/reduce.hpp b/boost/gil/extension/dynamic_image/reduce.hpp
index 6e86faa991..2ab2589016 100644
--- a/boost/gil/extension/dynamic_image/reduce.hpp
+++ b/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 <boost/gil/extension/dynamic_image/dynamic_at_c.hpp>
+
+#include <boost/gil/metafunctions.hpp>
+#include <boost/gil/typedefs.hpp>
-#include <boost/mpl/insert_range.hpp>
-#include <boost/mpl/range_c.hpp>
-#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/back.hpp>
-#include <boost/mpl/vector.hpp>
+#include <boost/mpl/insert.hpp>
+#include <boost/mpl/insert_range.hpp>
#include <boost/mpl/long.hpp>
#include <boost/mpl/logical.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/transform.hpp>
-#include <boost/mpl/insert.hpp>
-#include <boost/mpl/transform.hpp>
-
-#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<rest, T>::type type;
};
- template <typename SFirst>
+ template <typename SFirst>
struct copy_to_vector_impl<SFirst,1> {
typedef vector<typename deref<SFirst>::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<Types,Op,true> : public unary_reduce_impl<Types,Op> {
///////////////////////////////////////////////////////
-///
+///
/// \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<mpl::vector2<vec1_types, vec2_types>, pair_generator> BIN_TYPES;
typedef unary_reduce<BIN_TYPES,Op> 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<Types1,Op> unary1_t;
typedef unary_reduce<Types2,Op> unary2_t;
- static const std::size_t CROSS_SIZE = mpl::size<typename unary1_t::unique_t>::value *
+ static const std::size_t CROSS_SIZE = mpl::size<typename unary1_t::unique_t>::value *
mpl::size<typename unary2_t::unique_t>::value;
typedef detail::binary_reduce_impl<unary1_t,unary2_t,Op, (CROSS_SIZE>GIL_BINARY_REDUCE_LIMIT)> impl;
@@ -255,7 +246,7 @@ BOOST_FORCEINLINE typename UnaryOp::result_type apply_operation(const variant<Ty
}
template <typename Types1, typename Types2, typename BinaryOp>
-BOOST_FORCEINLINE typename BinaryOp::result_type apply_operation(const variant<Types1>& arg1, const variant<Types2>& arg2, BinaryOp op) {
+BOOST_FORCEINLINE typename BinaryOp::result_type apply_operation(const variant<Types1>& arg1, const variant<Types2>& arg2, BinaryOp op) {
return binary_reduce<Types1,Types2,BinaryOp>::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 <typename VecOfVecs, typename TypeGen, std::size_t K>
struct deref<cross_iterator<VecOfVecs,TypeGen,K> > {
@@ -413,13 +404,13 @@ template <typename VecOfVecs, typename TypeGen, typename OPP>
struct transform<cross_vector<VecOfVecs,TypeGen>, OPP > {
typedef typename lambda<OPP>::type Op;
struct adapter {
- template <typename Elements>
+ template <typename Elements>
struct apply {
typedef typename TypeGen::template apply<Elements>::type orig_t;
typedef typename Op::template apply<orig_t>::type type;
};
};
- typedef cross_vector<VecOfVecs, adapter > type;
+ typedef cross_vector<VecOfVecs, adapter > type;
};
} } // boost::mpl
@@ -460,9 +451,9 @@ namespace detail {
};
template <typename Op, typename Loc>
- struct reduce<Op, image_view<Loc> >
+ struct reduce<Op, image_view<Loc> >
: public reduce_view_basic<Op,image_view<Loc>,view_is_basic<image_view<Loc> >::value> {};
-
+
////////////////////////////////////////////////////////
////
//// Unary reduce_image operation. Splits into basic and non-basic images.
@@ -491,7 +482,7 @@ namespace detail {
};
template <typename Op, typename L1, typename L2>
- struct reduce<Op, std::pair<const image_view<L1>*, const image_view<L2>*> >
+ struct reduce<Op, std::pair<const image_view<L1>*, const image_view<L2>*> >
: public reduce_views_basic<Op,image_view<L1>,image_view<L2>,
mpl::and_<view_is_basic<image_view<L1> >, view_is_basic<image_view<L2> > >::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 <typename Vec, int Basis, int VecSize>
+ template <typename Vec, int Basis, int VecSize>
struct type_vec_to_integer_impl {
typedef typename mpl::back<Vec>::type last;
typedef typename mpl::pop_back<Vec>::type rest;
static const int value = type_vec_to_integer_impl<rest, Basis, VecSize-1>::value * Basis + last::value;
};
- template <typename Vec, int Basis>
+ template <typename Vec, int Basis>
struct type_vec_to_integer_impl<Vec,Basis,0> {
static const int value=0;
};
@@ -608,7 +599,7 @@ namespace detail {
typedef typename channel_order<DstColorSpace>::type dst_order_t;
typedef typename mpl::transform<src_order_t, type_to_index<dst_order_t,mpl::_1> >::type mapping;
static const int mapping_val = type_vec_to_integer<mapping>::value;
-
+
typedef typename reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,mapping_val>::first_t _first_t;
typedef typename reduce_color_spaces_impl<SrcColorSpace,DstColorSpace,mapping_val>::second_t _second_t;
typedef typename mpl::and_<color_space_is_base<DstColorSpace>, 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 <typename V1, typename V2, bool Compatible>
+ template <typename V1, typename V2, bool Compatible>
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 <typename V1, typename V2>
struct reduce_copy_pixop_compat<V1,V2,true> {
@@ -661,10 +652,10 @@ namespace detail {
typedef typename derived_view_type<V1, use_default, L1, use_default, use_default, use_default, mpl::false_>::type DV1;
typedef typename derived_view_type<V2, use_default, L2, use_default, use_default, use_default, mpl::true_ >::type DV2;
-
+
typedef std::pair<const DV1*, const DV2*> type;
};
-
+
// The general 2D version branches into compatible and incompatible views
template <typename V1, typename V2>
struct reduce_views_basic<copy_pixels_fn, V1, V2, true>
@@ -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 <typename View> struct reduce_view_basic<any_type_get_dimensions,View,true> { typedef gray8_view_t type; };
template <typename Img> struct reduce_image_basic<any_type_get_dimensions,Img,true> { 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 <typename View> struct reduce_view_basic<any_type_get_num_channels,View,true> {
+ template <typename View> struct reduce_view_basic<any_type_get_num_channels,View,true> {
typedef typename View::color_space_t::base Cs;
typedef typename view_type<uint8_t,typename reduce_color_space<Cs>::type>::type type;
};
- template <typename Img> struct reduce_image_basic<any_type_get_num_channels,Img,true> {
+ template <typename Img> struct reduce_image_basic<any_type_get_num_channels,Img,true> {
typedef typename Img::color_space_t::base Cs;
typedef typename image_type<uint8_t,typename reduce_color_space<Cs>::type>::type type;
};
@@ -711,13 +702,13 @@ namespace detail {
//// Reduce for resample_pixels (same as copy_pixels)
////
////////////////////////////////////////////////////////
-
+
template <typename Sampler, typename MapFn> struct resample_pixels_fn;
- template <typename S, typename M, typename V, bool IsBasic>
+ template <typename S, typename M, typename V, bool IsBasic>
struct reduce_view_basic<resample_pixels_fn<S,M>, V, IsBasic> : public reduce_view_basic<copy_pixels_fn, V, IsBasic> {};
- template <typename S, typename M, typename V1, typename V2, bool IsBasic>
+ template <typename S, typename M, typename V1, typename V2, bool IsBasic>
struct reduce_views_basic<resample_pixels_fn<S,M>, V1, V2, IsBasic> : public reduce_views_basic<copy_pixels_fn, V1, V2, IsBasic> {};
////////////////////////////////////////////////////////
@@ -727,18 +718,18 @@ namespace detail {
////
////////////////////////////////////////////////////////
-
+
template <typename CC> class copy_and_convert_pixels_fn;
// the only thing for 1D reduce is making them all mutable...
- template <typename CC, typename View, bool IsBasic>
- struct reduce_view_basic<copy_and_convert_pixels_fn<CC>, View, IsBasic>
+ template <typename CC, typename View, bool IsBasic>
+ struct reduce_view_basic<copy_and_convert_pixels_fn<CC>, View, IsBasic>
: public derived_view_type<View, use_default, use_default, use_default, use_default, mpl::true_> {
};
// 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 <typename CC, typename V1, typename V2, bool AreBasic>
+ template <typename CC, typename V1, typename V2, bool AreBasic>
struct reduce_views_basic<copy_and_convert_pixels_fn<CC>, V1, V2, AreBasic> {
typedef is_same<typename V1::pixel_t, typename V2::pixel_t> Same;
@@ -748,7 +739,7 @@ namespace detail {
typedef typename derived_view_type<V1, use_default, layout<Cs1, typename V1::channel_mapping_t>, use_default, use_default, mpl::false_>::type DV1;
typedef typename derived_view_type<V2, use_default, layout<Cs2, typename V2::channel_mapping_t>, use_default, use_default, mpl::true_ >::type DV2;
-
+
typedef std::pair<const DV1*, const DV2*> 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<Value>(val)
-
+
//detail::copy_construct_in_place_fn<base_t>
//detail::equal_to_fn<typename variant<Types>::base_t>
@@ -781,9 +772,8 @@ namespace detail {
//detail::color_converted_view_fn<DstP,typename color_convert_view_type<any_image_view<ViewTypes>, DstP>::type >
}
-} } // namespace boost::gil
-
-#endif // GIL_REDUCE_CODE_BLOAT
+}} // namespace boost::gil
+#endif // defined(BOOST_GIL_REDUCE_CODE_BLOAT)
#endif
diff --git a/boost/gil/extension/dynamic_image/variant.hpp b/boost/gil/extension/dynamic_image/variant.hpp
index 1ab53b549d..a0eb0f85db 100644
--- a/boost/gil/extension/dynamic_image/variant.hpp
+++ b/boost/gil/extension/dynamic_image/variant.hpp
@@ -1,46 +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 <boost/gil/utilities.hpp>
-#include "../../gil_config.hpp"
-#include "../../utilities.hpp"
-#include <cstddef>
-#include <cassert>
-#include <algorithm>
-#include <typeinfo>
#include <boost/bind.hpp>
-#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/at.hpp>
#include <boost/mpl/bool.hpp>
-#include <boost/mpl/transform.hpp>
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/max.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/sizeof.hpp>
-#include <boost/mpl/max.hpp>
-#include <boost/mpl/at.hpp>
-#include <boost/mpl/fold.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <typeinfo>
namespace boost { namespace gil {
-namespace detail {
+// Support for run-time instantiated types
+
+namespace detail {
template <typename Types, typename T> struct type_to_index;
template <typename Op, typename T> struct reduce;
struct destructor_op {
@@ -66,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
*/
@@ -162,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 <typename T> result_type operator()(const T& x) const {
return x==*gil_reinterpret_cast_c<const T*>(&_dst);
@@ -178,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 <typename Types>
+template <typename Types>
template <typename T> variant<Types>::variant(T& obj, bool do_swap) {
- _index=type_id<T>();
- if (_index==NUM_TYPES) throw std::bad_cast();
+ _index=type_id<T>();
+ if (_index==NUM_TYPES) throw std::bad_cast();
if (do_swap) {
new(&_bits) T(); // default construct
swap(obj, *gil_reinterpret_cast<T*>(&_bits));
- } else
+ } else
detail::copy_construct_in_place(const_cast<const T&>(obj), _bits);
}
-template <typename Types>
+template <typename Types>
void swap(variant<Types>& x, variant<Types>& y) {
- std::swap(x._bits,y._bits);
+ std::swap(x._bits,y._bits);
std::swap(x._index, y._index);
}
diff --git a/boost/gil/extension/io/bmp.hpp b/boost/gil/extension/io/bmp.hpp
index d9242dde0c..5ea0d2bfa9 100644
--- a/boost/gil/extension/io/bmp.hpp
+++ b/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 <boost/gil/extension/io/bmp/read.hpp>
#include <boost/gil/extension/io/bmp/write.hpp>
diff --git a/boost/gil/extension/io/bmp/detail/is_allowed.hpp b/boost/gil/extension/io/bmp/detail/is_allowed.hpp
index fab24d58d7..1a9af1bc9c 100644
--- a/boost/gil/extension/io/bmp/detail/is_allowed.hpp
+++ b/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 <boost/gil/channel.hpp>
+
+#include <boost/mpl/bool_fwd.hpp>
namespace boost { namespace gil { namespace detail {
diff --git a/boost/gil/extension/io/bmp/detail/read.hpp b/boost/gil/extension/io/bmp/detail/read.hpp
index 09e5652885..4e9ccbdb56 100644
--- a/boost/gil/extension/io/bmp/detail/read.hpp
+++ b/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 <vector>
-
-#include <boost/mpl/and.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/utility/enable_if.hpp>
+#include <boost/gil/extension/io/bmp/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/bmp/detail/reader_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/bmp/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/bmp/detail/is_allowed.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <vector>
namespace boost { namespace gil {
diff --git a/boost/gil/extension/io/bmp/detail/reader_backend.hpp b/boost/gil/extension/io/bmp/detail/reader_backend.hpp
index 589a5e3c4f..e84e22a34f 100644
--- a/boost/gil/extension/io/bmp/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/bmp/tags.hpp>
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 @@ public:
}
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 @@ public:
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/boost/gil/extension/io/bmp/detail/scanline_read.hpp b/boost/gil/extension/io/bmp/detail/scanline_read.hpp
index fdc1e54f68..b23c3f991f 100644
--- a/boost/gil/extension/io/bmp/detail/scanline_read.hpp
+++ b/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 <vector>
-
-#include <boost/function.hpp>
+#include <boost/gil/extension/io/bmp/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/bmp/detail/reader_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/bmp/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/bmp/detail/is_allowed.hpp>
+#include <boost/function.hpp>
+
+#include <vector>
namespace boost { namespace gil {
diff --git a/boost/gil/extension/io/bmp/detail/supported_types.hpp b/boost/gil/extension/io/bmp/detail/supported_types.hpp
index 89765594aa..3b5bb06e1b 100644
--- a/boost/gil/extension/io/bmp/detail/supported_types.hpp
+++ b/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 <boost/mpl/not.hpp>
-#include <boost/type_traits/is_same.hpp>
-
+#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/channel.hpp>
#include <boost/gil/color_base.hpp>
-#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/packed_pixel.hpp>
-
#include <boost/gil/io/base.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost { namespace gil { namespace detail {
@@ -76,7 +63,7 @@ struct bmp_read_support<uint8_t
{
static const bmp_bits_per_pixel::type bpp = 8;
};
-
+
template<>
@@ -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/boost/gil/extension/io/bmp/detail/write.hpp b/boost/gil/extension/io/bmp/detail/write.hpp
index 08ea24bae0..c0032c5962 100644
--- a/boost/gil/extension/io/bmp/detail/write.hpp
+++ b/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 <vector>
+#include <boost/gil/extension/io/bmp/tags.hpp>
+#include <boost/gil/extension/io/bmp/detail/writer_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/extension/io/bmp/tags.hpp>
-
-#include <boost/gil/extension/io/bmp/detail/writer_backend.hpp>
+#include <vector>
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 @@ private:
*/
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 @@ public:
}
};
-#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/boost/gil/extension/io/bmp/detail/writer_backend.hpp b/boost/gil/extension/io/bmp/detail/writer_backend.hpp
index a5147859f8..9ae4eb64f0 100644
--- a/boost/gil/extension/io/bmp/detail/writer_backend.hpp
+++ b/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 <boost/gil/extension/io/bmp/tags.hpp>
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 @@ public:
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/boost/gil/extension/io/bmp/old.hpp b/boost/gil/extension/io/bmp/old.hpp
index b265ca1960..3a7e496c57 100644
--- a/boost/gil/extension/io/bmp/old.hpp
+++ b/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 <boost/gil/extension/io/bmp.hpp>
namespace boost { namespace gil {
@@ -26,24 +15,14 @@ namespace boost { namespace gil {
/// \ingroup BMP_IO
/// \brief Returns the width and height of the BMP file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid BMP file
-template< typename String >
-inline
-point2< std::ptrdiff_t > bmp_read_dimensions( const String& filename )
+template<typename String>
+inline point_t bmp_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , bmp_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , bmp_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, bmp_tag>::type;
+ backend_t backend = read_image_info(filename, bmp_tag());
+ return { backend._info._width, backend._info._height };
}
-
/// \ingroup BMP_IO
/// \brief Loads the image specified by the given bmp 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.
diff --git a/boost/gil/extension/io/bmp/read.hpp b/boost/gil/extension/io/bmp/read.hpp
index e28c169bdf..b105c5772c 100644
--- a/boost/gil/extension/io/bmp/read.hpp
+++ b/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 <boost/gil/extension/io/bmp/tags.hpp>
-#include <boost/gil/extension/io/bmp/detail/supported_types.hpp>
#include <boost/gil/extension/io/bmp/detail/read.hpp>
#include <boost/gil/extension/io/bmp/detail/scanline_read.hpp>
+#include <boost/gil/extension/io/bmp/detail/supported_types.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/bmp/tags.hpp b/boost/gil/extension/io/bmp/tags.hpp
index ec8c4a15f8..37921e1922 100644
--- a/boost/gil/extension/io/bmp/tags.hpp
+++ b/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 <boost/gil/io/base.hpp>
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/boost/gil/extension/io/bmp/write.hpp b/boost/gil/extension/io/bmp/write.hpp
index 634bf3bd89..49991c55e8 100644
--- a/boost/gil/extension/io/bmp/write.hpp
+++ b/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 <boost/gil/extension/io/bmp/tags.hpp>
#include <boost/gil/extension/io/bmp/detail/supported_types.hpp>
#include <boost/gil/extension/io/bmp/detail/write.hpp>
#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
#include <boost/gil/io/write_view.hpp>
#endif
diff --git a/boost/gil/extension/io/jpeg.hpp b/boost/gil/extension/io/jpeg.hpp
index 8f4b5db410..0e52e57ac0 100644
--- a/boost/gil/extension/io/jpeg.hpp
+++ b/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 <boost/gil/extension/io/jpeg/read.hpp>
#include <boost/gil/extension/io/jpeg/write.hpp>
diff --git a/boost/gil/extension/io/jpeg/detail/base.hpp b/boost/gil/extension/io/jpeg/detail/base.hpp
index 551c4759d1..b639462abd 100644
--- a/boost/gil/extension/io/jpeg/detail/base.hpp
+++ b/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 <boost/gil/extension/io/jpeg/tags.hpp>
-namespace boost { namespace gil {
+#include <csetjmp>
-#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 @@ protected:
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/boost/gil/extension/io/jpeg/detail/is_allowed.hpp b/boost/gil/extension/io/jpeg/detail/is_allowed.hpp
index cf8015492e..e2992dae71 100644
--- a/boost/gil/extension/io/jpeg/detail/is_allowed.hpp
+++ b/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/boost/gil/extension/io/jpeg/detail/read.hpp b/boost/gil/extension/io/jpeg/detail/read.hpp
index f3f5a8afef..b9b713b9a5 100644
--- a/boost/gil/extension/io/jpeg/detail/read.hpp
+++ b/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 <csetjmp>
-#include <vector>
#include <boost/gil/extension/io/jpeg/tags.hpp>
+#include <boost/gil/extension/io/jpeg/detail/base.hpp>
+#include <boost/gil/extension/io/jpeg/detail/is_allowed.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/jpeg/detail/base.hpp>
-#include <boost/gil/extension/io/jpeg/detail/is_allowed.hpp>
+#include <csetjmp>
+#include <vector>
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 @@ public:
{
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 @@ private:
}
};
-namespace detail {
+namespace detail {
struct jpeg_type_format_checker
{
@@ -321,9 +310,9 @@ public:
}
};
-#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/boost/gil/extension/io/jpeg/detail/reader_backend.hpp b/boost/gil/extension/io/jpeg/detail/reader_backend.hpp
index 71c446af4f..72b9d61472 100644
--- a/boost/gil/extension/io/jpeg/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/jpeg/tags.hpp>
+#include <csetjmp>
#include <memory>
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.
@@ -116,7 +106,7 @@ public:
}
_src._jsrc.bytes_in_buffer = 0;
- _src._jsrc.next_input_byte = buffer;
+ _src._jsrc.next_input_byte = buffer_;
_src._jsrc.init_source = reinterpret_cast< void(*) ( j_decompress_ptr )>( &reader_backend< Device, jpeg_tag >::init_device );
_src._jsrc.fill_input_buffer = reinterpret_cast< boolean(*)( j_decompress_ptr )>( &reader_backend< Device, jpeg_tag >::fill_buffer );
_src._jsrc.skip_input_data = reinterpret_cast< void(*) ( j_decompress_ptr
@@ -190,7 +180,7 @@ public:
{
return _settings;
}
-
+
/// Return image header info.
const image_read_info< jpeg_tag >& get_info()
{
@@ -257,23 +247,23 @@ private:
{
gil_jpeg_source_mgr* src = reinterpret_cast< gil_jpeg_source_mgr* >( cinfo->src );
src->_jsrc.bytes_in_buffer = 0;
- src->_jsrc.next_input_byte = src->_this->buffer;
+ src->_jsrc.next_input_byte = src->_this->buffer_;
}
static boolean fill_buffer( jpeg_decompress_struct* cinfo )
{
gil_jpeg_source_mgr* src = reinterpret_cast< gil_jpeg_source_mgr* >( cinfo->src );
- size_t count = src->_this->_io_dev.read(src->_this->buffer, sizeof(src->_this->buffer) );
+ size_t count = src->_this->_io_dev.read(src->_this->buffer_, sizeof(src->_this->buffer_) );
if( count <= 0 )
{
// libjpeg does that: adding an EOF marker
- src->_this->buffer[0] = (JOCTET) 0xFF;
- src->_this->buffer[1] = (JOCTET) JPEG_EOI;
+ src->_this->buffer_[0] = (JOCTET) 0xFF;
+ src->_this->buffer_[1] = (JOCTET) JPEG_EOI;
count = 2;
}
- src->_jsrc.next_input_byte = src->_this->buffer;
+ src->_jsrc.next_input_byte = src->_this->buffer_;
src->_jsrc.bytes_in_buffer = count;
return TRUE;
@@ -316,12 +306,12 @@ public:
gil_jpeg_source_mgr _src;
// libjpeg default is 4096 - see jdatasrc.c
- JOCTET buffer[4096];
+ 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/boost/gil/extension/io/jpeg/detail/scanline_read.hpp b/boost/gil/extension/io/jpeg/detail/scanline_read.hpp
index ee33154c61..6171811d8a 100644
--- a/boost/gil/extension/io/jpeg/detail/scanline_read.hpp
+++ b/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 <csetjmp>
-#include <vector>
+#include <boost/gil/extension/io/jpeg/detail/base.hpp>
+#include <boost/gil/extension/io/jpeg/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/jpeg/detail/reader_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#include <boost/gil/io/typedefs.hpp>
-
-#include <boost/gil/extension/io/jpeg/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/jpeg/detail/base.hpp>
-#include <boost/gil/extension/io/jpeg/detail/is_allowed.hpp>
+#include <csetjmp>
+#include <vector>
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 @@ private:
}
};
-#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/boost/gil/extension/io/jpeg/detail/supported_types.hpp b/boost/gil/extension/io/jpeg/detail/supported_types.hpp
index 209a99f857..fdaf707364 100644
--- a/boost/gil/extension/io/jpeg/detail/supported_types.hpp
+++ b/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 <boost/mpl/not.hpp>
-#include <boost/type_traits/is_same.hpp>
-
#include <boost/gil/channel.hpp>
#include <boost/gil/color_base.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/type_traits/is_same.hpp>
+
namespace boost { namespace gil { namespace detail {
// Read support
@@ -90,7 +79,7 @@ struct jpeg_write_support<uint8_t
template< typename Pixel >
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/boost/gil/extension/io/jpeg/detail/write.hpp b/boost/gil/extension/io/jpeg/detail/write.hpp
index f9d2abfb57..f03d4f7820 100644
--- a/boost/gil/extension/io/jpeg/detail/write.hpp
+++ b/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 <vector>
+#include <boost/gil/extension/io/jpeg/tags.hpp>
+#include <boost/gil/extension/io/jpeg/detail/supported_types.hpp>
+#include <boost/gil/extension/io/jpeg/detail/writer_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/extension/io/jpeg/tags.hpp>
-
-#include <boost/gil/extension/io/jpeg/detail/supported_types.hpp>
-#include <boost/gil/extension/io/jpeg/detail/writer_backend.hpp>
+#include <vector>
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 @@ public:
}
};
-#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/boost/gil/extension/io/jpeg/detail/writer_backend.hpp b/boost/gil/extension/io/jpeg/detail/writer_backend.hpp
index 962c46df69..d3dc3c6fbb 100644
--- a/boost/gil/extension/io/jpeg/detail/writer_backend.hpp
+++ b/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 <boost/gil/extension/io/jpeg/tags.hpp>
#include <boost/gil/extension/io/jpeg/detail/base.hpp>
@@ -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 @@ public:
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/boost/gil/extension/io/jpeg/old.hpp b/boost/gil/extension/io/jpeg/old.hpp
index 3b3dd2a89b..5abc0af1a1 100644
--- a/boost/gil/extension/io/jpeg/old.hpp
+++ b/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 <boost/gil/extension/io/jpeg.hpp>
namespace boost { namespace gil {
@@ -26,33 +15,23 @@ namespace boost { namespace gil {
/// \ingroup JPEG_IO
/// \brief Returns the width and height of the JPEG file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid JPEG file
-template< typename String >
-inline
-point2< std::ptrdiff_t > jpeg_read_dimensions( const String& filename )
+template<typename String>
+inline point_t jpeg_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , jpeg_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , jpeg_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, jpeg_tag>::type;
+ backend_t backend = read_image_info(filename, jpeg_tag());
+ return { backend._info._width, backend._info._height };
}
-
/// \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 +45,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 +68,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 +87,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 +105,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 +124,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/boost/gil/extension/io/jpeg/read.hpp b/boost/gil/extension/io/jpeg/read.hpp
index ada31ff5bf..f5bc2fff17 100644
--- a/boost/gil/extension/io/jpeg/read.hpp
+++ b/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 <boost/gil/extension/io/jpeg/tags.hpp>
-#include <boost/gil/extension/io/jpeg/detail/supported_types.hpp>
#include <boost/gil/extension/io/jpeg/detail/read.hpp>
#include <boost/gil/extension/io/jpeg/detail/scanline_read.hpp>
+#include <boost/gil/extension/io/jpeg/detail/supported_types.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/jpeg/tags.hpp b/boost/gil/extension/io/jpeg/tags.hpp
index 047b5cbfd5..a12c237df6 100644
--- a/boost/gil/extension/io/jpeg/tags.hpp
+++ b/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 <stdio.h>
+#include <cstdio> // jpeglib doesn't know about FILE
-#include <jpeglib.h>
#include <jerror.h>
+#include <jpeglib.h>
#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 @@ private:
};
-
} // namespace gil
} // namespace boost
diff --git a/boost/gil/extension/io/jpeg/write.hpp b/boost/gil/extension/io/jpeg/write.hpp
index e04967b0ec..e5c59a95cf 100644
--- a/boost/gil/extension/io/jpeg/write.hpp
+++ b/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 <boost/gil/extension/io/jpeg/tags.hpp>
#include <boost/gil/extension/io/jpeg/detail/supported_types.hpp>
#include <boost/gil/extension/io/jpeg/detail/write.hpp>
#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
#include <boost/gil/io/write_view.hpp>
#endif
diff --git a/boost/gil/extension/io/png.hpp b/boost/gil/extension/io/png.hpp
index 648170b1c0..f035673801 100644
--- a/boost/gil/extension/io/png.hpp
+++ b/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 <boost/gil/extension/io/png/read.hpp>
#include <boost/gil/extension/io/png/write.hpp>
diff --git a/boost/gil/extension/io/png/detail/base.hpp b/boost/gil/extension/io/png/detail/base.hpp
index a58d033d10..7feb6f8f09 100644
--- a/boost/gil/extension/io/png/detail/base.hpp
+++ b/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 <boost/gil/extension/io/png/tags.hpp>
#include <memory>
@@ -56,7 +47,7 @@ protected:
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/boost/gil/extension/io/png/detail/is_allowed.hpp b/boost/gil/extension/io/png/detail/is_allowed.hpp
index cf83dd5f02..ac1f9c1749 100644
--- a/boost/gil/extension/io/png/detail/is_allowed.hpp
+++ b/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 <boost/mpl/bool_fwd.hpp>
#include <boost/mpl/for_each.hpp>
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/boost/gil/extension/io/png/detail/read.hpp b/boost/gil/extension/io/png/detail/read.hpp
index 9c4588c380..f14e32a1cf 100644
--- a/boost/gil/extension/io/png/detail/read.hpp
+++ b/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 <boost/gil/extension/io/png/tags.hpp>
+#include <boost/gil/extension/io/png/detail/reader_backend.hpp>
+#include <boost/gil/extension/io/png/detail/is_allowed.hpp>
-#include <boost/gil.hpp>
-
+#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/typedefs.hpp>
+#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
-
-#include <boost/gil/extension/io/png/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/png/detail/is_allowed.hpp>
+#include <boost/gil/io/typedefs.hpp>
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 @@ private:
, 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 @@ public:
}
};
-#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/boost/gil/extension/io/png/detail/reader_backend.hpp b/boost/gil/extension/io/png/detail/reader_backend.hpp
index 914d4c7505..18085b8746 100644
--- a/boost/gil/extension/io/png/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/png/tags.hpp>
-
#include <boost/gil/extension/io/png/detail/base.hpp>
+#include <boost/gil/extension/io/png/detail/supported_types.hpp>
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 @@ public:
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 @@ public:
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/boost/gil/extension/io/png/detail/scanline_read.hpp b/boost/gil/extension/io/png/detail/scanline_read.hpp
index 33b1dcba31..99374f164a 100644
--- a/boost/gil/extension/io/png/detail/scanline_read.hpp
+++ b/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 <boost/gil.hpp>
+#include <boost/gil/extension/io/png/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/png/detail/reader_backend.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/typedefs.hpp>
+#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
+#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/png/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/png/detail/is_allowed.hpp>
-
-namespace boost { namespace gil {
+namespace boost { namespace gil {
///
/// PNG Reader
diff --git a/boost/gil/extension/io/png/detail/supported_types.hpp b/boost/gil/extension/io/png/detail/supported_types.hpp
index 165e8f4877..ed98917ffc 100644
--- a/boost/gil/extension/io/png/detail/supported_types.hpp
+++ b/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 <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
#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/boost/gil/extension/io/png/detail/write.hpp b/boost/gil/extension/io/png/detail/write.hpp
index e571c09459..cf1ef2a2a7 100644
--- a/boost/gil/extension/io/png/detail/write.hpp
+++ b/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 <boost/gil/extension/io/png/detail/writer_backend.hpp>
+
+#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/less.hpp>
#include <boost/mpl/not.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-
-#include <boost/gil/extension/io/png/detail/writer_backend.hpp>
-
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 @@ private:
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 @@ public:
}
};
-#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/boost/gil/extension/io/png/detail/writer_backend.hpp b/boost/gil/extension/io/png/detail/writer_backend.hpp
index e018df79ea..659be4fa36 100644
--- a/boost/gil/extension/io/png/detail/writer_backend.hpp
+++ b/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 <boost/gil/io/typedefs.hpp>
-#include <boost/gil/io/base.hpp>
-
#include <boost/gil/extension/io/png/tags.hpp>
-
#include <boost/gil/extension/io/png/detail/base.hpp>
#include <boost/gil/extension/io/png/detail/supported_types.hpp>
+#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/typedefs.hpp>
+
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 @@ public:
, "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 @@ protected:
#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 @@ protected:
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 @@ protected:
);
#ifdef BOOST_GIL_IO_PNG_DITHERING_SUPPORTED
- // Dithering
+ // Dithering
if( _info._set_dithering )
{
png_set_dither( get_struct()
@@ -506,9 +494,9 @@ public:
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/boost/gil/extension/io/png/old.hpp b/boost/gil/extension/io/png/old.hpp
index 217633661e..f0300d25c6 100644
--- a/boost/gil/extension/io/png/old.hpp
+++ b/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 <boost/gil/extension/io/png.hpp>
namespace boost { namespace gil {
@@ -26,32 +15,23 @@ namespace boost { namespace gil {
/// \ingroup PNG_IO
/// \brief Returns the width and height of the PNG file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid PNG file
-template< typename String >
-inline
-point2< std::ptrdiff_t > png_read_dimensions( const String& filename )
+template<typename String>
+inline point_t png_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , png_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , png_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, png_tag>::type;
+ backend_t backend = read_image_info(filename, png_tag());
+ return { backend._info._width, backend._info._height };
}
/// \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 +45,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 +68,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 +87,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 +105,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 +124,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/boost/gil/extension/io/png/read.hpp b/boost/gil/extension/io/png/read.hpp
index 32bbd7e01b..db0cfeba74 100644
--- a/boost/gil/extension/io/png/read.hpp
+++ b/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 <boost/gil/extension/io/png/tags.hpp>
-#include <boost/gil/extension/io/png/detail/supported_types.hpp>
#include <boost/gil/extension/io/png/detail/read.hpp>
#include <boost/gil/extension/io/png/detail/scanline_read.hpp>
+#include <boost/gil/extension/io/png/detail/supported_types.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/png/tags.hpp b/boost/gil/extension/io/png/tags.hpp
index 79e3b489a0..d2fa4ddeda 100644
--- a/boost/gil/extension/io/png/tags.hpp
+++ b/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 <boost/gil/io/base.hpp>
+
+#include <string>
+#include <vector>
#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 <string>
-#include <vector>
-
-#include <boost/gil/io/base.hpp>
-
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/boost/gil/extension/io/png/write.hpp b/boost/gil/extension/io/png/write.hpp
index 47d2a8ae78..9642ec4285 100644
--- a/boost/gil/extension/io/png/write.hpp
+++ b/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 <boost/gil/extension/io/png/tags.hpp>
#include <boost/gil/extension/io/png/detail/supported_types.hpp>
#include <boost/gil/extension/io/png/detail/write.hpp>
-#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
+#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/write_view.hpp>
#endif
diff --git a/boost/gil/extension/io/pnm.hpp b/boost/gil/extension/io/pnm.hpp
index 8e69277fce..c0e3c3adcb 100644
--- a/boost/gil/extension/io/pnm.hpp
+++ b/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 <boost/gil/extension/io/pnm/read.hpp>
#include <boost/gil/extension/io/pnm/write.hpp>
diff --git a/boost/gil/extension/io/pnm/detail/is_allowed.hpp b/boost/gil/extension/io/pnm/detail/is_allowed.hpp
index 91be3091fa..30fd9693c4 100644
--- a/boost/gil/extension/io/pnm/detail/is_allowed.hpp
+++ b/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/boost/gil/extension/io/pnm/detail/read.hpp b/boost/gil/extension/io/pnm/detail/read.hpp
index 5f267ada5e..52a697e70f 100644
--- a/boost/gil/extension/io/pnm/detail/read.hpp
+++ b/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 <vector>
-#include <boost/bind.hpp>
-#include <boost/gil.hpp>
#include <boost/gil/extension/io/pnm/tags.hpp>
+#include <boost/gil/extension/io/pnm/detail/reader_backend.hpp>
+#include <boost/gil/extension/io/pnm/detail/is_allowed.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/bit_operations.hpp>
-#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/pnm/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/pnm/detail/is_allowed.hpp>
+#include <boost/bind.hpp>
+
+#include <vector>
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 @@ public:
{
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 @@ private:
};
-namespace detail {
+namespace detail {
struct pnm_type_format_checker
{
@@ -455,9 +445,9 @@ public:
}
};
-#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/boost/gil/extension/io/pnm/detail/reader_backend.hpp b/boost/gil/extension/io/pnm/detail/reader_backend.hpp
index 01ab7a0aaa..2497ee2878 100644
--- a/boost/gil/extension/io/pnm/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/pnm/tags.hpp>
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 @@ public:
, _scanline_length( 0 )
{
- read_header();
+ read_header();
if( _settings._dim.x == 0 )
{
@@ -182,9 +171,9 @@ public:
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/boost/gil/extension/io/pnm/detail/scanline_read.hpp b/boost/gil/extension/io/pnm/detail/scanline_read.hpp
index b109528145..242d8b6097 100644
--- a/boost/gil/extension/io/pnm/detail/scanline_read.hpp
+++ b/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 <vector>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-
-#include <boost/gil.hpp>
+#include <boost/gil/extension/io/pnm/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/pnm/detail/reader_backend.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/bit_operations.hpp>
-#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/pnm/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/pnm/detail/is_allowed.hpp>
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+
+#include <vector>
namespace boost { namespace gil {
@@ -93,7 +82,7 @@ private:
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 @@ private:
{
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 @@ private:
// 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 @@ private:
// 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/boost/gil/extension/io/pnm/detail/supported_types.hpp b/boost/gil/extension/io/pnm/detail/supported_types.hpp
index 7bede91402..e7298b6020 100644
--- a/boost/gil/extension/io/pnm/detail/supported_types.hpp
+++ b/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 <boost/gil/channel.hpp>
+#include <boost/gil/color_base.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_same.hpp>
-#include <boost/gil/channel.hpp>
-#include <boost/gil/color_base.hpp>
-
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/boost/gil/extension/io/pnm/detail/write.hpp b/boost/gil/extension/io/pnm/detail/write.hpp
index f92307c9c8..79ee35fdc9 100644
--- a/boost/gil/extension/io/pnm/detail/write.hpp
+++ b/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 <cstdlib>
-#include <string>
-
#include <boost/gil/extension/io/pnm/tags.hpp>
+#include <boost/gil/extension/io/pnm/detail/writer_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/extension/io/pnm/detail/writer_backend.hpp>
+#include <cstdlib>
+#include <string>
-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 @@ public:
}
};
-#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/boost/gil/extension/io/pnm/detail/writer_backend.hpp b/boost/gil/extension/io/pnm/detail/writer_backend.hpp
index 38672e6f71..a970da1aee 100644
--- a/boost/gil/extension/io/pnm/detail/writer_backend.hpp
+++ b/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 <boost/gil/extension/io/pnm/tags.hpp>
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 @@ public:
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/boost/gil/extension/io/pnm/old.hpp b/boost/gil/extension/io/pnm/old.hpp
index a9a1529ca0..b09e21b198 100644
--- a/boost/gil/extension/io/pnm/old.hpp
+++ b/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 <boost/gil/extension/io/pnm.hpp>
namespace boost { namespace gil {
@@ -26,33 +15,23 @@ namespace boost { namespace gil {
/// \ingroup PNM_IO
/// \brief Returns the width and height of the PNM file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid PNM file
-template< typename String >
-inline
-point2< std::ptrdiff_t > pnm_read_dimensions( const String& filename )
+template<typename String>
+inline point_t pnm_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , pnm_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , pnm_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, pnm_tag>::type;
+ backend_t backend = read_image_info(filename, pnm_tag());
+ return { backend._info._width, backend._info._height };
}
-
/// \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 +45,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 +68,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 +87,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 +105,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 +124,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/boost/gil/extension/io/pnm/read.hpp b/boost/gil/extension/io/pnm/read.hpp
index 67ec2635d8..87b3d5cea9 100644
--- a/boost/gil/extension/io/pnm/read.hpp
+++ b/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 <boost/gil/extension/io/pnm/tags.hpp>
#include <boost/gil/extension/io/pnm/detail/supported_types.hpp>
#include <boost/gil/extension/io/pnm/detail/read.hpp>
@@ -26,16 +15,14 @@
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/pnm/tags.hpp b/boost/gil/extension/io/pnm/tags.hpp
index 2151c373ed..b49ca72b3c 100644
--- a/boost/gil/extension/io/pnm/tags.hpp
+++ b/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 <boost/gil/io/base.hpp>
#include <boost/mpl/integral_c.hpp>
-#include <boost/gil/io/base.hpp>
-
namespace boost { namespace gil {
/// Defines pnm tag.
diff --git a/boost/gil/extension/io/pnm/write.hpp b/boost/gil/extension/io/pnm/write.hpp
index 1a90483cd8..43e810b450 100644
--- a/boost/gil/extension/io/pnm/write.hpp
+++ b/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 <boost/gil/extension/io/pnm/tags.hpp>
#include <boost/gil/extension/io/pnm/detail/supported_types.hpp>
#include <boost/gil/extension/io/pnm/detail/write.hpp>
-#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
+#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/write_view.hpp>
#endif
diff --git a/boost/gil/extension/io/raw.hpp b/boost/gil/extension/io/raw.hpp
index c3a3626c75..152fb2106e 100644
--- a/boost/gil/extension/io/raw.hpp
+++ b/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 <boost/gil/extension/io/raw/read.hpp>
#endif
diff --git a/boost/gil/extension/io/raw/detail/device.hpp b/boost/gil/extension/io/raw/detail/device.hpp
index 7f93336d51..d9c122c073 100644
--- a/boost/gil/extension/io/raw/detail/device.hpp
+++ b/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 <boost/utility/enable_if.hpp>
-
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/utility/enable_if.hpp>
+
#include <memory>
+#include <string>
namespace boost { namespace gil { namespace detail {
@@ -107,7 +98,7 @@ public:
, 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 @@ public:
, 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/boost/gil/extension/io/raw/detail/is_allowed.hpp b/boost/gil/extension/io/raw/detail/is_allowed.hpp
index 852378abae..eb4959eca1 100644
--- a/boost/gil/extension/io/raw/detail/is_allowed.hpp
+++ b/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 <boost/gil/io/base.hpp>
-#include <iostream>
namespace boost { namespace gil { namespace detail {
diff --git a/boost/gil/extension/io/raw/detail/read.hpp b/boost/gil/extension/io/raw/detail/read.hpp
index 6406d6575e..24213dd61f 100644
--- a/boost/gil/extension/io/raw/detail/read.hpp
+++ b/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 <cstdio>
-#include <vector>
#include <boost/gil/extension/io/raw/tags.hpp>
+#include <boost/gil/extension/io/raw/detail/device.hpp>
+#include <boost/gil/extension/io/raw/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/raw/detail/reader_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/raw/detail/is_allowed.hpp>
-#include <boost/gil/extension/io/raw/detail/device.hpp>
-#include <boost/gil/extension/io/raw/detail/reader_backend.hpp>
+#include <cstdio>
+#include <vector>
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 @@ public:
}
};
-#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/boost/gil/extension/io/raw/detail/reader_backend.hpp b/boost/gil/extension/io/raw/detail/reader_backend.hpp
index ad03a946f7..758a295029 100644
--- a/boost/gil/extension/io/raw/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/raw/tags.hpp>
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 @@ public:
, _info()
, _scanline_length( 0 )
{
- read_header();
+ read_header();
if( _settings._dim.x == 0 )
{
@@ -141,9 +130,9 @@ public:
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/boost/gil/extension/io/raw/detail/supported_types.hpp b/boost/gil/extension/io/raw/detail/supported_types.hpp
index 4175db9571..4358028ca8 100644
--- a/boost/gil/extension/io/raw/detail/supported_types.hpp
+++ b/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 <boost/mpl/not.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/gil/io/base.hpp>
#include <boost/gil/channel.hpp>
#include <boost/gil/color_base.hpp>
-#include <boost/gil/io/base.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost { namespace gil { namespace detail {
diff --git a/boost/gil/extension/io/raw/read.hpp b/boost/gil/extension/io/raw/read.hpp
index f670d68576..3e685f0285 100644
--- a/boost/gil/extension/io/raw/read.hpp
+++ b/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 <boost/gil/extension/io/raw/tags.hpp>
#include <boost/gil/extension/io/raw/detail/supported_types.hpp>
#include <boost/gil/extension/io/raw/detail/read.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image_info.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/raw/tags.hpp b/boost/gil/extension/io/raw/tags.hpp
index 684a24cbe0..4b232925a9 100644
--- a/boost/gil/extension/io/raw/tags.hpp
+++ b/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 <boost/gil/io/base.hpp>
#ifndef BOOST_GIL_EXTENSION_IO_RAW_C_LIB_COMPILED_AS_CPLUSPLUS
extern "C" {
@@ -30,8 +20,6 @@
}
#endif
-#include <boost/gil/io/base.hpp>
-
namespace boost { namespace gil {
/// Defines tiff tag.
diff --git a/boost/gil/extension/io/targa.hpp b/boost/gil/extension/io/targa.hpp
index 8ff4cb9302..21d3f6c983 100644
--- a/boost/gil/extension/io/targa.hpp
+++ b/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 <boost/gil/extension/io/targa/read.hpp>
#include <boost/gil/extension/io/targa/write.hpp>
diff --git a/boost/gil/extension/io/targa/detail/is_allowed.hpp b/boost/gil/extension/io/targa/detail/is_allowed.hpp
index 0033ba6e54..11d6797743 100644
--- a/boost/gil/extension/io/targa/detail/is_allowed.hpp
+++ b/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/boost/gil/extension/io/targa/detail/read.hpp b/boost/gil/extension/io/targa/detail/read.hpp
index b208a679f4..9cd50cdaba 100644
--- a/boost/gil/extension/io/targa/detail/read.hpp
+++ b/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 <vector>
-
#include <boost/gil/extension/io/targa/tags.hpp>
+#include <boost/gil/extension/io/targa/detail/reader_backend.hpp>
+#include <boost/gil/extension/io/targa/detail/is_allowed.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/targa/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/targa/detail/is_allowed.hpp>
+#include <vector>
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 @@ public:
, ConversionPolicy
>()
, backend_t( io_dev
- , settings
+ , settings
)
{}
@@ -106,7 +94,7 @@ public:
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 @@ public:
{
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 @@ public:
break;
}
}
-
+
break;
}
case targa_image_type::_rle_rgb:
@@ -168,12 +156,12 @@ public:
{
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 @@ public:
break;
}
}
-
+
break;
}
default:
@@ -257,13 +245,13 @@ private:
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 @@ private:
{
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 @@ private:
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 @@ private:
}
};
-namespace detail {
+namespace detail {
class targa_type_format_checker
{
@@ -407,9 +395,9 @@ public:
}
};
-#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/boost/gil/extension/io/targa/detail/reader_backend.hpp b/boost/gil/extension/io/targa/detail/reader_backend.hpp
index cbf216aacd..ab26562f04 100644
--- a/boost/gil/extension/io/targa/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/targa/tags.hpp>
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 @@ public:
, _settings( settings )
, _info()
{
- read_header();
+ read_header();
if( _settings._dim.x == 0 )
{
@@ -66,19 +55,19 @@ public:
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 @@ public:
{
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 @@ public:
{
_info._screen_origin_bit = true;
}
-
+
_info._valid = true;
}
@@ -165,9 +154,9 @@ public:
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/boost/gil/extension/io/targa/detail/scanline_read.hpp b/boost/gil/extension/io/targa/detail/scanline_read.hpp
index 7fbd0b05b0..c53cc14f34 100644
--- a/boost/gil/extension/io/targa/detail/scanline_read.hpp
+++ b/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 <vector>
+#include <boost/gil/extension/io/targa/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/targa/detail/reader_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/io/targa/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/targa/detail/is_allowed.hpp>
+#include <vector>
namespace boost { namespace gil {
@@ -75,9 +64,9 @@ public:
// 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 @@ private:
{
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 @@ private:
{
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 @@ private:
{
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 @@ private:
break;
}
}
-
+
break;
}
default:
diff --git a/boost/gil/extension/io/targa/detail/supported_types.hpp b/boost/gil/extension/io/targa/detail/supported_types.hpp
index 0cefcb4a5b..7a13495130 100644
--- a/boost/gil/extension/io/targa/detail/supported_types.hpp
+++ b/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 <boost/mpl/not.hpp>
-#include <boost/type_traits/is_same.hpp>
-
#include <boost/gil/channel.hpp>
#include <boost/gil/color_base.hpp>
-
#include <boost/gil/io/base.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+
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/boost/gil/extension/io/targa/detail/write.hpp b/boost/gil/extension/io/targa/detail/write.hpp
index 223c1b2161..5a4145cbc5 100644
--- a/boost/gil/extension/io/targa/detail/write.hpp
+++ b/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 <vector>
+#include <boost/gil/extension/io/targa/tags.hpp>
+#include <boost/gil/extension/io/targa/detail/writer_backend.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
-#include <boost/gil/extension/io/targa/tags.hpp>
-
-#include <boost/gil/extension/io/targa/detail/writer_backend.hpp>
+#include <vector>
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 @@ public:
}
};
-#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/boost/gil/extension/io/targa/detail/writer_backend.hpp b/boost/gil/extension/io/targa/detail/writer_backend.hpp
index 0dfec2c185..2d853e6314 100644
--- a/boost/gil/extension/io/targa/detail/writer_backend.hpp
+++ b/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 <boost/gil/extension/io/targa/tags.hpp>
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 @@ public:
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/boost/gil/extension/io/targa/old.hpp b/boost/gil/extension/io/targa/old.hpp
index 05a3d680b5..18c095f307 100644
--- a/boost/gil/extension/io/targa/old.hpp
+++ b/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 <boost/gil/extension/io/targa.hpp>
namespace boost { namespace gil {
@@ -26,33 +15,23 @@ namespace boost { namespace gil {
/// \ingroup BMP_IO
/// \brief Returns the width and height of the BMP file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid BMP file
-template< typename String >
-inline
-point2< std::ptrdiff_t > targa_read_dimensions( const String& filename )
+template<typename String>
+inline point_t targa_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , targa_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , targa_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, targa_tag>::type;
+ backend_t backend = read_image_info(filename, targa_tag());
+ return { backend._info._width, backend._info._height };
}
-
/// \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 +45,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 +68,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 +87,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 +105,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 +124,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/boost/gil/extension/io/targa/read.hpp b/boost/gil/extension/io/targa/read.hpp
index 41caaa7d58..85bc51b3b5 100644
--- a/boost/gil/extension/io/targa/read.hpp
+++ b/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 <boost/gil/extension/io/targa/tags.hpp>
-#include <boost/gil/extension/io/targa/detail/supported_types.hpp>
#include <boost/gil/extension/io/targa/detail/read.hpp>
#include <boost/gil/extension/io/targa/detail/scanline_read.hpp>
+#include <boost/gil/extension/io/targa/detail/supported_types.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/targa/tags.hpp b/boost/gil/extension/io/targa/tags.hpp
index dce128b32c..f56a1e20b4 100644
--- a/boost/gil/extension/io/targa/tags.hpp
+++ b/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 <boost/gil/io/base.hpp>
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/boost/gil/extension/io/targa/write.hpp b/boost/gil/extension/io/targa/write.hpp
index 3edecc7d63..6ec423549d 100644
--- a/boost/gil/extension/io/targa/write.hpp
+++ b/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 <boost/gil/extension/io/targa/tags.hpp>
#include <boost/gil/extension/io/targa/detail/supported_types.hpp>
#include <boost/gil/extension/io/targa/detail//write.hpp>
-#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
+#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/write_view.hpp>
#endif
diff --git a/boost/gil/extension/io/tiff.hpp b/boost/gil/extension/io/tiff.hpp
index 0d7e6c8cd5..6af181b4e0 100644
--- a/boost/gil/extension/io/tiff.hpp
+++ b/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 <boost/gil/extension/io/tiff/read.hpp>
#include <boost/gil/extension/io/tiff/write.hpp>
diff --git a/boost/gil/extension/io/tiff/detail/device.hpp b/boost/gil/extension/io/tiff/detail/device.hpp
index aebc9846c8..83c40dbcd3 100644
--- a/boost/gil/extension/io/tiff/detail/device.hpp
+++ b/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 <algorithm>
+#include <boost/gil/extension/io/tiff/detail/log.hpp>
-////////////////////////////////////////////////////////////////////////////////////////
-/// \file
-/// \brief
-/// \author Andreas Pokorny, Christian Henning \n
-///
-/// \date 2007-2008 \n
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/device.hpp>
+
+#include <boost/mpl/size.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <algorithm>
+#include <memory>
// 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 <tiffio.hxx>
-#include <boost/mpl/size.hpp>
-#include <boost/utility/enable_if.hpp>
-
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/extension/io/tiff/detail/log.hpp>
-
-#include <memory>
-
namespace boost { namespace gil { namespace detail {
template <int n_args>
@@ -58,7 +47,7 @@ struct set_property_f {
bool call_me(const typename Property:: type& value, std::shared_ptr<TIFF>& file) const;
};
-template <> struct get_property_f <1>
+template <> struct get_property_f <1>
{
// For single-valued properties
template <typename Property>
@@ -117,7 +106,7 @@ template <> struct set_property_f <2>
bool call_me(typename Property:: type const & values, std::shared_ptr<TIFF>& file) const
{
typename mpl:: at <typename Property:: arg_types, mpl::int_<0> >:: type const length = values. size ();
- typename mpl:: at <typename Property:: arg_types, mpl::int_<1> >:: type const pointer = & (values. front ());
+ typename mpl:: at <typename Property:: arg_types, mpl::int_<1> >:: type const pointer = & (values. front ());
return (1 == TIFFSetField( file.get()
, Property:: tag
, length
@@ -153,9 +142,9 @@ public:
return set_property_f <mpl:: size <typename Property:: arg_types>::value > ().template call_me<Property> (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 @@ public:
io_error_if( TIFFWriteScanline( _tiff_file.get()
, &buffer.front()
, row
- , plane
+ , plane
) == -1
, "Write error"
);
@@ -269,7 +258,7 @@ public:
io_error_if( TIFFWriteScanline( _tiff_file.get()
, buffer
, row
- , plane
+ , plane
) == -1
, "Write error"
);
diff --git a/boost/gil/extension/io/tiff/detail/is_allowed.hpp b/boost/gil/extension/io/tiff/detail/is_allowed.hpp
index d88413a63e..417a467c98 100644
--- a/boost/gil/extension/io/tiff/detail/is_allowed.hpp
+++ b/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 <boost/gil/io/base.hpp>
#include <boost/mpl/for_each.hpp>
-#include <boost/gil/io/base.hpp>
-
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/boost/gil/extension/io/tiff/detail/log.hpp b/boost/gil/extension/io/tiff/detail/log.hpp
index 965a576d28..2299ee9d1a 100644
--- a/boost/gil/extension/io/tiff/detail/log.hpp
+++ b/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 <iostream>
extern "C" {
#include "tiffio.h"
}
-#include <iostream>
-
namespace boost { namespace gil {
class tiff_no_log
diff --git a/boost/gil/extension/io/tiff/detail/read.hpp b/boost/gil/extension/io/tiff/detail/read.hpp
index 2471ff544e..e25c833a2f 100644
--- a/boost/gil/extension/io/tiff/detail/read.hpp
+++ b/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 <boost/gil/extension/io/tiff/detail/device.hpp>
+#include <boost/gil/extension/io/tiff/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/tiff/detail/reader_backend.hpp>
+
+#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/bit_operations.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
+#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
+
+#include <boost/static_assert.hpp>
+
+#include <algorithm>
+#include <string>
+#include <vector>
// 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 <algorithm>
-#include <string>
-#include <vector>
-
-#include <boost/static_assert.hpp>
-
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/bit_operations.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/reader_base.hpp>
-
-#include <boost/gil/extension/io/tiff/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/tiff/detail/device.hpp>
-#include <boost/gil/extension/io/tiff/detail/is_allowed.hpp>
-
-
-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 @@ public:
{
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<rgb16_view_t>::type );
// Steps:
@@ -218,7 +206,7 @@ public:
}
}
}
-
+
private:
template< typename View >
@@ -442,7 +430,7 @@ private:
, 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 @@ private:
, 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 @@ private:
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 @@ private:
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 @@ public:
}
};
-#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/boost/gil/extension/io/tiff/detail/reader_backend.hpp b/boost/gil/extension/io/tiff/detail/reader_backend.hpp
index d2a308f7d7..6de7e61688 100644
--- a/boost/gil/extension/io/tiff/detail/reader_backend.hpp
+++ b/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 <boost/gil/extension/io/tiff/tags.hpp>
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 @@ private:
{
_io_dev.set_directory( settings._directory );
}
- }
+ }
public:
@@ -163,9 +152,9 @@ public:
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/boost/gil/extension/io/tiff/detail/scanline_read.hpp b/boost/gil/extension/io/tiff/detail/scanline_read.hpp
index 7e7e2cc8b7..e07e391801 100644
--- a/boost/gil/extension/io/tiff/detail/scanline_read.hpp
+++ b/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 <boost/gil/extension/io/tiff/detail/device.hpp>
+#include <boost/gil/extension/io/tiff/detail/is_allowed.hpp>
+#include <boost/gil/extension/io/tiff/detail/reader_backend.hpp>
+
+#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/bit_operations.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
+#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/reader_base.hpp>
+#include <boost/gil/io/row_buffer_helper.hpp>
+#include <boost/gil/io/scanline_read_iterator.hpp>
+
+#include <boost/function.hpp>
+#include <boost/static_assert.hpp>
+
+#include <algorithm>
+#include <string>
+#include <vector>
// 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 <algorithm>
-#include <string>
-#include <vector>
-
-#include <boost/function.hpp>
-#include <boost/static_assert.hpp>
-
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
-#include <boost/gil/io/bit_operations.hpp>
-#include <boost/gil/io/row_buffer_helper.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/reader_base.hpp>
-#include <boost/gil/io/scanline_read_iterator.hpp>
-
-#include <boost/gil/extension/io/tiff/detail/reader_backend.hpp>
-#include <boost/gil/extension/io/tiff/detail/device.hpp>
-#include <boost/gil/extension/io/tiff/detail/is_allowed.hpp>
-
-
namespace boost { namespace gil {
///
@@ -88,7 +76,7 @@ public:
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 @@ private:
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<rgb16_view_t>::type );
this->_io_dev.get_field_defaulted( this->_red
@@ -179,7 +167,7 @@ private:
break;
}
- case 8:
+ case 8:
{
typedef channel_type< get_pixel_type< gray8_image_t::view_t >::type >::type channel_t;
@@ -278,16 +266,16 @@ private:
{
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 @@ private:
{
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 @@ private:
{
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 @@ private:
{
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 @@ private:
{
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/boost/gil/extension/io/tiff/detail/supported_types.hpp b/boost/gil/extension/io/tiff/detail/supported_types.hpp
index 7e08dffb55..f654482670 100644
--- a/boost/gil/extension/io/tiff/detail/supported_types.hpp
+++ b/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 <boost/gil/channel.hpp>
+#include <boost/gil/color_base.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_same.hpp>
-#include <boost/gil/channel.hpp>
-#include <boost/gil/color_base.hpp>
-
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/boost/gil/extension/io/tiff/detail/write.hpp b/boost/gil/extension/io/tiff/detail/write.hpp
index 06b72858d8..a0e4645bb7 100644
--- a/boost/gil/extension/io/tiff/detail/write.hpp
+++ b/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 <boost/gil/extension/io/tiff/tags.hpp>
+#include <boost/gil/extension/io/tiff/detail/writer_backend.hpp>
+#include <boost/gil/extension/io/tiff/detail/device.hpp>
-extern "C" {
-#include "tiff.h"
-#include "tiffio.h"
-}
+#include <boost/gil/premultiply.hpp>
+#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/device.hpp>
+
+#include <boost/static_assert.hpp>
#include <algorithm>
#include <string>
#include <vector>
-#include <boost/static_assert.hpp>
-
-#include <boost/gil/premultiply.hpp>
-
-#include <boost/gil/extension/io/tiff/tags.hpp>
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/device.hpp>
-
-#include <boost/gil/extension/io/tiff/detail/writer_backend.hpp>
-#include <boost/gil/extension/io/tiff/detail/device.hpp>
+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 @@ private:
// @todo: do optional bit swapping here if you need to...
}
}
-
+
/////////////////////////////
template< typename View >
@@ -239,9 +227,9 @@ private:
typedef mpl::bool_<mpl::contains<colour_space_t, alpha_t>::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 @@ private:
, it
);
}
-
+
/////////////////////////////
@@ -369,7 +357,7 @@ private:
, static_cast< int >( tw )
, static_cast< int >( th )
);
-
+
typedef typename color_space_type<typename View::value_type>::type colour_space_t;
typedef mpl::bool_<mpl::contains<colour_space_t, alpha_t>::value> has_alpha_t;
@@ -453,9 +441,9 @@ public:
}
};
-#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/boost/gil/extension/io/tiff/detail/writer_backend.hpp b/boost/gil/extension/io/tiff/detail/writer_backend.hpp
index c7ed63a3e5..65b32942bd 100644
--- a/boost/gil/extension/io/tiff/detail/writer_backend.hpp
+++ b/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 <boost/gil/extension/io/tiff/tags.hpp>
#include <boost/mpl/contains.hpp>
-#include <boost/gil/extension/io/tiff/tags.hpp>
-
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 @@ public:
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/boost/gil/extension/io/tiff/old.hpp b/boost/gil/extension/io/tiff/old.hpp
index d0fa548a37..cd2d97e2ec 100644
--- a/boost/gil/extension/io/tiff/old.hpp
+++ b/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 <boost/gil/extension/io/tiff.hpp>
namespace boost { namespace gil {
@@ -26,32 +15,23 @@ namespace boost { namespace gil {
/// \ingroup TIFF_IO
/// \brief Returns the width and height of the TIFF file at the specified location.
/// Throws std::ios_base::failure if the location does not correspond to a valid TIFF file
-template< typename String >
-inline
-point2< std::ptrdiff_t > tiff_read_dimensions( const String& filename )
+template<typename String>
+inline point_t tiff_read_dimensions(String const& filename)
{
- typedef typename get_reader_backend< String
- , tiff_tag
- >::type backend_t;
-
- backend_t backend = read_image_info( filename
- , tiff_tag()
- );
-
- return point2< std::ptrdiff_t >( backend._info._width
- , backend._info._height
- );
+ using backend_t = typename get_reader_backend<String, tiff_tag>::type;
+ backend_t backend = read_image_info(filename, tiff_tag());
+ return { backend._info._width, backend._info._height };
}
/// \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 +45,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 +68,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 +87,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 +105,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 +124,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/boost/gil/extension/io/tiff/read.hpp b/boost/gil/extension/io/tiff/read.hpp
index 285a8bf331..af7b4bcef2 100644
--- a/boost/gil/extension/io/tiff/read.hpp
+++ b/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 <boost/gil/extension/io/tiff/tags.hpp>
-#include <boost/gil/extension/io/tiff/detail/supported_types.hpp>
#include <boost/gil/extension/io/tiff/detail/read.hpp>
#include <boost/gil/extension/io/tiff/detail/scanline_read.hpp>
+#include <boost/gil/extension/io/tiff/detail/supported_types.hpp>
#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/make_backend.hpp>
-#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_dynamic_image_reader.hpp>
+#include <boost/gil/io/make_reader.hpp>
#include <boost/gil/io/make_scanline_reader.hpp>
-
-#include <boost/gil/io/read_view.hpp>
-#include <boost/gil/io/read_image.hpp>
-#include <boost/gil/io/read_image_info.hpp>
#include <boost/gil/io/read_and_convert_image.hpp>
#include <boost/gil/io/read_and_convert_view.hpp>
-
+#include <boost/gil/io/read_image.hpp>
+#include <boost/gil/io/read_image_info.hpp>
+#include <boost/gil/io/read_view.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
#endif
diff --git a/boost/gil/extension/io/tiff/tags.hpp b/boost/gil/extension/io/tiff/tags.hpp
index 2242e969ea..fc21c48261 100644
--- a/boost/gil/extension/io/tiff/tags.hpp
+++ b/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 <boost/gil/extension/io/tiff/detail/log.hpp>
+
+#include <boost/gil/io/base.hpp>
#include <boost/mpl/vector.hpp>
@@ -32,9 +25,6 @@
}
#endif
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/extension/io/tiff/detail/log.hpp>
-
namespace boost { namespace gil {
/// Defines tiff tag.
diff --git a/boost/gil/extension/io/tiff/write.hpp b/boost/gil/extension/io/tiff/write.hpp
index 1969a951fe..a96470afc3 100644
--- a/boost/gil/extension/io/tiff/write.hpp
+++ b/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 <boost/gil/extension/io/tiff/tags.hpp>
#include <boost/gil/extension/io/tiff/detail/supported_types.hpp>
#include <boost/gil/extension/io/tiff/detail/write.hpp>
-#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/make_dynamic_image_writer.hpp>
-
+#include <boost/gil/io/make_writer.hpp>
#include <boost/gil/io/write_view.hpp>
-
#endif
diff --git a/boost/gil/extension/numeric/affine.hpp b/boost/gil/extension/numeric/affine.hpp
index 6a77070063..ebef93afca 100644
--- a/boost/gil/extension/numeric/affine.hpp
+++ b/boost/gil/extension/numeric/affine.hpp
@@ -1,26 +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).
-*/
-
-/*************************************************************************************************/
-
+//
+// 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 <boost/gil/utilities.hpp> // point2
-
-////////////////////////////////////////////////////////////////////////////////////////
-/// \file
-/// \brief support for affine transformations
-/// \author Lubomir Bourdev and Hailin Jin \n
-/// Adobe Systems Incorporated
-/// \date 2005-2007 \n
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <boost/gil/point.hpp>
namespace boost { namespace gil {
@@ -40,11 +28,17 @@ public:
matrix3x2& operator*=(const matrix3x2& m) { (*this) = (*this)*m; return *this; }
static matrix3x2 get_rotate(T rads) { T c=std::cos(rads); T s=std::sin(rads); return matrix3x2(c,s,-s,c,0,0); }
- static matrix3x2 get_translate(const point2<T>& t) { return matrix3x2(1 ,0,0,1 ,t.x,t.y); }
+ static matrix3x2 get_translate(point<T> const& t)
+ {
+ return matrix3x2(1, 0, 0, 1, t.x, t.y);
+ }
static matrix3x2 get_translate(T x, T y) { return matrix3x2(1 ,0,0,1 ,x, y ); }
- static matrix3x2 get_scale (const point2<T>& s) { return matrix3x2(s.x,0,0,s.y,0 ,0 ); }
- static matrix3x2 get_scale (T x, T y) { return matrix3x2(x, 0,0,y, 0 ,0 ); }
- static matrix3x2 get_scale (T s) { return matrix3x2(s ,0,0,s ,0 ,0 ); }
+ static matrix3x2 get_scale(point<T> const& s)
+ {
+ return matrix3x2(s.x, 0, 0, s.y, 0, 0);
+ }
+ static matrix3x2 get_scale(T x, T y) { return matrix3x2(x, 0,0,y, 0 ,0 ); }
+ static matrix3x2 get_scale(T s) { return matrix3x2(s ,0,0,s ,0 ,0 ); }
T a,b,c,d,e,f;
};
@@ -60,9 +54,11 @@ matrix3x2<T> operator*(const matrix3x2<T>& m1, const matrix3x2<T>& m2) {
m1.e * m2.b + m1.f * m2.d + m2.f );
}
-template <typename T, typename F> BOOST_FORCEINLINE
-point2<F> operator*(const point2<T>& p, const matrix3x2<F>& m) {
- return point2<F>(m.a*p.x + m.c*p.y + m.e, m.b*p.x + m.d*p.y + m.f);
+template <typename T, typename F>
+BOOST_FORCEINLINE
+point<F> operator*(point<T> const& p, matrix3x2<F> const& m)
+{
+ return { m.a*p.x + m.c*p.y + m.e, m.b*p.x + m.d*p.y + m.f };
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -74,20 +70,25 @@ concept MappingFunctionConcept {
typename mapping_traits<MapFn>::result_type; where PointNDConcept<result_type>;
template <typename Domain> { where PointNDConcept<Domain> }
- result_type transform(MapFn&, const Domain& src);
+ result_type transform(MapFn&, const Domain& src);
};
*/
template <typename T> struct mapping_traits;
template <typename F>
-struct mapping_traits<matrix3x2<F> > {
- typedef point2<F> result_type;
+struct mapping_traits<matrix3x2<F>>
+{
+ using result_type = point<F>;
};
-template <typename F, typename F2> BOOST_FORCEINLINE
-point2<F> transform(const matrix3x2<F>& mat, const point2<F2>& src) { return src * mat; }
+template <typename F, typename F2>
+BOOST_FORCEINLINE
+point<F> transform(matrix3x2<F> const& mat, point<F2> const& src)
+{
+ return src * mat;
+}
-} } // namespace boost::gil
+}} // namespace boost::gil
-#endif // BOOST_GIL_EXTENSION_NUMERIC_AFFINE_HPP
+#endif
diff --git a/boost/gil/extension/numeric/algorithm.hpp b/boost/gil/extension/numeric/algorithm.hpp
index b7c175985f..8dd2850857 100644
--- a/boost/gil/extension/numeric/algorithm.hpp
+++ b/boost/gil/extension/numeric/algorithm.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_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 <boost/gil/metafunctions.hpp>
+#include <boost/gil/pixel_iterator.hpp>
+#include <algorithm>
#include <cassert>
#include <iterator>
-#include <algorithm>
#include <numeric>
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/pixel_iterator.hpp>
-#include <boost/gil/metafunctions.hpp>
-
namespace boost { namespace gil {
/// \brief Returns the reference proxy associated with a type that has a \p "reference" member typedef.
@@ -47,7 +35,7 @@ BinaryFunction for_each(Iterator1 first1,Iterator1 last1,Iterator2 first2,Binary
template <typename SrcIterator,typename DstIterator>
inline DstIterator assign_pixels(SrcIterator src,SrcIterator src_end,DstIterator dst) {
for_each(src,src_end,dst,pixel_assigns_t<typename pixel_proxy<typename std::iterator_traits<SrcIterator>::value_type>::type,
- typename pixel_proxy<typename std::iterator_traits<DstIterator>::value_type>::type>());
+ typename pixel_proxy<typename std::iterator_traits<DstIterator>::value_type>::type>());
return dst+(src_end-src);
}
@@ -56,8 +44,8 @@ template <std::size_t Size>
struct inner_product_k_t {
template <class _InputIterator1, class _InputIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2>
- 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));
@@ -70,8 +58,8 @@ template <>
struct inner_product_k_t<0> {
template <class _InputIterator1, class _InputIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2>
- 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;
@@ -84,9 +72,9 @@ template <std::size_t Size,
class _InputIterator1, class _InputIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2>
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<Size>::template apply(__first1,__first2,__init,
@@ -153,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/boost/gil/extension/numeric/channel_numeric_operations.hpp b/boost/gil/extension/numeric/channel_numeric_operations.hpp
index d2407f9814..d456f06eba 100644
--- a/boost/gil/extension/numeric/channel_numeric_operations.hpp
+++ b/boost/gil/extension/numeric/channel_numeric_operations.hpp
@@ -1,37 +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 <functional>
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/channel.hpp>
-
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
@@ -154,6 +142,6 @@ struct channel_assigns_t : public std::binary_function<Channel1,Channel2,Channel
}
};
-} } // namespace boost::gil
+}} // namespace boost::gil
-#endif // BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP
+#endif
diff --git a/boost/gil/extension/numeric/convolve.hpp b/boost/gil/extension/numeric/convolve.hpp
index ba840aec71..152ffd776a 100644
--- a/boost/gil/extension/numeric/convolve.hpp
+++ b/boost/gil/extension/numeric/convolve.hpp
@@ -1,47 +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).
-*/
-
-/*************************************************************************************************/
-
+//
+// 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_CONVOLVE_HPP
#define BOOST_GIL_EXTENSION_NUMERIC_CONVOLVE_HPP
-/*!
-/// \file
-/// \brief 2D seperable convolutions and correlations
-///
-/// \author Hailin Jin and Lubomir Bourdev \n
-/// Adobe Systems Incorporated
-/// \date 2005-2007 \n
-*/
+#include <boost/gil/extension/numeric/algorithm.hpp>
+#include <boost/gil/extension/numeric/pixel_numeric_operations.hpp>
+#include <boost/gil/algorithm.hpp>
+#include <boost/gil/image_view_factory.hpp>
+#include <boost/gil/metafunctions.hpp>
-#include <cstddef>
-#include <cassert>
#include <algorithm>
-#include <vector>
+#include <cassert>
+#include <cstddef>
#include <functional>
-
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/image_view_factory.hpp>
-#include <boost/gil/algorithm.hpp>
-#include <boost/gil/metafunctions.hpp>
-#include <boost/gil/extension/numeric/pixel_numeric_operations.hpp>
-#include <boost/gil/extension/numeric/algorithm.hpp>
+#include <vector>
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
};
@@ -83,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);
}
}
@@ -214,6 +203,6 @@ void convolve_cols_fixed(const SrcView& src, const Kernel& ker, const DstView& d
convolve_rows_fixed<PixelAccum>(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/boost/gil/extension/numeric/kernel.hpp b/boost/gil/extension/numeric/kernel.hpp
index 012874d72a..000d17094b 100644
--- a/boost/gil/extension/numeric/kernel.hpp
+++ b/boost/gil/extension/numeric/kernel.hpp
@@ -1,36 +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 <boost/gil/utilities.hpp>
-#include <cstddef>
-#include <cassert>
-#include <array>
#include <algorithm>
-#include <vector>
+#include <array>
+#include <cassert>
+#include <cstddef>
#include <memory>
-
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/utilities.hpp>
+#include <vector>
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
@@ -81,7 +71,7 @@ class kernel_1d_fixed : public detail::kernel_1d_adaptor<std::array<T,Size> > {
public:
kernel_1d_fixed() {}
explicit kernel_1d_fixed(std::size_t center_in) : parent_t(center_in) {}
-
+
template <typename FwdIterator>
explicit kernel_1d_fixed(FwdIterator elements, std::size_t center_in) : parent_t(center_in) {
detail::copy_n(elements,Size,this->begin());
@@ -98,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/boost/gil/extension/numeric/pixel_numeric_operations.hpp b/boost/gil/extension/numeric/pixel_numeric_operations.hpp
index f5fc7c3e5a..cc055f39b1 100644
--- a/boost/gil/extension/numeric/pixel_numeric_operations.hpp
+++ b/boost/gil/extension/numeric/pixel_numeric_operations.hpp
@@ -1,39 +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 <functional>
+#include <boost/gil/extension/numeric/channel_numeric_operations.hpp>
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/pixel.hpp>
#include <boost/gil/color_base_algorithm.hpp>
+#include <boost/gil/pixel.hpp>
-#include <boost/gil/extension/numeric/channel_numeric_operations.hpp>
+#include <functional>
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 <typename PixelRef1, // models pixel concept
@@ -78,9 +68,10 @@ struct pixel_multiplies_scalar_t {
const Scalar& s) const {
PixelR result;
static_transform(p,result,
- std::bind2nd(channel_multiplies_scalar_t<typename channel_type<PixelRef>::type,
- Scalar,
- typename channel_type<PixelR>::type>(),s));
+ std::bind(channel_multiplies_scalar_t<typename channel_type<PixelRef>::type,
+ Scalar,
+ typename channel_type<PixelR>::type>(),
+ std::placeholders::_1, s));
return result;
}
};
@@ -112,9 +103,10 @@ struct pixel_divides_scalar_t {
const Scalar& s) const {
PixelR result;
static_transform(p,result,
- std::bind2nd(channel_divides_scalar_t<typename channel_type<PixelRef>::type,
- Scalar,
- typename channel_type<PixelR>::type>(),s));
+ std::bind(channel_divides_scalar_t<typename channel_type<PixelRef>::type,
+ Scalar,
+ typename channel_type<PixelR>::type>(),
+ std::placeholders::_1, s));
return result;
}
};
@@ -177,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/boost/gil/extension/numeric/resample.hpp b/boost/gil/extension/numeric/resample.hpp
index ec619d57a1..e2e63a11e0 100644
--- a/boost/gil/extension/numeric/resample.hpp
+++ b/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 <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
-
-#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
-
#include <boost/gil/extension/numeric/affine.hpp>
+#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
-////////////////////////////////////////////////////////////////////////////////////////
-/// \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 <boost/lambda/bind.hpp>
+#include <boost/lambda/lambda.hpp>
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 <typename SrcView, typename DstView> BOOST_FORCEINLINE void apply_compatible(const SrcView& src, const DstView& dst) const {
- resample_pixels(src, dst, _dst_to_src, _sampler);
+ template <typename SrcView, typename DstView> 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<Types2>& 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 <typename Sampler, typename SrcTypes, typename DstTypes, typename MapFn>
+template <typename Sampler, typename SrcTypes, typename DstTypes, typename MapFn>
void resample_pixels(const any_image_view<SrcTypes>& src, const any_image_view<DstTypes>& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) {
apply_operation(src,dst,detail::resample_pixels_fn<Sampler,MapFn>(dst_to_src,sampler));
}
@@ -111,8 +100,8 @@ void resample_pixels(const any_image_view<SrcTypes>& src, const any_image_view<D
// Extract into dst the rotated bounds [src_min..src_max] rotated at 'angle' from the source view 'src'
// The source coordinates are in the coordinate space of the source image
// Note that the views could also be variants (i.e. any_image_view)
-template <typename Sampler, typename SrcMetaView, typename DstMetaView>
-void resample_subimage(const SrcMetaView& src, const DstMetaView& dst,
+template <typename Sampler, typename SrcMetaView, typename DstMetaView>
+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>((double)(dst.width()-1),1);
double dst_height = std::max<double>((double)(dst.height()-1),1);
- matrix3x2<double> mat =
- matrix3x2<double>::get_translate(-dst_width/2.0, -dst_height/2.0) *
+ matrix3x2<double> mat =
+ matrix3x2<double>::get_translate(-dst_width/2.0, -dst_height/2.0) *
matrix3x2<double>::get_scale(src_width / dst_width, src_height / dst_height)*
matrix3x2<double>::get_rotate(-angle)*
matrix3x2<double>::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 <typename Sampler, typename SrcMetaView, typename DstMetaView>
+template <typename Sampler, typename SrcMetaView, typename DstMetaView>
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/boost/gil/extension/numeric/sampler.hpp b/boost/gil/extension/numeric/sampler.hpp
index 494611a314..ba8fa05225 100644
--- a/boost/gil/extension/numeric/sampler.hpp
+++ b/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 <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
-
#include <boost/gil/extension/numeric/pixel_numeric_operations.hpp>
-
-////////////////////////////////////////////////////////////////////////////////////////
-/// \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 <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
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
@@ -47,9 +36,11 @@ concept SamplerConcept {
struct nearest_neighbor_sampler {};
template <typename DstP, typename SrcView, typename F>
-bool sample(nearest_neighbor_sampler, const SrcView& src, const point2<F>& p, DstP& result) {
+bool sample(nearest_neighbor_sampler, SrcView const& src, point<F> const& p, DstP& result)
+{
typename SrcView::point_t center(iround(p));
- if (center.x>=0 && center.y>=0 && center.x<src.width() && center.y<src.height()) {
+ if (center.x >= 0 && center.y >= 0 && center.x < src.width() && center.y < src.height())
+ {
result=src(center.x,center.y);
return true;
}
@@ -96,20 +87,19 @@ 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 {};
template <typename DstP, typename SrcView, typename F>
-bool sample(bilinear_sampler, const SrcView& src, const point2<F>& p, DstP& result)
+bool sample(bilinear_sampler, SrcView const& src, point<F> const& p, DstP& result)
{
- typedef typename SrcView::value_type SrcP;
-
- point2<ptrdiff_t> p0(ifloor(p.x), ifloor(p.y)); // the closest integer coordinate top left from p
- point2<F> frac(p.x-p0.x, p.y-p0.y);
+ using SrcP = typename SrcView::value_type;
+ point_t p0(ifloor(p.x), ifloor(p.y)); // the closest integer coordinate top left from p
+ point<F> 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 +184,6 @@ bool sample(bilinear_sampler, const SrcView& src, const point2<F>& p, DstP& resu
return true;
}
-} // namespace gil
-} // namespace boost
+}} // namespace boost::gil
-#endif // BOOST_GIL_EXTENSION_NUMERIC_SAMPLER_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_converters.hpp b/boost/gil/extension/toolbox/color_converters.hpp
index 5286ac14d6..6f1a0dcb33 100644
--- a/boost/gil/extension/toolbox/color_converters.hpp
+++ b/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 <boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp>
#include <boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp>
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp b/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp
index 1cfc873ac6..7890eb03f5 100644
--- a/boost/gil/extension/toolbox/color_converters/gray_to_rgba.hpp
+++ b/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 <boost/gil/color_convert.hpp>
namespace boost{ namespace gil {
@@ -42,8 +31,6 @@ struct default_color_converter_impl<gray_t,rgba_t>
}
};
-} // namespace gil
-} // namespace boost
-
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_GRAY_TO_RGBA_HPP
+}} // namespace boost::gil
+#endif
diff --git a/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp b/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp
index e4daa6570b..ccce774e48 100644
--- a/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp
+++ b/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 <boost/gil/color_convert.hpp>
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/boost/gil/extension/toolbox/color_spaces.hpp b/boost/gil/extension/toolbox/color_spaces.hpp
index acb3a9dea3..d34af0b64a 100644
--- a/boost/gil/extension/toolbox/color_spaces.hpp
+++ b/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 <boost/gil/extension/toolbox/color_spaces/cmyka.hpp>
#include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
#include <boost/gil/extension/toolbox/color_spaces/hsl.hpp>
@@ -26,4 +15,4 @@
#include <boost/gil/extension/toolbox/color_spaces/lab.hpp>
#include <boost/gil/extension/toolbox/color_spaces/xyz.hpp>
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/cmyka.hpp b/boost/gil/extension/toolbox/color_spaces/cmyka.hpp
index e6c3572b92..8631aa6656 100644
--- a/boost/gil/extension/toolbox/color_spaces/cmyka.hpp
+++ b/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 <boost/gil/rgba.hpp>
#include <boost/gil/cmyk.hpp>
-
#include <boost/gil/color_convert.hpp>
+#include <boost/gil/rgba.hpp>
#include <boost/gil/typedefs.hpp>
+#include <boost/mpl/vector.hpp>
+
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<P1>::type T1;
// default_color_converter_impl<cmyk_t,C2>()(
-// pixel<T1,cmyk_layout_t>(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<T1,cmyk_layout_t>(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<cmyka_t,rgba_t> {
void operator()(const P1& src, P2& dst) const {
typedef typename channel_type<P1>::type T1;
default_color_converter_impl<cmyk_t,rgba_t>()(
- pixel<T1,cmyk_layout_t>(get_color(src,cyan_t()),
- get_color(src,magenta_t()),
+ pixel<T1,cmyk_layout_t>(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<cmyka_t,cmyka_t> {
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_CMYKA_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp b/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp
index f32a95a541..0ada701a44 100644
--- a/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp
+++ b/boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp
@@ -1,31 +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 <boost/mpl/contains.hpp>
-
-#include <boost/gil/gil_config.hpp>
#include <boost/gil/color_convert.hpp>
#include <boost/gil/gray.hpp>
#include <boost/gil/typedefs.hpp>
+#include <boost/mpl/contains.hpp>
+#include <boost/mpl/vector.hpp>
+
namespace boost{ namespace gil {
typedef mpl::vector2<gray_color_t,alpha_t> gray_alpha_t;
@@ -73,15 +62,15 @@ struct default_color_converter_impl<gray_alpha_t,rgb_t> {
void operator()(const P1& src, P2& dst) const {
get_color(dst,red_t()) =
channel_convert<typename color_element_type<P2, red_t>::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<typename color_element_type<P2, green_t>::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<typename color_element_type<P2, blue_t>::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()) )
);
}
};
@@ -93,7 +82,7 @@ struct default_color_converter_impl<gray_alpha_t,gray_t> {
void operator()(const P1& src, P2& dst) const {
get_color(dst,gray_color_t()) =
channel_convert<typename color_element_type<P2, gray_color_t>::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()) )
);
}
};
@@ -101,4 +90,4 @@ struct default_color_converter_impl<gray_alpha_t,gray_t> {
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_GRAY_ALPHA_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/hsl.hpp b/boost/gil/extension/toolbox/color_spaces/hsl.hpp
index d5fb48e3f4..a2e6a1e040 100644
--- a/boost/gil/extension/toolbox/color_spaces/hsl.hpp
+++ b/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 <boost/gil/typedefs.hpp>
namespace boost{ namespace gil {
@@ -265,4 +254,4 @@ struct default_color_converter_impl<hsl_t,rgb_t>
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSL_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/hsv.hpp b/boost/gil/extension/toolbox/color_spaces/hsv.hpp
index 6e0b332c3f..823755057c 100644
--- a/boost/gil/extension/toolbox/color_spaces/hsv.hpp
+++ b/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 <boost/numeric/conversion/cast.hpp>
#include <boost/gil/typedefs.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <algorithm>
+#include <cmath>
+
namespace boost{ namespace gil {
/// \addtogroup ColorNameModel
@@ -95,7 +89,7 @@ struct default_color_converter_impl< rgb_t, hsv_t >
hue = ( temp_green - temp_blue )
/ diff;
}
- else if( temp_green == max_color )
+ else if( temp_green >= max_color ) // means == but >= avoids compiler warning; color is never greater than max
{
hue = 2.f + ( temp_blue - temp_red )
/ diff;
@@ -234,4 +228,4 @@ struct default_color_converter_impl<hsv_t,rgb_t>
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HSV_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/lab.hpp b/boost/gil/extension/toolbox/color_spaces/lab.hpp
index 140c79f763..ec5d955d31 100644
--- a/boost/gil/extension/toolbox/color_spaces/lab.hpp
+++ b/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 <boost/gil/gil_all.hpp> // FIXME: Include what you use, not everything, even in extensions!
#include <boost/gil/extension/toolbox/color_spaces/xyz.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use, not everything, even in extensions!
+
+#include <boost/mpl/vector.hpp>
+
namespace boost{ namespace gil {
/// \addtogroup ColorNameModel
@@ -175,4 +167,4 @@ struct default_color_converter_impl<lab_t,rgb_t>
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_LAB_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/color_spaces/xyz.hpp b/boost/gil/extension/toolbox/color_spaces/xyz.hpp
index a9973adf82..637002d81d 100644
--- a/boost/gil/extension/toolbox/color_spaces/xyz.hpp
+++ b/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 <boost/gil/typedefs.hpp>
+#include <boost/mpl/vector.hpp>
+
namespace boost{ namespace gil {
/// \addtogroup ColorNameModel
diff --git a/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp b/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp
index e8e282f6a5..7c35ba1d9b 100644
--- a/boost/gil/extension/toolbox/color_spaces/ycbcr.hpp
+++ b/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 <boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp>
-#include <cstdint>
-#include <boost/algorithm/clamp.hpp>
+#include <boost/gil.hpp> // FIXME: Include what you use!
+
+#include <boost/mpl/identity.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
-#include <boost/gil/gil_all.hpp>
-#include <boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp>
+#include <cstdint>
namespace boost{ namespace gil {
@@ -64,6 +55,21 @@ typedef boost::gil::layout<ycbcr_709__t> ycbcr_709__layout_t;
GIL_DEFINE_ALL_TYPEDEFS(8, uint8_t, ycbcr_601_)
GIL_DEFINE_ALL_TYPEDEFS(8, uint8_t, ycbcr_709_)
+namespace detail {
+
+// Source:boost/algorithm/clamp.hpp
+template<typename T>
+constexpr T const& clamp(T const& val,
+ typename boost::mpl::identity<T>::type const & lo,
+ typename boost::mpl::identity<T>::type const & hi)
+{
+ // assert ( !p ( hi, lo )); // Can't assert p ( lo, hi ) b/c they might be equal
+ auto const p = std::less<T>();
+ return p(val, lo) ? lo : p(hi, val) ? hi : val;
+}
+
+} // namespace detail
+
/*
* 601 Source: http://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion
* 709 Source: http://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.709_conversion
@@ -100,7 +106,6 @@ private:
, mpl::true_ // is 8 bit channel
) const
{
- using namespace boost::algorithm;
using namespace ycbcr_601_color_space;
typedef typename channel_type< Src_Pixel >::type src_channel_t;
@@ -114,9 +119,9 @@ private:
std::int_fast16_t c = y - 16;
std::int_fast16_t d = cb - 128;
std::int_fast16_t e = cr - 128;
- std::int_fast16_t red = clamp((( 298 * c + 409 * e + 128) >> 8), 0, 255);
- std::int_fast16_t green = clamp((( 298 * c - 100 * d - 208 * e + 128) >> 8), 0, 255);
- std::int_fast16_t blue = clamp((( 298 * c + 516 * d + 128) >> 8), 0, 255);
+ std::int_fast16_t red = detail::clamp((( 298 * c + 409 * e + 128) >> 8), 0, 255);
+ std::int_fast16_t green = detail::clamp((( 298 * c - 100 * d - 208 * e + 128) >> 8), 0, 255);
+ std::int_fast16_t blue = detail::clamp((( 298 * c + 516 * d + 128) >> 8), 0, 255);
get_color( dst, red_t() ) = (dst_channel_t) red;
get_color( dst, green_t() ) = (dst_channel_t) green;
@@ -132,7 +137,6 @@ private:
, mpl::false_ // is 8 bit channel
) const
{
- using namespace boost::algorithm;
using namespace ycbcr_601_color_space;
typedef typename channel_type< Dst_Pixel >::type dst_channel_t;
@@ -141,20 +145,14 @@ private:
double cb = get_color( src, cb_t() );
double cr = get_color( src, cr_t() );
- get_color(dst, red_t()) = (dst_channel_t) clamp( 1.6438 * ( y - 16.0 ) + 1.5960 * ( cr -128.0 )
- , 0.0
- , 255.0
- );
+ get_color(dst, red_t()) = static_cast<dst_channel_t>(
+ detail::clamp(1.6438 * (y - 16.0) + 1.5960 * (cr -128.0), 0.0, 255.0));
- get_color(dst, green_t()) = (dst_channel_t) clamp( 1.6438 * ( y - 16.0 ) - 0.3917 * ( cb - 128.0 ) + 0.8129 * ( cr -128.0 )
- , 0.0
- , 255.0
- );
+ get_color(dst, green_t()) = static_cast<dst_channel_t>(
+ detail::clamp(1.6438 * (y - 16.0) - 0.3917 * (cb - 128.0) + 0.8129 * (cr -128.0), 0.0, 255.0));
- get_color(dst, blue_t()) = (dst_channel_t) clamp( 1.6438 * ( y - 16.0 ) - 2.0172 * ( cb -128.0 )
- , 0.0
- , 255.0
- );
+ get_color(dst, blue_t()) = static_cast<dst_channel_t>(
+ detail::clamp(1.6438 * ( y - 16.0 ) - 2.0172 * ( cb -128.0 ), 0.0, 255.0));
}
};
diff --git a/boost/gil/extension/toolbox/dynamic_images.hpp b/boost/gil/extension/toolbox/dynamic_images.hpp
index f0993599eb..17c4ca34cd 100644
--- a/boost/gil/extension/toolbox/dynamic_images.hpp
+++ b/boost/gil/extension/toolbox/dynamic_images.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).
-
- 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 <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/size.hpp>
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
namespace boost { namespace gil {
@@ -120,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/boost/gil/extension/toolbox/image_types.hpp b/boost/gil/extension/toolbox/image_types.hpp
index 94d52fad63..4d21f1f7c4 100644
--- a/boost/gil/extension/toolbox/image_types.hpp
+++ b/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 <boost/gil/extension/toolbox/image_types/indexed_image.hpp>
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/image_types/indexed_image.hpp b/boost/gil/extension/toolbox/image_types/indexed_image.hpp
index c413f67533..4ee7966f30 100644
--- a/boost/gil/extension/toolbox/image_types/indexed_image.hpp
+++ b/boost/gil/extension/toolbox/image_types/indexed_image.hpp
@@ -1,35 +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_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 <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
+
+#include <boost/gil/image.hpp>
+#include <boost/gil/point.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/image.hpp>
-#include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
-
+#include <cstddef>
+#include <memory>
namespace boost{ namespace gil {
-typedef boost::gil::point2< std::ptrdiff_t > point_t;
-
template< typename Locator >
struct get_pixel_type_locator : mpl::if_< typename is_bit_aligned< typename Locator::value_type >::type
, typename Locator::reference
@@ -211,7 +203,7 @@ private:
template<typename Index_View, typename Palette_View>
indexed_image_view
<
- typename indexed_image_locator_type
+ typename indexed_image_locator_type
<
typename Index_View::locator
, typename Palette_View::locator
@@ -219,14 +211,14 @@ indexed_image_view
>
view(Index_View iv, Palette_View pv)
{
- typedef indexed_image_view<
+ typedef indexed_image_view<
typename indexed_image_locator_type<
typename Index_View::locator
, typename Palette_View::locator
>::type
> view_t;
- typedef indexed_image_deref_fn<
+ typedef indexed_image_deref_fn<
typename Index_View::locator
, typename Palette_View::locator
> defer_fn_t;
@@ -389,4 +381,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/boost/gil/extension/toolbox/image_types/subchroma_image.hpp b/boost/gil/extension/toolbox/image_types/subchroma_image.hpp
index e98abe0f1c..be2a7baa80 100644
--- a/boost/gil/extension/toolbox/image_types/subchroma_image.hpp
+++ b/boost/gil/extension/toolbox/image_types/subchroma_image.hpp
@@ -1,37 +1,28 @@
-/*
- 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 <boost/gil/image.hpp>
+#include <boost/gil/point.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/int.hpp>
#include <boost/mpl/if.hpp>
+#include <boost/mpl/int.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/vector_c.hpp>
-#include <boost/gil/image.hpp>
+#include <cstddef>
+#include <memory>
namespace boost{ namespace gil {
-typedef boost::gil::point2< std::ptrdiff_t > point_t;
-
////////////////////////////////////////////////////////////////////////////////////////
/// \class subchroma_image_deref_fn
/// \ingroup PixelLocatorModel PixelBasedModel
@@ -68,7 +59,7 @@ struct subchroma_image_deref_fn
{}
/// operator()
- typename result_type operator()( const point_t& p ) const
+ result_type operator()( const point_t& p ) const
{
typedef Scaling_Factors< mpl::at_c< Factors, 0 >::type::value
, mpl::at_c< Factors, 1 >::type::value
@@ -85,13 +76,13 @@ struct subchroma_image_deref_fn
);
}
- ///
+ ///
const plane_locator_t& y_locator() const { return _y_locator; }
const plane_locator_t& v_locator() const { return _v_locator; }
const plane_locator_t& u_locator() const { return _u_locator; }
private:
-
+
plane_locator_t _y_locator;
plane_locator_t _v_locator;
plane_locator_t _u_locator;
@@ -101,7 +92,7 @@ private:
////////////////////////////////////////////////////////////////////////////////////////
/// \class subchroma_image_locator_type
/// \ingroup PixelLocatorModel PixelBasedModel
-/// \brief
+/// \brief
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
@@ -122,19 +113,19 @@ struct subchroma_image_locator
/////////////////////////////
template < typename Locator, typename Factors >
-struct channel_type< subchroma_image_locator< Locator, Factors > >
+struct channel_type< subchroma_image_locator< Locator, Factors > >
: public channel_type< typename subchroma_image_locator< Locator, Factors >::type > {};
template < typename Locator, typename Factors >
-struct color_space_type< subchroma_image_locator< Locator, Factors > >
+struct color_space_type< subchroma_image_locator< Locator, Factors > >
: public color_space_type< typename subchroma_image_locator< Locator, Factors >::type > {};
template < typename Locator, typename Factors >
-struct channel_mapping_type< subchroma_image_locator< Locator, Factors > >
+struct channel_mapping_type< subchroma_image_locator< Locator, Factors > >
: public channel_mapping_type< typename subchroma_image_locator< Locator, Factors >::type > {};
template < typename Locator, typename Factors >
-struct is_planar< subchroma_image_locator< Locator, Factors > >
+struct is_planar< subchroma_image_locator< Locator, Factors > >
: public is_planar< typename subchroma_image_locator< Locator, Factors >::type > {};
/////////////////////////////
@@ -176,7 +167,7 @@ struct transposed_type< subchroma_image_locator< Locator, Factors > >
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
- , typename Factors = mpl::vector_c< int, 4, 4, 4 >
+ , typename Factors = mpl::vector_c< int, 4, 4, 4 >
>
class subchroma_image_view : public image_view< Locator >
{
@@ -207,7 +198,7 @@ public:
, _v_dimensions( v_dimensions )
, _u_dimensions( u_dimensions )
{}
-
+
/// copy constructor
template< typename Subchroma_View >
subchroma_image_view( const Subchroma_View& v )
@@ -249,11 +240,11 @@ private:
/////////////////////////////
template < typename Locator, typename Factors >
-struct channel_type< subchroma_image_view< Locator, Factors > >
- : public channel_type< Locator > {};
+struct channel_type< subchroma_image_view< Locator, Factors > >
+ : public channel_type< Locator > {};
template < typename Locator, typename Factors >
-struct color_space_type< subchroma_image_view< Locator, Factors > >
+struct color_space_type< subchroma_image_view< Locator, Factors > >
: public color_space_type< Locator > {};
template < typename Locator, typename Factors >
@@ -261,7 +252,7 @@ struct channel_mapping_type< subchroma_image_view< Locator, Factors > >
: public channel_mapping_type< Locator > {};
template < typename Locator, typename Factors >
-struct is_planar< subchroma_image_view< Locator, Factors > >
+struct is_planar< subchroma_image_view< Locator, Factors > >
: public is_planar< Locator > {};
/////////////////////////////
@@ -309,7 +300,7 @@ struct Scaling_Factors
, mpl::equal_to< mpl::int_< a >, mpl::int_< 1 > >
>
>::type::value
- ));
+ ));
BOOST_STATIC_ASSERT(( mpl::or_< mpl::equal_to< mpl::int_< b >, mpl::int_< 4 > >
, mpl::or_< mpl::equal_to< mpl::int_< b >, mpl::int_< 2 > >
@@ -318,7 +309,7 @@ struct Scaling_Factors
>
>
>::type::value
- ));
+ ));
BOOST_STATIC_CONSTANT( int, ss_X = ( mpl::divides< mpl::int_< J >
, mpl::int_< a >
@@ -345,7 +336,7 @@ struct Scaling_Factors
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Pixel
- , typename Factors = mpl::vector_c< int, 4, 4, 4 >
+ , typename Factors = mpl::vector_c< int, 4, 4, 4 >
, typename Allocator = std::allocator< unsigned char >
>
class subchroma_image : public Scaling_Factors< mpl::at_c< Factors, 0 >::type::value
@@ -355,7 +346,7 @@ class subchroma_image : public Scaling_Factors< mpl::at_c< Factors, 0 >::type::v
{
public:
-
+
typedef typename channel_type< Pixel >::type channel_t;
typedef pixel< channel_t, gray_layout_t> pixel_t;
@@ -419,7 +410,7 @@ private:
, locator
);
}
-
+
private:
@@ -516,7 +507,7 @@ typename subchroma_image< Pixel
std::size_t u_channel_size = 1;
unsigned char* u_base = y_base + ( y_width * y_height * y_channel_size );
- unsigned char* v_base = u_base + ( y_width / scaling_factors_t::ss_X )
+ unsigned char* v_base = u_base + ( y_width / scaling_factors_t::ss_X )
* u_channel_size;
typedef subchroma_image< Pixel, Factors >::plane_view_t plane_view_t;
@@ -549,7 +540,7 @@ typename subchroma_image< Pixel
, v_plane.xy_at( 0, 0 )
, u_plane.xy_at( 0, 0 )
);
-
+
typedef subchroma_image< Pixel
, Factors
@@ -574,4 +565,4 @@ typename subchroma_image< Pixel
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_IMAGE_TYPES_SUBCHROMA_IMAGE_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/metafunctions.hpp b/boost/gil/extension/toolbox/metafunctions.hpp
index 1912ed0023..16d7ee0184 100644
--- a/boost/gil/extension/toolbox/metafunctions.hpp
+++ b/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 <boost/gil/extension/toolbox/metafunctions/channel_type.hpp>
#include <boost/gil/extension/toolbox/metafunctions/channel_view.hpp>
#include <boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp>
@@ -28,4 +17,4 @@
#include <boost/gil/extension/toolbox/metafunctions/is_similar.hpp>
#include <boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp>
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/metafunctions/channel_type.hpp b/boost/gil/extension/toolbox/metafunctions/channel_type.hpp
index 13550b43e3..a2489a7cc6 100644
--- a/boost/gil/extension/toolbox/metafunctions/channel_type.hpp
+++ b/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 <boost/utility/enable_if.hpp>
-
-#include <boost/mpl/at.hpp>
+#include <boost/gil/extension/toolbox/dynamic_images.hpp>
+#include <boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp>
+#include <boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp>
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/channel.hpp>
-#include <boost/gil/extension/toolbox/dynamic_images.hpp>
-
-#include <boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp>
-#include <boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost{ namespace gil {
/// channel_type metafunction
-/// \brief Generates the channel type for
+/// \brief Generates the channel type for
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
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 <typename B, typename C, typename L, bool M>
-struct channel_type< bit_aligned_pixel_reference<B,C,L,M> >
+template <typename B, typename C, typename L, bool M>
+struct channel_type< bit_aligned_pixel_reference<B,C,L,M> >
: lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > >
, gen_chan_ref< B, C, L, M >
> {};
-template <typename B, typename C, typename L, bool M>
-struct channel_type<const bit_aligned_pixel_reference<B,C,L,M> >
+template <typename B, typename C, typename L, bool M>
+struct channel_type<const bit_aligned_pixel_reference<B,C,L,M> >
: lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > >
, gen_chan_ref< B, C, L, M >
> {};
-template <typename B, typename C, typename L>
+template <typename B, typename C, typename L>
struct gen_chan_ref_p
{
typedef packed_dynamic_channel_reference< B
@@ -92,8 +79,8 @@ struct channel_type< packed_pixel< BitField
>
> {};
-template <typename B, typename C, typename L>
-struct channel_type< const packed_pixel< B, C, L > >
+template <typename B, typename C, typename L>
+struct channel_type< const packed_pixel< B, C, L > >
: lazy_enable_if< is_homogeneous<packed_pixel< B, C, L > >
, 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/boost/gil/extension/toolbox/metafunctions/channel_view.hpp b/boost/gil/extension/toolbox/metafunctions/channel_view.hpp
index 4d42ff3ac1..454155b05d 100644
--- a/boost/gil/extension/toolbox/metafunctions/channel_view.hpp
+++ b/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 <boost/gil/image_view_factory.hpp>
@@ -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/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp b/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp
index 9cec37eac4..3721c4939b 100644
--- a/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp
+++ b/boost/gil/extension/toolbox/metafunctions/get_num_bits.hpp
@@ -1,27 +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_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 <boost/gil/channel.hpp>
#include <boost/mpl/int.hpp>
+#include <boost/mpl/size_t.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/utility/enable_if.hpp>
@@ -60,14 +50,14 @@ 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
- > : mpl::int_< sizeof(T) * 8 >
+ > : mpl::size_t< sizeof(T) * 8 >
{};
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_NUM_BITS_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp b/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp
index dc0876c1ae..59710c3079 100644
--- a/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp
+++ b/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 <boost/gil/extension/toolbox/dynamic_images.hpp>
#include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
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/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp b/boost/gil/extension/toolbox/metafunctions/gil_extensions.hpp
deleted file mode 100644
index 927a2194c7..0000000000
--- a/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 <boost/gil/gil_all.hpp>
-
-
-#include <boost/mpl/if.hpp>
-
-#include <boost/gil/extension/toolbox/dynamic_images.hpp>
-
-namespace boost { namespace gil {
-
-
-/// other goodies
-
-
-
-
-
-} // namespace gil
-} // namespace boost
-
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED
diff --git a/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp b/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp
index 369f8cbab5..87a7e8a8f3 100644
--- a/boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp
+++ b/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 <boost/gil/bit_aligned_pixel_reference.hpp>
namespace boost{ namespace gil {
@@ -29,19 +18,19 @@ namespace boost{ namespace gil {
template< typename PixelRef >
struct is_bit_aligned : mpl::false_{};
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
struct is_bit_aligned<bit_aligned_pixel_reference<B,C,L,M> > : mpl::true_{};
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
struct is_bit_aligned<const bit_aligned_pixel_reference<B,C,L,M> > : mpl::true_{};
-template <typename B, typename C, typename L>
+template <typename B, typename C, typename L>
struct is_bit_aligned<packed_pixel<B,C,L> > : mpl::true_{};
-template <typename B, typename C, typename L>
+template <typename B, typename C, typename L>
struct is_bit_aligned<const packed_pixel<B,C,L> > : mpl::true_{};
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_BIT_ALIGNED_TYPE_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp b/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp
index 9770d2bb2b..586afa44f1 100644
--- a/boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp
+++ b/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 <boost/mpl/at.hpp>
-
#include <boost/gil/pixel.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/at.hpp>
namespace boost{ namespace gil {
@@ -58,8 +47,8 @@ struct is_homogeneous_impl_p {};
// for packed_pixel
template <typename B, typename C, typename L >
-struct is_homogeneous<packed_pixel< B, C, L > >
- : is_homogeneous_impl_p< C
+struct is_homogeneous<packed_pixel< B, C, L > >
+ : 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<packed_pixel< B, C, L > >
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<C,0>::type
, 1
@@ -77,17 +66,17 @@ struct is_homogeneous< const packed_pixel< B, C, L > >
> {};
// for bit_aligned_pixel_reference
-template <typename B, typename C, typename L, bool M>
-struct is_homogeneous<bit_aligned_pixel_reference<B,C,L,M> >
+template <typename B, typename C, typename L, bool M>
+struct is_homogeneous<bit_aligned_pixel_reference<B,C,L,M> >
: is_homogeneous_impl<C,typename mpl::at_c<C,0>::type,1,mpl::size<C>::type::value>
{};
-template <typename B, typename C, typename L, bool M>
-struct is_homogeneous<const bit_aligned_pixel_reference<B,C,L,M> >
+template <typename B, typename C, typename L, bool M>
+struct is_homogeneous<const bit_aligned_pixel_reference<B,C,L,M> >
: is_homogeneous_impl<C,typename mpl::at_c<C,0>::type,1,mpl::size<C>::type::value>
{};
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_HOMOGENEOUS_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/metafunctions/is_similar.hpp b/boost/gil/extension/toolbox/metafunctions/is_similar.hpp
index 74af5c915d..9ac2fbd0bb 100644
--- a/boost/gil/extension/toolbox/metafunctions/is_similar.hpp
+++ b/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 <boost/gil/channel.hpp>
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/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp b/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp
index cff9a49bb7..709b4d9954 100644
--- a/boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp
+++ b/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 <boost/mpl/int.hpp>
-#include <boost/mpl/accumulate.hpp>
-
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/packed_pixel.hpp>
+#include <boost/mpl/accumulate.hpp>
+#include <boost/mpl/int.hpp>
+
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<image_t::view_t::reference>::value;
@@ -37,19 +26,19 @@ namespace boost{ namespace gil {
template< typename PixelRef >
struct pixel_bit_size : mpl::int_<0> {};
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
struct pixel_bit_size<bit_aligned_pixel_reference<B,C,L,M> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
-template <typename B, typename C, typename L, bool M>
+template <typename B, typename C, typename L, bool M>
struct pixel_bit_size<const bit_aligned_pixel_reference<B,C,L,M> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
-template <typename B, typename C, typename L>
+template <typename B, typename C, typename L>
struct pixel_bit_size<packed_pixel<B,C,L> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
-template <typename B, typename C, typename L>
+template <typename B, typename C, typename L>
struct pixel_bit_size<const packed_pixel<B,C,L> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
} // namespace gil
} // namespace boost
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_PIXEL_BIT_SIZE_HPP
+#endif
diff --git a/boost/gil/extension/toolbox/toolbox.hpp b/boost/gil/extension/toolbox/toolbox.hpp
index 07f10736db..557af11c9e 100644
--- a/boost/gil/extension/toolbox/toolbox.hpp
+++ b/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 <boost/gil/extension/toolbox/color_converters.hpp>
#include <boost/gil/extension/toolbox/color_spaces.hpp>
+#include <boost/gil/extension/toolbox/dynamic_images.hpp>
#include <boost/gil/extension/toolbox/image_types.hpp>
#include <boost/gil/extension/toolbox/metafunctions.hpp>
-#include <boost/gil/extension/toolbox/dynamic_images.hpp>
-
-#endif // BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP
+#endif
diff --git a/boost/gil/gil_all.hpp b/boost/gil/gil_all.hpp
deleted file mode 100644
index 17065b967f..0000000000
--- a/boost/gil/gil_all.hpp
+++ /dev/null
@@ -1,46 +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 "gil_config.hpp"
-#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/boost/gil/gil_config.hpp b/boost/gil/gil_config.hpp
deleted file mode 100644
index fdd39f3cdf..0000000000
--- a/boost/gil/gil_config.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright 2005-2007 Adobe Systems Incorporated
- Copyright 2018 Mateusz Loskot <mateusz at loskot dot net>
-
- Use, modification and distribution are subject to the 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_CONFIG_HPP
-#define GIL_CONFIG_HPP
-
-////////////////////////////////////////////////////////////////////////////////////////
-/// \file
-/// \brief GIL configuration file
-/// \author Lubomir Bourdev and Hailin Jin \n
-/// Adobe Systems Incorporated
-///
-////////////////////////////////////////////////////////////////////////////////////////
-
-#include <boost/config.hpp>
-#include <boost/config/pragma_message.hpp>
-
-#if defined(BOOST_GIL_DOXYGEN_ONLY)
-/// \def BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
-/// \brief Define to allow unaligned memory access
-/// Theoretically (or historically?) on platforms which support dereferencing on
-/// non-word memory boundary, unaligned access may result in performance improvement.
-/// \warning Unfortunately, this optimization may be a C/C++ strict aliasing rules
-/// violation, if accessed data buffer has effective type that cannot be aliased
-/// without leading to undefined behaviour.
-#define BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
-#endif
-
-#if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
-#if defined(sun) || defined(__sun) || \ // SunOS
- defined(__osf__) || defined(__osf) || \ // Tru64
- defined(_hpux) || defined(hpux) || \ // HP-UX
- defined(__arm__) || defined(__ARM_ARCH) || \ // ARM
- defined(_AIX) // AIX
-#error Unaligned access strictly disabled for some UNIX platforms or ARM architecture
-#elif defined(__i386__) || defined(__x86_64__) || defined(__vax__)
- // The check for little-endian architectures that tolerate unaligned memory
- // accesses is just an optimization. Nothing will break if it fails to detect
- // a suitable architecture.
- //
- // Unfortunately, this optimization may be a C/C++ strict aliasing rules violation
- // if accessed data buffer has effective type that cannot be aliased
- // without leading to undefined behaviour.
-BOOST_PRAGMA_MESSAGE("CAUTION: Unaligned access tolerated on little-endian may cause undefined behaviour")
-#else
-#error Unaligned access disabled for unknown platforms and architectures
-#endif
-#endif // defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
-
-#endif
diff --git a/boost/gil/gray.hpp b/boost/gil/gray.hpp
index 25e47ab214..e27ca17bcb 100644
--- a/boost/gil/gray.hpp
+++ b/boost/gil/gray.hpp
@@ -1,31 +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 "gil_config.hpp"
-#include "utilities.hpp"
-#include <boost/type_traits.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_GRAY_HPP
+#define BOOST_GIL_GRAY_HPP
+
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
+#include <boost/type_traits.hpp>
+
+#include <boost/gil/utilities.hpp>
namespace boost { namespace gil {
diff --git a/boost/gil/image.hpp b/boost/gil/image.hpp
index 577f69d4c6..c1b2f106a1 100644
--- a/boost/gil/image.hpp
+++ b/boost/gil/image.hpp
@@ -1,46 +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 <cstddef>
-#include <memory>
+//
+// 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 <boost/gil/algorithm.hpp>
+#include <boost/gil/image_view.hpp>
+#include <boost/gil/metafunctions.hpp>
+#include <boost/mpl/arithmetic.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
-#include <boost/mpl/arithmetic.hpp>
-
-#include "gil_config.hpp"
-#include "image_view.hpp"
-#include "metafunctions.hpp"
-#include "algorithm.hpp"
+#include <cstddef>
+#include <memory>
namespace boost { namespace gil {
-//#ifdef _MSC_VER
-//#pragma warning(push)
-//#pragma warning(disable : 4244) // conversion from 'gil::image<V,Alloc>::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
@@ -502,10 +482,6 @@ struct channel_mapping_type<image<Pixel,IsPlanar,Alloc> > : public channel_mappi
template <typename Pixel, bool IsPlanar, typename Alloc>
struct is_planar<image<Pixel,IsPlanar,Alloc> > : public mpl::bool_<IsPlanar> {};
-//#ifdef _MSC_VER
-//#pragma warning(pop)
-//#endif
-
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/image_view.hpp b/boost/gil/image_view.hpp
index fb42ef9f3b..34fd3da6fc 100644
--- a/boost/gil/image_view.hpp
+++ b/boost/gil/image_view.hpp
@@ -1,35 +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 <boost/gil/iterator_from_2d.hpp>
#include <cstddef>
#include <iterator>
-#include "gil_config.hpp"
-#include "iterator_from_2d.hpp"
-
-//#ifdef _MSC_VER
-//#pragma warning(push)
-//#pragma warning(disable : 4244) // conversion from 'gil::image<V,Alloc>::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 {
@@ -45,8 +27,8 @@ namespace boost { namespace gil {
/// that don't own the pixels. It is the user's responsibility that the underlying data remains
/// valid for the lifetime of the image view.
///
-/// Similar to iterators and ranges, constness of views does not extend to constness of pixels.
-/// A const \p image_view does not allow changing its location in memory (resizing, moving) but does
+/// Similar to iterators and ranges, constness of views does not extend to constness of pixels.
+/// A const \p image_view does not allow changing its location in memory (resizing, moving) but does
/// not prevent one from changing the pixels. The latter requires an image view whose value_type
/// is const.
///
@@ -82,6 +64,9 @@ public:
typedef typename Loc::template axis<D>::iterator iterator; // 1D iterator type along each dimension
};
typedef iterator_from_2d<Loc> iterator; // 1D iterator type for each pixel left-to-right inside top-to-bottom
+ typedef typename const_t::iterator const_iterator; // may be used to examine, but not to modify values
+ typedef typename const_t::reference const_reference; // behaves as a const reference
+ typedef typename std::iterator_traits<iterator>::pointer pointer; // behaves as a pointer to the value type
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::size_t size_type;
@@ -111,6 +96,35 @@ public:
template <typename L2> friend void swap(image_view<L2>& x, image_view<L2>& y);
+ /// \brief Exchanges the elements of the current view with those of \a other
+ /// in constant time.
+ ///
+ /// \note Required by the Collection concept
+ /// \see https://www.boost.org/libs/utility/Collection.html
+ void swap(image_view<Loc>& other)
+ {
+ using boost::gil::swap;
+ swap(*this, other);
+ }
+
+ /// \brief Returns true if the view has no elements, false otherwise.
+ ///
+ /// \note Required by the Collection concept
+ /// \see https://www.boost.org/libs/utility/Collection.html
+ bool empty() const { return !(width() > 0 && height() > 0); }
+
+ /// \brief Returns a reference to the first element in raster order.
+ ///
+ /// \note Required by the ForwardCollection, since view model the concept.
+ /// \see https://www.boost.org/libs/utility/Collection.html
+ reference front() const { return *begin(); }
+
+ /// \brief Returns a reference to the last element in raster order.
+ ///
+ /// \note Required by the ForwardCollection, since view model the concept.
+ /// \see https://www.boost.org/libs/utility/Collection.html
+ reference back() const { return *rbegin(); }
+
const point_t& dimensions() const { return _dimensions; }
const locator& pixels() const { return _pixels; }
x_coord_t width() const { return dimensions().x; }
@@ -120,7 +134,7 @@ public:
//\{@
/// \name 1D navigation
- size_type size() const { return width()*height(); }
+ size_type size() const { return width()*height(); }
iterator begin() const { return iterator(_pixels,_dimensions.x); }
iterator end() const { return begin()+(difference_type)size(); } // potential performance problem!
reverse_iterator rbegin() const { return reverse_iterator(end()); }
@@ -136,7 +150,7 @@ public:
/// \name 2-D navigation
reference operator()(const point_t& p) const { return _pixels(p.x,p.y); }
reference operator()(x_coord_t x, y_coord_t y)const { return _pixels(x,y); }
- template <std::size_t D> typename axis<D>::iterator axis_iterator(const point_t& p) const { return _pixels.axis_iterator<D>(p); }
+ template <std::size_t D> typename axis<D>::iterator axis_iterator(const point_t& p) const { return _pixels.template axis_iterator<D>(p); }
xy_locator xy_at(x_coord_t x, y_coord_t y) const { return _pixels+point_t(x_coord_t(x),y_coord_t(y)); }
locator xy_at(const point_t& p) const { return _pixels+p; }
//\}@
@@ -164,10 +178,10 @@ private:
xy_locator _pixels;
};
-template <typename L2>
-inline void swap(image_view<L2>& x, image_view<L2>& y) {
+template <typename L2>
+inline void swap(image_view<L2>& x, image_view<L2>& y) {
using std::swap;
- swap(x._dimensions,y._dimensions);
+ swap(x._dimensions,y._dimensions);
swap(x._pixels, y._pixels); // TODO: Extend further
}
@@ -176,16 +190,16 @@ inline void swap(image_view<L2>& x, image_view<L2>& y) {
/////////////////////////////
template <typename L>
-struct channel_type<image_view<L> > : public channel_type<L> {};
+struct channel_type<image_view<L> > : public channel_type<L> {};
template <typename L>
-struct color_space_type<image_view<L> > : public color_space_type<L> {};
+struct color_space_type<image_view<L> > : public color_space_type<L> {};
template <typename L>
-struct channel_mapping_type<image_view<L> > : public channel_mapping_type<L> {};
+struct channel_mapping_type<image_view<L> > : public channel_mapping_type<L> {};
template <typename L>
-struct is_planar<image_view<L> > : public is_planar<L> {};
+struct is_planar<image_view<L> > : public is_planar<L> {};
/////////////////////////////
// HasDynamicXStepTypeConcept
@@ -214,10 +228,6 @@ struct transposed_type<image_view<L> > {
typedef image_view<typename transposed_type<L>::type> type;
};
-} } // namespace boost::gil
-
-//#ifdef _MSC_VER
-//#pragma warning(pop)
-//#endif
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/image_view_factory.hpp b/boost/gil/image_view_factory.hpp
index 49ef336848..bfd76630ff 100644
--- a/boost/gil/image_view_factory.hpp
+++ b/boost/gil/image_view_factory.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).
-
- 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 <boost/gil/color_convert.hpp>
+#include <boost/gil/gray.hpp>
+#include <boost/gil/metafunctions.hpp>
+#include <boost/gil/point.hpp>
#include <cassert>
#include <cstddef>
-#include "gil_config.hpp"
-#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
@@ -48,12 +37,12 @@ template <typename T> struct transposed_type;
/// \brief Returns the type of a view that has a dynamic step along both X and Y
/// \ingroup ImageViewTransformations
-template <typename View>
+template <typename View>
struct dynamic_xy_step_type : public dynamic_y_step_type<typename dynamic_x_step_type<View>::type> {};
/// \brief Returns the type of a transposed view that has a dynamic step along both X and Y
/// \ingroup ImageViewTransformations
-template <typename View>
+template <typename View>
struct dynamic_xy_step_transposed_type : public dynamic_xy_step_type<typename transposed_type<View>::type> {};
@@ -70,10 +59,11 @@ interleaved_view(std::size_t width, std::size_t height,
/// \ingroup ImageViewConstructors
/// \brief Constructing image views from raw interleaved pixel data
template <typename Iterator>
-typename type_from_x_iterator<Iterator>::view_t
-interleaved_view(point2<std::size_t> dim,
- Iterator pixels, std::ptrdiff_t rowsize_in_bytes) {
- typedef typename type_from_x_iterator<Iterator>::view_t RView;
+auto interleaved_view(point<std::size_t> dim, Iterator pixels,
+ std::ptrdiff_t rowsize_in_bytes)
+ -> typename type_from_x_iterator<Iterator>::view_t
+{
+ using RView = typename type_from_x_iterator<Iterator>::view_t;
return RView(dim, typename RView::locator(pixels, rowsize_in_bytes));
}
@@ -158,7 +148,7 @@ namespace detail {
} // namespace detail
-/// \brief Returns the type of a view that does color conversion upon dereferencing its pixels
+/// \brief Returns the type of a view that does color conversion upon dereferencing its pixels
/// \ingroup ImageViewTransformationsColorConvert
template <typename SrcView, typename DstP, typename CC=default_color_converter>
struct color_converted_view_type : public detail::_color_converted_view_type<SrcView,
@@ -190,7 +180,7 @@ color_converted_view(const View& src) {
/// \ingroup ImageViewTransformationsFlipUD
template <typename View>
-inline typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src) {
+inline typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src) {
typedef typename dynamic_y_step_type<View>::type RView;
return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
}
@@ -200,7 +190,7 @@ inline typename dynamic_y_step_type<View>::type flipped_up_down_view(const View&
/// \brief view of a view flipped left-to-right
/// \ingroup ImageViewTransformationsFlipLR
-template <typename View>
+template <typename View>
inline typename dynamic_x_step_type<View>::type flipped_left_right_view(const View& src) {
typedef typename dynamic_x_step_type<View>::type RView;
return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,0),-1,1));
@@ -222,7 +212,7 @@ inline typename dynamic_xy_step_transposed_type<View>::type transposed_view(cons
/// \brief view of a view rotated 90 degrees clockwise
/// \ingroup ImageViewTransformations90CW
-template <typename View>
+template <typename View>
inline typename dynamic_xy_step_transposed_type<View>::type rotated90cw_view(const View& src) {
typedef typename dynamic_xy_step_transposed_type<View>::type RView;
return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1,1,true));
@@ -233,7 +223,7 @@ inline typename dynamic_xy_step_transposed_type<View>::type rotated90cw_view(con
/// \brief view of a view rotated 90 degrees counter-clockwise
/// \ingroup ImageViewTransformations90CCW
-template <typename View>
+template <typename View>
inline typename dynamic_xy_step_transposed_type<View>::type rotated90ccw_view(const View& src) {
typedef typename dynamic_xy_step_transposed_type<View>::type RView;
return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(src.width()-1,0),1,-1,true));
@@ -244,7 +234,7 @@ inline typename dynamic_xy_step_transposed_type<View>::type rotated90ccw_view(co
/// \brief view of a view rotated 180 degrees
/// \ingroup ImageViewTransformations180
-template <typename View>
+template <typename View>
inline typename dynamic_xy_step_type<View>::type rotated180_view(const View& src) {
typedef typename dynamic_xy_step_type<View>::type RView;
return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,src.height()-1),-1,-1));
@@ -255,13 +245,13 @@ inline typename dynamic_xy_step_type<View>::type rotated180_view(const View& src
/// \brief view of an axis-aligned rectangular area within an image_view
/// \ingroup ImageViewTransformationsSubimage
-template <typename View>
+template <typename View>
inline View subimage_view(const View& src, const typename View::point_t& topleft, const typename View::point_t& dimensions) {
return View(dimensions,src.xy_at(topleft));
}
/// \ingroup ImageViewTransformationsSubimage
-template <typename View>
+template <typename View>
inline View subimage_view(const View& src, int xMin, int yMin, int width, int height) {
return View(width,height,src.xy_at(xMin,yMin));
}
@@ -271,7 +261,7 @@ inline View subimage_view(const View& src, int xMin, int yMin, int width, int he
/// \brief view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y
/// \ingroup ImageViewTransformationsSubsampled
-template <typename View>
+template <typename View>
inline typename dynamic_xy_step_type<View>::type subsampled_view(const View& src, typename View::coord_t xStep, typename View::coord_t yStep) {
assert(xStep>0 && yStep>0);
typedef typename dynamic_xy_step_type<View>::type RView;
@@ -280,8 +270,8 @@ inline typename dynamic_xy_step_type<View>::type subsampled_view(const View& src
}
/// \ingroup ImageViewTransformationsSubsampled
-template <typename View>
-inline typename dynamic_xy_step_type<View>::type subsampled_view(const View& src, const typename View::point_t& step) {
+template <typename View>
+inline typename dynamic_xy_step_type<View>::type subsampled_view(const View& src, const typename View::point_t& step) {
return subsampled_view(src,step.x,step.y);
}
@@ -292,7 +282,7 @@ inline typename dynamic_xy_step_type<View>::type subsampled_view(const View& src
namespace detail {
template <typename View, bool AreChannelsTogether> struct __nth_channel_view_basic;
- // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
+ // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
// or images with a step
template <typename View>
struct __nth_channel_view_basic<View,false> {
@@ -364,8 +354,8 @@ namespace detail {
int _n; // the channel to use
- result_type operator()(argument_type srcP) const {
- return result_type(srcP[_n]);
+ result_type operator()(argument_type srcP) const {
+ return result_type(srcP[_n]);
}
};
@@ -417,7 +407,7 @@ typename nth_channel_view_type<View>::type nth_channel_view(const View& src, int
namespace detail {
template <int K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic;
- // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
+ // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
// or images with a step
template <int K, typename View>
struct __kth_channel_view_basic<K,View,false> {
@@ -493,7 +483,7 @@ namespace detail {
kth_channel_deref_fn() {}
template <typename P> kth_channel_deref_fn(const kth_channel_deref_fn<K,P>&) {}
- result_type operator()(argument_type srcP) const {
+ result_type operator()(argument_type srcP) const {
return result_type(gil::at_c<K>(srcP));
}
};
diff --git a/boost/gil/io/base.hpp b/boost/gil/io/base.hpp
index fddfa45c8e..9748cfcfc5 100644
--- a/boost/gil/io/base.hpp
+++ b/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 <ostream>
-#include <istream>
-#include <vector>
-
-#include <boost/bind.hpp>
-#include <boost/type_traits/is_base_of.hpp>
+#include <boost/gil/extension/toolbox/toolbox.hpp>
-#include <boost/gil/utilities.hpp>
-#include <boost/gil/color_convert.hpp>
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/bit_aligned_pixel_iterator.hpp>
+#include <boost/gil/color_convert.hpp>
+#include <boost/gil/utilities.hpp>
+#include <boost/gil/io/error.hpp>
+#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/extension/toolbox/toolbox.hpp>
+#include <boost/bind.hpp>
+#include <boost/type_traits/is_base_of.hpp>
-#include <boost/gil/io/typedefs.hpp>
-#include <boost/gil/io/error.hpp>
+#include <istream>
+#include <ostream>
+#include <vector>
namespace boost { namespace gil {
struct format_tag {};
-template< typename Property >
+template< typename Property >
struct property_base
{
typedef Property type;
@@ -84,11 +72,11 @@ public:
};
/**
- * 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/boost/gil/io/bit_operations.hpp b/boost/gil/io/bit_operations.hpp
index 245c7458d2..11dc124d60 100644
--- a/boost/gil/io/bit_operations.hpp
+++ b/boost/gil/io/bit_operations.hpp
@@ -1,26 +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_IO_BIT_OPERATIONS_HPP
#define BOOST_GIL_IO_BIT_OPERATIONS_HPP
-////////////////////////////////////////////////////////////////////////////////////////
-/// \file
-/// \brief
-/// \author Christian Henning \n
-///
-/// \date 2008 \n
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <boost/gil/io/typedefs.hpp>
#include <boost/bind.hpp>
+#include <boost/mpl/bool.hpp>
+#include <cstddef>
#include <array>
namespace boost { namespace gil { namespace detail {
@@ -107,7 +100,7 @@ private:
return result;
}
-
+
private:
bool _apply_operation;
diff --git a/boost/gil/io/conversion_policies.hpp b/boost/gil/io/conversion_policies.hpp
index 079e478ee2..d9c90e4e95 100644
--- a/boost/gil/io/conversion_policies.hpp
+++ b/boost/gil/io/conversion_policies.hpp
@@ -1,31 +1,22 @@
-/*
- 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 <boost/gil/image_view_factory.hpp>
+#include <boost/gil/io/error.hpp>
#include <algorithm>
#include <iterator>
-#include <boost/gil/image_view_factory.hpp>
namespace boost{namespace gil{ namespace detail {
-struct read_and_no_convert
+struct read_and_no_convert
{
public:
typedef void* color_converter_type;
@@ -38,7 +29,7 @@ public:
, OutIterator /* out */
, typename disable_if< typename pixels_are_compatible< typename std::iterator_traits<InIterator>::value_type
, typename std::iterator_traits<OutIterator>::value_type
- >::type
+ >::type
>::type* /* ptr */ = 0
)
{
@@ -53,7 +44,7 @@ public:
, OutIterator out
, typename enable_if< typename pixels_are_compatible< typename std::iterator_traits<InIterator>::value_type
, typename std::iterator_traits<OutIterator>::value_type
- >::type
+ >::type
>::type* /* ptr */ = 0
)
{
diff --git a/boost/gil/io/device.hpp b/boost/gil/io/device.hpp
index f453c376cf..7f180120ac 100644
--- a/boost/gil/io/device.hpp
+++ b/boost/gil/io/device.hpp
@@ -1,39 +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 <cstdio>
+#include <boost/gil/io/base.hpp>
+#include <boost/core/ignore_unused.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/base.hpp>
+#include <cstdio>
#include <memory>
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
@@ -46,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.
@@ -306,7 +294,7 @@ public:
);
return pos;
- }
+ }
void flush()
{
@@ -323,6 +311,7 @@ public:
);
assert( num_elements == line.size() );
+ boost::ignore_unused(num_elements);
}
int error()
@@ -338,7 +327,7 @@ private:
{
fclose( file );
}
- }
+ }
private:
@@ -742,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/boost/gil/io/dynamic_io_new.hpp b/boost/gil/io/dynamic_io_new.hpp
index 8ec01970eb..79ec66f48e 100644
--- a/boost/gil/io/dynamic_io_new.hpp
+++ b/boost/gil/io/dynamic_io_new.hpp
@@ -1,29 +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 <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
+
+#include <boost/gil/io/error.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/size.hpp>
-#include <boost/gil/gil_config.hpp>
-#include <boost/gil/io/error.hpp>
-#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
namespace boost { namespace gil {
diff --git a/boost/gil/io/error.hpp b/boost/gil/io/error.hpp
index 4920e8fc05..d51ead7411 100644
--- a/boost/gil/io/error.hpp
+++ b/boost/gil/io/error.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_IO_ERROR_HPP
#define BOOST_GIL_IO_ERROR_HPP
-////////////////////////////////////////////////////////////////////////////////////////
-/// \file
-/// \brief
-/// \author Christian Henning \n
-///
-/// \date 2010 \n
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <ios>
namespace boost { namespace gil {
-inline
-void io_error( const char* descr )
+inline void io_error(const char* descr)
{
- throw std::ios_base::failure( descr );
+ throw std::ios_base::failure(descr);
}
-inline
-void io_error_if( bool expr, const char* descr )
+inline void io_error_if(bool expr, const char* descr)
{
- if( expr )
- io_error( descr );
+ if (expr)
+ io_error(descr);
}
} // namespace gil
diff --git a/boost/gil/io/get_read_device.hpp b/boost/gil/io/get_read_device.hpp
index 547fbb7cb8..70e4064f51 100644
--- a/boost/gil/io/get_read_device.hpp
+++ b/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 <boost/gil/io/device.hpp>
+#include <boost/gil/io/path_spec.hpp>
#include <boost/mpl/and.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/path_spec.hpp>
-
namespace boost { namespace gil {
template< typename T
diff --git a/boost/gil/io/get_reader.hpp b/boost/gil/io/get_reader.hpp
index 858e86583b..4222bf929a 100644
--- a/boost/gil/io/get_reader.hpp
+++ b/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 <boost/gil/io/get_read_device.hpp>
namespace boost { namespace gil {
diff --git a/boost/gil/io/get_write_device.hpp b/boost/gil/io/get_write_device.hpp
index 638e595093..189dea773d 100644
--- a/boost/gil/io/get_write_device.hpp
+++ b/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 <boost/gil/io/device.hpp>
+#include <boost/gil/io/path_spec.hpp>
#include <boost/mpl/and.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/path_spec.hpp>
-#include <boost/gil/io/device.hpp>
namespace boost { namespace gil {
diff --git a/boost/gil/io/get_writer.hpp b/boost/gil/io/get_writer.hpp
index 85ef72b71a..d693043499 100644
--- a/boost/gil/io/get_writer.hpp
+++ b/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 <boost/gil/io/get_write_device.hpp>
namespace boost { namespace gil {
diff --git a/boost/gil/io/io.hpp b/boost/gil/io/io.hpp
index f581e3a245..86c32e7541 100644
--- a/boost/gil/io/io.hpp
+++ b/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<PixelType,FormatTag> must be implemented for
+ * - boolean meta function is_supported<PixelType,FormatTag> must be implemented for
* the new format tag
* - explicit specialisation of image_read_info<FormatTag> must be provided, containing
* runtime information available before/at reading the image
- * - explicit specialisation of image_write_info<FormatTag> must be provided, containing
- * runtime encoding parameters for writing an image
+ * - explicit specialisation of image_write_info<FormatTag> must be provided, containing
+ * runtime encoding parameters for writing an image
* - An image reader must be specialized:
* \code
* template<typename IODevice, typename ConversionPolicy>
@@ -37,7 +26,7 @@
* {
* reader( IODevice & device )
* reader( IODevice & device, typename ConversionPolicy::color_converter_type const& cc )
- * image_read_info<FormatTag> get_info();
+ * image_read_info<FormatTag> get_info();
* template<typename Image>
* void read_image( Image &, point_t const& top_left );
* template<typename View>
@@ -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<ColorConverter> and read_and_no_convert. ColorConverter
- * can be a user defined color converter.
- *
- * \code
+ * read_and_convert<ColorConverter> and read_and_no_convert. ColorConverter
+ * can be a user defined color converter.
+ *
+ * \code
* struct ConversionPolicy
* {
* template<typename InputIterator,typename OutputIterator>
- * 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<typename Device>
- * struct detail::is_input_device;
+ * template<typename Device>
+ * struct detail::is_input_device;
* }}}
* \endcode
- *
+ *
*/
#endif
diff --git a/boost/gil/io/make_backend.hpp b/boost/gil/io/make_backend.hpp
index c18775c2e6..e0a4a1f5dd 100644
--- a/boost/gil/io/make_backend.hpp
+++ b/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 <boost/gil/io/get_reader.hpp>
#include <boost/utility/enable_if.hpp>
-#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/boost/gil/io/make_dynamic_image_reader.hpp b/boost/gil/io/make_dynamic_image_reader.hpp
index 05c47d04d4..ffc9bd2735 100644
--- a/boost/gil/io/make_dynamic_image_reader.hpp
+++ b/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 <boost/gil/io/get_reader.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/get_reader.hpp>
-
namespace boost { namespace gil {
template< typename String
diff --git a/boost/gil/io/make_dynamic_image_writer.hpp b/boost/gil/io/make_dynamic_image_writer.hpp
index f4e21407dd..6610a613ed 100644
--- a/boost/gil/io/make_dynamic_image_writer.hpp
+++ b/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 <boost/gil/io/get_writer.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/get_writer.hpp>
-
namespace boost { namespace gil {
template< typename String
diff --git a/boost/gil/io/make_reader.hpp b/boost/gil/io/make_reader.hpp
index 3782e46f34..1ae2386a8f 100644
--- a/boost/gil/io/make_reader.hpp
+++ b/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 <boost/gil/io/get_reader.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/get_reader.hpp>
-
namespace boost { namespace gil {
template< typename String
diff --git a/boost/gil/io/make_scanline_reader.hpp b/boost/gil/io/make_scanline_reader.hpp
index c3bf6c1012..6142f52167 100644
--- a/boost/gil/io/make_scanline_reader.hpp
+++ b/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 <boost/gil/io/get_reader.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/get_reader.hpp>
-
namespace boost { namespace gil {
template< typename String
diff --git a/boost/gil/io/make_writer.hpp b/boost/gil/io/make_writer.hpp
index 9c266ddf65..46fe4153a5 100644
--- a/boost/gil/io/make_writer.hpp
+++ b/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 <boost/gil/io/get_writer.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/get_writer.hpp>
-
namespace boost { namespace gil {
template< typename String
diff --git a/boost/gil/io/path_spec.hpp b/boost/gil/io/path_spec.hpp
index 4686d7495c..f1ed379c8b 100644
--- a/boost/gil/io/path_spec.hpp
+++ b/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 <cstdlib>
-#include <string>
-
-#include <boost/mpl/bool_fwd.hpp>
-
#ifdef BOOST_GIL_IO_ADD_FS_PATH_SUPPORT
#define BOOST_FILESYSTEM_VERSION 3
#include <boost/filesystem/path.hpp>
#endif // BOOST_GIL_IO_ADD_FS_PATH_SUPPORT
+#include <boost/mpl/bool.hpp> // for complete types of true_ and false_
+
+#include <cstdlib>
+#include <string>
+
namespace boost { namespace gil { namespace detail {
template<typename P> struct is_supported_path_spec : mpl::false_ {};
diff --git a/boost/gil/io/read_and_convert_image.hpp b/boost/gil/io/read_and_convert_image.hpp
index a1ba856bf2..456cfbc975 100644
--- a/boost/gil/io/read_and_convert_image.hpp
+++ b/boost/gil/io/read_and_convert_image.hpp
@@ -1,32 +1,22 @@
-/*
- 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 <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/utility/enable_if.hpp>
-
#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/path_spec.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
+
+#include <boost/mpl/and.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
namespace boost{ namespace gil {
diff --git a/boost/gil/io/read_and_convert_view.hpp b/boost/gil/io/read_and_convert_view.hpp
index 51f913eced..a8ef788a78 100644
--- a/boost/gil/io/read_and_convert_view.hpp
+++ b/boost/gil/io/read_and_convert_view.hpp
@@ -1,32 +1,22 @@
-/*
- 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 <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/utility/enable_if.hpp>
-
#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/path_spec.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
+
+#include <boost/mpl/and.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost{ namespace gil {
@@ -140,7 +130,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 +167,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 +276,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 +310,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/boost/gil/io/read_image.hpp b/boost/gil/io/read_image.hpp
index 5f2b3c4681..1d64221178 100644
--- a/boost/gil/io/read_image.hpp
+++ b/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 <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/utility/enable_if.hpp>
-
#include <boost/gil/extension/toolbox/dynamic_images.hpp>
#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/path_spec.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
+
+#include <boost/mpl/and.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost{ namespace gil {
diff --git a/boost/gil/io/read_image_info.hpp b/boost/gil/io/read_image_info.hpp
index a3c7e54f3e..cf19dc27a0 100644
--- a/boost/gil/io/read_image_info.hpp
+++ b/boost/gil/io/read_image_info.hpp
@@ -1,32 +1,22 @@
-/*
- 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 <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/utility/enable_if.hpp>
-
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_reader.hpp>
#include <boost/gil/io/path_spec.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/utility/enable_if.hpp>
+
namespace boost{ namespace gil {
/// \ingroup IO
@@ -58,7 +48,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 +81,7 @@ read_image_info( Device& file
template< typename String
, typename FormatTag
>
-inline
+inline
typename get_reader_backend< String
, FormatTag
>::type
@@ -108,13 +98,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/boost/gil/io/read_view.hpp b/boost/gil/io/read_view.hpp
index 1a03733a3a..5bae9c6cd2 100644
--- a/boost/gil/io/read_view.hpp
+++ b/boost/gil/io/read_view.hpp
@@ -1,32 +1,23 @@
-/*
- 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 <boost/gil/io/base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
+#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_reader.hpp>
+#include <boost/gil/io/path_spec.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/mpl/and.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/gil/io/base.hpp>
-#include <boost/gil/io/device.hpp>
-#include <boost/gil/io/path_spec.hpp>
-
namespace boost{ namespace gil {
/// \ingroup IO
diff --git a/boost/gil/io/reader_base.hpp b/boost/gil/io/reader_base.hpp
index 1a7966d6cf..a2100faf4e 100644
--- a/boost/gil/io/reader_base.hpp
+++ b/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 <boost/gil/io/base.hpp>
-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/boost/gil/io/row_buffer_helper.hpp b/boost/gil/io/row_buffer_helper.hpp
index f9ab1e13ed..e06b98363b 100644
--- a/boost/gil/io/row_buffer_helper.hpp
+++ b/boost/gil/io/row_buffer_helper.hpp
@@ -1,29 +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_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
-///
-////////////////////////////////////////////////////////////////////////////////////////
-
+// TODO: Shall we move toolbox to core?
#include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
+#include <boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp>
+#include <boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp>
#include <boost/gil/io/typedefs.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <cstddef>
+#include <vector>
namespace boost { namespace gil { namespace detail {
@@ -67,10 +63,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
@@ -111,13 +107,19 @@ private:
buffer_t _row_buffer;
};
-template<typename Pixel >
-struct row_buffer_helper< Pixel
- , typename boost::enable_if< typename mpl::and_< typename is_bit_aligned< Pixel >::type
- , typename is_homogeneous< Pixel >::type
- >::type
- >
- >
+template<typename Pixel>
+struct row_buffer_helper
+<
+ Pixel,
+ typename boost::enable_if
+ <
+ typename mpl::and_
+ <
+ typename is_bit_aligned<Pixel>::type,
+ typename is_homogeneous<Pixel>::type
+ >::type
+ >
+>
{
typedef byte_t element_t;
typedef std::vector< element_t > buffer_t;
@@ -127,16 +129,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 +192,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/boost/gil/io/scanline_read_iterator.hpp b/boost/gil/io/scanline_read_iterator.hpp
index 3f812b9fa7..61528ea244 100644
--- a/boost/gil/io/scanline_read_iterator.hpp
+++ b/boost/gil/io/scanline_read_iterator.hpp
@@ -1,29 +1,21 @@
-/*
- 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 <boost/gil/io/error.hpp>
+#include <boost/gil/io/typedefs.hpp>
#include <boost/iterator/iterator_facade.hpp>
-#include <boost/gil/io/error.hpp>
-
+#include <iterator>
#include <memory>
+#include <vector>
namespace boost { namespace gil {
diff --git a/boost/gil/io/typedefs.hpp b/boost/gil/io/typedefs.hpp
index 294fb2eabd..20914baf4c 100644
--- a/boost/gil/io/typedefs.hpp
+++ b/boost/gil/io/typedefs.hpp
@@ -1,49 +1,37 @@
-/*
- 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 <vector>
-
-#include <boost/type_traits/is_base_of.hpp>
+#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
+#include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
+#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
#include <boost/gil/image.hpp>
+#include <boost/gil/point.hpp>
#include <boost/gil/utilities.hpp>
-#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
-#include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
-#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
+#include <boost/type_traits/is_base_of.hpp>
-namespace boost { namespace gil {
+#include <vector>
+
+namespace boost { namespace gil {
struct double_zero { static double apply() { return 0.0; } };
struct double_one { static double apply() { return 1.0; } };
-typedef unsigned char byte_t;
-typedef std::vector< byte_t > byte_vector_t;
-
-typedef point2< std::ptrdiff_t > point_t;
+using byte_t = unsigned char;
+using byte_vector_t = std::vector<byte_t>;
} // namespace gil
} // namespace boost
-namespace boost {
+namespace boost {
template<> struct is_floating_point<gil::float32_t> : mpl::true_ {};
template<> struct is_floating_point<gil::float64_t> : mpl::true_ {};
diff --git a/boost/gil/io/write_view.hpp b/boost/gil/io/write_view.hpp
index 16d496ef1a..26f3caa1bd 100644
--- a/boost/gil/io/write_view.hpp
+++ b/boost/gil/io/write_view.hpp
@@ -1,24 +1,22 @@
-/*
- 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 <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/utility/enable_if.hpp>
-
#include <boost/gil/io/base.hpp>
+#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
+#include <boost/gil/io/get_writer.hpp>
#include <boost/gil/io/path_spec.hpp>
-#include <boost/gil/io/conversion_policies.hpp>
+
+#include <boost/mpl/and.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/utility/enable_if.hpp>
////////////////////////////////////////////////////////////////////////////////////////
/// \file
diff --git a/boost/gil/iterator_from_2d.hpp b/boost/gil/iterator_from_2d.hpp
index 767ad699d1..c75b4b2f91 100644
--- a/boost/gil/iterator_from_2d.hpp
+++ b/boost/gil/iterator_from_2d.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).
+//
+// 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 <boost/gil/concepts.hpp>
+#include <boost/gil/locator.hpp>
+#include <boost/gil/pixel_iterator.hpp>
+#include <boost/gil/point.hpp>
- 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 <boost/iterator/iterator_facade.hpp>
#include <cassert>
-#include <boost/iterator/iterator_facade.hpp>
-#include "gil_concept.hpp"
-#include "gil_config.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
///
////////////////////////////////////////////////////////////////////////////////////////
@@ -45,7 +36,7 @@ namespace boost { namespace gil {
/// \ingroup PixelIteratorModelFromLocator PixelBasedModel
/// \brief Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
///
-/// Pixels are traversed from the top to the bottom row and from the left to the right
+/// Pixels are traversed from the top to the bottom row and from the left to the right
/// within each row
template <typename Loc2> // Models PixelLocatorConcept
@@ -93,7 +84,7 @@ private:
_coords.x=0;
++_coords.y;
_p+=point_t(-_width,1);
- }
+ }
}
void decrement() {
--_coords.x;
@@ -105,7 +96,7 @@ private:
}
}
- BOOST_FORCEINLINE void advance(difference_type d) {
+ BOOST_FORCEINLINE void advance(difference_type d) {
if (_width==0) return; // unfortunately we need to check for that. Default-constructed images have width of 0 and the code below will throw if executed.
point_t delta;
if (_coords.x+d>=0) { // not going back to a previous row?
@@ -114,13 +105,13 @@ private:
} else {
delta.x=(_coords.x+(std::ptrdiff_t)d*(1-_width))%_width -_coords.x;
delta.y=-(_width-_coords.x-(std::ptrdiff_t)d-1)/_width;
- }
+ }
_p+=delta;
_coords.x+=delta.x;
_coords.y+=delta.y;
}
- difference_type distance_to(const iterator_from_2d& it) const {
+ difference_type distance_to(const iterator_from_2d& it) const {
if (_width==0) return 0;
return (it.y_pos()-_coords.y)*_width + (it.x_pos()-_coords.x);
}
@@ -130,7 +121,7 @@ private:
return _coords==it._coords && _p==it._p;
}
- point2<std::ptrdiff_t> _coords;
+ point_t _coords;
std::ptrdiff_t _width;
Loc2 _p;
};
diff --git a/boost/gil/locator.hpp b/boost/gil/locator.hpp
index 50d78f740e..69a623b732 100644
--- a/boost/gil/locator.hpp
+++ b/boost/gil/locator.hpp
@@ -1,42 +1,29 @@
-/*
- 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 <boost/gil/pixel_iterator.hpp>
+#include <boost/gil/point.hpp>
- Use, modification and distribution are subject to the 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 <cstddef>
#include <cassert>
-#include "pixel_iterator.hpp"
-
-////////////////////////////////////////////////////////////////////////////////////////
-/// Pixel 2D LOCATOR
-////////////////////////////////////////////////////////////////////////////////////////
+#include <cstddef>
namespace boost { namespace gil {
+
+/// Pixel 2D locator
+
//forward declarations
template <typename P> std::ptrdiff_t memunit_step(const P*);
template <typename P> P* memunit_advanced(const P* p, std::ptrdiff_t diff);
template <typename P> P& memunit_advanced_ref(P* p, std::ptrdiff_t diff);
template <typename Iterator, typename D> struct iterator_add_deref;
-template <typename T> class point2;
+template <typename T> class point;
namespace detail {
// helper class specialized for each axis of pixel_2d_locator
template <std::size_t D, typename Loc> class locator_axis;
@@ -125,7 +112,7 @@ public:
typedef typename std::iterator_traits<x_iterator>::value_type value_type;
typedef typename std::iterator_traits<x_iterator>::reference reference; // result of dereferencing
typedef typename std::iterator_traits<x_iterator>::difference_type coord_t; // 1D difference type (same for all dimensions)
- typedef point2<coord_t> difference_type; // result of operator-(locator,locator)
+ typedef point<coord_t> difference_type; // result of operator-(locator,locator)
typedef difference_type point_t;
template <std::size_t D> struct axis {
typedef typename detail::locator_axis<D,Loc>::coord_t coord_t;
diff --git a/boost/gil/metafunctions.hpp b/boost/gil/metafunctions.hpp
index ee446778f3..f67cd81bbd 100644
--- a/boost/gil/metafunctions.hpp
+++ b/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 <boost/gil/channel.hpp>
+#include <boost/gil/concepts.hpp>
-#include <iterator>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/bool.hpp>
@@ -34,9 +21,8 @@
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/type_traits.hpp>
-#include "gil_config.hpp"
-#include "gil_concept.hpp"
-#include "channel.hpp"
+
+#include <iterator>
namespace boost { namespace gil {
@@ -115,7 +101,7 @@ template <typename View> struct view_is_basic : public mpl::false_ {};
template <typename Loc> struct view_is_basic<image_view<Loc> > : public locator_is_basic<Loc> {};
/// \ingroup GILIsBasic
-/// \brief Basic images must use basic views and std::allocator of char
+/// \brief Basic images must use basic views and std::allocator
template <typename Img> struct image_is_basic : public mpl::false_ {};
template <typename Pixel, bool IsPlanar, typename Alloc> struct image_is_basic<image<Pixel,IsPlanar,Alloc> > : public mpl::true_ {};
@@ -487,9 +473,6 @@ public:
typedef typename image_type<channel_t, layout_t, planar>::type type;
};
-
-
-
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/packed_pixel.hpp b/boost/gil/packed_pixel.hpp
index 414d5dbbdf..9777f44b13 100644
--- a/boost/gil/packed_pixel.hpp
+++ b/boost/gil/packed_pixel.hpp
@@ -1,37 +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 <boost/gil/pixel.hpp>
-#include <functional>
#include <boost/core/ignore_unused.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/front.hpp>
-#include "gil_config.hpp"
-#include "pixel.hpp"
+
+#include <functional>
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/boost/gil/pixel.hpp b/boost/gil/pixel.hpp
index df48cc667a..ee7c5c5286 100644
--- a/boost/gil/pixel.hpp
+++ b/boost/gil/pixel.hpp
@@ -1,39 +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 <boost/gil/channel.hpp>
+#include <boost/gil/color_base.hpp>
+#include <boost/gil/color_base_algorithm.hpp>
+#include <boost/gil/concepts.hpp>
+#include <boost/gil/metafunctions.hpp>
+#include <boost/gil/utilities.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 September 28, 2006
-///
-////////////////////////////////////////////////////////////////////////////////////////
-
-#include <functional>
#include <boost/core/ignore_unused.hpp>
-#include <boost/utility/enable_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/front.hpp>
#include <boost/type_traits.hpp>
-#include "gil_config.hpp"
-#include "color_base.hpp"
-#include "gil_concept.hpp"
-#include "channel.hpp"
-#include "metafunctions.hpp"
-#include "utilities.hpp"
-#include "color_base_algorithm.hpp"
+#include <boost/utility/enable_if.hpp>
+
+#include <functional>
namespace boost { namespace gil {
@@ -207,10 +195,11 @@ struct channel_type<pixel<ChannelValue,Layout> > {
typedef ChannelValue type;
};
-} } // namespace boost::gil
+}} // namespace boost::gil
namespace boost {
template <typename ChannelValue, typename Layout>
struct has_trivial_constructor<gil::pixel<ChannelValue,Layout> > : public has_trivial_constructor<ChannelValue> {};
}
+
#endif
diff --git a/boost/gil/pixel_iterator.hpp b/boost/gil/pixel_iterator.hpp
index 0353d47668..c5a5e1cf36 100644
--- a/boost/gil/pixel_iterator.hpp
+++ b/boost/gil/pixel_iterator.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).
-
- 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 <boost/gil/concepts.hpp>
+#include <boost/gil/utilities.hpp>
+#include <boost/gil/pixel.hpp>
#include <cassert>
#include <iterator>
-#include "gil_config.hpp"
-#include "gil_concept.hpp"
-#include "utilities.hpp"
-#include "pixel.hpp"
namespace boost { namespace gil {
diff --git a/boost/gil/pixel_iterator_adaptor.hpp b/boost/gil/pixel_iterator_adaptor.hpp
index f488f5693a..3783c5136c 100644
--- a/boost/gil/pixel_iterator_adaptor.hpp
+++ b/boost/gil/pixel_iterator_adaptor.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_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 <boost/gil/concepts.hpp>
+#include <boost/gil/pixel_iterator.hpp>
-#include <iterator>
#include <boost/iterator/iterator_facade.hpp>
-#include "gil_config.hpp"
-#include "gil_concept.hpp"
-#include "pixel_iterator.hpp"
-namespace boost { namespace gil {
+#include <iterator>
+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
@@ -203,6 +188,6 @@ struct iterator_add_deref<dereference_iterator_adaptor<Iterator, PREV_DEREF>,Der
}
};
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/planar_pixel_iterator.hpp b/boost/gil/planar_pixel_iterator.hpp
index 9585e84574..856b3d3fbf 100644
--- a/boost/gil/planar_pixel_iterator.hpp
+++ b/boost/gil/planar_pixel_iterator.hpp
@@ -1,33 +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 <boost/gil/pixel.hpp>
+#include <boost/gil/step_iterator.hpp>
- Use, modification and distribution are subject to the 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 <boost/iterator/iterator_facade.hpp>
#include <cassert>
#include <iterator>
-#include <boost/iterator/iterator_facade.hpp>
-#include "gil_config.hpp"
-#include "pixel.hpp"
-#include "step_iterator.hpp"
namespace boost { namespace gil {
//forward declaration (as this file is included in planar_pixel_reference.hpp)
@@ -114,11 +101,7 @@ private:
void increment() { static_transform(*this,*this,detail::inc<ChannelPtr>()); }
void decrement() { static_transform(*this,*this,detail::dec<ChannelPtr>()); }
-#ifdef BOOST_NO_CXX98_BINDERS
void advance(std::ptrdiff_t d){ static_transform(*this,*this,std::bind(detail::plus_asymmetric<ChannelPtr,std::ptrdiff_t>(),std::placeholders::_1,d)); }
-#else
- void advance(std::ptrdiff_t d){ static_transform(*this,*this,std::bind2nd(detail::plus_asymmetric<ChannelPtr,std::ptrdiff_t>(),d)); }
-#endif
reference dereference() const { return this->template deref<reference>(); }
std::ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); }
diff --git a/boost/gil/planar_pixel_reference.hpp b/boost/gil/planar_pixel_reference.hpp
index 2d71842992..e020650bab 100644
--- a/boost/gil/planar_pixel_reference.hpp
+++ b/boost/gil/planar_pixel_reference.hpp
@@ -1,43 +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 <boost/gil/channel.hpp>
+#include <boost/gil/color_base.hpp>
+#include <boost/gil/concepts.hpp>
+#include <boost/gil/pixel.hpp>
+#include <boost/gil/planar_pixel_iterator.hpp>
#include <boost/mpl/range_c.hpp>
-#include "gil_config.hpp"
-#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.
@@ -46,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 <typename ChannelReference, typename ColorSpace> // ChannelReference is a channel reference (const or mutable)
-struct planar_pixel_reference
+struct planar_pixel_reference
: public detail::homogeneous_color_base<ChannelReference,layout<ColorSpace>,mpl::size<ColorSpace>::value> {
typedef detail::homogeneous_color_base<ChannelReference,layout<ColorSpace>,mpl::size<ColorSpace>::value> parent_t;
private:
@@ -64,7 +50,7 @@ public:
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 <typename P> planar_pixel_reference(const P& p) : parent_t(p) { check_compatible<P>();}
@@ -161,7 +147,7 @@ struct channel_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
typedef typename channel_traits<ChannelReference>::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.
@@ -178,7 +164,6 @@ void swap(const boost::gil::planar_pixel_reference<CR,CS> x, R& y) {
boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
}
-
/// \brief swap for planar_pixel_reference
/// \ingroup PixelModelPlanarRef
template <typename CR, typename CS> inline
@@ -186,13 +171,13 @@ void swap(typename boost::gil::planar_pixel_reference<CR,CS>::value_type& x, con
boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
}
-
/// \brief swap for planar_pixel_reference
/// \ingroup PixelModelPlanarRef
template <typename CR, typename CS> inline
void swap(const boost::gil::planar_pixel_reference<CR,CS> x, const boost::gil::planar_pixel_reference<CR,CS> y) {
boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
}
+
} // namespace std
#endif
diff --git a/boost/gil/point.hpp b/boost/gil/point.hpp
new file mode 100644
index 0000000000..ffba0044e5
--- /dev/null
+++ b/boost/gil/point.hpp
@@ -0,0 +1,277 @@
+//
+// 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_POINT_HPP
+#define BOOST_GIL_POINT_HPP
+
+#include <boost/gil/utilities.hpp>
+
+#include <boost/config.hpp>
+
+#include <cstddef>
+#include <type_traits>
+
+namespace boost { namespace gil {
+
+/// \addtogroup PointModel
+///
+/// Example:
+/// \code
+/// point<std::ptrdiff_t> p(3,2);
+/// assert((p[0] == p.x) && (p[1] == p.y));
+/// assert(axis_value<0>(p) == 3);
+/// assert(axis_value<1>(p) == 2);
+/// \endcode
+
+/// \brief 2D point both axes of which have the same dimension type
+/// \ingroup PointModel
+/// Models: Point2DConcept
+template <typename T>
+class point
+{
+public:
+ using value_type = T;
+
+ template<std::size_t D>
+ struct axis
+ {
+ using coord_t = value_type;
+ };
+
+ static constexpr std::size_t num_dimensions = 2;
+
+ point() = default;
+ point(T px, T py) : x(px), y(py) {}
+
+ point operator<<(std::ptrdiff_t shift) const
+ {
+ return point(x << shift, y << shift);
+ }
+
+ point operator>>(std::ptrdiff_t shift) const
+ {
+ return point(x >> shift, y >> shift);
+ }
+
+ point& operator+=(point const& p)
+ {
+ x += p.x;
+ y += p.y;
+ return *this;
+ }
+
+ point& operator-=(point const& p)
+ {
+ x -= p.x;
+ y -= p.y;
+ return *this;
+ }
+
+ point& operator/=(double d)
+ {
+ if (d < 0 || 0 < d)
+ {
+ x = static_cast<T>(x / d);
+ y = static_cast<T>(y / d);
+ }
+ return *this;
+ }
+
+ point& operator*=(double d)
+ {
+ x = static_cast<T>(x * d);
+ y = static_cast<T>(y * d);
+ return *this;
+ }
+
+ T const& operator[](std::size_t i) const
+ {
+ return this->*mem_array[i];
+ }
+
+ T& operator[](std::size_t i)
+ {
+ return this->*mem_array[i];
+ }
+
+ T x{0};
+ T y{0};
+
+private:
+ // this static array of pointers to member variables makes operator[] safe
+ // and doesn't seem to exhibit any performance penalty.
+ static T point<T>::* const mem_array[num_dimensions];
+};
+
+/// Alias template for backward compatibility with Boost <=1.68.
+template <typename T>
+using point2 = point<T>;
+
+/// Common type to represent 2D dimensions or in-memory size of image or view.
+/// @todo TODO: rename to dims_t or dimensions_t for purpose clarity?
+using point_t = point<std::ptrdiff_t>;
+
+template <typename T>
+T point<T>::* const point<T>::mem_array[point<T>::num_dimensions] =
+{
+ &point<T>::x,
+ &point<T>::y
+};
+
+/// \ingroup PointModel
+template <typename T>
+BOOST_FORCEINLINE
+bool operator==(const point<T>& p1, const point<T>& p2)
+{
+ return p1.x == p2.x && p1.y == p2.y;
+}
+
+/// \ingroup PointModel
+template <typename T>
+BOOST_FORCEINLINE
+bool operator!=(const point<T>& p1, const point<T>& p2)
+{
+ return p1.x != p2.x || p1.y != p2.y;
+}
+
+/// \ingroup PointModel
+template <typename T>
+BOOST_FORCEINLINE
+point<T> operator+(const point<T>& p1, const point<T>& p2)
+{
+ return { p1.x + p2.x, p1.y + p2.y };
+}
+
+/// \ingroup PointModel
+template <typename T>
+BOOST_FORCEINLINE
+point<T> operator-(const point<T>& p)
+{
+ return { -p.x, -p.y };
+}
+
+/// \ingroup PointModel
+template <typename T>
+BOOST_FORCEINLINE
+point<T> operator-(const point<T>& p1, const point<T>& p2)
+{
+ return { p1.x - p2.x, p1.y - p2.y };
+}
+
+/// \ingroup PointModel
+template <typename T, typename D>
+BOOST_FORCEINLINE
+auto operator/(point<T> const& p, D d) -> point<typename std::common_type<T, D>::type>
+{
+ static_assert(std::is_arithmetic<D>::value, "denominator is not arithmetic type");
+ using result_type = typename std::common_type<T, D>::type;
+ if (d < 0 || 0 < d)
+ {
+ double const x = p.x / static_cast<double>(d);
+ double const y = p.y / static_cast<double>(d);
+ return point<result_type>{
+ static_cast<result_type>(iround(x)),
+ static_cast<result_type>(iround(y))};
+ }
+ else
+ {
+ return point<result_type>{0, 0};
+ }
+}
+
+/// \ingroup PointModel
+template <typename T, typename M>
+BOOST_FORCEINLINE
+auto operator*(point<T> const& p, M m) -> point<typename std::common_type<T, M>::type>
+{
+ static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
+ using result_type = typename std::common_type<T, M>::type;
+ return point<result_type>{p.x * m, p.y * m};
+}
+
+/// \ingroup PointModel
+template <typename T, typename M>
+BOOST_FORCEINLINE
+auto operator*(M m, point<T> const& p) -> point<typename std::common_type<T, M>::type>
+{
+ static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
+ using result_type = typename std::common_type<T, M>::type;
+ return point<result_type>{p.x * m, p.y * m};
+}
+
+/// \ingroup PointModel
+template <std::size_t K, typename T>
+BOOST_FORCEINLINE
+T const& axis_value(point<T> const& p)
+{
+ static_assert(K < point<T>::num_dimensions, "axis index out of range");
+ return p[K];
+}
+
+/// \ingroup PointModel
+template <std::size_t K, typename T>
+BOOST_FORCEINLINE
+T& axis_value(point<T>& p)
+{
+ static_assert(K < point<T>::num_dimensions, "axis index out of range");
+ return p[K];
+}
+
+/// \addtogroup PointAlgorithm
+///
+/// Example:
+/// \code
+/// assert(iround(point<double>(3.1, 3.9)) == point<std::ptrdiff_t>(3,4));
+/// \endcode
+
+/// \ingroup PointAlgorithm
+template <typename T>
+inline point<std::ptrdiff_t> iround(point<T> const& p)
+{
+ static_assert(std::is_integral<T>::value, "T is not integer");
+ return { static_cast<std::ptrdiff_t>(p.x), static_cast<std::ptrdiff_t>(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> iround(point<float> const& p)
+{
+ return { iround(p.x), iround(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> iround(point<double> const& p)
+{
+ return { iround(p.x), iround(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> ifloor(point<float> const& p)
+{
+ return { ifloor(p.x), ifloor(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> ifloor(point<double> const& p)
+{
+ return { ifloor(p.x), ifloor(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> iceil(point<float> const& p)
+{
+ return { iceil(p.x), iceil(p.y) };
+}
+
+/// \ingroup PointAlgorithm
+inline point<std::ptrdiff_t> iceil(point<double> const& p)
+{
+ return { iceil(p.x), iceil(p.y) };
+}
+
+}} // namespace boost::gil
+
+#endif
diff --git a/boost/gil/position_iterator.hpp b/boost/gil/position_iterator.hpp
index df97611c15..747123c1ac 100644
--- a/boost/gil/position_iterator.hpp
+++ b/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 <boost/gil/locator.hpp>
#include <boost/iterator/iterator_facade.hpp>
-#include "locator.hpp"
namespace boost { namespace gil {
diff --git a/boost/gil/premultiply.hpp b/boost/gil/premultiply.hpp
index eb865d3af1..e7fb315c65 100644
--- a/boost/gil/premultiply.hpp
+++ b/boost/gil/premultiply.hpp
@@ -1,69 +1,76 @@
-/*
- 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 <iostream>
-
#include <boost/gil/rgba.hpp>
+
+#include <boost/core/ignore_unused.hpp>
+#include <boost/mpl/for_each.hpp>
#include <boost/mpl/remove.hpp>
namespace boost { namespace gil {
template <typename SrcP, typename DstP>
-struct channel_premultiply {
- channel_premultiply (SrcP const & src, DstP & dst)
- : src_ (src), dst_ (dst)
- {}
-
- template <typename Channel>
- 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_));
- }
- SrcP const & src_;
- DstP & dst_;
-};
+struct channel_premultiply
+{
+ channel_premultiply(SrcP const & src, DstP & dst)
+ : src_(src), dst_(dst)
+ {}
+
+ template <typename Channel>
+ void operator()(Channel c) const
+ {
+ // FIXME: Is c input paramater not used intentionally? Add comment on relation between src_ vs c.
+ // @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_));
+ }
+ SrcP const & src_;
+ DstP & dst_;
+};
namespace detail
{
- template <typename SrcP, typename DstP>
- void assign_alpha_if(mpl::true_, SrcP const &src, DstP &dst)
- {
- get_color (dst,alpha_t()) = alpha_or_max (src);
- };
-
- template <typename SrcP, typename DstP>
- void assign_alpha_if(mpl::false_, SrcP const &src, DstP &dst)
- {
- // nothing to do
- };
+ template <typename SrcP, typename DstP>
+ void assign_alpha_if(mpl::true_, SrcP const &src, DstP &dst)
+ {
+ get_color(dst,alpha_t()) = alpha_or_max(src);
+ }
+
+ template <typename SrcP, typename DstP>
+ void assign_alpha_if(mpl::false_, SrcP const& src, DstP& dst)
+ {
+ // nothing to do
+ boost::ignore_unused(src);
+ boost::ignore_unused(dst);
+ }
}
-struct premultiply {
- template <typename SrcP, typename DstP>
- void operator()(const SrcP& src, DstP& dst) const {
- typedef typename color_space_type<SrcP>::type src_colour_space_t;
- typedef typename color_space_type<DstP>::type dst_colour_space_t;
- typedef typename mpl:: remove <src_colour_space_t, alpha_t>:: type src_colour_channels;
-
- typedef mpl::bool_<mpl::contains<dst_colour_space_t, alpha_t>::value> has_alpha_t;
- mpl:: for_each <src_colour_channels> ( channel_premultiply <SrcP, DstP> (src, dst) );
- detail::assign_alpha_if(has_alpha_t(), src, dst);
- }
+struct premultiply
+{
+ template <typename SrcP, typename DstP>
+ void operator()(const SrcP& src, DstP& dst) const
+ {
+ typedef typename color_space_type<SrcP>::type src_colour_space_t;
+ typedef typename color_space_type<DstP>::type dst_colour_space_t;
+ typedef typename mpl::remove <src_colour_space_t, alpha_t>::type src_colour_channels;
+
+ typedef mpl::bool_<mpl::contains<dst_colour_space_t, alpha_t>::value> has_alpha_t;
+ mpl::for_each<src_colour_channels>(channel_premultiply<SrcP, DstP>(src, dst));
+ detail::assign_alpha_if(has_alpha_t(), src, dst);
+ }
};
template <typename SrcConstRefP, // const reference to the source pixel
typename DstP> // 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 +80,17 @@ public:
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 <typename SrcView, typename DstP>
-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<src_pix_ref, DstP> deref_t; // the dereference adaptor that performs color conversion
@@ -92,11 +101,11 @@ public:
};
template <typename DstP, typename View> inline
-typename premultiplied_view_type<View,DstP>::type premultiply_view(const View& src) {
+typename premultiplied_view_type<View,DstP>::type premultiply_view(const View& src)
+{
return premultiplied_view_type<View,DstP>::make(src);
}
- }
-}
+}} // namespace boost::gil
-#endif // BOOST_GIL_PREMULTIPLY_HPP
+#endif
diff --git a/boost/gil/promote_integral.hpp b/boost/gil/promote_integral.hpp
index 82441d4c3b..ea7868ba51 100644
--- a/boost/gil/promote_integral.hpp
+++ b/boost/gil/promote_integral.hpp
@@ -16,16 +16,16 @@
#ifndef BOOST_GIL_PROMOTE_INTEGRAL_HPP
#define BOOST_GIL_PROMOTE_INTEGRAL_HPP
-#include <climits>
-#include <cstddef>
-#include <type_traits>
-
#include <boost/mpl/begin.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/next.hpp>
+#include <climits>
+#include <cstddef>
+#include <type_traits>
+
namespace boost { namespace gil
{
diff --git a/boost/gil/rgb.hpp b/boost/gil/rgb.hpp
index 64e3aca6cd..15d2291710 100644
--- a/boost/gil/rgb.hpp
+++ b/boost/gil/rgb.hpp
@@ -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).
+//
+// 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 <boost/gil/metafunctions.hpp>
+#include <boost/gil/planar_pixel_iterator.hpp>
- 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 <cstddef>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector_c.hpp>
-#include "gil_config.hpp"
-#include "metafunctions.hpp"
-#include "planar_pixel_iterator.hpp"
+
+#include <cstddef>
namespace boost { namespace gil {
@@ -65,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/boost/gil/rgba.hpp b/boost/gil/rgba.hpp
index 209d702e42..ec4fcf5b0c 100644
--- a/boost/gil/rgba.hpp
+++ b/boost/gil/rgba.hpp
@@ -1,30 +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 <boost/gil/planar_pixel_iterator.hpp>
+#include <boost/gil/rgb.hpp>
-#include <cstddef>
-#include "gil_config.hpp"
#include <boost/mpl/contains.hpp>
-#include "rgb.hpp"
-#include "planar_pixel_iterator.hpp"
+#include <boost/mpl/vector.hpp>
+
+#include <cstddef>
namespace boost { namespace gil {
@@ -51,13 +41,14 @@ inline
typename type_from_x_iterator<planar_pixel_iterator<IC,rgba_t> >::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<planar_pixel_iterator<IC,rgba_t> >::view_t RView;
return RView(width, height,
typename RView::locator(planar_pixel_iterator<IC,rgba_t>(r,g,b,a),
rowsize_in_bytes));
}
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/step_iterator.hpp b/boost/gil/step_iterator.hpp
index b62249f3c5..afc465f745 100644
--- a/boost/gil/step_iterator.hpp
+++ b/boost/gil/step_iterator.hpp
@@ -1,34 +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 <boost/gil/pixel_iterator.hpp>
+#include <boost/gil/pixel_iterator_adaptor.hpp>
+#include <boost/gil/utilities.hpp>
- 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 <boost/iterator/iterator_facade.hpp>
#include <cstddef>
#include <iterator>
-#include <boost/iterator/iterator_facade.hpp>
-#include "gil_config.hpp"
-#include "utilities.hpp"
-#include "pixel_iterator.hpp"
-#include "pixel_iterator_adaptor.hpp"
namespace boost { namespace gil {
@@ -36,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
@@ -315,6 +301,6 @@ typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdi
return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor<I>::type());
}
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/typedefs.hpp b/boost/gil/typedefs.hpp
index 09797f29af..d1f5170afa 100644
--- a/boost/gil/typedefs.hpp
+++ b/boost/gil/typedefs.hpp
@@ -9,22 +9,16 @@
#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 "gil_config.hpp"
+#include <boost/gil/cmyk.hpp>
+#include <boost/gil/device_n.hpp>
+#include <boost/gil/gray.hpp>
+#include <boost/gil/point.hpp>
+#include <boost/gil/rgb.hpp>
+#include <boost/gil/rgba.hpp>
#include <cstdint>
#include <memory>
-#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) \
@@ -32,7 +26,7 @@
template <typename, typename> struct planar_pixel_reference; \
template <typename, typename> struct planar_pixel_iterator; \
template <typename> class memory_based_step_iterator; \
- template <typename> class point2; \
+ template <typename> class point; \
template <typename> class memory_based_2d_locator; \
template <typename> class image_view; \
template <typename, bool, typename> class image; \
diff --git a/boost/gil/utilities.hpp b/boost/gil/utilities.hpp
index 977df99839..e17b1ccd7f 100644
--- a/boost/gil/utilities.hpp
+++ b/boost/gil/utilities.hpp
@@ -1,185 +1,94 @@
-/*
- 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_UTILITIES_HPP
+#define BOOST_GIL_UTILITIES_HPP
- See http://opensource.adobe.com/gil for most recent version including documentation.
-*/
-
-/*************************************************************************************************/
-
-#ifndef GIL_UTILITIES_H
-#define GIL_UTILITIES_H
-
-#include "gil_config.hpp"
-#include <functional>
-#include <boost/config/no_tr1/cmath.hpp>
-#include <cstddef>
-#include <algorithm>
-#include <utility>
-#include <iterator>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/mpl/size.hpp>
-#include <boost/mpl/distance.hpp>
#include <boost/mpl/begin.hpp>
+#include <boost/mpl/distance.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/size.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits.hpp>
-////////////////////////////////////////////////////////////////////////////////////////
-/// \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
-///
-///
-////////////////////////////////////////////////////////////////////////////////////////
+#include <algorithm>
+#include <cmath>
+#include <cstddef>
+#include <functional>
+#include <iterator>
+#include <utility>
namespace boost { namespace gil {
-/**
-\addtogroup PointModel
+/// Various utilities not specific to the image library.
+/// Some are non-standard STL extensions or generic iterator adaptors
-Example:
-\code
-point2<std::ptrdiff_t> p(3,2);
-assert((p[0] == p.x) && (p[1] == p.y));
-assert(axis_value<0>(p) == 3);
-assert(axis_value<1>(p) == 2);
-\endcode
-*/
+////////////////////////////////////////////////////////////////////////////////
+/// Rounding of real numbers / points to integers / integer points
+////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////
-// CLASS point2
-///
-/// \brief 2D point both axes of which have the same dimension type
-/// \ingroup PointModel
-/// Models: Point2DConcept
-///
-////////////////////////////////////////////////////////////////////////////////////////
+inline std::ptrdiff_t iround(float x)
+{
+ return static_cast<std::ptrdiff_t>(x + (x < 0.0f ? -0.5f : 0.5f));
+}
-template <typename T>
-class point2 {
-public:
- typedef T value_type;
- template <std::size_t D> struct axis { typedef value_type coord_t; };
- static const std::size_t num_dimensions=2;
-
- point2() : x(0), y(0) {}
- point2(T newX, T newY) : x(newX), y(newY) {}
- point2(const point2& p) : x(p.x), y(p.y) {}
- ~point2() {}
-
- point2& operator=(const point2& p) { x=p.x; y=p.y; return *this; }
-
- point2 operator<<(std::ptrdiff_t shift) const { return point2(x<<shift,y<<shift); }
- point2 operator>>(std::ptrdiff_t shift) const { return point2(x>>shift,y>>shift); }
- point2& operator+=(const point2& p) { x+=p.x; y+=p.y; return *this; }
- point2& operator-=(const point2& p) { x-=p.x; y-=p.y; return *this; }
- point2& operator/=(double t) { if (t<0 || 0<t) { x/=t; y/=t; } return *this; }
-
- const T& operator[](std::size_t i) const { return this->*mem_array[i]; }
- T& operator[](std::size_t i) { return this->*mem_array[i]; }
-
- T x,y;
-private:
- // this static array of pointers to member variables makes operator[] safe and doesn't seem to exhibit any performance penalty
- static T point2<T>::* const mem_array[num_dimensions];
-};
+inline std::ptrdiff_t iround(double x)
+{
+ return static_cast<std::ptrdiff_t>(x + (x < 0.0 ? -0.5 : 0.5));
+}
-template <typename T>
-T point2<T>::* const point2<T>::mem_array[point2<T>::num_dimensions] = { &point2<T>::x, &point2<T>::y };
-
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-bool operator==(const point2<T>& p1, const point2<T>& p2) { return (p1.x==p2.x && p1.y==p2.y); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-bool operator!=(const point2<T>& p1, const point2<T>& p2) { return p1.x!=p2.x || p1.y!=p2.y; }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<T> operator+(const point2<T>& p1, const point2<T>& p2) { return point2<T>(p1.x+p2.x,p1.y+p2.y); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<T> operator-(const point2<T>& p) { return point2<T>(-p.x,-p.y); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<T> operator-(const point2<T>& p1, const point2<T>& p2) { return point2<T>(p1.x-p2.x,p1.y-p2.y); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<double> operator/(const point2<T>& p, double t) { return (t<0 || 0<t) ? point2<double>(p.x/t,p.y/t) : point2<double>(0,0); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<T> operator*(const point2<T>& p, std::ptrdiff_t t) { return point2<T>(p.x*t,p.y*t); }
-/// \ingroup PointModel
-template <typename T> BOOST_FORCEINLINE
-point2<T> operator*(std::ptrdiff_t t, const point2<T>& p) { return point2<T>(p.x*t,p.y*t); }
-
-/// \ingroup PointModel
-template <std::size_t K, typename T> BOOST_FORCEINLINE
-const T& axis_value(const point2<T>& p) { return p[K]; }
-
-/// \ingroup PointModel
-template <std::size_t K, typename T> BOOST_FORCEINLINE
- T& axis_value( point2<T>& p) { return p[K]; }
-
-////////////////////////////////////////////////////////////////////////////////////////
-///
-/// Rounding of real numbers / points to integers / integer points
-///
-////////////////////////////////////////////////////////////////////////////////////////
-
-inline std::ptrdiff_t iround(float x ) { return static_cast<std::ptrdiff_t>(x + (x < 0.0f ? -0.5f : 0.5f)); }
-inline std::ptrdiff_t iround(double x) { return static_cast<std::ptrdiff_t>(x + (x < 0.0 ? -0.5 : 0.5)); }
-inline std::ptrdiff_t ifloor(float x ) { return static_cast<std::ptrdiff_t>(std::floor(x)); }
-inline std::ptrdiff_t ifloor(double x) { return static_cast<std::ptrdiff_t>(std::floor(x)); }
-inline std::ptrdiff_t iceil(float x ) { return static_cast<std::ptrdiff_t>(std::ceil(x)); }
-inline std::ptrdiff_t iceil(double x) { return static_cast<std::ptrdiff_t>(std::ceil(x)); }
-
-/**
-\addtogroup PointAlgorithm
-
-Example:
-\code
-assert(iround(point2<double>(3.1, 3.9)) == point2<std::ptrdiff_t>(3,4));
-\endcode
-*/
-
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> iround(const point2<float >& p) { return point2<std::ptrdiff_t>(iround(p.x),iround(p.y)); }
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> iround(const point2<double>& p) { return point2<std::ptrdiff_t>(iround(p.x),iround(p.y)); }
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> ifloor(const point2<float >& p) { return point2<std::ptrdiff_t>(ifloor(p.x),ifloor(p.y)); }
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> ifloor(const point2<double>& p) { return point2<std::ptrdiff_t>(ifloor(p.x),ifloor(p.y)); }
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> iceil (const point2<float >& p) { return point2<std::ptrdiff_t>(iceil(p.x), iceil(p.y)); }
-/// \ingroup PointAlgorithm
-inline point2<std::ptrdiff_t> iceil (const point2<double>& p) { return point2<std::ptrdiff_t>(iceil(p.x), iceil(p.y)); }
-
-////////////////////////////////////////////////////////////////////////////////////////
-///
+inline std::ptrdiff_t ifloor(float x)
+{
+ return static_cast<std::ptrdiff_t>(std::floor(x));
+}
+
+inline std::ptrdiff_t ifloor(double x)
+{
+ return static_cast<std::ptrdiff_t>(std::floor(x));
+}
+
+inline std::ptrdiff_t iceil(float x)
+{
+ return static_cast<std::ptrdiff_t>(std::ceil(x));
+}
+
+inline std::ptrdiff_t iceil(double x)
+{
+ return static_cast<std::ptrdiff_t>(std::ceil(x));
+}
+
+////////////////////////////////////////////////////////////////////////////////
/// computing size with alignment
-///
-////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
-template <typename T>
-inline T align(T val, std::size_t alignment) {
- return val+(alignment - val%alignment)%alignment;
+template <typename T>
+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 <typename ConstT, typename Value, typename Reference, typename ConstReference,
- typename ArgType, typename ResultType, bool IsMutable>
-struct deref_base {
+template
+<
+ typename ConstT,
+ typename Value,
+ typename Reference,
+ typename ConstReference,
+ typename ArgType,
+ typename ResultType,
+ bool IsMutable
+>
+struct deref_base
+{
typedef ArgType argument_type;
typedef ResultType result_type;
typedef ConstT const_t;
@@ -193,10 +102,16 @@ struct deref_base {
/// \ingroup PixelDereferenceAdaptorModel
///
template <typename D1, typename D2>
-class deref_compose : public deref_base<
+class deref_compose : public deref_base
+<
deref_compose<typename D1::const_t, typename D2::const_t>,
- 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>
+ 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:
D1 _fn1;
@@ -205,35 +120,45 @@ public:
typedef typename D2::argument_type argument_type;
typedef typename D1::result_type result_type;
- deref_compose() {}
+ deref_compose() = default;
deref_compose(const D1& x, const D2& y) : _fn1(x), _fn2(y) {}
deref_compose(const deref_compose& dc) : _fn1(dc._fn1), _fn2(dc._fn2) {}
- template <typename _D1, typename _D2> deref_compose(const deref_compose<_D1,_D2>& dc) : _fn1(dc._fn1), _fn2(dc._fn2) {}
+
+ template <typename _D1, typename _D2>
+ deref_compose(const deref_compose<_D1,_D2>& dc)
+ : _fn1(dc._fn1), _fn2(dc._fn2)
+ {}
result_type operator()(argument_type x) const { return _fn1(_fn2(x)); }
result_type operator()(argument_type x) { return _fn1(_fn2(x)); }
};
// reinterpret_cast is implementation-defined. Static cast is not.
-template <typename OutPtr, typename In> BOOST_FORCEINLINE
- OutPtr gil_reinterpret_cast( In* p) { return static_cast<OutPtr>(static_cast<void*>(p)); }
+template <typename OutPtr, typename In>
+BOOST_FORCEINLINE
+OutPtr gil_reinterpret_cast(In* p)
+{
+ return static_cast<OutPtr>(static_cast<void*>(p));
+}
template <typename OutPtr, typename In> BOOST_FORCEINLINE
-const OutPtr gil_reinterpret_cast_c(const In* p) { return static_cast<const OutPtr>(static_cast<const void*>(p)); }
+const OutPtr gil_reinterpret_cast_c(const In* p)
+{
+ return static_cast<const OutPtr>(static_cast<const void*>(p));
+}
namespace detail {
-////////////////////////////////////////////////////////////////////////////////////////
-///
+////////////////////////////////////////////////////////////////////////////////
/// \brief copy_n taken from SGI STL.
-///
-////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
template <class InputIter, class Size, class OutputIter>
std::pair<InputIter, OutputIter> _copy_n(InputIter first, Size count,
- OutputIter result,
- std::input_iterator_tag) {
- for ( ; count > 0; --count) {
+ OutputIter result, std::input_iterator_tag)
+{
+ for ( ; count > 0; --count)
+ {
*result = *first;
++first;
++result;
@@ -243,100 +168,108 @@ std::pair<InputIter, OutputIter> _copy_n(InputIter first, Size count,
template <class RAIter, class Size, class OutputIter>
inline std::pair<RAIter, OutputIter>
-_copy_n(RAIter first, Size count, OutputIter result, std::random_access_iterator_tag) {
+_copy_n(RAIter first, Size count, OutputIter result, std::random_access_iterator_tag)
+{
RAIter last = first + count;
return std::pair<RAIter, OutputIter>(last, std::copy(first, last, result));
}
template <class InputIter, class Size, class OutputIter>
inline std::pair<InputIter, OutputIter>
-_copy_n(InputIter first, Size count, OutputIter result) {
+_copy_n(InputIter first, Size count, OutputIter result)
+{
return _copy_n(first, count, result, typename std::iterator_traits<InputIter>::iterator_category());
}
template <class InputIter, class Size, class OutputIter>
inline std::pair<InputIter, OutputIter>
-copy_n(InputIter first, Size count, OutputIter result) {
+copy_n(InputIter first, Size count, OutputIter result)
+{
return detail::_copy_n(first, count, result);
}
/// \brief identity taken from SGI STL.
template <typename T>
-struct identity {
+struct identity
+{
typedef T argument_type;
typedef T result_type;
const T& operator()(const T& val) const { return val; }
};
-/*************************************************************************************************/
-
/// \brief plus function object whose arguments may be of different type.
template <typename T1, typename T2>
struct plus_asymmetric {
typedef T1 first_argument_type;
typedef T2 second_argument_type;
typedef T1 result_type;
- T1 operator()(T1 f1, T2 f2) const {
+ T1 operator()(T1 f1, T2 f2) const
+ {
return f1+f2;
}
};
-/*************************************************************************************************/
-
/// \brief operator++ wrapped in a function object
template <typename T>
-struct inc {
+struct inc
+{
typedef T argument_type;
typedef T result_type;
T operator()(T x) const { return ++x; }
};
-/*************************************************************************************************/
-
/// \brief operator-- wrapped in a function object
template <typename T>
-struct dec {
+struct dec
+{
typedef T argument_type;
typedef T result_type;
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 <typename Types, typename T>
-struct type_to_index
- : public mpl::distance<typename mpl::begin<Types>::type,
- typename mpl::find<Types,T>::type>::type {};
+struct type_to_index
+ : public mpl::distance
+ <
+ typename mpl::begin<Types>::type,
+ typename mpl::find<Types,T>::type
+ >::type
+ {
+ };
} // namespace detail
-
-
/// \ingroup ColorSpaceAndLayoutModel
/// \brief Represents a color space and ordering of channels in memory
-template <typename ColorSpace, typename ChannelMapping = mpl::range_c<int,0,mpl::size<ColorSpace>::value> >
-struct layout {
+template <typename ColorSpace, typename ChannelMapping = mpl::range_c<int,0,mpl::size<ColorSpace>::value>>
+struct layout
+{
typedef ColorSpace color_space_t;
typedef ChannelMapping channel_mapping_t;
};
/// \brief A version of swap that also works with reference proxy objects
template <typename Value, typename T1, typename T2> // where value_type<T1> == value_type<T2> == Value
-void swap_proxy(T1& left, T2& right) {
+void swap_proxy(T1& left, T2& right)
+{
Value tmp = left;
left = right;
right = tmp;
}
/// \brief Run-time detection of whether the underlying architecture is little endian
-inline bool little_endian() {
+BOOST_FORCEINLINE bool little_endian()
+{
short tester = 0x0001;
return *(char*)&tester!=0;
}
/// \brief Run-time detection of whether the underlying architecture is big endian
-inline bool big_endian() {
+BOOST_FORCEINLINE bool big_endian()
+{
return !little_endian();
}
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif
diff --git a/boost/gil/version.hpp b/boost/gil/version.hpp
index 660f97e970..5fd5a51577 100644
--- a/boost/gil/version.hpp
+++ b/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
#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/boost/gil/virtual_locator.hpp b/boost/gil/virtual_locator.hpp
index 2e858f3b2c..44997d559d 100644
--- a/boost/gil/virtual_locator.hpp
+++ b/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 <boost/gil/position_iterator.hpp>
#include <boost/iterator/iterator_facade.hpp>
-#include "position_iterator.hpp"
namespace boost { namespace gil {
@@ -131,6 +118,6 @@ struct transposed_type<virtual_2d_locator<D,IsTransposed> > {
typedef virtual_2d_locator<D,1-IsTransposed> type;
};
-} } // namespace boost::gil
+}} // namespace boost::gil
#endif