Class
RasterImageDecoder
ChartForgeX.Raster
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[]
- The encoded image bytes.
Read 4 overloads
public static RgbaImage Read(string path) #Reads and decodes a raster image file.
Parameters
- path string
- The source image path.
public static RgbaImage Read(string path, RasterDecodeOptions? options) #Reads a raster file with explicit encoded-input and pixel limits.
Parameters
- path string
- options ChartForgeX.Raster.RasterDecodeOptions?
Returns
RgbaImagepublic static RgbaImage Read(Stream stream) #Reads and decodes a raster image stream.
Parameters
- stream System.IO.Stream
- The source image stream.
TryDecode 2 overloads
public static bool TryDecode(byte[]? data, out RgbaImage image) #Attempts to decode raster image bytes.
Parameters
- data byte[]?
- The encoded image bytes.
- image ChartForgeX.Raster.RgbaImage
- 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[]?
- options ChartForgeX.Raster.RasterDecodeOptions?
- image ChartForgeX.Raster.RgbaImage
Returns
boolTryRead 4 overloads
public static bool TryRead(string? path, out RgbaImage image) #Attempts to read and decode a raster image file.
Parameters
- path string?
- The source image path.
- image ChartForgeX.Raster.RgbaImage
- 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?
- options ChartForgeX.Raster.RasterDecodeOptions?
- image ChartForgeX.Raster.RgbaImage
Returns
boolpublic static bool TryRead(Stream? stream, out RgbaImage image) #Attempts to read and decode a raster image stream.
Parameters
- stream System.IO.Stream?
- The source image stream.
- image ChartForgeX.Raster.RgbaImage
- 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?
- options ChartForgeX.Raster.RasterDecodeOptions?
- image ChartForgeX.Raster.RgbaImage
Returns
bool