Table of Contents

Class WebPDecoder

Namespace
Imazen.WebP
Assembly
Imazen.WebP.dll

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

data byte[]
output byte[]
stride int
format WebPPixelFormat

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

data byte[]
width int
height int

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

data byte[]
width int
height int
format WebPPixelFormat

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

stream Stream
width int
height int

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

stream Stream
width int
height int
format WebPPixelFormat

Returns

byte[]

IsWebP(byte[])

Checks whether the given data starts with a valid WebP header (RIFF...WEBP).

public static bool IsWebP(byte[] data)

Parameters

data byte[]

Returns

bool

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

stream Stream

Returns

bool