diff options
Diffstat (limited to 'include/SFML/Graphics/BlendMode.hpp')
-rw-r--r-- | include/SFML/Graphics/BlendMode.hpp | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/include/SFML/Graphics/BlendMode.hpp b/include/SFML/Graphics/BlendMode.hpp index 15da7d1..415ff42 100644 --- a/include/SFML/Graphics/BlendMode.hpp +++ b/include/SFML/Graphics/BlendMode.hpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. @@ -48,16 +48,16 @@ struct SFML_GRAPHICS_API BlendMode //////////////////////////////////////////////////////// enum Factor { - Zero, ///< (0, 0, 0, 0) - One, ///< (1, 1, 1, 1) - SrcColor, ///< (src.r, src.g, src.b, src.a) - OneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a) - DstColor, ///< (dst.r, dst.g, dst.b, dst.a) - OneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a) - SrcAlpha, ///< (src.a, src.a, src.a, src.a) - OneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a) - DstAlpha, ///< (dst.a, dst.a, dst.a, dst.a) - OneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a) + Zero, //!< (0, 0, 0, 0) + One, //!< (1, 1, 1, 1) + SrcColor, //!< (src.r, src.g, src.b, src.a) + OneMinusSrcColor, //!< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a) + DstColor, //!< (dst.r, dst.g, dst.b, dst.a) + OneMinusDstColor, //!< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a) + SrcAlpha, //!< (src.a, src.a, src.a, src.a) + OneMinusSrcAlpha, //!< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a) + DstAlpha, //!< (dst.a, dst.a, dst.a, dst.a) + OneMinusDstAlpha //!< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a) }; //////////////////////////////////////////////////////// @@ -68,9 +68,11 @@ struct SFML_GRAPHICS_API BlendMode //////////////////////////////////////////////////////// enum Equation { - Add, ///< Pixel = Src * SrcFactor + Dst * DstFactor - Subtract, ///< Pixel = Src * SrcFactor - Dst * DstFactor - ReverseSubtract ///< Pixel = Dst * DstFactor - Src * SrcFactor + Add, //!< Pixel = Src * SrcFactor + Dst * DstFactor + Subtract, //!< Pixel = Src * SrcFactor - Dst * DstFactor + ReverseSubtract, //!< Pixel = Dst * DstFactor - Src * SrcFactor + Min, //!< Pixel = min(Dst, Src) + Max //!< Pixel = max(Dst, Src) }; //////////////////////////////////////////////////////////// @@ -112,12 +114,12 @@ struct SFML_GRAPHICS_API BlendMode //////////////////////////////////////////////////////////// // Member Data //////////////////////////////////////////////////////////// - Factor colorSrcFactor; ///< Source blending factor for the color channels - Factor colorDstFactor; ///< Destination blending factor for the color channels - Equation colorEquation; ///< Blending equation for the color channels - Factor alphaSrcFactor; ///< Source blending factor for the alpha channel - Factor alphaDstFactor; ///< Destination blending factor for the alpha channel - Equation alphaEquation; ///< Blending equation for the alpha channel + Factor colorSrcFactor; //!< Source blending factor for the color channels + Factor colorDstFactor; //!< Destination blending factor for the color channels + Equation colorEquation; //!< Blending equation for the color channels + Factor alphaSrcFactor; //!< Source blending factor for the alpha channel + Factor alphaDstFactor; //!< Destination blending factor for the alpha channel + Equation alphaEquation; //!< Blending equation for the alpha channel }; //////////////////////////////////////////////////////////// @@ -147,10 +149,12 @@ SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right //////////////////////////////////////////////////////////// // Commonly used blending modes //////////////////////////////////////////////////////////// -SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha -SFML_GRAPHICS_API extern const BlendMode BlendAdd; ///< Add source to dest -SFML_GRAPHICS_API extern const BlendMode BlendMultiply; ///< Multiply source and dest -SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with source +SFML_GRAPHICS_API extern const BlendMode BlendAlpha; //!< Blend source and dest according to dest alpha +SFML_GRAPHICS_API extern const BlendMode BlendAdd; //!< Add source to dest +SFML_GRAPHICS_API extern const BlendMode BlendMultiply; //!< Multiply source and dest +SFML_GRAPHICS_API extern const BlendMode BlendMin; //!< Take minimum between source and dest +SFML_GRAPHICS_API extern const BlendMode BlendMax; //!< Take maximum between source and dest +SFML_GRAPHICS_API extern const BlendMode BlendNone; //!< Overwrite dest with source } // namespace sf |