Class WebPDecoder
Raw buffer WebP decoder. No System.Drawing dependency — works on all platforms.
public static class WebPDecoder
- Inheritance
-
WebPDecoder
- Inherited Members
Methods
Decode(byte[], byte[], int, WebPPixelFormat)
Decodes WebP data directly into a caller-provided buffer.
public static void Decode(byte[] data, byte[] output, int stride, WebPPixelFormat format)
Parameters
databyte[]outputbyte[]strideintformatWebPPixelFormat
Decode(byte[], out int, out int)
Decodes WebP data to a BGRA pixel buffer. Returns the pixel data as a byte array.
public static byte[] Decode(byte[] data, out int width, out int height)
Parameters
Returns
- byte[]
Decode(byte[], out int, out int, WebPPixelFormat)
Decodes WebP data to a pixel buffer in the specified format.
public static byte[] Decode(byte[] data, out int width, out int height, WebPPixelFormat format)
Parameters
databyte[]widthintheightintformatWebPPixelFormat
Returns
- byte[]
DecodeFromStream(Stream, out int, out int)
Decodes WebP data from a stream to a BGRA pixel buffer. Reads the entire stream into memory first.
public static byte[] DecodeFromStream(Stream stream, out int width, out int height)
Parameters
Returns
- byte[]
DecodeFromStream(Stream, out int, out int, WebPPixelFormat)
Decodes WebP data from a stream to a pixel buffer in the specified format. Reads the entire stream into memory first.
public static byte[] DecodeFromStream(Stream stream, out int width, out int height, WebPPixelFormat format)
Parameters
streamStreamwidthintheightintformatWebPPixelFormat
Returns
- byte[]
IsWebP(byte[])
Checks whether the given data starts with a valid WebP header (RIFF...WEBP).
public static bool IsWebP(byte[] data)
Parameters
databyte[]
Returns
IsWebP(Stream)
Checks whether the given stream starts with a valid WebP header. The stream position is restored after checking.
public static bool IsWebP(Stream stream)
Parameters
streamStream