import { Color } from 'three';
import { ColorFormat } from './buf/draw/v1/metadata_pb';
export declare const STRIDE: {
    /** Arrows: [x, y, z, ox, oy, oz, ...] */
    readonly ARROWS: 6;
    /** Line/Points: [x, y, z, ...] */
    readonly POSITIONS: 3;
    /** Nurbs control points: [x, y, z, ox, oy, oz, theta, ...] */
    readonly NURBS_CONTROL_POINTS: 7;
    /** Nurbs knots/weights: [w, ...] */
    readonly NURBS_KNOTS: 1;
    /** Colors: [r, g, b, ...] */
    readonly COLORS_RGB: 3;
};
/**
 * Creates a Float32Array view over a Uint8Array without copying data.
 * Falls back to a copy if the buffer is not 4-byte aligned (rare with protobuf).
 *
 * An optional `transform` applies a per-element function during conversion.
 *
 * @param bytes - The raw bytes from a protobuf bytes field
 * @param transform - Optional function applied to every float element
 * @returns A Float32Array view or copy of the data
 *
 * @example
 * ```ts
 * const positions = asFloat32Array(line.positions)
 * const meterPositions = asFloat32Array(line.positions, inMeters)
 * ```
 */
export declare const asFloat32Array: (bytes: Uint8Array, transform?: (value: number) => number) => Float32Array;
/**
 * Sets a Three.js Color from 3 bytes of a uint8 RGB color array starting at `offset`.
 * Mutates and returns `target` — pass a pre-allocated Color to avoid allocations
 * in hot paths.
 *
 * @param bytes - Uint8Array with at least `offset + 3` elements [r, g, b, ...]
 * @param target - Color instance to write into
 * @param offset - Byte offset to start reading from (default 0)
 * @returns The mutated `target`, or black if the array has fewer than `offset + 3` elements
 *
 * @example
 * ```ts
 * asColor(colors.current, material.color)
 * asColor(colors.current, pointColorUtil, STRIDE.COLORS_RGB) // read second color
 * ```
 */
export declare const asColor: (bytes: Uint8Array, target: Color, offset?: number) => Color;
export declare const asRGB: (bytes: Uint8Array, target: {
    r: number;
    g: number;
    b: number;
}, offset?: number) => {
    r: number;
    g: number;
    b: number;
};
/**
 * Reads a byte from a uint8 opacities array at `index` and normalizes it to 0-1.
 * Returns `fallback` when the array is absent or shorter than `index + 1`.
 *
 * @param opacities - Uint8Array of opacity values (0-255). Length 1 = uniform. Length N = per-vertex.
 * @param fallback - Value to return when no opacity byte is available (default 1)
 * @param index - Index into the opacities array (default 0)
 * @returns Normalized opacity in 0-1 range, or the fallback value
 *
 * @example
 * ```ts
 * material.opacity = asOpacity(metadata.opacities)
 * ```
 */
export declare const asOpacity: (opacities: Uint8Array | undefined, fallback?: number, index?: number) => number;
/**
 * Returns true when `colors` contains exactly one color (RGB or RGBA),
 * as opposed to a per-vertex color array.
 *
 * @example
 * ```ts
 * if (isSingleColor(colors)) {
 *   material.color = asColor(colors, colorUtil)
 * }
 * ```
 */
export declare const isSingleColor: (colors: Uint8Array) => boolean;
/**
 * Returns true when `colors` contains per-vertex color data rather than a
 * single uniform color.
 *
 * @param colors - Uint8Array of packed RGB bytes (stride of 3)
 *
 * @example
 * ```ts
 * if (isVertexColors(colors, positions.length / 3)) {
 *   // treat as per-vertex
 * }
 * ```
 */
export declare const isVertexColors: (colors: Uint8Array | undefined) => colors is Uint8Array;
/**
 * Per-element transform that converts a millimeter value to meters.
 * Pass to {@link asFloat32Array} to fuse the conversion into a single pass.
 *
 * @example
 * ```ts
 * const positions = asFloat32Array(line.positions, inMeters)
 * ```
 */
export declare const inMeters: (v: number) => number;
/** Returns the byte stride for a given color format. */
export declare const colorStride: (format?: ColorFormat) => number;
