Struct bevy_retrograde::core::image::png::PngEncoder [−]
pub struct PngEncoder<W> where
W: Write, { /* fields omitted */ }
Expand description
PNG encoder
Implementations
impl<W> PngEncoder<W> where
W: Write,
impl<W> PngEncoder<W> where
W: Write,
pub fn new(w: W) -> PngEncoder<W>
pub fn new(w: W) -> PngEncoder<W>
Create a new encoder that writes its output to w
pub fn new_with_quality(
w: W,
compression: CompressionType,
filter: FilterType
) -> PngEncoder<W>
pub fn new_with_quality(
w: W,
compression: CompressionType,
filter: FilterType
) -> PngEncoder<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. It is likely that the library used will at some point gain the ability to use adaptive filtering methods per pixel row (or even interlaced row). We might make it the new default variant in which case choosing a particular filter method likely produces larger images. Be sure to check the release notes once in a while.
Trait Implementations
impl<W> ImageEncoder for PngEncoder<W> where
W: Write,
impl<W> ImageEncoder for PngEncoder<W> where
W: Write,
Auto Trait Implementations
impl<W> RefUnwindSafe for PngEncoder<W> where
W: RefUnwindSafe,
impl<W> Send for PngEncoder<W> where
W: Send,
impl<W> Sync for PngEncoder<W> where
W: Sync,
impl<W> Unpin for PngEncoder<W> where
W: Unpin,
impl<W> UnwindSafe for PngEncoder<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V