Thermal Camera SDK 11.4.10
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
ImageInfo.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
12#pragma once
13
14#include "otcsdk/Api.h"
15
16
17namespace optris
18{
19
31enum class ColorFormat
32{
33 RGB,
34 BGR,
35 BGRA,
38};
39
50{
51 OneByte = 1,
52 TwoBytes = 2,
53 FourBytes = 4,
54 EightBytes = 8,
55};
56
57
60{
61public:
68 OTC_SDK_API ImageInfo(ColorFormat colorFormat, WidthAlignment widthAlignment) noexcept;
69
70
76 ColorFormat getColorFormat() const noexcept;
77
83 int getChannels() const noexcept;
84
90 int getOffsetRed() const noexcept;
91
97 int getOffsetGreen() const noexcept;
98
104 int getOffsetBlue() const noexcept;
105
113 int getOffsetAlpha() const noexcept;
114
115
121 OTC_SDK_API int resize(int width, int height);
122
128 int getWidth() const noexcept;
129
137 int getStride() const noexcept;
138
144 int getHeight() const noexcept;
145
151 int getSize() const noexcept;
152
153
159 WidthAlignment getWidthAlignment() const noexcept;
160
166 int getWidthPaddingInBytes() const noexcept;
167
168
169private:
170 ColorFormat _colorFormat;
171
172 int _channels;
173
174 int _offsetRed;
175 int _offsetBlue;
176
177 int _width;
178 int _stride;
179 int _height;
180 int _size;
181
182 int _widthAlignment;
183 int _widthPaddingInBytes;
184};
185
186
187// Inline implementations
188inline ColorFormat ImageInfo::getColorFormat() const noexcept
189{
190 return _colorFormat;
191}
192
193inline int ImageInfo::getChannels() const noexcept
194{
195 return _channels;
196}
197
198inline int ImageInfo::getOffsetRed() const noexcept
199{
200 return _offsetRed;
201}
202
203inline int ImageInfo::getOffsetGreen() const noexcept
204{
205 return 1;
206}
207
208inline int ImageInfo::getOffsetBlue() const noexcept
209{
210 return _offsetBlue;
211}
212
213inline int ImageInfo::getOffsetAlpha() const noexcept
214{
215 return 3;
216}
217
218inline int ImageInfo::getWidth() const noexcept
219{
220 return _width;
221}
222
223inline int ImageInfo::getStride() const noexcept
224{
225 return _stride;
226}
227
228inline int ImageInfo::getHeight() const noexcept
229{
230 return _height;
231}
232
233inline int ImageInfo::getSize() const noexcept
234{
235 return _size;
236}
237
239{
240 return static_cast<WidthAlignment>(_widthAlignment);
241}
242
243inline int ImageInfo::getWidthPaddingInBytes() const noexcept
244{
245 return _widthPaddingInBytes;
246}
247
248} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
Encapsulates all relevant information about a false color image.
Definition ImageInfo.h:60
int getStride() const noexcept
Returns the image stride in bytes.
Definition ImageInfo.h:223
int getWidthPaddingInBytes() const noexcept
Returns width padding in bytes.
Definition ImageInfo.h:243
int getWidth() const noexcept
Returns the image width in pixels.
Definition ImageInfo.h:218
int getSize() const noexcept
Returns the image size in pixels.
Definition ImageInfo.h:233
WidthAlignment getWidthAlignment() const noexcept
Returns the width alignment of the image.
Definition ImageInfo.h:238
ColorFormat getColorFormat() const noexcept
Returns the color format of the image.
Definition ImageInfo.h:188
int getHeight() const noexcept
Returns the image height in pixels.
Definition ImageInfo.h:228
OTC_SDK_API int resize(int width, int height)
Resizes the image to the given dimension.
int getChannels() const noexcept
Returns the number of color channels.
Definition ImageInfo.h:193
int getOffsetGreen() const noexcept
Returns the offset of the green color byte.
Definition ImageInfo.h:203
int getOffsetAlpha() const noexcept
Returns the offset of the alpha byte.
Definition ImageInfo.h:213
int getOffsetRed() const noexcept
Returns the offset of the red color byte.
Definition ImageInfo.h:198
OTC_SDK_API ImageInfo(ColorFormat colorFormat, WidthAlignment widthAlignment) noexcept
Constructor.
int getOffsetBlue() const noexcept
Returns the offset of the blue color byte.
Definition ImageInfo.h:208
Main SDK namespace.
Definition AlarmChannel.h:21
ColorFormat
Represents the different available color formats.
Definition ImageInfo.h:32
@ BGR
Pixel colors values are stored in the sequence: (blue, green, red).
@ RGB
Pixel colors values are stored in the sequence: (red, green, blue).
WidthAlignment
Represents the different available width alignments.
Definition ImageInfo.h:50
@ EightBytes
The row size is aligned to eight bytes.
@ TwoBytes
The row size is aligned to two bytes.
@ OneByte
The row size is aligned to one byte.
@ FourBytes
The row size is aligned to four bytes.