|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { setCurrentImage } from '../state.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export async function displayMainImage(imageData) {
|
|
|
const preview = document.getElementById('mainImagePreview');
|
|
|
const img = document.getElementById('mainImage');
|
|
|
const placeholder = preview.querySelector('.placeholder');
|
|
|
|
|
|
if (!img || !placeholder) return;
|
|
|
|
|
|
img.src = imageData;
|
|
|
img.style.display = 'block';
|
|
|
placeholder.style.display = 'none';
|
|
|
|
|
|
setCurrentImage(imageData);
|
|
|
|
|
|
|
|
|
import('../state.js').then(module => {
|
|
|
module.setZoomLevel(1);
|
|
|
});
|
|
|
img.style.transform = 'scale(1)';
|
|
|
|
|
|
|
|
|
const zoomDisplay = document.getElementById('zoomLevel');
|
|
|
if (zoomDisplay) {
|
|
|
zoomDisplay.textContent = 'Zoom: 100%';
|
|
|
}
|
|
|
|
|
|
|
|
|
const zoomIn = document.getElementById('zoomIn');
|
|
|
const zoomOut = document.getElementById('zoomOut');
|
|
|
const zoomReset = document.getElementById('zoomReset');
|
|
|
|
|
|
if (zoomIn) zoomIn.disabled = false;
|
|
|
if (zoomOut) zoomOut.disabled = false;
|
|
|
if (zoomReset) zoomReset.disabled = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function displayQuickImage(imageData) {
|
|
|
const preview = document.getElementById('quickImagePreview');
|
|
|
const img = document.getElementById('quickImage');
|
|
|
const placeholder = preview.querySelector('.placeholder');
|
|
|
|
|
|
if (!img || !placeholder) return;
|
|
|
|
|
|
img.src = imageData;
|
|
|
img.style.display = 'block';
|
|
|
placeholder.style.display = 'none';
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function displayCroppedEmbryo(index, detection, totalCount) {
|
|
|
const img = document.getElementById('croppedImage');
|
|
|
const counter = document.getElementById('embryoCounter');
|
|
|
|
|
|
if (img) {
|
|
|
img.src = detection.imageData;
|
|
|
img.style.display = 'block';
|
|
|
}
|
|
|
|
|
|
if (counter) {
|
|
|
counter.textContent = `Embryo ${index + 1} of ${totalCount}`;
|
|
|
}
|
|
|
}
|
|
|
|