// // 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_PIXEL_DEREFERENCE_HPP #define BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP #include #include #include #include #include #include #include #include #if defined(BOOST_CLANG) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wunused-local-typedefs" #endif #if defined(BOOST_GCC) && (BOOST_GCC >= 40900) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #endif namespace boost { namespace gil { /// \ingroup PixelDereferenceAdaptorConcept /// \brief Represents a unary function object that can be invoked upon dereferencing a pixel iterator. /// /// This can perform an arbitrary computation, such as color conversion or table lookup. /// \code /// concept PixelDereferenceAdaptorConcept /// : DefaultConstructibleConcept, CopyConstructibleConcept, AssignableConcept /// { /// typename const_t; where PixelDereferenceAdaptorConcept; /// typename value_type; where PixelValueConcept; /// typename reference; // may be mutable /// typename const_reference; // must not be mutable /// static const bool D::is_mutable; /// /// where Convertible; /// }; /// \endcode template struct PixelDereferenceAdaptorConcept { void constraints() { gil_function_requires < boost::UnaryFunctionConcept < D, typename detail::remove_const_and_reference::type, typename D::argument_type > >(); gil_function_requires>(); gil_function_requires>(); gil_function_requires>(); gil_function_requires::type >>(); using const_t = typename D::const_t; gil_function_requires>(); using value_type = typename D::value_type; gil_function_requires>(); // TODO: Should this be concept-checked after "if you remove const and reference"? --mloskot using reference = typename D::reference; // == PixelConcept (if you remove const and reference) using const_reference = typename D::const_reference; // == PixelConcept (if you remove const and reference) bool const is_mutable = D::is_mutable; ignore_unused_variable_warning(is_mutable); } D d; }; template struct PixelDereferenceAdaptorArchetype { using argument_type = P; using result_type = P; using const_t = PixelDereferenceAdaptorArchetype; using value_type = typename std::remove_reference

::type; using reference = typename std::add_lvalue_reference

::type; using const_reference = reference; static const bool is_mutable = false; P operator()(P) const { throw; } }; }} // namespace boost::gil #if defined(BOOST_CLANG) #pragma clang diagnostic pop #endif #if defined(BOOST_GCC) && (BOOST_GCC >= 40900) #pragma GCC diagnostic pop #endif #endif