having a seq[uint32] how can i directly create a pixie image ?
i'm currently using a double for loop w/setRgbaUnsafe cast:
for i in 0..<m.w:
for j in 0..<m.h:
image.setRgbaUnsafe(i,j, cast[ColorRGBX](m.image[i*m.w+j]))
this is used when you load an image file from memory:
import pixie
const imageIcon = "icon.png".staticRead
let image = imageIcon.decodeImage
# do something w/image...
ColorRGBX is the same size as uint32 - 4 bytes r, g, b, x (premultiplied alpha).
So this cast is actually correct:
image.data = cast[seq[ColorRGBX]](m.image)
You might have to call toPremultipliedAlpha() after from pixie/internal if your image has alpha.