Skip to content

Commit c5992fe

Browse files
authored
Firefly-1311: Merge PR #1429 from FIREFLY-1311-hips-smoothing
Firefly-1311: fixed: hips tile should not be smoothed at highest resolution
2 parents b717be6 + 1cf8d14 commit c5992fe

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

docs/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- [Notes on next version](next-release-details.md)
88

99
## Version 2023.2
10+
- 2023.2.1 - (Sept 14, 2023)
11+
- docker tag: `latest`, `2023.2`, `2023.2.1`
1012
- 2023.2.0 - (Aug 25, 2023)
1113
- docker tag: `2023.2.0`
1214

@@ -36,6 +38,10 @@
3638
- [All Bug Fixes](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr+milestone%3a2023.2+label%3abug)
3739
- [All PRs](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr++milestone%3a2023.2+)
3840

41+
##### _Patches 2023.2_
42+
- 2023.2.1
43+
- Fixed: HiPS tile pixels should not be smoothed at highest resolution: [Firefly-1311](https://github.com/Caltech-IPAC/firefly/pull/1429)
44+
- Small bug fixes related to SHA Release [PR](https://github.com/Caltech-IPAC/firefly/pull/1425), [PR](https://github.com/Caltech-IPAC/firefly/pull/1425)
3945

4046
## Version 2023.1
4147
- 2023.1.5 - (June 15, 2023)

src/firefly/js/visualize/HiPSUtil.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ export function getHiPSNorderlevel(plot, limitToImageDepth= false) {
133133
if (screenPixArcsecSize> 100) return {useAllSky:true, norder:3};
134134

135135
let norder= getNOrderForPixArcSecSize(screenPixArcsecSize);
136+
let maxOrder= Number(plot.hipsProperties?.hips_order);
136137

137138
if (limitToImageDepth) {
138-
let maxOrder= Number(plot.hipsProperties?.hips_order);
139139
if (!maxOrder) {
140140
const hipsPixelScale= Number(plot.hipsProperties?.hips_pixel_scale);
141141
maxOrder= hipsPixelScale ? getNOrderForPixArcSecSize(hipsPixelScale*3600) : 3;
142142
}
143143
norder= Math.min(norder, maxOrder);
144144
}
145-
return {norder, useAllSky:false};
145+
return {norder, useAllSky:false, isMaxOrder:norder===maxOrder};
146146

147147
}
148148

src/firefly/js/visualize/iv/HiPSRenderer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ const colorId = (plot) => plot?.colorTableId ?? -1;
2121
* @param isBaseImage
2222
* @param screenRenderEnabled
2323
* @param hipsColorOps
24+
* @param {boolean} isMaxOrder - true if the order drawing is max order
2425
* @return {{drawTile(*=, *=): undefined, drawTileImmediate(*=, *, *=): void, abort(): void}}
2526
*/
26-
export function makeHipsRenderer(screenRenderParams, totalCnt, isBaseImage, screenRenderEnabled, hipsColorOps) {
27+
export function makeHipsRenderer(screenRenderParams, totalCnt, isBaseImage, screenRenderEnabled,
28+
hipsColorOps, isMaxOrder) {
2729

2830
let renderedCnt=0;
2931
let abortRender= false;
3032
let firstRenderTime= 0;
3133
let renderComplete= false;
3234
const {offscreenCanvas, plotView}= screenRenderParams;
3335
const offscreenCtx = offscreenCanvas.getContext('2d');
36+
offscreenCtx.imageSmoothingEnabled = !isMaxOrder;
3437
const allImageCancelFuncs= [];
3538
let plotTaskId;
3639

src/firefly/js/visualize/iv/HiPSTileDrawer.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function createHiPSDrawer(targetCanvas, GPU) {
5050
const {viewDim}= plotView;
5151
let transitionNorder;
5252

53-
const {norder, useAllSky}= getHiPSNorderlevel(plot, true);
53+
const {norder, useAllSky, isMaxOrder}= getHiPSNorderlevel(plot, true);
5454
const {fov,centerWp}= getPointMaxSide(plot,viewDim);
5555
if (!centerWp) return;
5656
const tilesToLoad= findCellOnScreen(plot,viewDim,norder, fov, centerWp);
@@ -79,12 +79,12 @@ export function createHiPSDrawer(targetCanvas, GPU) {
7979

8080
if (drawTiming!==DrawTiming.IMMEDIATE) {
8181
drawTransitionalImage(fov,centerWp,targetCanvas,plot, plotView,norder, transitionNorder, hipsColorOps,
82-
opacity, tilesToLoad);
82+
opacity, tilesToLoad, true, isMaxOrder);
8383
}
8484

8585
const offscreenCanvas = makeOffScreenCanvas(plotView,plot,drawTiming!==DrawTiming.IMMEDIATE);
8686
abortLastDraw= drawDisplay(targetCanvas, offscreenCanvas, plot, plotView, norder, hipsColorOps,
87-
tilesToLoad, useAllSky, opacity, drawTiming);
87+
tilesToLoad, useAllSky, opacity, drawTiming, true, isMaxOrder);
8888
lastDrawNorder= norder;
8989
lastFov= fov;
9090
};
@@ -116,9 +116,9 @@ function drawTransitionalImage(fov, centerWp, targetCanvas, plot, plotView,
116116
const tilesToLoad3= findCellOnScreen(plot,viewDim,3, fov, centerWp);
117117
const offscreenCanvas = makeOffScreenCanvas(plotView,plot,false);
118118
drawDisplay(targetCanvas, offscreenCanvas, plot, plotView, 2, hipsColorOps, tilesToLoad2, true,
119-
opacity, DrawTiming.IMMEDIATE, false);
119+
opacity, DrawTiming.IMMEDIATE, false, false);
120120
drawDisplay(targetCanvas, offscreenCanvas, plot, plotView, 3, hipsColorOps, tilesToLoad3, false,
121-
opacity, DrawTiming.IMMEDIATE);
121+
opacity, DrawTiming.IMMEDIATE, true, false);
122122
}
123123
else {
124124
let lookMore= true;
@@ -129,7 +129,7 @@ function drawTransitionalImage(fov, centerWp, targetCanvas, plot, plotView,
129129
const hasSomeTiles= tilesToLoad.some( (tile)=> findTileCachedImage(createImageUrl(plot,tile),colorTableId,bias,contrast));
130130
if (hasSomeTiles || testNorder===3) { // if there are tiles or we need to do the allsky
131131
drawDisplay(targetCanvas, offscreenCanvas, plot, plotView, testNorder, hipsColorOps, tilesToLoad, testNorder===3,
132-
opacity, DrawTiming.IMMEDIATE, false);
132+
opacity, DrawTiming.IMMEDIATE, false, false);
133133
lookMore= false;
134134
}
135135
}
@@ -157,17 +157,19 @@ const fovEqual= (fov1,fov2) => Math.trunc(fov1*10000) === Math.trunc(fov2*10000)
157157
* @param opacity
158158
* @param drawTiming
159159
* @param screenRenderEnabled
160+
* @param {boolean} [isMaxOrder] true if this norder is the max order
160161
*/
161162
function drawDisplay(targetCanvas, offscreenCanvas, plot, plotView, norder, hipsColorOps, tilesToLoad, useAllSky, opacity,
162-
drawTiming= DrawTiming.ASYNC, screenRenderEnabled= true) {
163+
drawTiming= DrawTiming.ASYNC, screenRenderEnabled= true, isMaxOrder=false) {
163164
if (!targetCanvas) return noOp;
164165
const {viewDim}= plotView;
165166
const boundingBox= computeBounding(primePlot(plotView),viewDim.width,viewDim.height);// should use main plot not overlay plot
166167
const offsetX= boundingBox.x>0 ? boundingBox.x : 0;
167168
const offsetY= boundingBox.y>0 ? boundingBox.y : 0;
168169

169170
const screenRenderParams= {plotView, plot, targetCanvas, offscreenCanvas, opacity, offsetX, offsetY};
170-
const drawer= makeHipsRenderer(screenRenderParams, tilesToLoad.length, !plot.asOverlay, screenRenderEnabled, hipsColorOps);
171+
const drawer= makeHipsRenderer(screenRenderParams, tilesToLoad.length, !plot.asOverlay,
172+
screenRenderEnabled, hipsColorOps, isMaxOrder);
171173

172174
if (plot.blank) {
173175
drawer.renderToScreen();

0 commit comments

Comments
 (0)