jpg
Encode texture as jpg. Call after stop before deinit.
Parameters
- self:*Picture
- *Picture
- writer:*std.Io.Writer
- *std.Io.Writer
Source
Implementation
pub fn jpg(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 JPGEncoder.write(writer, pixels, self.texture.width, self.texture.height);
}