Skip to content

Commit

Permalink
fixup! WIP [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebionne committed May 12, 2022
1 parent 9b028da commit 9cc270c
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 68 deletions.
16 changes: 8 additions & 8 deletions include/boost/gil/concepts/image_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ struct RandomAccessNDImageViewConcept
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>>();
gil_function_requires<RandomAccessIterator<iterator>>();
gil_function_requires<RandomAccessIterator<reverse_iterator>>();

using first_it_type = typename View::template axis<0>::iterator;
using last_it_type = typename View::template axis<N-1>::iterator;
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
gil_function_requires<RandomAccessIterator<first_it_type>>();
gil_function_requires<RandomAccessIterator<last_it_type>>();

// static_assert(typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value, "");
// static_assert(typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value, "");
Expand Down Expand Up @@ -399,19 +399,19 @@ struct RandomAccessNDImageViewIsMutableConcept
{
gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();

gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
gil_function_requires<Mutable_RandomAccessIterator<typename View::iterator>>();

gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
gil_function_requires<Mutable_RandomAccessIterator
<
typename View::reverse_iterator
>>();

gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
gil_function_requires<Mutable_RandomAccessIterator
<
typename View::template axis<0>::iterator
>>();

gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
gil_function_requires<Mutable_RandomAccessIterator
<
typename View::template axis<View::num_dimensions - 1>::iterator
>>();
Expand Down
108 changes: 54 additions & 54 deletions include/boost/gil/concepts/pixel_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,48 +43,48 @@ template <typename It> struct iterator_adaptor_get_base;
// Isolating mutability to result in faster compile time
namespace detail {

// Preconditions: TT Models boost_concepts::ForwardTraversalConcept
template <class TT>
struct ForwardIteratorIsMutableConcept
{
void constraints()
{
auto const tmp = *i;
*i++ = tmp; // require postincrement and assignment
}
TT i;
};

// Preconditions: TT Models boost::BidirectionalIteratorConcept
template <class TT>
struct BidirectionalIteratorIsMutableConcept
{
void constraints()
{
gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
auto const tmp = *i;
*i-- = tmp; // require postdecrement and assignment
}
TT i;
};

// Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
template <class TT>
struct RandomAccessIteratorIsMutableConcept
{
void constraints()
{
gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();

typename std::iterator_traits<TT>::difference_type n = 0;
ignore_unused_variable_warning(n);
i[n] = *i; // require element access and assignment
}
TT i;
};
//// Preconditions: TT Models ForwardIterator
//template <class TT>
//struct ForwardIteratorIsMutableConcept
//{
// void constraints()
// {
// auto const tmp = *i;
// *i++ = tmp; // require postincrement and assignment
// }
// TT i;
//};
//
//// Preconditions: TT Models BidirectionalIterator
//template <class TT>
//struct BidirectionalIteratorIsMutableConcept
//{
// void constraints()
// {
// gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
// auto const tmp = *i;
// *i-- = tmp; // require postdecrement and assignment
// }
// TT i;
//};
//
//// Preconditions: TT Models RandomAccessIterator
//template <class TT>
//struct RandomAccessIteratorIsMutableConcept
//{
// void constraints()
// {
// gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();
//
// typename std::iterator_traits<TT>::difference_type n = 0;
// ignore_unused_variable_warning(n);
// i[n] = *i; // require element access and assignment
// }
// TT i;
//};

// Iterators that can be used as the base of memory_based_step_iterator require some additional functions
// \tparam Iterator Models boost_concepts::RandomAccessTraversalConcept
// \tparam Iterator Models RandomAccessIterator
template <typename Iterator>
struct RandomAccessIteratorIsMemoryBasedConcept
{
Expand All @@ -109,7 +109,7 @@ struct PixelIteratorIsMutableConcept
{
void constraints()
{
gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator>>();
gil_function_requires<Mutable_RandomAccessIterator<Iterator>>();

using ref_t = typename std::remove_reference
<
Expand Down Expand Up @@ -155,7 +155,7 @@ struct HasTransposedTypeConcept
///
/// \code
/// concept PixelIteratorConcept<typename Iterator>
/// : boost_concepts::RandomAccessTraversalConcept<Iterator>, PixelBasedConcept<Iterator>
/// : RandomAccessIterator<Iterator>, PixelBasedConcept<Iterator>
/// {
/// where PixelValueConcept<value_type>;
/// typename const_iterator_type<It>::type;
Expand All @@ -169,7 +169,7 @@ struct PixelIteratorConcept
{
void constraints()
{
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
gil_function_requires<RandomAccessIterator<Iterator>>();
gil_function_requires<PixelBasedConcept<Iterator>>();

using value_type = typename std::iterator_traits<Iterator>::value_type;
Expand Down Expand Up @@ -220,7 +220,7 @@ struct MutablePixelIteratorConcept
/// \ingroup PixelIteratorConceptStepIterator
/// \brief Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
/// \code
/// concept MemoryBasedIteratorConcept<boost_concepts::RandomAccessTraversalConcept Iterator>
/// concept MemoryBasedIteratorConcept<RandomAccessIterator Iterator>
/// {
/// typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<Iterator> >;
/// std::ptrdiff_t memunit_step(const Iterator&);
Expand All @@ -235,7 +235,7 @@ struct MemoryBasedIteratorConcept
{
void constraints()
{
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
gil_function_requires<RandomAccessIterator<Iterator>>();
gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator>>();
}
};
Expand All @@ -245,7 +245,7 @@ struct MemoryBasedIteratorConcept
///
/// Step iterators are iterators that have a set_step method
/// \code
/// concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
/// concept StepIteratorConcept<ForwardIterator Iterator>
/// {
/// template <Integral D>
/// void Iterator::set_step(D step);
Expand All @@ -256,7 +256,7 @@ struct StepIteratorConcept
{
void constraints()
{
gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
gil_function_requires<ForwardIterator<Iterator>>();
it.set_step(0);
}
Iterator it;
Expand All @@ -275,7 +275,7 @@ struct MutableStepIteratorConcept
void constraints()
{
gil_function_requires<StepIteratorConcept<Iterator>>();
gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
gil_function_requires<Mutable_ForwardIterator<Iterator>>();
}
};

Expand All @@ -295,17 +295,17 @@ struct MutableStepIteratorConcept
/// The adaptee can be obtained from the iterator via the "base()" method.
///
/// \code
/// concept IteratorAdaptorConcept<boost_concepts::ForwardTraversalConcept Iterator>
/// concept IteratorAdaptorConcept<ForwardIterator Iterator>
/// {
/// where SameType<is_iterator_adaptor<Iterator>::type, std::true_type>;
///
/// typename iterator_adaptor_get_base<Iterator>;
/// where Metafunction<iterator_adaptor_get_base<Iterator> >;
/// where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
/// where ForwardIterator<iterator_adaptor_get_base<Iterator>::type>;
///
/// typename another_iterator;
/// typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
/// where boost_concepts::ForwardTraversalConcept<another_iterator>;
/// where ForwardIterator<another_iterator>;
/// where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
///
/// const iterator_adaptor_get_base<Iterator>::type& Iterator::base() const;
Expand All @@ -316,10 +316,10 @@ struct IteratorAdaptorConcept
{
void constraints()
{
gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
gil_function_requires<ForwardIterator<Iterator>>();

using base_t = typename iterator_adaptor_get_base<Iterator>::type;
gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t>>();
gil_function_requires<ForwardIterator<base_t>>();

static_assert(is_iterator_adaptor<Iterator>::value, "");
using rebind_t = typename iterator_adaptor_rebind<Iterator, void*>::type;
Expand All @@ -342,7 +342,7 @@ struct MutableIteratorAdaptorConcept
void constraints()
{
gil_function_requires<IteratorAdaptorConcept<Iterator>>();
gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
gil_function_requires<Mutable_ForwardIterator<Iterator>>();
}
};

Expand Down
8 changes: 4 additions & 4 deletions include/boost/gil/concepts/pixel_locator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ struct RandomAccessNDLocatorConcept

using first_it_type = typename Loc::template axis<0>::iterator;
using last_it_type = typename Loc::template axis<N-1>::iterator;
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
gil_function_requires<RandomAccessIterator<first_it_type>>();
gil_function_requires<RandomAccessIterator<last_it_type>>();

// point_t must be an N-dimensional point, each dimension of which must
// have the same type as difference_type of the corresponding iterator
Expand Down Expand Up @@ -309,11 +309,11 @@ struct RandomAccessNDLocatorIsMutableConcept
{
void constraints()
{
gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
gil_function_requires<Mutable_RandomAccessIterator
<
typename Loc::template axis<0>::iterator
>>();
gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
gil_function_requires<Mutable_RandomAccessIterator
<
typename Loc::template axis<Loc::num_dimensions-1>::iterator
>>();
Expand Down
4 changes: 2 additions & 2 deletions include/boost/gil/planar_pixel_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct planar_pixel_iterator
stl_interfaces::iterator_interface
<
planar_pixel_iterator<ChannelPtr, ColorSpace>,
pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
std::random_access_iterator_tag,
pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference, ColorSpace> const
>,
detail::homogeneous_color_base
Expand All @@ -60,8 +60,8 @@ struct planar_pixel_iterator
using parent_t = stl_interfaces::iterator_interface
<
planar_pixel_iterator<ChannelPtr, ColorSpace>,
pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
std::random_access_iterator_tag,
pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference, ColorSpace> const
>;

Expand Down

0 comments on commit 9cc270c

Please sign in to comment.