Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Stop.hpp
1// INFINITY_API_PUBLIC
2
3#pragma once
4
5#include <Infinity/Types/Math/Vector2.hpp>
6#include <Infinity/Types/Math/Vector3.hpp>
7#include <Infinity/Types/Math/Vector4.hpp>
8
10{
11
62 template<typename T>
63 struct INFINITY_API_TEMPLATE Stop
64 {
72 float position;
73
81
87 Stop() = default;
88
100 Stop(float position, T value) : position(position), value(value) { }
101
110 bool operator==(const Stop<T>& other) const
111 {
112 return position == other.position && value == other.value;
113 }
114
121 bool operator!=(const Stop<T>& other) const
122 {
123 return !(*this == other);
124 }
125
141 bool operator<(const Stop<T>& other) const
142 {
143 return position < other.position;
144 }
145
154 bool operator>(const Stop<T>& other) const
155 {
156 return position > other.position;
157 }
158
167 bool operator<=(const Stop<T>& other) const
168 {
169 return position <= other.position;
170 }
171
180 bool operator>=(const Stop<T>& other) const
181 {
182 return position >= other.position;
183 }
184 };
185
197
208
220
231
251 template<typename T>
252 inline std::ostream& operator<<(std::ostream& out, const Stop<T>& s)
253 {
254 out << s.position << " " << s.value;
255 return out;
256 }
257
275 template<typename T>
276 inline std::istream& operator>>(std::istream& in, Stop<T>& s)
277 {
278 in >> s.position >> s.value;
279 return in;
280 }
281}
282
283// Register Value<Stop> specializations in the type system
Template wrapper for primitive types to integrate with the Infinity type system.
Definition Value.hpp:89
Definition Math.hpp:9
std::istream & operator>>(std::istream &in, t_Matrix3< T > &m)
Stream extraction operator for single-line text input.
Definition Matrix3.hpp:726
std::ostream & operator<<(std::ostream &out, const t_Matrix3< T > &m)
Stream insertion operator for single-line text output.
Definition Matrix3.hpp:709
Represents a control point in a gradient or interpolation ramp.
Definition Stop.hpp:64
bool operator<(const Stop< T > &other) const
Less-than comparison operator based on position.
Definition Stop.hpp:141
bool operator!=(const Stop< T > &other) const
Inequality comparison operator.
Definition Stop.hpp:121
bool operator<=(const Stop< T > &other) const
Less-than-or-equal comparison operator based on position.
Definition Stop.hpp:167
bool operator>(const Stop< T > &other) const
Greater-than comparison operator based on position.
Definition Stop.hpp:154
Stop(float position, T value)
Constructs a stop with specified position and value.
Definition Stop.hpp:100
float position
Position of the stop along the parameter axis.
Definition Stop.hpp:72
Stop()=default
Default constructor.
T value
Value associated with this stop.
Definition Stop.hpp:80
bool operator==(const Stop< T > &other) const
Equality comparison operator.
Definition Stop.hpp:110
bool operator>=(const Stop< T > &other) const
Greater-than-or-equal comparison operator based on position.
Definition Stop.hpp:180