C# 클래스 AForge.Imaging.Formats.PNMCodec

PNM image format decoder.

The PNM (an acronym derived from "Portable Any Map") format is an abstraction of the PBM, PGM and PPM formats. I.e. the name "PNM" refers collectively to PBM (binary images), PGM (grayscale images) and PPM (color image) image formats.

Image in PNM format can be found in different scientific databases and laboratories, for example Yale Face Database and AT&T Face Database.

Only PNM images of P5 (binary encoded PGM) and P6 (binary encoded PPM) formats are supported at this point.

The maximum supported pixel value is 255 at this point.

The class supports only one-frame PNM images. As it is specified in format specification, the multi-frame PNM images has appeared starting from 2000.

상속: IImageDecoder
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
Close ( ) : void

Close decoding of previously opened stream.

The method does not close stream itself, but just closes decoding cleaning all associated data with it.

DecodeFrame ( int frameIndex, ImageInfo &imageInfo ) : Bitmap

Decode specified frame.

DecodeSingleFrame ( Stream stream ) : Bitmap

Decode first frame of PNM image.

Open ( Stream stream ) : int

Open specified stream.

비공개 메소드들

메소드 설명
ReadHeader ( Stream stream ) : PNMImageInfo
ReadImageFrame ( Stream stream, PNMImageInfo imageInfo ) : Bitmap
ReadIntegerValue ( Stream stream ) : int
ReadP5Image ( Stream stream, int width, int height, int maxValue ) : Bitmap
ReadP6Image ( Stream stream, int width, int height, int maxValue ) : Bitmap
ReadUntilSpace ( Stream stream, byte buffer, int start ) : int
SkipSpaces ( Stream stream ) : byte

메소드 상세

Close() 공개 메소드

Close decoding of previously opened stream.

The method does not close stream itself, but just closes decoding cleaning all associated data with it.

public Close ( ) : void
리턴 void

DecodeFrame() 공개 메소드

Decode specified frame.
No image stream was opened previously. Stream does not contain frame with specified index. The stream contains invalid (broken) PNM image.
public DecodeFrame ( int frameIndex, ImageInfo &imageInfo ) : Bitmap
frameIndex int Image frame to decode.
imageInfo ImageInfo Receives information about decoded frame.
리턴 System.Drawing.Bitmap

DecodeSingleFrame() 공개 메소드

Decode first frame of PNM image.
Not a PNM image format. Format of the PNM image is not supported. The stream contains invalid (broken) PNM image.
public DecodeSingleFrame ( Stream stream ) : Bitmap
stream Stream Source stream, which contains encoded image.
리턴 System.Drawing.Bitmap

Open() 공개 메소드

Open specified stream.
Not a PNM image format. Format of the PNM image is not supported. The stream contains invalid (broken) PNM image.
public Open ( Stream stream ) : int
stream Stream Stream to open.
리턴 int