38 #ifndef LibMultiSense_DisparityMessage
39 #define LibMultiSense_DisparityMessage
62 #ifdef SENSORPOD_FIRMWARE
65 #endif // SENSORPOD_FIRMWARE
73 #ifdef SENSORPOD_FIRMWARE
82 #ifndef SENSORPOD_FIRMWARE
98 template<
class Archive>
111 message.write(
dataP, imageSize);
115 dataP = message.peek();
116 message.seek(message.tell() + imageSize);
124 const uint8_t *
dataP,
143 const uint8_t *sP =
dataP;
144 const uint32_t sourceOffset = offset -
META_LENGTH;
151 stream.
seek(destOffset);
153 #if MULTISENSE_WIRE_BITS_PER_PIXEL == 12 && MULTISENSE_API_BITS_PER_PIXEL == 16
157 uint16_t *dP =
reinterpret_cast<uint16_t*
>(stream.
peek());
159 for(uint32_t i=0; i<count; i+=2, sP+=3) {
160 dP[i] = ((sP[0] ) | ((sP[1] & 0x0F) << 8));
161 dP[i+1] = ((sP[1] >> 4) | (sP[2] << 4) );
164 #elif MULTISENSE_WIRE_BITS_PER_PIXEL == 12 && MULTISENSE_API_BITS_PER_PIXEL == 32
168 float *dP =
reinterpret_cast<float*
>(stream.
peek());
170 for(uint32_t i=0; i<count; i+=2, sP+=3) {
172 dP[i] =
static_cast<float>((sP[0] ) | ((sP[1] & 0x0F) << 8)) / 16.0f;
173 dP[i+1] =
static_cast<float>((sP[1] >> 4) | (sP[2] << 4) ) / 16.0f;
177 #error MULTISENSE_WIRE_BITS_PER_PIXEL and MULTISENSE_API_BITS_PER_PIXEL not supported
183 #endif // !SENSORPOD_FIRMWARE