ImageDecoderInit Class

The options of an ImageDecoder (https://w3c.github.io/webcodecs/#dictdef-imagedecoderinit).

public sealed class ImageDecoderInit

Constructors

NameDescription
ImageDecoderInit()

ImageDecoderInit()

ImageDecoder.cs
  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.
[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public ImageDecoderInit()

No documentation is available.

Properties

NameDescription
ColorSpaceConversionGets whether the colors are converted to sRGB (ColorSpaceConversion.Default) or keep their encoded values.
DataGets the encoded image: a byte[] or a ReadOnlyMemory<T> of bytes (copied by the constructor), or, from the scripts, a buffer source or a ReadableStream whose chunks are Uint8Array objects.
DesiredHeightGets the height the decoded frames are scaled to (with ImageDecoderInit.DesiredWidth).
DesiredWidthGets the width the decoded frames are scaled to (with ImageDecoderInit.DesiredHeight).
PreferAnimationGets whether an animated track is selected by default when the image has several tracks.
TypeGets the MIME type of the image (e.g. image/png).

ColorSpaceConversion

ImageDecoder.cs

Gets whether the colors are converted to sRGB (ColorSpaceConversion.Default) or keep their encoded values.

public ColorSpaceConversion ColorSpaceConversion { get; init; }

Gets the encoded image: a byte[] or a ReadOnlyMemory<T> of bytes (copied by the constructor), or, from the scripts, a buffer source or a ReadableStream whose chunks are Uint8Array objects.

public required object? Data { get; init; }

DesiredHeight

ImageDecoder.cs

Gets the height the decoded frames are scaled to (with ImageDecoderInit.DesiredWidth).

public uint? DesiredHeight { get; init; }

DesiredWidth

ImageDecoder.cs

Gets the width the decoded frames are scaled to (with ImageDecoderInit.DesiredHeight).

public uint? DesiredWidth { get; init; }

PreferAnimation

ImageDecoder.cs

Gets whether an animated track is selected by default when the image has several tracks.

public bool? PreferAnimation { get; init; }

Gets the MIME type of the image (e.g. image/png).

public required string Type { get; init; }