# Visual and Audio Accessibility Guide

This package exposes engine-neutral accessibility helpers for visual and audio
features that need renderer, platform, or profile-storage integration.

## Renderer Integration

- `createColorblindPostProcessShader` returns a matrix, uniforms, and fragment
  source for protanopia, deuteranopia, tritanopia, achromatopsia, and anomaly
  filters.
- `createScreenMagnifierState`, `moveScreenMagnifierFocus`, and
  `getMagnifiedViewport` calculate stable source and target rectangles for a
  movable zoom lens.
- `createMotionAccessibilitySettings`, `createMotionAccessibilityPlan`, and
  `scaleCameraShakeAmplitude` centralize camera shake sliders and reduced motion
  behavior.
- `evaluatePhotosensitivity` reviews a frame sample window and returns
  brightness, contrast, blending, and suppression decisions for rapid flashing.

## Platform Accessibility

- `ScreenReaderEngine` owns the UI tree and live announcements.
- `exportScreenReaderBridgeSnapshot` exports that tree for UIAutomation,
  NSAccessibility, TalkBack, or ARIA bridge adapters.
- Exported nodes include role, label, value, parent/child links, focus state,
  live-region politeness, and string properties.

## Captions and Audio Cues

- `SubtitleCaptionEngine` renders speaker subtitles, sound-effect captions,
  music descriptions, and directional sound indicators.
- `authorClosedCaptionTags` converts timed non-verbal audio events into
  bracketed caption tags such as `[door creaks]`.
- `createVisualCuePlan` duplicates audio-only feedback with screen flash,
  directional indicator, caption text, and haptic values.

## Text and Preferences

- `TextAccessibilityEngine` provides accessible fonts, letter spacing, line
  height, category overrides, and global scaling.
- `planTextScaleForLayout` clamps global scale to the 0.5x-3x UI range and
  reports whether a bounded region should fit, wrap, reduce scale, or truncate.
- `createAccessibilitySettingsSnapshot`, `serializeAccessibilitySettings`,
  `deserializeAccessibilitySettings`, and `applyAccessibilitySettings` persist
  per-player preferences and apply them before gameplay systems start.
