UNPKG

@playcanvas/splat-transform

Version:

Library and CLI tool for 3D Gaussian splat format conversion and transformation

37 lines (36 loc) 2.01 kB
import { DataTable, TypedArray } from './data-table'; import { Transform } from '../utils'; /** * Computes the delta transform needed to convert raw data from its current * coordinate system into the output format's coordinate system. * * @param transform - The DataTable's current source transform. * @param outputFormatTransform - The output format's expected transform. * @returns The delta transform to apply to raw data, or null if it is identity. */ declare const computeWriteTransform: (transform: Transform, outputFormatTransform: Transform) => Transform | null; /** * Generates transformed typed arrays for requested columns, applying the given * transform. Columns unaffected by the transform return references to the * original arrays (zero copy). * * @param dataTable - The source DataTable. * @param columnNames - Which columns to produce. * @param delta - The transform to apply. If identity or null, original arrays are returned. * @param inPlace - If true, mutate the DataTable's existing column arrays instead of allocating new ones. * @returns A map of column name to typed array. */ declare const transformColumns: (dataTable: DataTable, columnNames: string[], delta: Transform | null, inPlace?: boolean) => Map<string, TypedArray>; /** * Returns a DataTable with column data converted to the target coordinate * space. If the DataTable is already in that space, returns it unchanged. * * @param dataTable - The source DataTable. * @param targetTransform - The desired coordinate-space transform. * @param inPlace - If true, mutate the DataTable's column arrays and transform * in place instead of allocating a new DataTable. The caller must ensure no * other code depends on the original column data. * @returns A DataTable whose raw data is in the target coordinate space. */ declare const convertToSpace: (dataTable: DataTable, targetTransform: Transform, inPlace?: boolean) => DataTable; export { transformColumns, computeWriteTransform, convertToSpace };