diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp
index a444f354..9f10ae74 100644
--- a/broker/JFJochBrokerHttp.cpp
+++ b/broker/JFJochBrokerHttp.cpp
@@ -478,6 +478,7 @@ void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional
const std::optional &jpegQuality,
const std::optional &showResRing,
const std::optional &color,
+ const std::optional &showResEst,
Pistache::Http::ResponseWriter &response) {
int64_t image_id = id.value_or(ImageBuffer::MaxImage);
PreviewImageSettings settings{};
@@ -485,7 +486,8 @@ void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional
settings.show_user_mask = showUserMask.value_or(true);
settings.show_roi = showRoi.value_or(false);
settings.show_spots = showSpots.value_or(true);
- settings.saturation_value = saturation.value_or(10);
+ settings.saturation_value = saturation;
+ settings.background_value = 0.0;
settings.jpeg_quality = jpegQuality.value_or(100);
settings.resolution_ring = showResRing;
settings.scale = ConvertColorScale(color);
diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h
index 30d710a1..52428bb2 100644
--- a/broker/JFJochBrokerHttp.h
+++ b/broker/JFJochBrokerHttp.h
@@ -147,6 +147,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void image_buffer_image_cbor_get(const std::optional &id,
Pistache::Http::ResponseWriter &response) override;
+
void image_buffer_image_jpeg_get(const std::optional &id,
const std::optional &showUserMask,
const std::optional &showRoi,
@@ -156,6 +157,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
const std::optional &jpegQuality,
const std::optional &showResRing,
const std::optional &color,
+ const std::optional &showResEst,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_tiff_get(const std::optional &id, Pistache::Http::ResponseWriter &response) override;
diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp
index bed52937..a6839454 100644
--- a/broker/gen/api/DefaultApi.cpp
+++ b/broker/gen/api/DefaultApi.cpp
@@ -1114,9 +1114,17 @@ void DefaultApi::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Reque
color = valueQuery_instance;
}
}
+ auto showResEstQuery = request.query().get("show_res_est");
+ std::optional showResEst;
+ if(showResEstQuery.has_value()){
+ bool valueQuery_instance;
+ if(fromStringValue(showResEstQuery.value(), valueQuery_instance)){
+ showResEst = valueQuery_instance;
+ }
+ }
try {
- this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, showBeamCenter, saturation, jpegQuality, showResRing, color, response);
+ this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, showBeamCenter, saturation, jpegQuality, showResRing, color, showResEst, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast(e.code()), e.what());
return;
diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h
index 2352955e..3e03c074 100644
--- a/broker/gen/api/DefaultApi.h
+++ b/broker/gen/api/DefaultApi.h
@@ -462,11 +462,12 @@ private:
/// Show ROI areas on the image (optional, default to false)
/// Show spot finding results on the image (optional, default to true)
/// Show beam center on the image (optional, default to true)
- /// Saturation value to set contrast in the preview image (optional, default to 10.0f)
+ /// Saturation value to set contrast in the preview image; if not provided, then autocontrast procedure is used (optional, default to 0.0f)
/// Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)
/// Show resolution ring, provided in Angstrom (optional, default to 0.1f)
/// Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo")
- virtual void image_buffer_image_jpeg_get(const std::optional &id, const std::optional &showUserMask, const std::optional &showRoi, const std::optional &showSpots, const std::optional &showBeamCenter, const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, Pistache::Http::ResponseWriter &response) = 0;
+ /// Show resolution estimation as a ring (optional, default to false)
+ virtual void image_buffer_image_jpeg_get(const std::optional &id, const std::optional &showUserMask, const std::optional &showRoi, const std::optional &showSpots, const std::optional &showBeamCenter, const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, const std::optional &showResEst, Pistache::Http::ResponseWriter &response) = 0;
///
/// Get preview image in TIFF format
///
diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml
index b68561ca..13b9e1f8 100644
--- a/broker/jfjoch_api.yaml
+++ b/broker/jfjoch_api.yaml
@@ -143,16 +143,17 @@ components:
saturation:
in: query
name: saturation
+ required: false
schema:
type: number
format: float
- default: 10
minimum: -32767
maximum: 32767
- description: "Saturation value to set contrast in the preview image"
+ description: "Saturation value to set contrast in the preview image; if not provided, then autocontrast procedure is used"
background:
in: query
name: background
+ required: false
schema:
type: number
format: float
@@ -208,6 +209,13 @@ components:
default: 0.1
minimum: 0.1
maximum: 100.0
+ resolution_estimate:
+ in: query
+ name: show_res_est
+ description: "Show resolution estimation as a ring"
+ schema:
+ type: boolean
+ default: false
color_scale:
in: query
name: color
@@ -3166,6 +3174,7 @@ paths:
- $ref: '#/components/parameters/jpeg_quality'
- $ref: '#/components/parameters/resolution_ring'
- $ref: '#/components/parameters/color_scale'
+ - $ref: '#/components/parameters/resolution_estimate'
responses:
"200":
description: Preview image
diff --git a/broker/redoc-static.html b/broker/redoc-static.html
index 3fc8d7ff..3f9432d2 100644
--- a/broker/redoc-static.html
+++ b/broker/redoc-static.html
@@ -1351,14 +1351,16 @@ For still measurement the number is ignored
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">Show spot finding results on the image
| show_beam_center | boolean Default: true Show beam center on the image
- |
| saturation | number <float> [ -32767 .. 32767 ] Default: 10 Saturation value to set contrast in the preview image
+ |
| saturation | number <float> [ -32767 .. 32767 ] Saturation value to set contrast in the preview image; if not provided, then autocontrast procedure is used
|
| jpeg_quality | integer <int64> [ 0 .. 100 ] Default: 100 Quality of JPEG image (100 - highest; 0 - lowest)
|
| show_res_ring | number <float> [ 0.1 .. 100 ] Default: 0.1 Show resolution ring, provided in Angstrom
- |
| color | string Default: "indigo" Enum: "indigo" "viridis" "bw" "heat" | color | string Default: "indigo" Enum: "indigo" "viridis" "bw" "heat" Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat
+ | |
| show_res_est | boolean Default: false Show resolution estimation as a ring
|
Responses