Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Renamed io/dynamic_io_new.hpp to io/detail/dynamic.hpp #653

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/bmp/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include <boost/gil/extension/io/bmp/detail/is_allowed.hpp>
#include <boost/gil/extension/io/bmp/detail/reader_backend.hpp>

#include <boost/gil/io/detail/dynamic.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/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
Expand Down Expand Up @@ -709,7 +709,7 @@ class dynamic_image_reader< Device
{
detail::bmp_type_format_checker format_checker( this->_info._bits_per_pixel );

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/bmp/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/jpeg/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include <boost/gil/extension/io/jpeg/detail/base.hpp>
#include <boost/gil/extension/io/jpeg/detail/is_allowed.hpp>

#include <boost/gil/io/detail/dynamic.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/typedefs.hpp>

Expand Down Expand Up @@ -284,7 +284,7 @@ class dynamic_image_reader< Device
: JCS_RGB
);

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/jpeg/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/png/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include <boost/gil/extension/io/png/detail/is_allowed.hpp>

#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/detail/dynamic.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/conversion_policies.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>
#include <boost/gil/io/error.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
Expand Down Expand Up @@ -416,7 +416,7 @@ class dynamic_image_reader< Device
, this->_info._color_type
);

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/png/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <boost/gil/extension/io/png/detail/writer_backend.hpp>

#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/detail/mp11.hpp>

Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/pnm/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include <boost/gil/extension/io/pnm/detail/is_allowed.hpp>

#include <boost/gil.hpp> // FIXME: Include what you use!
#include <boost/gil/io/detail/dynamic.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/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
Expand Down Expand Up @@ -421,7 +421,7 @@ class dynamic_image_reader< Device
{
detail::pnm_type_format_checker format_checker( this->_info._type );

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/pnm/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/bit_operations.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>
#include <boost/gil/detail/mp11.hpp>

#include <cstdlib>
Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/raw/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include <boost/gil/extension/io/raw/detail/is_allowed.hpp>
#include <boost/gil/extension/io/raw/detail/reader_backend.hpp>

#include <boost/gil/io/detail/dynamic.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/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
Expand Down Expand Up @@ -205,7 +205,7 @@ class dynamic_image_reader< Device
{
detail::raw_type_format_checker format_checker( this->_info );

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/extension/io/targa/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include <boost/gil/extension/io/targa/detail/reader_backend.hpp>
#include <boost/gil/extension/io/targa/detail/is_allowed.hpp>

#include <boost/gil/io/detail/dynamic.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/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/typedefs.hpp>
Expand Down Expand Up @@ -367,7 +367,7 @@ class dynamic_image_reader< Device
{
detail::targa_type_format_checker format_checker( this->_info._bits_per_pixel );

if( !construct_matched( images
if( !detail::construct_matched( images
, format_checker
))
{
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/targa/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>

#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion include/boost/gil/extension/io/tiff/detail/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include <boost/gil/extension/io/tiff/detail/is_allowed.hpp>
#include <boost/gil/extension/io/tiff/detail/reader_backend.hpp>

#include <boost/gil/io/detail/dynamic.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/dynamic_io_new.hpp>
#include <boost/gil/io/reader_base.hpp>
#include <boost/gil/io/row_buffer_helper.hpp>

Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/io/tiff/detail/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <boost/gil/premultiply.hpp>
#include <boost/gil/io/base.hpp>
#include <boost/gil/io/device.hpp>
#include <boost/gil/io/dynamic_io_new.hpp>

#include <algorithm>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// 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
#ifndef BOOST_GIL_IO_DETAIL_DYNAMIC_HPP
#define BOOST_GIL_IO_DETAIL_DYNAMIC_HPP

#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>

Expand All @@ -15,14 +15,12 @@

#include <type_traits>

namespace boost { namespace gil {

namespace detail {
namespace boost { namespace gil { namespace detail {

template <long N>
struct construct_matched_t
{
template <typename ...Images,typename Pred>
template <typename ...Images, typename Pred>
static bool apply(any_image<Images...>& img, Pred pred)
{
if (pred.template apply<mp11::mp_at_c<any_image<Images...>, N-1>>())
Expand All @@ -39,8 +37,8 @@ struct construct_matched_t
template <>
struct construct_matched_t<0>
{
template <typename ...Images,typename Pred>
static bool apply(any_image<Images...>&,Pred) { return false; }
template <typename ...Images, typename Pred>
static bool apply(any_image<Images...>&, Pred) { return false; }
};

// A function object that can be passed to apply_operation.
Expand Down Expand Up @@ -81,24 +79,22 @@ class dynamic_io_fnobj
apply(view, typename IsSupported::template apply<View>::type());
}

template< typename View, typename Info >
template <typename View, typename Info>
void operator()(View const& view, Info const& info)
{
apply(view, info, typename IsSupported::template apply<View>::type());
}
};

} // namespace detail

/// \brief Within the any_image, constructs an image with the given dimensions
/// and a type that satisfies the given predicate
template <typename ...Images,typename Pred>
template <typename ...Images, typename Pred>
inline bool construct_matched(any_image<Images...>& img, Pred pred)
{
constexpr auto size = mp11::mp_size<any_image<Images...>>::value;
return detail::construct_matched_t<size>::apply(img, pred);
return construct_matched_t<size>::apply(img, pred);
}

} } // namespace boost::gil
} } } // namespace boost::gil::detail

#endif