gui 12 bit mode done

This commit is contained in:
2022-02-17 17:33:16 +01:00
parent 40a9dce7e0
commit d2731c77a3
4 changed files with 53 additions and 7 deletions

View File

@ -1064,6 +1064,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
// mythen3 / gotthard2 debugging
int discardBits = numDiscardBits;
uint16_t temp = 0;
switch (dr) {
case 4:
@ -1083,6 +1084,28 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
}
break;
case 12:
for (ichan = 0; ichan < size; ++ichan) {
// first 12 bit pixel
// lsb (8 bytes)
temp = (*((u_int8_t *)source)) & 0xFF;
++source;
// msb (4 bytes)
temp |= (((*((u_int8_t *)source)) & 0xF) << 8);
dest[ichan] = (double)temp;
// second 12bit pixel
++ichan;
// lsb (4 bytes)
temp = (((*((u_int8_t *)source)) & 0xF0) >> 4);
++source;
// msb (8 bytes)
temp |= (((*((u_int8_t *)source)) & 0xFF) << 4);
++source;
dest[ichan] = (double)temp;
}
break;
case 16:
if (detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::GOTTHARD2) {