Пример #1
0
            inline InputT find_format_copy_impl2(
                const InputT& Input,
                FormatterT Formatter,
                const FindResultT& FindResult,
                const FormatResultT& FormatResult)
            {
                typedef find_format_store<
                    BOOST_STRING_TYPENAME 
                        range_const_iterator<InputT>::type, 
                        FormatterT,
                        FormatResultT > store_type;

                // Create store for the find result
                store_type M( FindResult, FormatResult, Formatter );

                if ( !M )
                {
                    // Match not found - return original sequence
                    return InputT( Input );
                }

                InputT Output;
                // Copy the beginning of the sequence
                pdalboost::algorithm::detail::insert( Output, ::pdalboost::end(Output), ::pdalboost::begin(Input), M.begin() );
                // Copy formatted result
                pdalboost::algorithm::detail::insert( Output, ::pdalboost::end(Output), M.format_result() );
                // Copy the rest of the sequence
                pdalboost::algorithm::detail::insert( Output, ::pdalboost::end(Output), M.end(), ::pdalboost::end(Input) );

                return Output;
            }
Пример #2
0
float NormalizeColor(InputT input) {
	return float(input) / float(InputT(-1));
}