import type { PickingInfo, UpdateParameters } from "@deck.gl/core";
import { Layer } from "@deck.gl/core";
import { Model } from "@luma.gl/engine";
import type { Material } from "../gpglLayers/typeDefs";
import type { DeckGLLayerContext, ExtendedLayerProps, LayerPickInfo } from "../utils/layerTools";
import { type ColormapProps, type ColormapSetup } from "../utils/colormapTools";
import type { RGBColor, TypedFloatArray, TypedIntArray } from "../../utils";
import type { ValueArray2D } from "./typeDefs";
/**
 * Props for defining a triangle surfaces with optional value mapping and texture coordinates.
 * If a value map, ie. a 2D array of values, is provided, it will be used to generate a 2D texture
 * of values which will be mapped on the surface and converted to colors using the colormap
 *
 * @property topology The type of triangle topology to use: either `triangle-list` or `triangle-strip`.
 * @property vertices The array of vertex positions, as either a typed float array or a number array.
 * @property normals (Optional) The array of vertex normals, as either a typed float array or a number array.
 * @property texCoords (Optional) The array of texture coordinates, as either a typed float array or a number array.
 * @property valueMap (Optional) A 2D array of values used to generate a value texture.
 * @property vertexIndices An object containing the indices of vertices and the size of each index group.
 * @property vertexIndices.value The array of vertex indices, as either a typed int array or a number array.
 * @property vertexIndices.size The number of indices per group (e.g., 3 for triangles).
 */
export type ValueMappedTriangleProps = {
    topology: "triangle-list" | "triangle-strip";
    vertices: TypedFloatArray | number[];
    normals?: TypedFloatArray | number[];
    texCoords?: TypedFloatArray | number[];
    valueMap?: ValueArray2D;
    vertexIndices: {
        value: TypedIntArray | number[];
        size: number;
    };
};
/**
 * Props for defining a triangle mesh geometry.
 *
 * @property topology Specifies the type of mesh topology. Can be either `line-list` or `line-strip`.
 * @property vertices Optional array of vertex positions. Accepts either a typed float array or a regular number array.
 *                      If not provided, the vertices of the ValueMappedTriangleProps will be used.
 * @property vertexIndices Object containing the indices for the vertices and the size of each index group.
 * @property vertexIndices.value The indices referencing vertices, as a typed integer array or a number array.
 * @property vertexIndices.size The number of indices per primitive (e.g., 1 for vertex indices).
 */
export type TriangleMeshProps = {
    topology: "line-list" | "line-strip";
    vertices?: TypedFloatArray | number[];
    vertexIndices: {
        value: TypedIntArray | number[];
        size: number;
    };
};
/**
 * Props for the GpglValueMappedSurfaceLayer component, which renders surfaces with value-mapped textures.
 *
 * @remarks
 * This interface extends `ExtendedLayerProps` and provides configuration for rendering surfaces
 * with value-mapped textures, optional triangle meshes, and various rendering options such as
 * shading, lighting, and depth testing.
 */
export interface GpglValueMappedSurfaceLayerProps extends ExtendedLayerProps {
    /** Surfaces with a value map used as texture. */
    valueMappedTriangles: ValueMappedTriangleProps[];
    /** Optional triangle meshes. Inferred from `valueMappedTriangles` if not specified. */
    triangleMeshes: TriangleMeshProps[];
    /** Whether to display the mesh overlay. */
    showMesh: boolean;
    /** Definition of the colormap to use for mapping values to colors. */
    colormap?: ColormapProps;
    /** Setup of the colormap. */
    colormapSetup?: ColormapSetup;
    /** Plain color if no value map is provided. */
    color: RGBColor;
    /**  Surface material properties.
     * material: true  = default material, coloring depends on surface orientation and lighting.
     *           false = no material,  coloring is independent on surface orientation and lighting.
     *           or full spec:
     *      material: {
     *           ambient: 0.35,
     *           diffuse: 0.9,
     *           shininess: 32,
     *           specularColor: [38, 38, 38],
     *       }
     * Default value: true.
     */
    material: Material;
    /** Enables smooth shading for the surface.
     * If true, the per-vertex normals will be interpolated across triangles and used for shading.
     * Otherwise, a constant normal will be computed and used across each triangle.
     */
    smoothShading: boolean;
    /** Enables depth testing for rendering. */
    depthTest: boolean;
    /** Indicates if the Z axis increases downwards. */
    ZIncreasingDownwards: boolean;
}
/**
 * GpglValueMappedSurfaceLayer is a layer handling surfaces textured by a value map.
 * These values are converted to color using a colormap and associated setup.
 *
 * A primary use case is to display seismic data.
 * The surfaces are expected to be small compared to the ones handled by the triangles layer.
 */
export declare class GpglValueMappedSurfaceLayer extends Layer<GpglValueMappedSurfaceLayerProps> {
    setShaderModuleProps(args: Partial<{
        [x: string]: Partial<Record<string, unknown> | undefined>;
    }>): void;
    initializeState(context: DeckGLLayerContext): void;
    updateState(params: UpdateParameters<Layer<GpglValueMappedSurfaceLayerProps>>): void;
    private _consolidateColormap;
    private _createColormapTexture;
    private _createValuesTexture;
    private _createModels;
    getModels(): Model[];
    private _getClampColors;
    draw(args: any): void;
    decodePickingColor(): number;
    getPickingInfo({ info }: {
        info: PickingInfo;
    }): LayerPickInfo;
}
