Onsens  1.0
This is C++ game about bitwise logic.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BlendMode.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_BLENDMODE_HPP
26#define SFML_BLENDMODE_HPP
27
29// Headers
32
33
34namespace sf
35{
36
42{
49 enum Factor
50 {
60 OneMinusDstAlpha
61 };
62
70 {
73 ReverseSubtract
74 };
75
83
95 BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation = Add);
96
108 BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor,
109 Equation colorBlendEquation, Factor alphaSourceFactor,
110 Factor alphaDestinationFactor, Equation alphaBlendEquation);
111
113 // Member Data
121};
122
133SFML_GRAPHICS_API bool operator ==(const BlendMode& left, const BlendMode& right);
134
145SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right);
146
148// Commonly used blending modes
154
155} // namespace sf
156
157
158#endif // SFML_BLENDMODE_HPP
159
160
#define SFML_GRAPHICS_API
SFML_GRAPHICS_API const BlendMode BlendAdd
Add source to dest.
SFML_GRAPHICS_API const BlendMode BlendAlpha
Blend source and dest according to dest alpha.
SFML_GRAPHICS_API const BlendMode BlendNone
Overwrite dest with source.
SFML_NETWORK_API bool operator==(const IpAddress &left, const IpAddress &right)
Overload of == operator to compare two IP addresses.
SFML_NETWORK_API bool operator!=(const IpAddress &left, const IpAddress &right)
Overload of != operator to compare two IP addresses.
SFML_GRAPHICS_API const BlendMode BlendMultiply
Multiply source and dest.
Blending modes for drawing.
Definition: BlendMode.hpp:42
BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation=Add)
Construct the blend mode given the factors and equation.
Factor colorSrcFactor
Source blending factor for the color channels.
Definition: BlendMode.hpp:115
Equation alphaEquation
Blending equation for the alpha channel.
Definition: BlendMode.hpp:120
BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor, Equation colorBlendEquation, Factor alphaSourceFactor, Factor alphaDestinationFactor, Equation alphaBlendEquation)
Construct the blend mode given the factors and equation.
Equation
Enumeration of the blending equations.
Definition: BlendMode.hpp:70
@ Subtract
Pixel = Src * SrcFactor - Dst * DstFactor.
Definition: BlendMode.hpp:72
@ Add
Pixel = Src * SrcFactor + Dst * DstFactor.
Definition: BlendMode.hpp:71
BlendMode()
Default constructor.
Factor alphaSrcFactor
Source blending factor for the alpha channel.
Definition: BlendMode.hpp:118
Factor alphaDstFactor
Destination blending factor for the alpha channel.
Definition: BlendMode.hpp:119
Factor colorDstFactor
Destination blending factor for the color channels.
Definition: BlendMode.hpp:116
Equation colorEquation
Blending equation for the color channels.
Definition: BlendMode.hpp:117
Factor
Enumeration of the blending factors.
Definition: BlendMode.hpp:50
@ DstColor
(dst.r, dst.g, dst.b, dst.a)
Definition: BlendMode.hpp:55
@ OneMinusSrcColor
(1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
Definition: BlendMode.hpp:54
@ DstAlpha
(dst.a, dst.a, dst.a, dst.a)
Definition: BlendMode.hpp:59
@ One
(1, 1, 1, 1)
Definition: BlendMode.hpp:52
@ OneMinusSrcAlpha
(1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
Definition: BlendMode.hpp:58
@ SrcAlpha
(src.a, src.a, src.a, src.a)
Definition: BlendMode.hpp:57
@ OneMinusDstColor
(1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
Definition: BlendMode.hpp:56
@ SrcColor
(src.r, src.g, src.b, src.a)
Definition: BlendMode.hpp:53
@ Zero
(0, 0, 0, 0)
Definition: BlendMode.hpp:51