min cut and max cuts in 0-255 range for jpeg/png colors HiPS

This commit is contained in:
bmatthieu3
2025-03-18 16:14:35 +01:00
committed by Matthieu Baumann
parent 492927c557
commit b2bb7df6e3
2 changed files with 20 additions and 4 deletions

View File

@@ -246,7 +246,6 @@ export let DefaultActionsForContextMenu = (function () {
// Parameter given for full support of the Aladin view position and orientation in the sky
// WCS object
hips2fitsUrl += '&wcs=' + encodeURIComponent(wcs)
// Parameters given to fill the more readable user formular in HiPS2FITS interface
// Sky projection center

View File

@@ -216,7 +216,13 @@ import { Form } from "../Widgets/Form.js";
name: 'mincut',
value: 0.0,
change: (e) => {
self.options.layer.setCuts(+e.target.value, self.options.layer.getColorCfg().getCuts()[1])
let minCut = +e.target.value
let imgFormat = self.options.layer.imgFormat;
if (imgFormat !== "fits") {
minCut /= 255.0;
}
self.options.layer.setCuts(minCut, self.options.layer.getColorCfg().getCuts()[1])
}
},
{
@@ -229,7 +235,14 @@ import { Form } from "../Widgets/Form.js";
name: 'maxcut',
value: 1.0,
change: (e) => {
self.options.layer.setCuts(self.options.layer.getColorCfg().getCuts()[0], +e.target.value)
let maxCut = +e.target.value
let imgFormat = self.options.layer.imgFormat;
if (imgFormat !== "fits") {
maxCut /= 255.0;
}
self.options.layer.setCuts(self.options.layer.getColorCfg().getCuts()[0], maxCut)
}
}]
});
@@ -287,11 +300,15 @@ import { Form } from "../Widgets/Form.js";
let reversed = colorCfg.getReversed();
let [minCut, maxCut] = colorCfg.getCuts();
if (layer.imgFormat !== "fits") {
minCut = Math.round(minCut * 255);
maxCut = Math.round(maxCut * 255);
}
this.pixelSettingsContent.set('mincut', +minCut.toFixed(4))
this.pixelSettingsContent.set('maxcut', +maxCut.toFixed(4))
this.pixelSettingsContent.set('stretch', stretch)
let fmtInput = this.pixelSettingsContent.getInput('fmt')
fmtInput.innerHTML = '';
for (const option of layer.formats) {
fmtInput.innerHTML += "<option>" + option + "</option>";