Skip to content
ChartForgeX
Class

RasterImageDecoder

ChartForgeX.Raster

Namespace
ChartForgeX.Raster
Assembly
ChartForgeX
Modifiers
static

Decodes dependency-free raster image formats into RGBA pixels.

Inheritance

  • object
  • RasterImageDecoder

Methods

Decode 2 overloads
public static RgbaImage Decode(byte[] data) #

Decodes raster image bytes into RGBA pixels.

Parameters

data byte[] required
The encoded image bytes.

Returns

RgbaImage The decoded RGBA image.
public static RgbaImage Decode(byte[] data, RasterDecodeOptions? options) #

Decodes raster bytes with explicit encoded-input and pixel limits.

Parameters

data byte[] required
options ChartForgeX.Raster.RasterDecodeOptions? required

Returns

RgbaImage
Read 4 overloads
public static RgbaImage Read(string path) #

Reads and decodes a raster image file.

Parameters

path string required
The source image path.

Returns

RgbaImage The decoded RGBA image.
public static RgbaImage Read(string path, RasterDecodeOptions? options) #

Reads a raster file with explicit encoded-input and pixel limits.

Parameters

path string required
options ChartForgeX.Raster.RasterDecodeOptions? required

Returns

RgbaImage
public static RgbaImage Read(Stream stream) #

Reads and decodes a raster image stream.

Parameters

stream System.IO.Stream required
The source image stream.

Returns

RgbaImage The decoded RGBA image.
public static RgbaImage Read(Stream stream, RasterDecodeOptions? options) #

Reads a raster stream with explicit limits without closing the caller's stream.

Parameters

stream System.IO.Stream required
options ChartForgeX.Raster.RasterDecodeOptions? required

Returns

RgbaImage
TryDecode 2 overloads
public static bool TryDecode(byte[]? data, out RgbaImage image) #

Attempts to decode raster image bytes.

Parameters

data byte[]? required
The encoded image bytes.
image ChartForgeX.Raster.RgbaImage required
The decoded RGBA image when successful.

Returns

bool true when the image could be decoded.
public static bool TryDecode(byte[]? data, RasterDecodeOptions? options, out RgbaImage image) #

Attempts to decode bytes within explicit raster limits.

Parameters

data byte[]? required
options ChartForgeX.Raster.RasterDecodeOptions? required
image ChartForgeX.Raster.RgbaImage required

Returns

bool
TryRead 4 overloads
public static bool TryRead(string? path, out RgbaImage image) #

Attempts to read and decode a raster image file.

Parameters

path string? required
The source image path.
image ChartForgeX.Raster.RgbaImage required
The decoded RGBA image when successful.

Returns

bool true when the image could be decoded.
public static bool TryRead(string? path, RasterDecodeOptions? options, out RgbaImage image) #

Attempts to decode a file within explicit raster limits.

Parameters

path string? required
options ChartForgeX.Raster.RasterDecodeOptions? required
image ChartForgeX.Raster.RgbaImage required

Returns

bool
public static bool TryRead(Stream? stream, out RgbaImage image) #

Attempts to read and decode a raster image stream.

Parameters

stream System.IO.Stream? required
The source image stream.
image ChartForgeX.Raster.RgbaImage required
The decoded RGBA image when successful.

Returns

bool true when the image could be decoded.
public static bool TryRead(Stream? stream, RasterDecodeOptions? options, out RgbaImage image) #

Attempts to decode a stream within explicit raster limits without closing it.

Parameters

stream System.IO.Stream? required
options ChartForgeX.Raster.RasterDecodeOptions? required
image ChartForgeX.Raster.RgbaImage required

Returns

bool