27 #include <VisionX/interface/components/Calibration.h>
28 #include <VisionX/interface/core/DataTypes.h>
39 struct ImageFormatInfo;
40 class ImageProviderInfo;
73 const ImageType destinationImageType,
92 convertImage(
const ImageProviderInfo& imageProviderInfo,
void* inputData,
void* outputData);
103 CByteImage*
createByteImage(
const ImageFormatInfo& imageFormat,
const ImageType imageType);
116 CByteImage*
createByteImage(
const ImageProviderInfo& imageProviderInfo);
127 CFloatImage*
createFloatImage(
const ImageFormatInfo& imageFormat,
const ImageType imageType);
148 rgbToDepthValue(
unsigned char r,
unsigned char g,
unsigned char b,
bool noiseResistant =
false)
153 constexpr
char size = 8;
154 constexpr
int channels = 3;
157 auto add = [&](
unsigned char v,
char channelNumber)
159 auto end = size * channels;
160 for (
int offset = 0; offset < end; offset += channels)
162 auto tmp = (
v & 0b1) << (channelNumber + offset);
177 result = (r + (g << 8) + (b << 16));
187 bool noiseResistant =
false)
192 constexpr
char size = 8;
193 constexpr
int channels = 3;
194 auto toRGB = [&](
unsigned int v,
char channelNumber)
197 v =
v >> channelNumber;
199 for (
int offset = 0; offset < size; offset++)
201 int shift =
std::max(offset * channels - offset, 0);
202 int masked =
v & mask;
203 int shiftedV = masked >> shift;
205 mask = mask << channels;
210 r = toRGB(depthInMM, 0);
211 g = toRGB(depthInMM, 1);
212 b = toRGB(depthInMM, 2);
216 r = depthInMM & 0xFF;
217 g = (depthInMM >> 8) & 0xFF;
218 b = (depthInMM >> 16) & 0xFF;
228 operator<<(ostream& os,
const visionx::ImageDimension& dimension)
230 os << dimension.width <<
"x" << dimension.height;