{#if kind === 'batch'}

1. Batch photos

Add one or more photos of the slab on a green or black sheet.

{photos.length} photo{photos.length === 1 ? '' : 's'}
{#if photos.length}
{#each photos as p, i (i)}
photo {i}
{/each}
{/if} {:else if kind === 'pickCalibration'}

2. Pick calibration photo

Choose the reference shot that will drive mask, axis, and measure.

{#each photos as p, i (i)}
session.pickCalibration(i)} on:keydown={(e) => onThumbKey(e, i)} aria-label="pick photo {i} as calibration"> photo {i}
{/each}
{:else if kind === 'mask'}

3. Mask

Adjust sheet and sensitivity, then approve the mask. Removed background shows as a gray checkerboard.

{#if cap.source && maskObjUrl}
calibration photo (hidden, drives mask preview)
{/if} {#if control}
{/if} {#if overlay && overlay.slabPx === 0}

No slab pixels detected — the mask removed everything. Lower the sensitivity, or set the sheet to match what the photo sits on, then retake if the shot is dark.

{:else if failed}

No slab pixels detected. Adjust controls or retake.

{:else if overlay}

Mask settled: {overlay.slabPx} slab pixels.

{/if}
{:else if kind === 'axis'}

4. Length axis

Place the tape endpoints at the two ends of the slab's length.

{:else if kind === 'measure'}

5. Measure

Enter length and thickness (1/8″ steps). Widths, sqft, and bdft are derived from the calibration mask.

{#if measure}
{/if} {#if results}
Length {fmt(results.lengthEighths)}
Thickness {fmt(results.thicknessEighths)}
Sqft {results.sqft}
Bdft {results.bdft}
{:else} {/if} {:else}

Unknown capture state.

{/if}