/** * @file preset.ts * @brief Material resolution by size, scheme, presence and surroundings. * @details Piecewise-linear size knots preserve duplicate-x steps; packing reuses storage. */ import { type Scheme } from "./layout.js"; import { type MaterialSpec } from "./material.js"; import { PRESET_COUNT, PRESET_NAMES } from "./presets.js"; export declare const PRESET_STANDARD = 0; export declare const PRESET_CLEAR = 1; /** @brief Glass with no effect at all (the backdrop as it is). */ export declare const PRESET_IDENTITY = 2; export declare const PRESET_MENU = 3; export declare const PRESET_NOTIFICATION = 4; export declare const PRESET_POPOVER = 5; export declare const PRESET_SIDEBAR = 6; export declare const PRESET_ATTACHED_SIDEBAR = 7; export declare const PRESET_INSPECTOR = 8; export declare const PRESET_DOCK = 9; export declare const PRESET_CONTROL_PANEL = 10; export declare const PRESET_KEYBOARD = 11; export declare const PRESET_WIDGET = 12; export declare const PRESET_ICON = 13; export declare const PRESET_PLAYER = 14; export declare const PRESET_CALL = 15; export declare const PRESET_CAMERA = 16; export declare const PRESET_CONTROL = 17; export declare const PRESET_LOUPE = 18; export declare const PRESET_SLIDER = 19; export declare const PRESET_MONOGRAM = 20; export declare const PRESET_BUBBLE = 21; export declare const PRESET_TEXT = 22; export declare const PRESET_ASSISTANT = 23; export declare const PRESET_ASSISTANT_CARD = 24; export declare const PRESET_FOCUS_RING = 25; export declare const PRESET_FOCUS_BACKGROUND = 26; export declare const PRESET_VEHICLE = 27; export { PRESET_COUNT, PRESET_NAMES }; export declare const PRESET_RANGE: Float32Array; /** * @brief Resolve environment flags to a supported preset-table row. * @details Rows cover default, inactive, contrast, reduced transparency, reduced motion, combined * accessibility, inactive with contrast, tinted and button outlines. Other combinations select * their strongest supported setting. */ export declare function surroundings(environment: number): number; /** * @brief The material vector of a preset row. * @param p Receives `VECTOR` values. * @param preset Preset number. * @param scheme 0 dark, 1 light. * @param environment `ENV_*` bits. * @param least Short side of the smallest member (points). * @param side Short side of the largest member (points). * @returns The table row (whose backdrop scale may come from the blur, see `packPreset`). */ export declare function presetVector(p: Float64Array, preset: number, scheme: number, environment: number, least: number, side: number): number; /** @brief Number of the preset with a name of `PRESET_NAMES`, or -1. */ export declare function presetNumber(name: string): number; /** * @brief The short side a preset is always evaluated at, or 0 when it follows the short side of the * shape. * @details The dock is drawn at the largest size class (160) whatever the height of its bar. */ export declare function presetSide(preset: number): number; /** * @brief Check whether a preset is eligible for backdrop luminance adaptation. * @details Tinted, reduced-transparency and increased-contrast settings keep the selected scheme * fixed, including for otherwise eligible small glass. */ export declare function presetFollows(preset: number, environment: number): boolean; /** * @brief Pack a preset for the current size, scheme, presence, and surroundings. * @details At `mix` 0 or 1 with presence 1, the result matches packing the corresponding * `presetMaterial` on a 2× screen. On other screens, rows whose blur determines the backdrop scale * use the scale estimated for that screen. * @param d Block storage; the material rows (`MATERIAL_FLOATS` at `o`, without the color layer) are * written. * @param o Float offset of the block. * @param info Receives six values at `io` (see `packParams`). * @param io Float offset into `info`. * @param preset Preset number (`PRESET_*`). * @param side Short side of the shape in points (of the largest member for a union). * @param least Smallest short side in points (equal to `side` for a single shape). * @param mix Scheme: 0 dark, 1 light; values between blend the two (transitions of adaptive glass). * @param presence 1 for the material itself; below 1 it is blended in from plain glass, as * `packMaterial` does. * @param environment `ENV_*` bits. * @param headroom Extended-range share in [0, 1]. * @param scale Device pixels per point. * @returns Feature bits of the packed material. */ export declare function packPreset(d: Float32Array, o: number, info: Float32Array, io: number, preset: number, side: number, least: number, mix: number, presence: number, environment?: number, headroom?: number, scale?: number): number; /** * @brief A preset as a description, a numerical snapshot of the built-in profile. * @details It keeps the scheme of its surroundings: a description does not follow the backdrop * luminance. * @param preset Preset number (`PRESET_*`, or `presetNumber(name)`). * @param side Short side of the shape in points (a preset with a size class of its own, see * `presetSide`, ignores it). * @param scheme Dark or light surroundings. * @param environment `ENV_*` bits of the surroundings (default none). * @param headroom Extended-range share in [0, 1] (default 0, standard dynamic range). * @param least Smallest short side of a union in points (default `side`). */ export declare function presetMaterial(preset: number, side: number, scheme: Scheme, environment?: number, headroom?: number, least?: number): MaterialSpec; /** * @brief The standard material as a description (`presetMaterial(PRESET_STANDARD, ...)`), a * numerical snapshot of the built-in profile. */ export declare function standardMaterial(side: number, scheme: Scheme, environment?: number, headroom?: number): MaterialSpec; /** @brief The clear material as a description (`presetMaterial(PRESET_CLEAR, ...)`). */ export declare function clearMaterial(side: number, scheme: Scheme, environment?: number, headroom?: number): MaterialSpec;