diff options
Diffstat (limited to 'boost/gil/extension/io/jpeg')
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/base.hpp | 38 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/is_allowed.hpp | 25 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/read.hpp | 53 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/reader_backend.hpp | 58 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/scanline_read.hpp | 49 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/supported_types.hpp | 37 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/write.hpp | 50 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/detail/writer_backend.hpp | 39 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/old.hpp | 61 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/read.hpp | 39 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/tags.hpp | 35 | ||||
-rw-r--r-- | boost/gil/extension/io/jpeg/write.hpp | 26 |
12 files changed, 182 insertions, 328 deletions
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 |