diff options
Diffstat (limited to 'basebmp/inc/basebmp/colortraits.hxx')
-rw-r--r-- | basebmp/inc/basebmp/colortraits.hxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/basebmp/inc/basebmp/colortraits.hxx b/basebmp/inc/basebmp/colortraits.hxx index ba6a4cfeee27..4fb75caa7f6d 100644 --- a/basebmp/inc/basebmp/colortraits.hxx +++ b/basebmp/inc/basebmp/colortraits.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,10 +44,10 @@ namespace basebmp When true, 0 means fully transparent, and 1 fully opaque. And vice versa. */ -template< typename ValueType, +template< typename ValueType, typename AlphaType, bool polarity > struct BlendFunctor; -template< typename ValueType, +template< typename ValueType, typename AlphaType > struct BlendFunctor<ValueType,AlphaType,true> : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType> { @@ -60,7 +60,7 @@ template< typename ValueType, return (vigra::NumericTraits<AlphaType>::one()-fAlpha)*v1 + fAlpha*v2; } }; -template< typename ValueType, +template< typename ValueType, typename AlphaType > struct BlendFunctor<ValueType,AlphaType,false> : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType> { @@ -79,12 +79,12 @@ template< typename ValueType, @tpl polarity When true, 0 means fully transparent, and 1 fully opaque. And vice - versa. + versa. */ -template< typename ValueType, +template< typename ValueType, typename AlphaType, bool polarity > struct IntegerBlendFunctor; -template< typename ValueType, +template< typename ValueType, typename AlphaType > struct IntegerBlendFunctor<ValueType,AlphaType,true> : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType> { @@ -97,7 +97,7 @@ template< typename ValueType, vigra::NumericTraits<AlphaType>::max(); } }; -template< typename ValueType, +template< typename ValueType, typename AlphaType > struct IntegerBlendFunctor<ValueType,AlphaType,false> : public TernaryFunctorBase<AlphaType,ValueType,ValueType,ValueType> { @@ -105,7 +105,7 @@ template< typename ValueType, ValueType v1, ValueType v2 ) const { - return (alpha*v1 + + return (alpha*v1 + vigra::NumericTraits<AlphaType>::toPromote( vigra::NumericTraits<AlphaType>::max()-alpha)*v2) / vigra::NumericTraits<AlphaType>::max(); @@ -129,18 +129,18 @@ template< typename ColorType > struct ColorTraits typedef ColorType component_type; /// Calculate normalized distance between color c1 and c2 - static inline vigra::NormTraits<ColorType> distance( ColorType c1, - ColorType c2 ) - { + static inline vigra::NormTraits<ColorType> distance( ColorType c1, + ColorType c2 ) + { return vigra::norm(c1 - c2); } - static inline component_type toGreyscale( ColorType c ) + static inline component_type toGreyscale( ColorType c ) { return c; } - static inline ColorType fromGreyscale( component_type c ) + static inline ColorType fromGreyscale( component_type c ) { return c; } |