/** * Copyright (c) 2026 mol* contributors, licensed under MIT, See LICENSE file for more info. * @author Tadej Satler * * Turning a binary voxel selection into a soft-edged mask — shared by the volume tools. */ import { Tensor } from '../../mol-math/linear-algebra.js'; import { RuntimeContext } from '../../mol-task/index.js'; import type { GridBox } from './types.js'; /** * Mask value at distance `d` (in voxels) from the selection: `1` up to `extend`, then a raised * cosine falling to `0` over `softEdge + 1` voxels. */ export declare function softValue(d: number, extend: number, softEdge: number): number; /** Tight bounding box of the voxels whose value equals `match`, or `undefined` if there are none. */ export declare function voxelBBox(values: Uint8Array, space: Tensor.Space, match: number): GridBox | undefined; /** Grows `box` by `pad` voxels on every side, clamped to the grid. */ export declare function padGridBox(box: GridBox, pad: number, dimensions: ArrayLike): GridBox; /** * Extends a binary voxel selection by `extend` voxels and adds a raised-cosine falloff, writing * the result on the full grid. * * The distance transform only runs inside the selection's bounding box padded by the reach of the * edge, since every voxel outside that is `0` anyway — for a typical map that is a few percent of * the grid. Distances are exact Euclidean, so the falloff is smooth rather than quantised to the * few steps a chamfer transform can produce. */ export declare function softMaskFromBinary(selected: Uint8Array, space: Tensor.Space, extend: number, softEdge: number, ctx: RuntimeContext): Promise;