UNPKG

@thi.ng/pixel

Version:

Typedarray integer & float pixel buffers w/ customizable formats, blitting, drawing, convolution

14 lines (13 loc) 354 B
import { Lane } from "../api.js"; import { __luminanceABGR } from "../internal/utils.js"; import { defIntFormat } from "./int-format.js"; const GRAY8 = defIntFormat({ type: "u8", size: 8, channels: [{ size: 8, lane: Lane.RED }], fromABGR: (x) => __luminanceABGR(x), toABGR: (x) => (4278190080 | (x & 255) * 65793) >>> 0 }); export { GRAY8 };