API Reference
OfficeWebpCodec
Managed WebP encoding and decoding for RGBA images.
Inheritance
- Object
- OfficeWebpCodec
Remarks
Lossless encoding deterministically selects between a literal VP8L stream and a bounded prediction, subtract-green, and LZ77 stream. Explicit lossy encoding uses VP8 YUV 4:2:0 and exact alpha. Decoding supports bounded VP8 keyframes with optional raw or lossless-compressed alpha and lossless VP8L; animation remains a caller-codec responsibility.
Methods
public static Byte[] Encode(OfficeRasterImage image) #Byte[]Encodes an RGBA image as a lossless VP8L WebP image.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
public static Byte[] Encode(OfficeRasterImage image, Double dpiX, Double dpiY) #Byte[]Encodes an RGBA image as a lossless VP8L WebP image with Exif resolution metadata.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- dpiX System.Double
- dpiY System.Double
public static Byte[] Encode(OfficeRasterImage image, OfficeWebpEncodeOptions options) #Byte[]Encodes an image with an explicit lossless or lossy WebP compression mode.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- options OfficeIMO.Drawing.OfficeWebpEncodeOptions
public static Byte[] Encode(OfficeRasterImage image, OfficeWebpEncodeOptions options, CancellationToken cancellationToken) #Byte[]Encodes an image with cancellation and an explicit WebP compression mode.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- options OfficeIMO.Drawing.OfficeWebpEncodeOptions
- cancellationToken System.Threading.CancellationToken
public static Void EncodeTo(OfficeRasterImage image, Stream destination, OfficeWebpEncodeOptions options, CancellationToken cancellationToken = default) #VoidEncodes WebP to a caller-owned writable stream.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.IO.Stream
- options OfficeIMO.Drawing.OfficeWebpEncodeOptions
- cancellationToken System.Threading.CancellationToken = default
public static Void EncodeTo(OfficeRasterImage image, IBufferWriter<Byte> destination, OfficeWebpEncodeOptions options, CancellationToken cancellationToken = default) #VoidEncodes WebP to a caller-owned buffer writer.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.Buffers.IBufferWriter<System.Byte>
- options OfficeIMO.Drawing.OfficeWebpEncodeOptions
- cancellationToken System.Threading.CancellationToken = default
public static Void EncodeTo(OfficeRasterImage image, Stream destination) #VoidEncodes an RGBA image directly to a caller-owned writable stream.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.IO.Stream
public static Void EncodeTo(OfficeRasterImage image, Stream destination, Double dpiX, Double dpiY) #VoidEncodes an RGBA image with Exif resolution metadata directly to a writable stream.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.IO.Stream
- dpiX System.Double
- dpiY System.Double
public static Void EncodeTo(OfficeRasterImage image, IBufferWriter<Byte> destination) #VoidEncodes an RGBA image directly to a caller-owned buffer writer.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.Buffers.IBufferWriter<System.Byte>
public static Void EncodeTo(OfficeRasterImage image, IBufferWriter<Byte> destination, Double dpiX, Double dpiY) #VoidEncodes an RGBA image with Exif resolution metadata directly to a buffer writer.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- destination System.Buffers.IBufferWriter<System.Byte>
- dpiX System.Double
- dpiY System.Double
public static Boolean IsWebp(Byte[]? encodedBytes) #BooleanReturns whether the payload is a RIFF WebP container.
Parameters
- encodedBytes System.Byte[]?
public static Boolean TryDecode(Byte[]? encodedBytes, out OfficeRasterImage? image) #BooleanAttempts to decode bounded ordinary lossless VP8L, including prediction, color, subtract-green, palette, LZ77, color-cache, and Huffman features. VP8 keyframes with raw or lossless-compressed alpha are also decoded; animation remains an optional caller-codec responsibility.
Parameters
- encodedBytes System.Byte[]?
- image OfficeIMO.Drawing.OfficeRasterImage?
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?