DVUI

png

Encode texture as png. Call after stop before deinit.

Parameters

#
self:*Picture
*Picture
writer:*std.Io.Writer
*std.Io.Writer

Source

Implementation

#
pub fn png(self: *Picture, writer: *std.Io.Writer) !void {
        const pma_pixels = try dvui.textureReadTarget(currentWindow().lifo(), self.texture);
        const pixels = Color.PMA.sliceToRGBA(pma_pixels);
        defer currentWindow().lifo().free(pixels);

        try PNGEncoder.write(writer, pixels, self.texture.width, self.texture.height);
    }