fix(weather): upright N. America cloud tiles; lift shells over coarse 3D tiles (#730)

This commit is contained in:
Bilawal Sidhu authored and GitHub committed 2026-09-23 14:49:39 -05:00
1 parent 082074a006
commit 005254fcd1
7 files changed
+130 -3

No files matched your search

+10 -2
View File
@@ -4,13 +4,21 @@ import { infraredAlpha } from './infraredAlpha.js';
export const MAX_MOSAIC_BYTES = 4 * 1024 * 1024;
/** Apply the display transfer once to a decoded image. */
export function processInfraredImage(image, mode, createCanvas) {
/** Apply the display transfer once to a decoded image; `flipY` draws a
* bottom-up image back upright. */
export function processInfraredImage(
image,
mode,
createCanvas,
{ flipY = false } = {},
) {
const canvas = createCanvas();
canvas.width = image.width;
canvas.height = image.height;
const context = canvas.getContext('2d');
if (flipY) context.setTransform(1, 0, 0, -1, 0, image.height);
context.drawImage(image, 0, 0);
if (flipY) context.setTransform(1, 0, 0, 1, 0, 0);
const pixels = context.getImageData(0, 0, canvas.width, canvas.height);
pixels.data.set(infraredAlpha(pixels.data, mode));
context.putImageData(pixels, 0, 0);