pub struct PngEncoder<W: Write> { /* private fields */ }
Expand description

PNG encoder

Implementations

Create a new encoder that writes its output to w

Create a new encoder that writes its output to w with CompressionType compression and FilterType filter.

It is best to view the options as a hint to the implementation on the smallest or fastest option for encoding a particular image. That is, using options that map directly to a PNG image parameter will use this parameter where possible. But variants that have no direct mapping may be interpreted differently in minor versions. The exact output is expressly not part the SemVer stability guarantee.

Note that it is not optimal to use a single filter type, so an adaptive filter type is selected as the default. The filter which best minimizes file size may change with the type of compression used.

👎 Deprecated:

Use PngEncoder::write_image instead. Beware that write_image has a different endianness convention

Encodes the image data that has dimensions width and height and ColorType c.

Expects data in big endian.

Trait Implementations

Write a PNG image with the specified width, height, and color type.

For color types with 16-bit per channel or larger, the contents of buf should be in native endian. PngEncoder will automatically convert to big endian as required by the underlying PNG format.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.