import { type SkFont, type SkImage, type SkRect } from "@shopify/react-native-skia"; import type { LiveChartPalette, Marker, MarkerGroupBadge, MarkerKind } from "../types"; export type MarkerAtlasPalette = Pick; /** Default icon box (px) when `marker.size` is unset. */ export declare const DEFAULT_ICON_SIZE = 16; /** Count-badge digits render at this fraction of the chart font, so two digits fit * a small round badge. Shared with the overlay's per-frame digit layout. */ export declare const BADGE_TEXT_SCALE = 0.75; /** Atlas cell sig for one count-badge glyph (`0`-`9`), drawn white. */ export declare function groupGlyphSig(ch: string): string; /** Atlas cell sig for a dedicated group badge (one per chart — its own custom * image/icon, independent of the member markers). */ export declare const GROUP_BADGE_SIG = "grpbadge"; /** Atlas cell sig for the round count-badge background (one fixed circle per color). */ export declare function groupBgSig(color: string): string; /** Text shown in a collapsed-cluster count badge — exact up to `"99"`, capped there * so it always fits the fixed round badge (≤ 2 digits). */ export declare function groupCountText(count: number): string; /** Width of proportionally laid-out count-badge text at its on-canvas scale. */ export declare function groupCountTextWidth(text: string, digitWidths: Record, letterSpacing?: number): number; /** Default glyph color per kind when `marker.color` is unset. Worklet-safe so the * per-frame overlay worklet can resolve a collapsed cluster's badge color. */ export declare function defaultMarkerColor(kind: MarkerKind, palette: MarkerAtlasPalette): string; /** * Axis-anchored kinds whose geometry depends on the chart's baseline (a * variable-length stem, or a box pinned to the axis) and therefore cannot be a * fixed-size sprite. These fall back to a self-projecting glyph component. * * Only applies when the marker has no `icon`/`image` override — those take * precedence and render as ordinary centered stamps via the atlas. */ export declare function isConnectorMarker(m: Marker): boolean; /** * Stable key for a marker's *visual appearance* (excludes position/anchor). * Two markers with the same signature share one atlas cell. Called both on the * JS thread (to build the atlas) and inside the per-frame worklet (to look a * marker's cell up), so it must stay worklet-safe and primitive-only. */ export declare function markerAppearanceSig(m: Marker): string; /** One packed glyph in the atlas image: its source rect + box size. */ export interface AtlasCell { /** Source rect into the (hi-res) atlas texture, in **device** pixels. */ rect: SkRect; /** Logical (DPR-independent) cell width/height, used to center the blit. */ w: number; h: number; } export interface MarkerAtlas { /** Packed glyph texture, or null when there are no atlas-rendered markers. */ image: SkImage | null; /** appearance-signature → cell. */ cells: Record; /** * Device-pixel scale the texture was rasterized at. Cell `rect`s are in * texture (device) pixels, while `w`/`h` stay in logical pixels — so the * per-frame blit must apply an `RSXform` scale of `1 / scale` to map the * hi-res cell back to its logical on-canvas size. See `buildMarkerAtlas`. */ scale: number; /** Logical ink width (px) of each count-badge digit `"0"`–`"9"`, for laying them * out proportionally (so narrow digits like `1` don't leave gaps). Empty when * the atlas carries no group cells (clustering off). */ digitWidths: Record; } /** * Rasterize every distinct marker appearance into a single packed atlas image, * once per appearance-set change (NOT per frame). The per-frame worklet then * blits these cells via one `drawAtlas` call. * * Connector kinds (see `isConnectorMarker`) are skipped — they render via a * self-projecting fallback component. * * The texture is rasterized at `scale` (the screen's device-pixel ratio) so the * cells carry enough resolution to stay crisp when blitted onto a retina canvas * — every glyph is recorded in logical coords then magnified by `scale`, and the * per-frame `drawAtlas` shrinks it back with an `RSXform` scale of `1 / scale`. * Without this the logical-sized texture is upscaled ~3× on iOS and looks blurry. */ export declare function buildMarkerAtlas(markers: Marker[], palette: MarkerAtlasPalette, font: SkFont, scale?: number, /** Also bake count-badge cells (digits + per-color backgrounds) for * `markerCluster: "stacked"` collapse. Off by default — no atlas bloat. */ withGroups?: boolean, /** A dedicated group badge (custom image/icon) to bake one cell for, under * {@link GROUP_BADGE_SIG} — drawn for a collapsed cluster instead of the count. * Only baked when it carries an `image` or `icon`. */ groupBadge?: MarkerGroupBadge): MarkerAtlas; //# sourceMappingURL=markerAtlas.d.ts.map