Class PbmDecoder
- Namespace
- SixLabors.ImageSharp.Formats.Pbm
- Assembly
- SixLabors.ImageSharp.dll
Image decoder for reading PGM, PBM or PPM bitmaps from a stream. These images are from the family of PNM images.
- PBMBlack and white images.
- PGMGrayscale images.
- PPMColor images, with RGB pixels.
public sealed class PbmDecoder : ImageDecoder, IImageDecoder
- Inheritance
-
PbmDecoder
- Implements
- Inherited Members
Properties
Instance
Gets the shared instance.
public static PbmDecoder Instance { get; }
Property Value
Methods
Decode(DecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image.
protected override Image Decode(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
Parameters
options
DecoderOptionsThe general decoder options.
stream
StreamThe Stream containing image data.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.
Decode<TPixel>(DecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
protected override Image<TPixel> Decode<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>
Parameters
options
DecoderOptionsThe general decoder options.
stream
StreamThe Stream containing image data.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
- Image<TPixel>
The Image<TPixel>.
Type Parameters
TPixel
The pixel format.
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.
Identify(DecoderOptions, Stream, CancellationToken)
Reads the raw image information from the specified stream.
protected override ImageInfo Identify(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
Parameters
options
DecoderOptionsThe general decoder options.
stream
StreamThe Stream containing image data.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.