Chris@16: /* Chris@16: Copyright 2005-2007 Adobe Systems Incorporated Chris@16: Chris@16: Use, modification and distribution are subject to the Boost Software License, Chris@16: Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: http://www.boost.org/LICENSE_1_0.txt). Chris@16: Chris@16: See http://opensource.adobe.com/gil for most recent version including documentation. Chris@16: */ Chris@16: Chris@16: /*************************************************************************************************/ Chris@16: Chris@16: #ifndef GIL_APPLY_OPERATION_HPP Chris@16: #define GIL_APPLY_OPERATION_HPP Chris@16: Chris@16: //////////////////////////////////////////////////////////////////////////////////////// Chris@16: /// \file Chris@16: /// \brief Implements apply_operation for variants. Optionally performs type reduction Chris@16: /// \author Lubomir Bourdev and Hailin Jin \n Chris@16: /// Adobe Systems Incorporated Chris@16: /// \date 2005-2007 \n Last updated on May 4, 2006 Chris@16: /// Chris@16: //////////////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #include "apply_operation_base.hpp" Chris@16: #include "variant.hpp" Chris@16: Chris@16: #ifndef GIL_REDUCE_CODE_BLOAT Chris@16: Chris@16: namespace boost { namespace gil { Chris@16: Chris@16: /// \ingroup Variant Chris@16: /// \brief Invokes a generic mutable operation (represented as a unary function object) on a variant Chris@16: template GIL_FORCEINLINE Chris@16: typename UnaryOp::result_type apply_operation(variant& arg, UnaryOp op) { Chris@16: return apply_operation_base(arg._bits, arg._index ,op); Chris@16: } Chris@16: Chris@16: /// \ingroup Variant Chris@16: /// \brief Invokes a generic constant operation (represented as a unary function object) on a variant Chris@16: template GIL_FORCEINLINE Chris@16: typename UnaryOp::result_type apply_operation(const variant& arg, UnaryOp op) { Chris@16: return apply_operation_basec(arg._bits, arg._index ,op); Chris@16: } Chris@16: Chris@16: /// \ingroup Variant Chris@16: /// \brief Invokes a generic constant operation (represented as a binary function object) on two variants Chris@16: template GIL_FORCEINLINE Chris@16: typename BinaryOp::result_type apply_operation(const variant& arg1, const variant& arg2, BinaryOp op) { Chris@16: return apply_operation_base(arg1._bits, arg1._index, arg2._bits, arg2._index, op); Chris@16: } Chris@16: Chris@16: } } // namespace boost::gil Chris@16: Chris@16: #else Chris@16: Chris@16: #include "reduce.hpp" Chris@16: Chris@16: #endif Chris@16: Chris@16: #endif