Skip to content

Commit

Permalink
modified: htdocs/fitswebql/fitswebqlse.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jvo203 committed Oct 2, 2023
1 parent 2c18cec commit f694384
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions htdocs/fitswebql/fitswebqlse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,28 @@ function crosshair_move(event) {
// update the velocitytooltip html
d3.select("#velocitytooltip")
.html(velocity.toFixed(2) + " km/s");

// get the 'PVCanvas'
let canvas = document.getElementById("PVCanvas");

// apply a 10-pixel correction to x and y
let pixel = canvas.getContext('2d').getImageData(tooltipX - 10, tooltipY - 10, 1, 1).data;
console.log("P-V pixel:", pixel);

// get the RGB from the pixel
let r = pixel[0];
let g = pixel[1];
let b = pixel[2];

// set the background of "pvtooltip" to r,g,b
d3.select("#pvtooltip")
.style("background-color", "rgb(" + r + "," + g + "," + b + ")");

const inputs = [r / 255, g / 255, b / 255];
console.log("inputs:", inputs);

let intensity = rbf_compute(inputs);
console.log("inverted pixel intensity:", intensity);
}

/** ---------------------------------------------------------------------
Expand Down

0 comments on commit f694384

Please sign in to comment.