Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
ImageInfo.h
Go to the documentation of this file.
1// Copyright (c) 2025 Optris GmbH Co. KG
2
11
12#pragma once
13
14#include "otcsdk/Api.h"
15
16
17namespace optris
18{
19
31enum class ColorFormat
32{
35};
36
47{
48 OneByte = 1,
52};
53
54
57{
58public:
65 OTC_SDK_API ImageInfo(ColorFormat colorFormat, WidthAlignment widthAlignment) noexcept;
66
67
73 ColorFormat getColorFormat() const noexcept;
74
80 int getChannels() const noexcept;
81
87 int getOffsetRed() const noexcept;
88
94 int getOffsetGreen() const noexcept;
95
101 int getOffsetBlue() const noexcept;
102
103
109 OTC_SDK_API int resize(int width, int height);
110
116 int getWidth() const noexcept;
117
125 int getStride() const noexcept;
126
132 int getHeight() const noexcept;
133
139 int getSize() const noexcept;
140
141
147 WidthAlignment getWidthAlignment() const noexcept;
148
154 int getWidthPaddingInBytes() const noexcept;
155
156
157private:
158 ColorFormat _colorFormat;
159
160 int _channels;
161
162 int _offsetRed;
163 int _offsetBlue;
164
165 int _width;
166 int _stride;
167 int _height;
168 int _size;
169
170 int _widthAlignment;
171 int _widthPaddingInBytes;
172};
173
174
175// Inline implementations
176inline ColorFormat ImageInfo::getColorFormat() const noexcept
177{
178 return _colorFormat;
179}
180
181inline int ImageInfo::getChannels() const noexcept
182{
183 return _channels;
184}
185
186inline int ImageInfo::getOffsetRed() const noexcept
187{
188 return _offsetRed;
189}
190
191inline int ImageInfo::getOffsetGreen() const noexcept
192{
193 return 1;
194}
195
196inline int ImageInfo::getOffsetBlue() const noexcept
197{
198 return _offsetBlue;
199}
200
201inline int ImageInfo::getWidth() const noexcept
202{
203 return _width;
204}
205
206inline int ImageInfo::getStride() const noexcept
207{
208 return _stride;
209}
210
211inline int ImageInfo::getHeight() const noexcept
212{
213 return _height;
214}
215
216inline int ImageInfo::getSize() const noexcept
217{
218 return _size;
219}
220
222{
223 return static_cast<WidthAlignment>(_widthAlignment);
224}
225
226inline int ImageInfo::getWidthPaddingInBytes() const noexcept
227{
228 return _widthPaddingInBytes;
229}
230
231} // 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
int getStride() const noexcept
Returns the image stride in bytes.
Definition ImageInfo.h:206
int getWidthPaddingInBytes() const noexcept
Returns width padding in bytes.
Definition ImageInfo.h:226
int getWidth() const noexcept
Returns the image width in pixels.
Definition ImageInfo.h:201
int getSize() const noexcept
Returns the image size in pixels.
Definition ImageInfo.h:216
WidthAlignment getWidthAlignment() const noexcept
Returns the width alignment of the image.
Definition ImageInfo.h:221
ColorFormat getColorFormat() const noexcept
Returns the color format of the image.
Definition ImageInfo.h:176
int getHeight() const noexcept
Returns the image height in pixels.
Definition ImageInfo.h:211
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:181
int getOffsetGreen() const noexcept
Returns the offset of the green color byte.
Definition ImageInfo.h:191
int getOffsetRed() const noexcept
Returns the offset of the red color byte.
Definition ImageInfo.h:186
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:196
Main SDK namespace.
Definition DeviceInfo.h:23
ColorFormat
Represents the different available color formats.
Definition ImageInfo.h:32
@ BGR
Pixel colors values are stored in the sequence: (blue, green, red).
Definition ImageInfo.h:34
@ RGB
Pixel colors values are stored in the sequence: (red, green, blue).
Definition ImageInfo.h:33
WidthAlignment
Represents the different available width alignments.
Definition ImageInfo.h:47
@ EightBytes
The row size is aligned to eight bytes.
Definition ImageInfo.h:51
@ TwoBytes
The row size is aligned to two bytes.
Definition ImageInfo.h:49
@ OneByte
The row size is aligned to one byte.
Definition ImageInfo.h:48
@ FourBytes
The row size is aligned to four bytes.
Definition ImageInfo.h:50