mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
hdf5 doestn work yet, wip
This commit is contained in:
@ -1065,6 +1065,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
||||
int discardBits = numDiscardBits;
|
||||
|
||||
uint16_t temp = 0;
|
||||
uint8_t *src = (uint8_t *)source;
|
||||
switch (dr) {
|
||||
|
||||
case 4:
|
||||
@ -1086,22 +1087,13 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
||||
|
||||
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);
|
||||
temp = (*src++ & 0xFF);
|
||||
temp |= ((*src & 0xF) << 8u);
|
||||
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;
|
||||
|
||||
temp = ((*src++ & 0xF0) >> 4u);
|
||||
temp |= ((*src++ & 0xFF) << 4u);
|
||||
dest[ichan] = (double)temp;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user