Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
Vector.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
10
11#pragma once
12
13#include <ostream>
14
15
16namespace optris
17{
18
24template<typename T>
25struct Vector2
26{
28 using ComponentType = T;
29
31 T x;
33 T y;
34};
35
36
41
42
43// Utility functions
52template<typename T>
53inline bool operator==(const Vector2<T>& lhs, const Vector2<T>& rhs) noexcept
54{
55 return lhs.x == rhs.x && lhs.y == rhs.y;
56}
57
66template<typename T>
67inline bool operator!=(const Vector2<T>& lhs, const Vector2<T>& rhs) noexcept
68{
69 return lhs.x != rhs.x || lhs.y != rhs.y;
70}
71
80template<typename T>
81inline Vector2<T> operator+(const Vector2<T>& lhs, const Vector2<T>& rhs) noexcept
82{
83 return {lhs.x + rhs.x, lhs.y + rhs.y};
84}
85
94template<typename T>
95inline Vector2<T> operator-(const Vector2<T>& lhs, const Vector2<T>& rhs) noexcept
96{
97 return {lhs.x - rhs.x, lhs.y - rhs.y};
98}
99
108template<typename T>
109std::ostream& operator<<(std::ostream& out, const Vector2<T>& vector) noexcept
110{
111 return (out << "(" << vector.x << ", " << vector.y << ")");
112}
113
114} // namespace optris
Main SDK namespace.
Definition AlarmChannel.h:21
Vector2< int > Vector2i
Alias for a 2D vector with integer components.
Definition Vector.h:40
OTC_SDK_API std::ostream & operator<<(std::ostream &out, const AlarmChannelConfig &config) noexcept
Output stream operator for alarm channel configurations.
Vector2< T > operator-(const Vector2< T > &lhs, const Vector2< T > &rhs) noexcept
Subtracts two vectors.
Definition Vector.h:95
Vector2< float > Vector2f
Alias for a 2D vector with float components.
Definition Vector.h:38
Vector2< T > operator+(const Vector2< T > &lhs, const Vector2< T > &rhs) noexcept
Adds two vectors together.
Definition Vector.h:81
bool operator!=(const RadiationParameters &lhs, const RadiationParameters &rhs) noexcept
Checks if two radiation parameter sets are unequal.
bool operator==(const RadiationParameters &lhs, const RadiationParameters &rhs) noexcept
Checks if two radiation parameter sets are equal.
Generic 2D vector structure.
Definition Vector.h:26
T ComponentType
Type of the vector components.
Definition Vector.h:28
float x
Definition Vector.h:31
float y
Definition Vector.h:33