Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
ImageIterator.h
Go to the documentation of this file.
1// Copyright (c) 2025 Optris GmbH Co. KG
2
10
11#pragma once
12
13#include <vector>
14
15#include "otcsdk/Api.h"
17#include "otcsdk/common/Pixel.h"
18
19
20namespace optris
21{
22
23// Forward declaration
24class Image;
25
26
33{
34public:
36 using Container = std::vector<unsigned char>;
37
38
44 OTC_SDK_API explicit ImageIterator(Image& image) noexcept;
45
46
52 bool hasNext() const noexcept;
53
56
57
63 OTC_SDK_API Pixel getPixel() const noexcept;
64
70 OTC_SDK_API void setPixel(const Pixel& pixel) noexcept;
71
77 int getIndex() const noexcept;
78
84 int getX() const noexcept;
85
91 int getY() const noexcept;
92
93
94private:
95 Container::iterator _iterator;
96 Container::iterator _end;
97
98 ImageInfo _info;
99
100 int _index;
101 int _x;
102 int _y;
103};
104
105
112{
113public:
115 using Container = std::vector<unsigned char>;
116
117
123 OTC_SDK_API explicit ConstImageIterator(const Image& image) noexcept;
124
125
131 bool hasNext() const noexcept;
132
135
141 OTC_SDK_API Pixel getPixel() const noexcept;
142
148 int getIndex() const noexcept;
149
155 int getX() const noexcept;
156
162 int getY() const noexcept;
163
164
165private:
166 Container::const_iterator _iterator;
167 Container::const_iterator _end;
168
169 ImageInfo _info;
170
171 int _index;
172 int _x;
173 int _y;
174};
175
176
177// Inline implementations
178inline bool ImageIterator::hasNext() const noexcept
179{
180 return _iterator != _end;
181}
182
183inline int ImageIterator::getIndex() const noexcept
184{
185 return _index;
186}
187
188inline int ImageIterator::getX() const noexcept
189{
190 return _x;
191}
192
193inline int ImageIterator::getY() const noexcept
194{
195 return _y;
196}
197
198inline bool ConstImageIterator::hasNext() const noexcept
199{
200 return _iterator != _end;
201}
202
203inline int ConstImageIterator::getIndex() const noexcept
204{
205 return _index;
206}
207
208inline int ConstImageIterator::getX() const noexcept
209{
210 return _x;
211}
212
213inline int ConstImageIterator::getY() const noexcept
214{
215 return _y;
216}
217
218} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains a class holding detail information about the properties of a false color image.
Contains a class encapsulating a pixel with three color channels and 8 bits of color depth.
OTC_SDK_API Pixel getPixel() const noexcept
Returns the current pixel.
bool hasNext() const noexcept
Returns whether there is a next pixel.
Definition ImageIterator.h:198
int getY() const noexcept
Returns the y-coordinate of the current pixel.
Definition ImageIterator.h:213
std::vector< unsigned char > Container
Container type storing the pixel values.
Definition ImageIterator.h:115
int getIndex() const noexcept
Returns the current pixel index.
Definition ImageIterator.h:203
OTC_SDK_API void next()
Moves to the next pixel.
OTC_SDK_API ConstImageIterator(const Image &image) noexcept
Constructor.
int getX() const noexcept
Returns the x-coordinate of the current pixel.
Definition ImageIterator.h:208
Encapsulates all relevant information about a false color image.
Definition ImageInfo.h:57
OTC_SDK_API Pixel getPixel() const noexcept
Returns the current pixel.
int getX() const noexcept
Returns the x-coordinate of the current pixel.
Definition ImageIterator.h:188
OTC_SDK_API void next()
Moves to the next pixel.
int getIndex() const noexcept
Returns the current pixel index.
Definition ImageIterator.h:183
bool hasNext() const noexcept
Returns whether there is a next pixel.
Definition ImageIterator.h:178
std::vector< unsigned char > Container
Container type storing the pixel values.
Definition ImageIterator.h:36
OTC_SDK_API ImageIterator(Image &image) noexcept
Constructor.
OTC_SDK_API void setPixel(const Pixel &pixel) noexcept
Sets the current pixel.
int getY() const noexcept
Returns the y-coordinate of the current pixel.
Definition ImageIterator.h:193
Encapsulates false color images with 8-bit color depth.
Definition Image.h:38
Represents a pixel with three color channels and 8 bits of color depth.
Definition Pixel.h:22
Main SDK namespace.
Definition DeviceInfo.h:23