mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
10 lines
478 B
TypeScript
10 lines
478 B
TypeScript
import { toData, fromData } from './kotlin-data'
|
|
import { rgbaFromPacket } from './image-rgba'
|
|
declare const FaceclawGraphics: any
|
|
|
|
/** Decoded RGBA of encoded image bytes, or null when undecodable (transparent pixels come out black). */
|
|
export function decodeImageRgba(bytes: Uint8Array): { width: number; height: number; rgba: Uint8Array } | null {
|
|
const data = FaceclawGraphics.rgbaPacketFromImageData(toData(bytes))
|
|
return data ? rgbaFromPacket(fromData(data)) : null
|
|
}
|