# Wipe

class in `@dioramajs/media/frost`

```ts
import { Wipe } from '@dioramajs/media/frost'
```

Where the glass is wiped clear: `size` × `size` cells over the box, each 0 (fogged) to 1
(clear), y up. A stroke clears a band along the pointer's path; each step the clear areas fog
back over `refog` seconds. Deterministic: the same strokes and steps give the same mask.

```ts
class Wipe
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `constructor` | `constructor(size: number): Wipe` |  |
| `active` | `boolean` | Some cell is still fogging back. |
| `clear` | `Float32Array` |  |
| `peak` | `number` | Clearest cell, 0..1. |
| `size` | `number` |  |
| `reset` | `reset(): void` | Fogs every cell at once. |
| `resized` | `resized(size: number): Wipe` | A copy of this mask at `size` cells a side, nearest cell. |
| `step` | `step(seconds: number, refog: number, floor?: number): void` | Fogs back by `seconds` out of `refog`: a fully clear cell is fogged after `refog` s. With a `floor` a wiped cell fogs back only down to it, so a thin fog returns instead of all of it. |
| `stroke` | `stroke(ax: number, ay: number, bx: number, by: number, radius: number, width: number, height: number): void` | Clears the cells within `radius` px of the segment `a`–`b` (box px, y up, box `width` × `height`). |
| `write` | `write(out: Uint8Array): void` | Writes the mask into the red channel of RGBA bytes. |

Defined in [packages/media/src/wipe.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/media/src/wipe.ts#L23).
