luv

Workshop wiki

png.lisp

hal/png.lisp

system luv · 2 definitions · on GitHub

PNG output for renderer readbacks.

in-package#:luv
defunrgba-png-pixels
pixelswidthheightformat
unless
error"Expected ~D pixel bytes, got ~D."
lengthpixels
ecaseformat
:rgba8-unorm:rgba8-unorm-srgb
pixels
:bgra8-unorm:bgra8-unorm-srgb
let
rgba
copy-seqpixels
loopforoffsetbelowby4do
rotatef
arefrgbaoffset
arefrgba
+offset2
rgba
defunwrite-rgba-png
pathnamepixelswidthheightformat

Write tightly packed rgba or BGRA byte pixels to pathname as a PNG.

zpng:write-png
make-instance'zpng:png:widthwidth:heightheight:color-type:truecolor-alpha:image-data
pathname:if-exists:supersede
pathname