Function image::write_buffer_with_format
source · pub fn write_buffer_with_format<W: Write + Seek>(
buffered_writer: &mut W,
buf: &[u8],
width: u32,
height: u32,
color: impl Into<ExtendedColorType>,
format: ImageFormat
) -> ImageResult<()>
Expand description
Writes the supplied buffer to a writer in the specified format.
The buffer is assumed to have the correct format according to the specified color type. This will lead to corrupted writers if the buffer contains malformed data.
Assumes the writer is buffered. In most cases, you should wrap your writer in a BufWriter
for
best performance.