Add EvenHub icon to phone preview screen

This commit is contained in:
James Babcock committed 2026-10-12 02:33:22 -07:00
1 parent 14d1f7f509
commit ccbf523e9a
8 files changed
+100 -8

No files matched your search

+9
View File
@@ -12,6 +12,15 @@ export function previewPixels(pixels: Uint8Array, width: number, height: number,
return new ImageSource(native)
}
/** Gray pixels as a white-on-transparent image (gray becomes alpha). */
export function whiteIconPixels(pixels: Uint8Array, width: number, height: number): ImageSource {
const copy = new Uint8Array(pixels)
const data = NSData.dataWithBytesLength(interop.handleof(copy.buffer), copy.byteLength)
const native = FaceclawGraphics.whiteIconWidthHeight(data, width, height)
if (!native) throw new Error('Could not create icon image')
return new ImageSource(native)
}
export function rasterizeSvg(svg: string, size: number): GrayImage | null {
const data = FaceclawGraphics.renderSVGSize(svg, size)
if (!data) return null