Namespace ::color::operation::functor

TOC

Description

Objects with operator().
Unary functions
Description
Common modole of all unary functions.
Declaration
       template< typename category_name >
        struct generic_unary_functor
         {
          public:
            typedef category_name  category_type;

            typedef ::color::trait::index< category_type >       index_trait_type;
            typedef ::color::trait::container< category_type >   container_trait_type;

            typedef ::color::model< category_type >  model_type;

            typedef model_type  result_type;
            typedef model_type  left_type, first_argument_type;
            typedef model_type  right_type, second_argument_type;

            typedef typename index_trait_type::instance_type        index_type;

            typedef ::color::operation::functor::generic_binary_functor< category_type > this_type;

          public:
                   model_type   operator()( model_type const& right )const;
                   model_type & operator()( model_type & result, model_type const& right )const;

          public:
            static model_type   process( model_type const& right );
            static model_type & process( model_type & result, model_type const& right );
         };
							
Binary functions
Description
Common modole of all unary functions.
Declaration
       template< typename category_name >
        struct generic_binary_functor
         {
          public:
            typedef category_name  category_type;

            typedef ::color::trait::index< category_type >       index_trait_type;
            typedef ::color::trait::container< category_type >   container_trait_type;

            typedef ::color::model< category_type >  model_type;

            typedef model_type  result_type;
            typedef model_type  left_type, first_argument_type;
            typedef model_type  right_type, second_argument_type;

            typedef typename index_trait_type::instance_type        index_type;

            typedef ::color::operation::functor::generic_binary_functor< category_type > this_type;

          public:
            model_type  operator()( model_type const& left, model_type const&right )const;
            model_type& operator()( model_type & result, model_type const& left, model_type const&right )const;

          public:
            static model_type  accumulate( model_type &result, model_type const& right );

            static model_type   process(    model_type const& left, model_type const& right );
            static model_type & process(   model_type & result, model_type const& left, model_type const&right  );
         };
							

List:

Name
addition
Declaration
Same as generic_unary_functor
Description
Per coordinate addition of two colors.
Example:
typedef ::color::rgb<double> color_t;
color_t a{ constant::orange_t{} }, b{ constant::lime_t{} }, r{ constant::blue_t{}
::color::operation::functor::addition<color_t::category_type>{}( r, a );
::color::operation::functor::addition<color_t::category_type>{}( r, a, b );

Name
divide
Declaration
TODO
Description
TODO.
Example:
TODO

Name
invert
Declaration
TODO
Description
TODO.
Example:
TODO

Name
multiply
Declaration
TODO
Description
TODO.
Example:
TODO

Name
scale
Declaration
TODO
Description
TODO.
Example:
TODO

Name
subtract
Declaration
TODO
Description
TODO.
Example:
TODO

Name
TODO
Declaration
TODO
Description
TODO.
Example:
TODO