import { Vec3 } from 'playcanvas';
import { DataTable } from './data-table';
import type { DeviceCreator } from './types';
/**
 * Translate splats by a 3D vector offset.
 */
type Translate = {
    /** Action type identifier. */
    kind: 'translate';
    /** Translation offset. */
    value: Vec3;
};
/**
 * Rotate splats by Euler angles.
 */
type Rotate = {
    /** Action type identifier. */
    kind: 'rotate';
    /** Euler angles in degrees (x, y, z). */
    value: Vec3;
};
/**
 * Uniformly scale all splats.
 */
type Scale = {
    /** Action type identifier. */
    kind: 'scale';
    /** Scale factor. */
    value: number;
};
/**
 * Remove splats containing NaN or Infinity values.
 */
type FilterNaN = {
    /** Action type identifier. */
    kind: 'filterNaN';
};
/**
 * Filter splats by comparing a column value.
 *
 * For `opacity`, `scale_0/1/2`, and `f_dc_0/1/2`, the value is specified in user-friendly
 * (transformed) space: linear opacity (0-1), linear scale, and linear color (0-1).
 * The value is automatically converted to raw PLY space before comparison.
 *
 * To compare against raw PLY values directly (without the user-friendly conversion),
 * use the `_raw` suffix (e.g. `opacity_raw`, `scale_0_raw`, `f_dc_0_raw`).
 *
 * If the DataTable has a pending spatial transform and the column is affected by it
 * (position, rotation, scale, or SH columns), the transform is applied (baked in)
 * before comparison. This applies to both regular and `_raw` columns.
 */
type FilterByValue = {
    /** Action type identifier. */
    kind: 'filterByValue';
    /** Name of the column to compare. */
    columnName: string;
    /** Comparison operator. */
    comparator: 'lt' | 'lte' | 'gt' | 'gte' | 'eq' | 'neq';
    /** Value to compare against. */
    value: number;
};
/**
 * Remove spherical harmonic bands above a threshold.
 */
type FilterBands = {
    /** Action type identifier. */
    kind: 'filterBands';
    /** Maximum SH band to keep (0-3). */
    value: 0 | 1 | 2 | 3;
};
/**
 * Keep only splats within a bounding box.
 */
type FilterBox = {
    /** Action type identifier. */
    kind: 'filterBox';
    /** Minimum corner of the box. */
    min: Vec3;
    /** Maximum corner of the box. */
    max: Vec3;
};
/**
 * Keep only splats within a sphere.
 */
type FilterSphere = {
    /** Action type identifier. */
    kind: 'filterSphere';
    /** Center of the sphere. */
    center: Vec3;
    /** Radius of the sphere. */
    radius: number;
};
/**
 * Parameter for .mjs generator modules.
 */
type Param = {
    /** Action type identifier. */
    kind: 'param';
    /** Parameter name. */
    name: string;
    /** Parameter value. */
    value: string;
};
/**
 * Assign a LOD level to all splats.
 */
type Lod = {
    /** Action type identifier. */
    kind: 'lod';
    /** LOD level to assign. */
    value: number;
};
/**
 * Print a statistical summary to the logger.
 */
type Summary = {
    /** Action type identifier. */
    kind: 'summary';
};
/**
 * Reorder splats by Morton code (Z-order curve) for improved spatial locality.
 */
type MortonOrder = {
    /** Action type identifier. */
    kind: 'mortonOrder';
};
/**
 * Simplify splats to a target count using NanoGS progressive pairwise merging.
 *
 * Instead of discarding low-visibility splats, this iteratively merges nearby
 * similar splats into single approximating Gaussians using Mass-Preserving
 * Moment Matching (MPMM), preserving scene structure and appearance.
 */
type Decimate = {
    /** Action type identifier. */
    kind: 'decimate';
    /** Target number of splats to keep, or null for percentage mode. */
    count: number | null;
    /** Percentage of splats to keep (0-100), or null for count mode. */
    percent: number | null;
};
/**
 * Remove Gaussians that don't meaningfully contribute to any solid voxel.
 *
 * GPU-voxelizes the scene at a given resolution, then evaluates each Gaussian's
 * opacity contribution at occupied voxel centers. Discards Gaussians whose
 * contribution is below a minimum threshold at every solid voxel.
 */
type FilterFloaters = {
    /** Action type identifier. */
    kind: 'filterFloaters';
    /** Voxel size in world units. Default: 0.05 */
    voxelResolution?: number;
    /** Opacity threshold for solid voxels. Default: 0.1 */
    opacityCutoff?: number;
    /** Minimum Gaussian contribution at a voxel center to be kept. Default: 1/255 */
    minContribution?: number;
};
/**
 * Filter Gaussians to keep only those in the connected cluster at a seed position.
 *
 * GPU-voxelizes the scene at a coarse resolution, finds the connected component
 * of occupied blocks containing the seed, and keeps only Gaussians whose AABB
 * overlaps that cluster.
 */
type FilterCluster = {
    /** Action type identifier. */
    kind: 'filterCluster';
    /** Voxel size in world units for coarse voxelization. Default: 1.0 */
    voxelResolution?: number;
    /** Seed position for finding the connected component. Default: Vec3(0,0,0) */
    seed?: Vec3;
    /** Opacity threshold for solid voxels. Default: 0.999 */
    opacityCutoff?: number;
    /** Minimum Gaussian contribution at a cluster voxel center to be kept. Default: 0.1 */
    minContribution?: number;
};
/**
 * Options for processing actions that require external resources.
 */
type ProcessOptions = {
    /** Function to create a GPU device (required for filterFloaters, filterCluster). */
    createDevice?: DeviceCreator;
};
/**
 * A processing action to apply to splat data.
 *
 * Actions can transform, filter, or analyze the data:
 * - `translate` - Move splats by a Vec3 offset
 * - `rotate` - Rotate splats by Euler angles (degrees)
 * - `scale` - Uniformly scale splats
 * - `filterNaN` - Remove splats with NaN/Inf values
 * - `filterByValue` - Keep splats matching a column condition
 * - `filterBands` - Remove spherical harmonic bands above a threshold
 * - `filterBox` - Keep splats within a bounding box
 * - `filterSphere` - Keep splats within a sphere
 * - `filterFloaters` - Remove splats not contributing to any occupied voxel (GPU)
 * - `filterCluster` - Keep splats in the connected cluster at a seed position (GPU)
 * - `lod` - Assign LOD level to all splats
 * - `summary` - Print statistical summary to logger
 * - `mortonOrder` - Reorder splats by Morton code for spatial locality
 * - `decimate` - Simplify to target count via progressive pairwise merging
 */
type ProcessAction = Translate | Rotate | Scale | FilterNaN | FilterByValue | FilterBands | FilterBox | FilterSphere | FilterFloaters | FilterCluster | Param | Lod | Summary | MortonOrder | Decimate;
/**
 * Applies a sequence of processing actions to splat data.
 *
 * Actions are applied in order and can include transformations (translate, rotate, scale),
 * filters (NaN, value, box, sphere, bands), and analysis (summary).
 *
 * @param dataTable - The input splat data.
 * @param processActions - Array of actions to apply in sequence.
 * @param options - Optional resources for GPU-dependent actions (e.g. filterCluster).
 * @returns The processed DataTable (may be a new instance if filtered).
 *
 * @example
 * ```ts
 * import { Vec3 } from 'playcanvas';
 *
 * const processed = await processDataTable(dataTable, [
 *     { kind: 'scale', value: 0.5 },
 *     { kind: 'translate', value: new Vec3(0, 1, 0) },
 *     { kind: 'filterNaN' },
 *     // opacity value is in linear space (0-1), automatically converted to logit for comparison
 *     { kind: 'filterByValue', columnName: 'opacity', comparator: 'gt', value: 0.1 }
 * ]);
 * ```
 */
declare const processDataTable: (dataTable: DataTable, processActions: ProcessAction[], options?: ProcessOptions) => Promise<DataTable>;
export { processDataTable, type ProcessAction, type ProcessOptions, type Translate, type Rotate, type Scale, type FilterNaN, type FilterByValue, type FilterBands, type FilterBox, type FilterSphere, type FilterFloaters, type FilterCluster, type Param, type Lod, type Summary, type MortonOrder, type Decimate };
