PreviewImage: Remove PNG support (to clean dependencies)
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 11m13s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 12m37s
Build Packages / build:rpm (rocky8) (push) Successful in 12m38s
Build Packages / Generate python client (push) Successful in 15s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 13m1s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m57s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m2s
Build Packages / Build documentation (push) Successful in 34s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 13m34s
Build Packages / build:rpm (rocky9) (push) Successful in 14m12s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m17s
Build Packages / Unit tests (push) Successful in 53m11s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 11m13s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 12m37s
Build Packages / build:rpm (rocky8) (push) Successful in 12m38s
Build Packages / Generate python client (push) Successful in 15s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 13m1s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m57s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m2s
Build Packages / Build documentation (push) Successful in 34s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 13m34s
Build Packages / build:rpm (rocky9) (push) Successful in 14m12s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m17s
Build Packages / Unit tests (push) Successful in 53m11s
This commit is contained in:
1 parent
0217f3713e
commit
fce1a2dca9
22 files changed
+14
-532
No files matched your search
+1
-14
@@ -47,12 +47,6 @@ SET(lzma OFF)
|
||||
SET(jpeg OFF)
|
||||
SET(old-jpeg OFF)
|
||||
|
||||
# PNG
|
||||
set(PNG_SHARED OFF)
|
||||
set(PNG_STATIC ON)
|
||||
set(PNG_EXECUTABLES OFF)
|
||||
set(PNG_TESTS OFF)
|
||||
|
||||
INCLUDE(CheckLanguage)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
CHECK_LANGUAGE(CUDA)
|
||||
@@ -99,13 +93,6 @@ FetchContent_Declare(tiff
|
||||
GIT_TAG v4.6.0
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
FetchContent_Declare(
|
||||
png
|
||||
GIT_REPOSITORY https://github.com/pnggroup/libpng
|
||||
GIT_TAG v1.6.49
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(hdf5
|
||||
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
|
||||
GIT_TAG hdf5_1.14.5
|
||||
@@ -149,7 +136,7 @@ FetchContent_Declare(
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2 hdf5 tiff png)
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2 hdf5 tiff)
|
||||
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
|
||||
@@ -497,35 +497,6 @@ void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional<int64_t>
|
||||
response.send(Pistache::Http::Code::Not_Found);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::image_buffer_image_png_get(const std::optional<int64_t> &id,
|
||||
const std::optional<bool> &showUserMask,
|
||||
const std::optional<bool> &showRoi,
|
||||
const std::optional<bool> &showSpots,
|
||||
const std::optional<bool> &showBeamCenter,
|
||||
const std::optional<float> &saturation,
|
||||
const std::optional<int64_t> &jpegQuality,
|
||||
const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_id = id.value_or(ImageBuffer::MaxImage);
|
||||
PreviewImageSettings settings{};
|
||||
|
||||
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.jpeg_quality = jpegQuality.value_or(100);
|
||||
settings.resolution_ring = showResRing;
|
||||
settings.scale = ConvertColorScale(color);
|
||||
settings.show_beam_center = showBeamCenter.value_or(true);
|
||||
settings.format = PreviewImageFormat::PNG;
|
||||
std::string s = state_machine.GetPreviewJPEG(settings, image_id);
|
||||
if (!s.empty())
|
||||
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg"));
|
||||
else
|
||||
response.send(Pistache::Http::Code::Not_Found);
|
||||
}
|
||||
|
||||
void
|
||||
JFJochBrokerHttp::image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_id = ImageBuffer::MaxImage;
|
||||
|
||||
@@ -157,16 +157,6 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
void image_buffer_image_png_get(const std::optional<int64_t> &id,
|
||||
const std::optional<bool> &showUserMask,
|
||||
const std::optional<bool> &showRoi,
|
||||
const std::optional<bool> &showSpots,
|
||||
const std::optional<bool> &showBeamCenter,
|
||||
const std::optional<float> &saturation,
|
||||
const std::optional<int64_t> &jpegQuality,
|
||||
const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Post(*router, base + "/image_buffer/clear", Routes::bind(&DefaultApi::image_buffer_clear_post_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/image.cbor", Routes::bind(&DefaultApi::image_buffer_image_cbor_get_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/image.jpeg", Routes::bind(&DefaultApi::image_buffer_image_jpeg_get_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/image.png", Routes::bind(&DefaultApi::image_buffer_image_png_get_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/image.tiff", Routes::bind(&DefaultApi::image_buffer_image_tiff_get_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/start.cbor", Routes::bind(&DefaultApi::image_buffer_start_cbor_get_handler, this));
|
||||
Routes::Get(*router, base + "/image_buffer/status", Routes::bind(&DefaultApi::image_buffer_status_get_handler, this));
|
||||
@@ -1078,99 +1077,6 @@ void DefaultApi::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Reque
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::image_buffer_image_png_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the query params
|
||||
auto idQuery = request.query().get("id");
|
||||
std::optional<int64_t> id;
|
||||
if(idQuery.has_value()){
|
||||
int64_t valueQuery_instance;
|
||||
if(fromStringValue(idQuery.value(), valueQuery_instance)){
|
||||
id = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto showUserMaskQuery = request.query().get("show_user_mask");
|
||||
std::optional<bool> showUserMask;
|
||||
if(showUserMaskQuery.has_value()){
|
||||
bool valueQuery_instance;
|
||||
if(fromStringValue(showUserMaskQuery.value(), valueQuery_instance)){
|
||||
showUserMask = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto showRoiQuery = request.query().get("show_roi");
|
||||
std::optional<bool> showRoi;
|
||||
if(showRoiQuery.has_value()){
|
||||
bool valueQuery_instance;
|
||||
if(fromStringValue(showRoiQuery.value(), valueQuery_instance)){
|
||||
showRoi = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto showSpotsQuery = request.query().get("show_spots");
|
||||
std::optional<bool> showSpots;
|
||||
if(showSpotsQuery.has_value()){
|
||||
bool valueQuery_instance;
|
||||
if(fromStringValue(showSpotsQuery.value(), valueQuery_instance)){
|
||||
showSpots = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto showBeamCenterQuery = request.query().get("show_beam_center");
|
||||
std::optional<bool> showBeamCenter;
|
||||
if(showBeamCenterQuery.has_value()){
|
||||
bool valueQuery_instance;
|
||||
if(fromStringValue(showBeamCenterQuery.value(), valueQuery_instance)){
|
||||
showBeamCenter = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto saturationQuery = request.query().get("saturation");
|
||||
std::optional<float> saturation;
|
||||
if(saturationQuery.has_value()){
|
||||
float valueQuery_instance;
|
||||
if(fromStringValue(saturationQuery.value(), valueQuery_instance)){
|
||||
saturation = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto jpegQualityQuery = request.query().get("jpeg_quality");
|
||||
std::optional<int64_t> jpegQuality;
|
||||
if(jpegQualityQuery.has_value()){
|
||||
int64_t valueQuery_instance;
|
||||
if(fromStringValue(jpegQualityQuery.value(), valueQuery_instance)){
|
||||
jpegQuality = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto showResRingQuery = request.query().get("show_res_ring");
|
||||
std::optional<float> showResRing;
|
||||
if(showResRingQuery.has_value()){
|
||||
float valueQuery_instance;
|
||||
if(fromStringValue(showResRingQuery.value(), valueQuery_instance)){
|
||||
showResRing = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto colorQuery = request.query().get("color");
|
||||
std::optional<std::string> color;
|
||||
if(colorQuery.has_value()){
|
||||
std::string valueQuery_instance;
|
||||
if(fromStringValue(colorQuery.value(), valueQuery_instance)){
|
||||
color = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this->image_buffer_image_png_get(id, showUserMask, showRoi, showSpots, showBeamCenter, saturation, jpegQuality, showResRing, color, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
@@ -107,7 +107,6 @@ private:
|
||||
void image_buffer_clear_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_png_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -451,22 +450,6 @@ private:
|
||||
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo")</param>
|
||||
virtual void image_buffer_image_jpeg_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get preview image in PNG format using custom settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
|
||||
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
|
||||
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
|
||||
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
|
||||
/// <param name="showBeamCenter">Show beam center on the image (optional, default to true)</param>
|
||||
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 10.0f)</param>
|
||||
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
|
||||
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
|
||||
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo")</param>
|
||||
virtual void image_buffer_image_png_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get preview image in TIFF format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
||||
@@ -3103,42 +3103,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/error_message'
|
||||
/image_buffer/image.png:
|
||||
get:
|
||||
summary: Get preview image in PNG format using custom settings
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/image_id'
|
||||
- $ref: '#/components/parameters/show_user_mask'
|
||||
- $ref: '#/components/parameters/show_roi'
|
||||
- $ref: '#/components/parameters/show_spots'
|
||||
- $ref: '#/components/parameters/show_beam_center'
|
||||
- $ref: '#/components/parameters/saturation'
|
||||
- $ref: '#/components/parameters/jpeg_quality'
|
||||
- $ref: '#/components/parameters/resolution_ring'
|
||||
- $ref: '#/components/parameters/color_scale'
|
||||
responses:
|
||||
"200":
|
||||
description: Preview image
|
||||
content:
|
||||
image/jpeg:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
"404":
|
||||
description: Image not present in the buffer - either not yet measured or already replaced by a next image.
|
||||
"400":
|
||||
description: Input parsing or validation error
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Exception error
|
||||
"500":
|
||||
description: Error within Jungfraujoch code - see output message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/error_message'
|
||||
/image_buffer/image.tiff:
|
||||
get:
|
||||
summary: Get preview image in TIFF format
|
||||
|
||||
@@ -387,7 +387,7 @@ Get user mask of the detector (binary)
|
||||
Get user mask of the detector (TIFF)
|
||||
" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Detector must be Initialized.
|
||||
Get user mask of the detector (TIFF)
|
||||
</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1user_mask.tiff/put" role="menuitem" aria-label="Upload user mask of the detector" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="put" class="sc-jxYSNo NmQLu operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Upload user mask of the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1preview~1pedestal.tiff/get" role="menuitem" aria-label="Get pedestal in TIFF format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get pedestal in TIFF format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1preview~1plot/get" role="menuitem" aria-label="Generate 1D plot from Jungfraujoch" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Generate 1D plot from Jungfraujoch</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1result~1scan/get" role="menuitem" aria-label="Get full scan result" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get full scan result</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1start.cbor/get" role="menuitem" aria-label="Get Start message in CBOR format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get Start message in CBOR format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.cbor/get" role="menuitem" aria-label="Get image message in CBOR format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get image message in CBOR format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.jpeg/get" role="menuitem" aria-label="Get preview image in JPEG format using custom settings" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get preview image in JPEG format using custom settings</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.png/get" role="menuitem" aria-label="Get preview image in PNG format using custom settings" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get preview image in PNG format using custom settings</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.tiff/get" role="menuitem" aria-label="Get preview image in TIFF format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get preview image in TIFF format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1clear/post" role="menuitem" aria-label="Clear image buffer" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="post" class="sc-jxYSNo NmQLu operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Clear image buffer</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1status/get" role="menuitem" aria-label="Get status of the image buffers" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get status of the image buffers</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1version/get" role="menuitem" aria-label="Get Jungfraujoch version of jfjoch_broker" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get JuLine truncated
|
||||
</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1config~1user_mask.tiff/put" role="menuitem" aria-label="Upload user mask of the detector" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="put" class="sc-jxYSNo NmQLu operation-type put">put</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Upload user mask of the detector</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1preview~1pedestal.tiff/get" role="menuitem" aria-label="Get pedestal in TIFF format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get pedestal in TIFF format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1preview~1plot/get" role="menuitem" aria-label="Generate 1D plot from Jungfraujoch" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Generate 1D plot from Jungfraujoch</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1result~1scan/get" role="menuitem" aria-label="Get full scan result" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get full scan result</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1start.cbor/get" role="menuitem" aria-label="Get Start message in CBOR format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get Start message in CBOR format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.cbor/get" role="menuitem" aria-label="Get image message in CBOR format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get image message in CBOR format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.jpeg/get" role="menuitem" aria-label="Get preview image in JPEG format using custom settings" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get preview image in JPEG format using custom settings</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1image.tiff/get" role="menuitem" aria-label="Get preview image in TIFF format" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get preview image in TIFF format</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1clear/post" role="menuitem" aria-label="Clear image buffer" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="post" class="sc-jxYSNo NmQLu operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Clear image buffer</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1image_buffer~1status/get" role="menuitem" aria-label="Get status of the image buffers" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get status of the image buffers</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1version/get" role="menuitem" aria-label="Get Jungfraujoch version of jfjoch_broker" aria-expanded="false" class="sc-cgHfjM ixknQI"><label class="sc-fpikKz iHRgeo -depth2"><span type="get" class="sc-jxYSNo NmQLu operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-gWaSiO cxcra">Get Jungfraujoch version of jfjoch_broker</span></label></li></ul><div class="sc-kSaXSp QuyG"><a target="_blank" rel="noopener noreferrer" href="https://redocly.com/redoc/">API docs by Redocly</a></div></div></div><div class="sc-jOlHRD bovaLG"><div class="sc-cZnrqW crXcHD"><svg class="" style="transform:translate(2px, -4px) rotate(180deg);transition:transform 0.2s ease" viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15"><g tranLine truncated
|
||||
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
|
||||
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
|
||||
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
|
||||
@@ -1335,35 +1335,7 @@ For still measurement the number is ignored</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/image_buffer/image.jpeg</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="<p>Test Jungfraujoch system</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Test Jungfraujoch system</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/image.jpeg</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="tab:R9pra:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9pra:0" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9pra:0" aria-labelledby="tab:R9pra:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1image_buffer~1image.png/get" data-section-id="/paths/~1image_buffer~1image.png/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1image_buffer~1image.png/get" aria-label="/paths/~1image_buffer~1image.png/get"></a>Get preview image in PNG format using custom settings<!-- --> </h2><div><h5 class="sc-eqYatC czjApA">query<!-- --> Parameters</h5><table class="sc-eqNDNG icJLQx"><tbody><tr class=""><td kind="field" title="id" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">id</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">integer</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->>= -2<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">-1</span></div> <div><div html="<p>Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_user_mask" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">show_user_mask</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">boolean</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">false</span></div> <div><div html="<p>Show user mask</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Show user mask</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_roi" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">show_roi</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">boolean</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">false</span></div> <div><div html="<p>Show ROI areas on the image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Show ROI areas on the image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_spots" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">show_spots</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">boolean</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">true</span></div> <div><div html="<p>Show spot finding results on the image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Show spot finding results on the image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_beam_center" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">show_beam_center</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">boolean</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">true</span></div> <div><div html="<p>Show beam center on the image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Show beam center on the image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="saturation" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">saturation</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">number</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->[ -32767 .. 32767 ]<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">10</span></div> <div><div html="<p>Saturation value to set contrast in the preview image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Saturation value to set contrast in the preview image</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="jpeg_quality" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">jpeg_quality</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">integer</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->[ 0 .. 100 ]<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">100</span></div> <div><div html="<p>Quality of JPEG image (100 - highest; 0 - lowest)</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Quality of JPEG image (100 - highest; 0 - lowest)</p>
|
||||
</div></div></div></td></tr><tr class=""><td kind="field" title="show_res_ring" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">show_res_ring</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">number</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->float<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->[ 0.1 .. 100 ]<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">0.1</span></div> <div><div html="<p>Show resolution ring, provided in Angstrom</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Show resolution ring, provided in Angstrom</p>
|
||||
</div></div></div></td></tr><tr class="last "><td kind="field" title="color" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">color</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">string</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">"indigo"</span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Enum<!-- -->:</span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">"indigo"</span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">"viridis"</span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">"bw"</span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">"heat"</span> </div> <div><div html="<p>Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat</p>
|
||||
</div></div></div></td></tr></tbody></table></div><div><h3 class="sc-gDzyrw kjrVcG">Responses</h3><div><button class="sc-jIDBmd lkmdtA"><svg class="sc-dntSTA cGxVlA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">200<!-- --> </strong><div html="<p>Preview image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Preview image</p>
|
||||
</div></button></div><div><button class="sc-jIDBmd ifAHvq"><svg class="sc-dntSTA jKYZgc" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">400<!-- --> </strong><div html="<p>Input parsing or validation error</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Input parsing or validation error</p>
|
||||
</div></button></div><div><button class="sc-jIDBmd kQCDrg" disabled=""><strong class="sc-eJvlPh fBhAXU">404<!-- --> </strong><div html="<p>Image not present in the buffer - either not yet measured or already replaced by a next image.</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Image not present in the buffer - either not yet measured or already replaced by a next image.</p>
|
||||
</div></button></div><div><button class="sc-jIDBmd ifAHvq"><svg class="sc-dntSTA jKYZgc" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">500<!-- --> </strong><div html="<p>Error within Jungfraujoch code - see output message.</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/image_buffer/image.png</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="<p>Test Jungfraujoch system</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Test Jungfraujoch system</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/image.png</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="tab:R9prq:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9prq:0" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9prq:0" aria-labelledby="tab:R9prq:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1image_buffer~1image.tiff/get" data-section-id="/paths/~1image_buffer~1image.tiff/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1image_buffer~1image.tiff/get" aria-label="/paths/~1image_buffer~1image.tiff/get"></a>Get preview image in TIFF format<!-- --> </h2><div><h5 class="sc-eqYatC czjApA">query<!-- --> Parameters</h5><table class="sc-eqNDNG icJLQx"><tbody><tr class="last "><td kind="field" title="id" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">id</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">integer</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->>= -2<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">-1</span></div> <div><div html="<p>Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/image.jpeg</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="tab:R9pra:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9pra:0" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9pra:0" aria-labelledby="tab:R9pra:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1image_buffer~1image.tiff/get" data-section-id="/paths/~1image_buffer~1image.tiff/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1image_buffer~1image.tiff/get" aria-label="/paths/~1image_buffer~1image.tiff/get"></a>Get preview image in TIFF format<!-- --> </h2><div><h5 class="sc-eqYatC czjApA">query<!-- --> Parameters</h5><table class="sc-eqNDNG icJLQx"><tbody><tr class="last "><td kind="field" title="id" class="sc-kCuUfV sc-fbQrwq gdmNWp dFOJWJ"><span class="sc-hwddKA cteAyA"></span><span class="property-name">id</span></td><td class="sc-gGKoUb ixGaBD"><div><div><span class="sc-bEjUoa sc-boKDdR lhyyLL jYezsP"></span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq">integer</span><span class="sc-bEjUoa sc-fOOuSg lhyyLL dbKJYq"> <!-- --><<!-- -->int64<!-- -->><!-- --> </span><span> <span class="sc-bEjUoa sc-goiVcJ lhyyLL bDfgbe"> <!-- -->>= -2<!-- --> </span></span></div><div><span class="sc-bEjUoa lhyyLL"> <!-- -->Default:<!-- --> </span> <span class="sc-bEjUoa sc-dTWiOz lhyyLL kMQdIk">-1</span></div> <div><div html="<p>Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer</p>
|
||||
</div></div></div></td></tr></tbody></table></div><div><h3 class="sc-gDzyrw kjrVcG">Responses</h3><div><button class="sc-jIDBmd lkmdtA"><svg class="sc-dntSTA cGxVlA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">200<!-- --> </strong><div html="<p>Preview image</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Preview image</p>
|
||||
@@ -1379,7 +1351,7 @@ For still measurement the number is ignored</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="post" class="sc-fQLpxn kwcmyC http-verb post">post</span><span class="sc-jvKoal kZcHWP">/image_buffer/clear</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="<p>Test Jungfraujoch system</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Test Jungfraujoch system</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/clear</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="tab:R9psq:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9psq:0" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9psq:0" aria-labelledby="tab:R9psq:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1image_buffer~1status/get" data-section-id="/paths/~1image_buffer~1status/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1image_buffer~1status/get" aria-label="/paths/~1image_buffer~1status/get"></a>Get status of the image buffers<!-- --> </h2><div class="sc-bfjeOH txIPi"><div html="<p>Can be run at any stage of Jungfraujoch operation, including during data collection.
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/clear</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-error react-tabs__tab--selected" role="tab" id="tab:R9psa:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9psa:0" tabindex="0" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9psa:0" aria-labelledby="tab:R9psa:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"msg"</span>: <span class="token string">"Detector in wrong state"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"reason"</span>: <span class="token string">"WrongDAQState"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1image_buffer~1status/get" data-section-id="/paths/~1image_buffer~1status/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1image_buffer~1status/get" aria-label="/paths/~1image_buffer~1status/get"></a>Get status of the image buffers<!-- --> </h2><div class="sc-bfjeOH txIPi"><div html="<p>Can be run at any stage of Jungfraujoch operation, including during data collection.
|
||||
The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots,
|
||||
then image might be replaced in the buffer between calling /images and /image.cbor.</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw kbZred"><p>Can be run at any stage of Jungfraujoch operation, including during data collection.
|
||||
@@ -1391,13 +1363,13 @@ then image might be replaced in the buffer between calling /images and /image.cb
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Error within Jungfraujoch code - see output message.</p>
|
||||
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/image_buffer/status</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="<p>Test Jungfraujoch system</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Test Jungfraujoch system</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/status</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab:R9pta:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9pta:0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab:R9pta:1" aria-selected="false" aria-disabled="false" aria-controls="panel:R9pta:1" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9pta:0" aria-labelledby="tab:R9pta:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"min_image_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_image_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"image_numbers"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token number">0</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"total_slots"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"available_slots"</span>: <span class="token number">0</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel:R9pta:1" aria-labelledby="tab:R9pta:1"></div></div></div></div></div></div><div id="/paths/~1version/get" data-section-id="/paths/~1version/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1version/get" aria-label="/paths/~1version/get"></a>Get Jungfraujoch version of jfjoch_broker<!-- --> </h2><div><h3 class="sc-gDzyrw kjrVcG">Responses</h3><div><button class="sc-jIDBmd lkmdtA"><svg class="sc-dntSTA cGxVlA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">200<!-- --> </strong><div html="<p>Release number of Jungfraujoch</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/image_buffer/status</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab:R9psq:0" aria-selected="true" aria-disabled="false" aria-controls="panel:R9psq:0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab:R9psq:1" aria-selected="false" aria-disabled="false" aria-controls="panel:R9psq:1" data-rttab="true">500</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel:R9psq:0" aria-labelledby="tab:R9psq:0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button><button> Expand all </button><button> Collapse all </button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"min_image_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"max_image_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"image_numbers"</span>: <button class="collapser" aria-label="collapse"></button><span class="token punctuation">[</span><span class="ellipsis"></span><ul class="array collapsible"><li><div class="hoverable collapsed"><span class="token number">0</span></div></li></ul><span class="token punctuation">]</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"total_slots"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"available_slots"</span>: <span class="token number">0</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel:R9psq:1" aria-labelledby="tab:R9psq:1"></div></div></div></div></div></div><div id="/paths/~1version/get" data-section-id="/paths/~1version/get" class="sc-dTvVRJ gHrCVQ"><div class="sc-jJLAfE gkiSyE"><div class="sc-ggWZvA fqkwbU"><h2 class="sc-kNOymR iFSqkw"><a class="sc-kcLKEh fRdsOi" href="#/paths/~1version/get" aria-label="/paths/~1version/get"></a>Get Jungfraujoch version of jfjoch_broker<!-- --> </h2><div><h3 class="sc-gDzyrw kjrVcG">Responses</h3><div><button class="sc-jIDBmd lkmdtA"><svg class="sc-dntSTA cGxVlA" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">200<!-- --> </strong><div html="<p>Release number of Jungfraujoch</p>
|
||||
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Release number of Jungfraujoch</p>
|
||||
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/version</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="<p>Test Jungfraujoch system</p>
|
||||
" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"><p>Test Jungfraujoch system</p>
|
||||
</div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://localhost:5232</span>/version</div></div></div></div></div></div></div></div></div><div class="sc-evkzZa iZqpqg"></div></div></div>
|
||||
<script>
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.3","info":{"title":"Jungfraujoch","description":"API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland).\nJungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU.\nJungfraujoch uses FPGA boards to acquire data at high data rates.\n\n# License Clarification\n\nWhile this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply**\nwhen this file is used solely to generate OpenAPI clients or when implementing applications that\ninteract with the API. Generated client code and applications using this API definition are not\nsubject to the GPL license requirements and may be distributed under terms of your choosing.\n\nThis exception is similar in spirit to the Linux Kernel's approach to userspace API headers and\nthe GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that\nuser programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not\nderivative works of the kernel and are not subject to the terms of the GPL.\n\nThis exception is intended to allow wider use of this API specification without imposing GPL\nrequirements on applications that merely interact with the API, regardless of whether they\ncommunicate through network calls or other mechanisms.\n","version":"1.0.0-rc.95","contact":{"name":"Filip Leonarski (Paul Scherrer Institute)","email":"filip.leonarski@psi.ch"},"license":{"name":"GPL-3.0","url":"https://www.gnu.org/licenses/gpl-3.0.html"}},"servers":[{"url":"http://localhost:5232","description":"Test Jungfraujoch system"}],"components":{"parameters":{"binning":{"in":"query","name":"binning","required":false,"schema":{"type":"integer"},"description":"Binning of frames for the plot (0 = default binning)"},"compression":{"in":"query","name":"compression","required":false,"schema":{"type":"boolean","default":false},"description":"Enable DEFLATE compression of output data."},"experimental_coord":{"in":"query","name":"experimental_coord","required":false,"schema":{"type":"boolean","default":false},"description":"If measurement has goniometer axis defined, plot X-axis will represent rotation angle\nIf measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value\nFor still measurement the number is ignored\n"},"azint_unit":{"in":"query","name":"azint_unit","required":false,"schema":{"type":"string","enum":["Q_recipA","d_A","two_theta_deg"],"default":"Q_recipA"},"description":"Unit used for azim int.\n"},"fill_value":{"in":"query","name":"fill","required":false,"schema":{"type":"number","format":"float"},"description":"Fill value for elements that were missed during data collection\n"},"plot_type":{"in":"query","name":"type","required":true,"description":"Type of requested plot","schema":{"type":"string","enum":["bkg_estimate","azint","azint_1d","spot_count","spot_count_low_res","spot_count_indexed","spot_count_ice","indexing_rate","indexing_time","indexing_unit_cell_length","indexing_unit_cell_angle","profile_radius","b_factor","error_pixels","saturated_pixels","image_collection_efficiency","receiver_delay","receiver_free_send_buf","strong_pixels","roi_sum","roi_mean","roi_max_count","roi_pixels","roi_weighted_x","roi_weighted_y","packets_received","max_pixel_value","resolution_estimate","pixel_sum","processing_time","beam_center_x","beam_center_y"]}},"roi":{"in":"query","name":"roi","required":false,"schema":{"type":"string","minLength":1},"description":"Name of ROI for which plot is requested"},"image_id":{"in":"query","name":"id","required":false,"schema":{"type":"integer","format":"int64","default":-1,"minimum":-2},"description":"Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer"},"saturation":{"in":"query","name":"saturation","schema":{"type":"number","format":"float","default":10,"minimum":-32767,"maximum":32767},"description":"Saturation value to set contrast in the preview image"},"background":{"in":"query","name":"background","schema":{"type":"number","format":"float","default":0,"minimum":-32767,"maximum":32767},"description":"Background value to set contrast in the preview image"},"show_spots":{"in":"query","name":"show_spots","schema":{"type":"boolean","default":true},"description":"Show spot finding results on the image"},"show_beam_center":{"in":"query","name":"show_beam_center","schema":{"type":"boolean","default":true},"description":"Show beam center on the image"},"show_roi":{"in":"query","name":"show_roi","schema":{"type":"boolean","default":false},"description":"Show ROI areas on the image"},"jpeg_quality":{"in":"query","name":"jpeg_quality","description":"Quality of JPEG image (100 - highest; 0 - lowest)","schema":{"type":"integer","format":"int64","default":100,"minimum":0,"maximum":100}},"show_user_mask":{"in":"quLine truncated
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.3","info":{"title":"Jungfraujoch","description":"API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland).\nJungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU.\nJungfraujoch uses FPGA boards to acquire data at high data rates.\n\n# License Clarification\n\nWhile this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply**\nwhen this file is used solely to generate OpenAPI clients or when implementing applications that\ninteract with the API. Generated client code and applications using this API definition are not\nsubject to the GPL license requirements and may be distributed under terms of your choosing.\n\nThis exception is similar in spirit to the Linux Kernel's approach to userspace API headers and\nthe GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that\nuser programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not\nderivative works of the kernel and are not subject to the terms of the GPL.\n\nThis exception is intended to allow wider use of this API specification without imposing GPL\nrequirements on applications that merely interact with the API, regardless of whether they\ncommunicate through network calls or other mechanisms.\n","version":"1.0.0-rc.95","contact":{"name":"Filip Leonarski (Paul Scherrer Institute)","email":"filip.leonarski@psi.ch"},"license":{"name":"GPL-3.0","url":"https://www.gnu.org/licenses/gpl-3.0.html"}},"servers":[{"url":"http://localhost:5232","description":"Test Jungfraujoch system"}],"components":{"parameters":{"binning":{"in":"query","name":"binning","required":false,"schema":{"type":"integer"},"description":"Binning of frames for the plot (0 = default binning)"},"compression":{"in":"query","name":"compression","required":false,"schema":{"type":"boolean","default":false},"description":"Enable DEFLATE compression of output data."},"experimental_coord":{"in":"query","name":"experimental_coord","required":false,"schema":{"type":"boolean","default":false},"description":"If measurement has goniometer axis defined, plot X-axis will represent rotation angle\nIf measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value\nFor still measurement the number is ignored\n"},"azint_unit":{"in":"query","name":"azint_unit","required":false,"schema":{"type":"string","enum":["Q_recipA","d_A","two_theta_deg"],"default":"Q_recipA"},"description":"Unit used for azim int.\n"},"fill_value":{"in":"query","name":"fill","required":false,"schema":{"type":"number","format":"float"},"description":"Fill value for elements that were missed during data collection\n"},"plot_type":{"in":"query","name":"type","required":true,"description":"Type of requested plot","schema":{"type":"string","enum":["bkg_estimate","azint","azint_1d","spot_count","spot_count_low_res","spot_count_indexed","spot_count_ice","indexing_rate","indexing_time","indexing_unit_cell_length","indexing_unit_cell_angle","profile_radius","b_factor","error_pixels","saturated_pixels","image_collection_efficiency","receiver_delay","receiver_free_send_buf","strong_pixels","roi_sum","roi_mean","roi_max_count","roi_pixels","roi_weighted_x","roi_weighted_y","packets_received","max_pixel_value","resolution_estimate","pixel_sum","processing_time","beam_center_x","beam_center_y"]}},"roi":{"in":"query","name":"roi","required":false,"schema":{"type":"string","minLength":1},"description":"Name of ROI for which plot is requested"},"image_id":{"in":"query","name":"id","required":false,"schema":{"type":"integer","format":"int64","default":-1,"minimum":-2},"description":"Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer"},"saturation":{"in":"query","name":"saturation","schema":{"type":"number","format":"float","default":10,"minimum":-32767,"maximum":32767},"description":"Saturation value to set contrast in the preview image"},"background":{"in":"query","name":"background","schema":{"type":"number","format":"float","default":0,"minimum":-32767,"maximum":32767},"description":"Background value to set contrast in the preview image"},"show_spots":{"in":"query","name":"show_spots","schema":{"type":"boolean","default":true},"description":"Show spot finding results on the image"},"show_beam_center":{"in":"query","name":"show_beam_center","schema":{"type":"boolean","default":true},"description":"Show beam center on the image"},"show_roi":{"in":"query","name":"show_roi","schema":{"type":"boolean","default":false},"description":"Show ROI areas on the image"},"jpeg_quality":{"in":"query","name":"jpeg_quality","description":"Quality of JPEG image (100 - highest; 0 - lowest)","schema":{"type":"integer","format":"int64","default":100,"minimum":0,"maximum":100}},"show_user_mask":{"in":"quLine truncated
|
||||
|
||||
var container = document.getElementById('redoc');
|
||||
Redoc.hydrate(__redoc_state, container);
|
||||
|
||||
@@ -29,7 +29,6 @@ RUN dnf -y update && \
|
||||
rpm-build \
|
||||
rpmdevtools \
|
||||
numactl-devel \
|
||||
openssl-devel \
|
||||
redhat-rpm-config \
|
||||
ninja-build \
|
||||
libxcb-devel \
|
||||
@@ -65,6 +64,7 @@ RUN dnf -y update && \
|
||||
python3-wheel \
|
||||
twine \
|
||||
openblas \
|
||||
openblas-static \
|
||||
openblas-devel \
|
||||
libdrm-devel \
|
||||
libglvnd-core-devel \
|
||||
|
||||
@@ -57,6 +57,7 @@ RUN dnf -y update && \
|
||||
zlib-static \
|
||||
fontconfig-devel \
|
||||
openblas-devel \
|
||||
openblas-static \
|
||||
openblas-serial \
|
||||
mesa-dri-drivers \
|
||||
libdrm-devel \
|
||||
|
||||
@@ -31,6 +31,7 @@ Automatically downloaded by CMake and statically linked:
|
||||
* Catch2 testing library - see [github.com/catchorg/Catch2](https://github.com/catchorg/Catch2)
|
||||
* HDF5 library - see [github.com/HDFGroup/hdf5](https://github.com/HDFGroup/hdf5)
|
||||
* TIFF library - see [gitlab.com/libtiff/libtiff](https://gitlab.com/libtiff/libtiff)
|
||||
* JPEG library (preferably jpeg-turbo) - see [github.com/libjpeg-turbo/libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo)
|
||||
* Ceres Solver library for least square optimization - see [http://ceres-solver.org/]
|
||||
|
||||
Please follow the link provided above to check for LICENSE file. Building code with dependencies above requires access from the build system to github.com.
|
||||
|
||||
@@ -140,7 +140,6 @@ Class | Method | HTTP request | Description
|
||||
*DefaultApi* | [**image_buffer_clear_post**](docs/DefaultApi.md#image_buffer_clear_post) | **POST** /image_buffer/clear | Clear image buffer
|
||||
*DefaultApi* | [**image_buffer_image_cbor_get**](docs/DefaultApi.md#image_buffer_image_cbor_get) | **GET** /image_buffer/image.cbor | Get image message in CBOR format
|
||||
*DefaultApi* | [**image_buffer_image_jpeg_get**](docs/DefaultApi.md#image_buffer_image_jpeg_get) | **GET** /image_buffer/image.jpeg | Get preview image in JPEG format using custom settings
|
||||
*DefaultApi* | [**image_buffer_image_png_get**](docs/DefaultApi.md#image_buffer_image_png_get) | **GET** /image_buffer/image.png | Get preview image in PNG format using custom settings
|
||||
*DefaultApi* | [**image_buffer_image_tiff_get**](docs/DefaultApi.md#image_buffer_image_tiff_get) | **GET** /image_buffer/image.tiff | Get preview image in TIFF format
|
||||
*DefaultApi* | [**image_buffer_start_cbor_get**](docs/DefaultApi.md#image_buffer_start_cbor_get) | **GET** /image_buffer/start.cbor | Get Start message in CBOR format
|
||||
*DefaultApi* | [**image_buffer_status_get**](docs/DefaultApi.md#image_buffer_status_get) | **GET** /image_buffer/status | Get status of the image buffers
|
||||
|
||||
@@ -43,7 +43,6 @@ Method | HTTP request | Description
|
||||
[**image_buffer_clear_post**](DefaultApi.md#image_buffer_clear_post) | **POST** /image_buffer/clear | Clear image buffer
|
||||
[**image_buffer_image_cbor_get**](DefaultApi.md#image_buffer_image_cbor_get) | **GET** /image_buffer/image.cbor | Get image message in CBOR format
|
||||
[**image_buffer_image_jpeg_get**](DefaultApi.md#image_buffer_image_jpeg_get) | **GET** /image_buffer/image.jpeg | Get preview image in JPEG format using custom settings
|
||||
[**image_buffer_image_png_get**](DefaultApi.md#image_buffer_image_png_get) | **GET** /image_buffer/image.png | Get preview image in PNG format using custom settings
|
||||
[**image_buffer_image_tiff_get**](DefaultApi.md#image_buffer_image_tiff_get) | **GET** /image_buffer/image.tiff | Get preview image in TIFF format
|
||||
[**image_buffer_start_cbor_get**](DefaultApi.md#image_buffer_start_cbor_get) | **GET** /image_buffer/start.cbor | Get Start message in CBOR format
|
||||
[**image_buffer_status_get**](DefaultApi.md#image_buffer_status_get) | **GET** /image_buffer/status | Get status of the image buffers
|
||||
@@ -2578,90 +2577,6 @@ with jfjoch_client.ApiClient(configuration) as api_client:
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer | [optional] [default to -1]
|
||||
**show_user_mask** | **bool**| Show user mask | [optional] [default to False]
|
||||
**show_roi** | **bool**| Show ROI areas on the image | [optional] [default to False]
|
||||
**show_spots** | **bool**| Show spot finding results on the image | [optional] [default to True]
|
||||
**show_beam_center** | **bool**| Show beam center on the image | [optional] [default to True]
|
||||
**saturation** | **float**| Saturation value to set contrast in the preview image | [optional] [default to 10]
|
||||
**jpeg_quality** | **int**| Quality of JPEG image (100 - highest; 0 - lowest) | [optional] [default to 100]
|
||||
**show_res_ring** | **float**| Show resolution ring, provided in Angstrom | [optional] [default to 0.1]
|
||||
**color** | **str**| Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat | [optional] [default to indigo]
|
||||
|
||||
### Return type
|
||||
|
||||
**bytearray**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: image/jpeg, text/plain, application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Preview image | - |
|
||||
**404** | Image not present in the buffer - either not yet measured or already replaced by a next image. | - |
|
||||
**400** | Input parsing or validation error | - |
|
||||
**500** | Error within Jungfraujoch code - see output message. | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **image_buffer_image_png_get**
|
||||
> bytearray image_buffer_image_png_get(id=id, show_user_mask=show_user_mask, show_roi=show_roi, show_spots=show_spots, show_beam_center=show_beam_center, saturation=saturation, jpeg_quality=jpeg_quality, show_res_ring=show_res_ring, color=color)
|
||||
|
||||
Get preview image in PNG format using custom settings
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import jfjoch_client
|
||||
from jfjoch_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:5232
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = jfjoch_client.Configuration(
|
||||
host = "http://localhost:5232"
|
||||
)
|
||||
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with jfjoch_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = jfjoch_client.DefaultApi(api_client)
|
||||
id = -1 # int | Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional) (default to -1)
|
||||
show_user_mask = False # bool | Show user mask (optional) (default to False)
|
||||
show_roi = False # bool | Show ROI areas on the image (optional) (default to False)
|
||||
show_spots = True # bool | Show spot finding results on the image (optional) (default to True)
|
||||
show_beam_center = True # bool | Show beam center on the image (optional) (default to True)
|
||||
saturation = 10 # float | Saturation value to set contrast in the preview image (optional) (default to 10)
|
||||
jpeg_quality = 100 # int | Quality of JPEG image (100 - highest; 0 - lowest) (optional) (default to 100)
|
||||
show_res_ring = 0.1 # float | Show resolution ring, provided in Angstrom (optional) (default to 0.1)
|
||||
color = indigo # str | Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional) (default to indigo)
|
||||
|
||||
try:
|
||||
# Get preview image in PNG format using custom settings
|
||||
api_response = api_instance.image_buffer_image_png_get(id=id, show_user_mask=show_user_mask, show_roi=show_roi, show_spots=show_spots, show_beam_center=show_beam_center, saturation=saturation, jpeg_quality=jpeg_quality, show_res_ring=show_res_ring, color=color)
|
||||
print("The response of DefaultApi->image_buffer_image_png_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DefaultApi->image_buffer_image_png_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0-rc.94",
|
||||
"version": "1.0.0-rc.95",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0-rc.94",
|
||||
"version": "1.0.0-rc.95",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.4",
|
||||
|
||||
@@ -27,7 +27,6 @@ type preview_settings = {
|
||||
resolution_ring: number;
|
||||
scale: color_scale;
|
||||
image_id: number;
|
||||
use_png: boolean;
|
||||
};
|
||||
|
||||
type MyProps = {
|
||||
@@ -76,8 +75,7 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
show_beam_center: true,
|
||||
resolution_ring: 0.5,
|
||||
scale: color_scale.INDIGO,
|
||||
image_id: -1,
|
||||
use_png: true
|
||||
image_id: -1
|
||||
},
|
||||
s_url: null,
|
||||
update: true,
|
||||
@@ -158,15 +156,6 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
this.getValues(s);
|
||||
}
|
||||
|
||||
usePNGToggle = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let s : preview_settings = {
|
||||
...this.state.settings,
|
||||
use_png: event.target.checked
|
||||
};
|
||||
this.setState({settings: s});
|
||||
this.getValues(s);
|
||||
}
|
||||
|
||||
showBeamCenterToggle = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let s : preview_settings = {
|
||||
...this.state.settings,
|
||||
@@ -246,13 +235,7 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
}
|
||||
|
||||
getImage(s: preview_settings,) {
|
||||
let url = `/image_buffer/image.`;
|
||||
|
||||
if (s.use_png)
|
||||
url += "png";
|
||||
else
|
||||
url += "jpeg";
|
||||
|
||||
let url = `/image_buffer/image.jpeg`;
|
||||
url += `?id=${s.image_id}`;
|
||||
url += `&saturation=${s.saturation}`;
|
||||
url += `&jpeg_quality=${s.jpeg_quality}`
|
||||
@@ -360,9 +343,6 @@ class PreviewImage extends Component<MyProps, MyState> {
|
||||
<FormControlLabel control={
|
||||
<Checkbox checked={this.state.update} onChange={this.updateToggle} name="Update"/>
|
||||
} label="Auto-update image"/>
|
||||
<FormControlLabel control={
|
||||
<Checkbox checked={this.state.settings.use_png} onChange={this.usePNGToggle} name="Use PNG format"/>
|
||||
} label="PNG image format (slower, but lossless)"/>
|
||||
<FormControlLabel control={
|
||||
<Checkbox checked={this.state.settings.show_spots} onChange={this.showSpotsToggle} name="Show spots"/>
|
||||
} label="Show spots"/>
|
||||
|
||||
@@ -1081,53 +1081,6 @@ export class DefaultService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get preview image in PNG format using custom settings
|
||||
* @param id Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer
|
||||
* @param showUserMask Show user mask
|
||||
* @param showRoi Show ROI areas on the image
|
||||
* @param showSpots Show spot finding results on the image
|
||||
* @param showBeamCenter Show beam center on the image
|
||||
* @param saturation Saturation value to set contrast in the preview image
|
||||
* @param jpegQuality Quality of JPEG image (100 - highest; 0 - lowest)
|
||||
* @param showResRing Show resolution ring, provided in Angstrom
|
||||
* @param color Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat
|
||||
* @returns binary Preview image
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getImageBufferImagePng(
|
||||
id: number = -1,
|
||||
showUserMask: boolean = false,
|
||||
showRoi: boolean = false,
|
||||
showSpots: boolean = true,
|
||||
showBeamCenter: boolean = true,
|
||||
saturation: number = 10,
|
||||
jpegQuality: number = 100,
|
||||
showResRing: number = 0.1,
|
||||
color: 'indigo' | 'viridis' | 'bw' | 'heat' = 'indigo',
|
||||
): CancelablePromise<Blob> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/image_buffer/image.png',
|
||||
query: {
|
||||
'id': id,
|
||||
'show_user_mask': showUserMask,
|
||||
'show_roi': showRoi,
|
||||
'show_spots': showSpots,
|
||||
'show_beam_center': showBeamCenter,
|
||||
'saturation': saturation,
|
||||
'jpeg_quality': jpegQuality,
|
||||
'show_res_ring': showResRing,
|
||||
'color': color,
|
||||
},
|
||||
errors: {
|
||||
400: `Input parsing or validation error`,
|
||||
404: `Image not present in the buffer - either not yet measured or already replaced by a next image.`,
|
||||
500: `Error within Jungfraujoch code - see output message.`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get preview image in TIFF format
|
||||
* @param id Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer
|
||||
|
||||
@@ -42,8 +42,6 @@ ADD_LIBRARY(JFJochPreview STATIC
|
||||
ZMQPreviewSocket.h
|
||||
ZMQMetadataSocket.cpp
|
||||
ZMQMetadataSocket.h
|
||||
JFJochPNG.cpp
|
||||
JFJochPNG.h
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochPreview PUBLIC JFJochZMQ JFJochCommon CBORStream2FrameSerialize)
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
#include <png.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#include "../common/JFJochException.h"
|
||||
|
||||
#include "JFJochPNG.h"
|
||||
|
||||
struct PNGMemoryWriter {
|
||||
std::string buffer;
|
||||
};
|
||||
|
||||
void pngWriteCallback(png_structp png_ptr, png_bytep data, png_size_t length) {
|
||||
auto writer = static_cast<PNGMemoryWriter*>(png_get_io_ptr(png_ptr));
|
||||
size_t old_size = writer->buffer.size();
|
||||
writer->buffer.resize(old_size + length);
|
||||
std::memcpy(writer->buffer.data() + old_size, data, length);
|
||||
}
|
||||
|
||||
std::string WritePNGToMem(const CompressedImage& image, int compression_level) {
|
||||
if (image.GetMode() != CompressedImageMode::RGB)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Only RGB images allowed for PNG saving");
|
||||
|
||||
std::vector<uint8_t> buffer;
|
||||
image.GetUncompressed(buffer);
|
||||
|
||||
int width = image.GetWidth();
|
||||
int height = image.GetHeight();
|
||||
int color_type = PNG_COLOR_TYPE_RGB;
|
||||
int bit_depth = 8;
|
||||
|
||||
// Initialize libpng structures
|
||||
png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL);
|
||||
if (!png_ptr) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Error initializing PNG write structure");
|
||||
}
|
||||
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
if (!info_ptr) {
|
||||
png_destroy_write_struct(&png_ptr, NULL);
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Error initializing PNG info structure");
|
||||
}
|
||||
|
||||
// Set up error handling
|
||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Error during PNG creation");
|
||||
}
|
||||
|
||||
PNGMemoryWriter writer;
|
||||
|
||||
writer.buffer.reserve(width * height * 3);
|
||||
|
||||
png_set_write_fn(png_ptr, &writer, pngWriteCallback, NULL);
|
||||
|
||||
// Set image information
|
||||
png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, color_type,
|
||||
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
|
||||
|
||||
// Set compression level (0-9, where 0 is no compression and 9 is maximum)
|
||||
png_set_compression_level(png_ptr, compression_level);
|
||||
|
||||
// Write PNG header
|
||||
png_write_info(png_ptr, info_ptr);
|
||||
|
||||
// Allocate row pointers
|
||||
std::vector<png_bytep> row_pointers(height);
|
||||
for (int y = 0; y < height; y++) {
|
||||
row_pointers[y] = buffer.data() + y * width * 3;
|
||||
}
|
||||
|
||||
// Write PNG image data
|
||||
png_write_image(png_ptr, row_pointers.data());
|
||||
|
||||
// Finish writing
|
||||
png_write_end(png_ptr, NULL);
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
|
||||
return writer.buffer;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JFJOCH_JFJOCHPNG_H
|
||||
#define JFJOCH_JFJOCHPNG_H
|
||||
|
||||
#include "../common/CompressedImage.h"
|
||||
|
||||
std::string WritePNGToMem(const CompressedImage& image, int compression_level = 6);
|
||||
|
||||
#endif //JFJOCH_JFJOCHPNG_H
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
#include "../frame_serialize/CBORStream2Deserializer.h"
|
||||
#include "../compression/JFJochDecompress.h"
|
||||
#include "JFJochPNG.h"
|
||||
|
||||
constexpr const static rgb lime = {.r = 0xcd, .g = 0xdc, .b = 0x39};
|
||||
constexpr const static rgb pink = {.r = 0xe9, .g = 0x1e, .b = 0x63};
|
||||
@@ -263,8 +262,6 @@ std::string PreviewImage::GenerateImage(const PreviewImageSettings& settings,
|
||||
return WriteJPEGToMem(rgb_image, settings.jpeg_quality);
|
||||
case PreviewImageFormat::TIFF:
|
||||
return WriteTIFFToString(rgb_image);
|
||||
case PreviewImageFormat::PNG:
|
||||
return WritePNGToMem(rgb_image);
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Preview image format not supported");
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "PreviewCounter.h"
|
||||
#include "../common/ColorScale.h"
|
||||
|
||||
enum class PreviewImageFormat {JPEG, PNG, TIFF};
|
||||
enum class PreviewImageFormat {JPEG, TIFF};
|
||||
|
||||
struct PreviewImageSettings {
|
||||
float saturation_value = 10;
|
||||
|
||||
@@ -30,7 +30,6 @@ ADD_EXECUTABLE(jfjoch_test
|
||||
TIFFTest.cpp
|
||||
JFJochReceiverProcessingTest.cpp
|
||||
JPEGTest.cpp
|
||||
PNGTest.cpp
|
||||
HistogramTest.cpp
|
||||
ROIMapTest.cpp
|
||||
LossyFilterTest.cpp
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include "../preview/JFJochPNG.h"
|
||||
|
||||
TEST_CASE("PNGTest","[PNG]") {
|
||||
size_t width = 1024;
|
||||
size_t height = 1024;
|
||||
std::vector<rgb> val(width * height);
|
||||
for (int i = 0; i < width * height; i++) {
|
||||
size_t x = i % width;
|
||||
if (x < 512) {
|
||||
val[i].r = 234;
|
||||
val[i].g = 0;
|
||||
val[i].b = 0;
|
||||
} else {
|
||||
val[i].r = 0;
|
||||
val[i].g = 0;
|
||||
val[i].b = 255;
|
||||
}
|
||||
}
|
||||
|
||||
std::string s;
|
||||
|
||||
CompressedImage image(val, width, height);
|
||||
REQUIRE_NOTHROW(s = WritePNGToMem(image));
|
||||
std::ofstream f("x.png", std::ios::binary);
|
||||
f.write(s.data(), s.size());
|
||||
}
|
||||
Reference in new issue
Block a user