// This class provides the Skia image encoding API (`SkEncoder`) on top of the // third-party `png` crate (PNG compression and encoding implemented in Rust). class SkPngRustEncoderImpl final : public SkPngEncoderBase {
public: enum ExtraRowTransform { // `kNone...` indicates that pixels from `SkPngEncoderBase` can be fed // directly into Rust `png`.
kNone_ExtraRowTransform,
// `kRgba8ToRgb8...` indicates that `SkPngEncoderBase` gives RGBx (8-bit) // pixels to `onEncodeRow`. And since Rust `png` can't ignore the // alpha channel (`libpng` can do this via `png_set_filler`), we need to // do an extra RGBA => RGB transformation before feeding the data into // Rust.
kRgba8ToRgb8_ExtraRowTransform,
// `kRgba16leToRgba16be...` indicates that `SkPngEncoderBase` gives RGBA (16-bit) // little endian pixels to `onEncodeRow`. And since Rust `png` can't swap the // endianess (`libpng` can do this via `png_set_swap`), we need to // do an extra LE => BE transformation before feeding the data into // Rust.
kRgba16leToRgba16be_ExtraRowTransform,
// `kRgba16leToRgb16be...` indicates that `SkPngEncoderBase` gives RGBA (16-bit) // little endian pixels to `onEncodeRow`. And we must ignore alpha + swap endianess.
kRgba16leToRgb16be_ExtraRowTransform,
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.