ZMQPreviewPublisher: Support both 16-bit and 32-bit images in preview
This commit is contained in:
@@ -70,20 +70,6 @@ void FrameTransformation::PackSummation() {
|
||||
}
|
||||
}
|
||||
|
||||
void FrameTransformation::Generate16BitPreview() {
|
||||
// Generate 16-bit preview image
|
||||
auto arr = (int32_t *) precompression_buffer.data();
|
||||
|
||||
for (int pxl = 0; pxl < experiment.GetPixelsNum(); pxl++) {
|
||||
if (arr[pxl] >= INT16_MAX)
|
||||
image16bit[pxl] = INT16_MAX;
|
||||
else if (arr[pxl] <= INT16_MIN)
|
||||
image16bit[pxl] = INT16_MIN;
|
||||
else
|
||||
image16bit[pxl] = static_cast<int16_t>(arr[pxl]);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameTransformation::Pack() {
|
||||
|
||||
if (summation > 1) {
|
||||
@@ -95,9 +81,6 @@ void FrameTransformation::Pack() {
|
||||
experiment.GetYPixelsNumFullImage(),
|
||||
static_cast<int32_t>(experiment.GetUnderflow()),
|
||||
static_cast<int32_t>(experiment.GetOverflow()));
|
||||
|
||||
if (pixel_depth == 4)
|
||||
Generate16BitPreview();
|
||||
} else {
|
||||
if (binning_2x2)
|
||||
Bin2x2_sum<int16_t>((int16_t *) precompression_buffer.data(),
|
||||
@@ -149,11 +132,8 @@ void FrameTransformation::ApplyROI(const ROIFilter &filter) {
|
||||
filter.Apply((int32_t *) precompression_buffer.data(), static_cast<int32_t>(INT32_MIN));
|
||||
}
|
||||
|
||||
int16_t *FrameTransformation::GetPreview16BitImage() {
|
||||
if (pixel_depth == 2)
|
||||
return (int16_t *) precompression_buffer.data();
|
||||
else
|
||||
return image16bit.data();
|
||||
const void *FrameTransformation::GetPreviewImage() const {
|
||||
return precompression_buffer.data();
|
||||
}
|
||||
|
||||
void FrameTransformation::ProcessModule(JFConversion &conv, const int16_t *input, uint16_t module_number, int data_stream) {
|
||||
|
||||
Reference in New Issue
Block a user