/** * BOOTSTRAP_PATTERN — the canonical asymmetric test pattern used by: * * - T023 canary (JS-side analytical tripwire in `__tests__/bootstrap/`) * - T053's iOS pointer-path smoke (bare-example worklet writes bytes via * `ctx.target.writeBytes`) * - T053a's Skia helper smoke (`drawWithSkia` produces pixel-equivalent * output) * * Declared in the library (main package) as the single source of truth so * downstream smoke tests / canaries can import it directly. The library * itself never runs the pattern in production code — it's a pure JS * reference used only by tests and smoke harnesses. * * Design notes: * * - The pattern is a **rotating right-triangle gradient** keyed on * `frameIndex`. Two stacked asymmetries (triangle orientation rotates * by 90° every frame; the gradient is distinct per quadrant) make any * accidental horizontal / vertical flip or 90°/180°/270° rotation * observable as a probe-pixel drift exceeding the ±32/255 tolerance. * - RGB values are in the range [0, 255]; no alpha — the target buffer's * alpha channel is always 0xff. * - The formula is analytic — `expectedCenterRGBA` computes the expected * center pixel for a given (frameIndex, width, height) in pure JS so * the Jest/Node tripwire can verify without ever running the pipeline. */ export interface RGBA { r: number; g: number; b: number; a: number; } /** * Compute the pattern RGBA at pixel (x, y) for frame `frameIndex` within a * `width × height` canvas. Shared by the native pump fallback, the JS * tripwire, and the consumer-facing bare-example worklet. * * Algorithm (deterministic, analytical): * * 1. `rot = frameIndex % 4` selects one of 4 triangle orientations: * 0 → top-left (x+y <= w+h-1 keeps pixel "inside") * 1 → top-right (x >= y anchor) * 2 → bottom-right * 3 → bottom-left * 2. "Inside" pixels get a per-quadrant distinctive RGB: * rot 0: (nx, ny, 0xff) — red/green gradient * rot 1: (0xff - nx, ny, nx) — magenta anchor * rot 2: (0, 0xff - ny, nx) — cyan anchor * rot 3: (nx, 0, 0xff - ny) — yellow anchor * where (nx, ny) = (floor(x*255/(w-1)), floor(y*255/(h-1))). * 3. "Outside" pixels fall back to a flat frame-keyed colour: * r = (frameIndex * 11) & 0xff * g = (frameIndex * 53) & 0xff * b = (frameIndex * 97) & 0xff * (Same triple as the T041 placeholder, to keep migration continuous.) * * The triangle boundary is chosen so that the center pixel (x=w/2, y=h/2) * is ALWAYS inside — this keeps `expectedCenterRGBA` deterministic across * every (width, height, frameIndex) combination. */ export declare function bootstrapPatternRGBA(frameIndex: number, x: number, y: number, width: number, height: number): RGBA; /** * Analytic expected-RGBA at the center pixel (w/2, h/2) for frame * `frameIndex`. Used by the T023 canary tripwire to verify pipeline output * without running it: the formula is frozen here, and a drift in the * pattern definition breaks the tripwire before the pipeline regresses. */ export declare function expectedCenterRGBA(frameIndex: number, width: number, height: number): RGBA; /** * Consumer-side helper: fill a row-major pixel buffer with the pattern. * `format` controls the channel order; the target buffer must be at least * `height * rowBytes` bytes long. This is the body a worklet would call * inside `ctx.target.writeBytes(...)` — kept on the JS side so that * smoke screens don't need a Reanimated runtime to exercise the pump. */ export declare function fillBootstrapPattern(out: Uint8Array, frameIndex: number, width: number, height: number, rowBytes: number, format: 'bgra8888' | 'rgba8888'): void; //# sourceMappingURL=bootstrap-pattern.d.ts.map