C# 클래스 CSJ2K.j2k.image.output.ImgWriterPPM

This class writes 3 components from an image in 8 bit unsigned data to a binary PPM file.

The size of the image that is written is the size of the source image. No component subsampling is allowed in any of the components that are written to the file.

Before writing, all coefficients are inversly level-shifted and then "saturated" (they are limited * to the nominal dynamic range).
Ex: if the nominal range is 0-255, the following algorithm is applied:
if coeff<0, output=0
if coeff>255, output=255
else output=coeff
The write() methods of an object of this class may not be called concurrently from different threads.

NOTE: This class is not thread safe, for reasons of internal buffering.

상속: CSJ2K.j2k.image.output.ImgWriter
파일 보기 프로젝트 열기: cureos/csj2k

공개 메소드들

메소드 설명
ImgWriterPPM ( IFileInfo out_Renamed, BlkImgDataSrc imgSrc, int n1, int n2, int n3 ) : System

Creates a new writer to the specified File object, to write data from the specified component.

The three components that will be written as R, G and B must be specified through the b1, b2 and b3 arguments.

ImgWriterPPM ( System fname, BlkImgDataSrc imgSrc, int n1, int n2, int n3 ) : System

Creates a new writer to the specified file, to write data from the specified component.

The three components that will be written as R, G and B must be specified through the b1, b2 and b3 arguments.

ToString ( ) : System.String

Returns a string of information about the object, more than 1 line long. The information string includes information from the underlying RandomAccessFile (its toString() method is called in turn).

close ( ) : void

Closes the underlying file or netwrok connection to where the data is written. Any call to other methods of the class become illegal after a call to this one.

flush ( ) : void

Writes all buffered data to the file or resource.

write ( ) : void

Writes the source's current tile to the output. The requests of data issued to the source BlkImgDataSrc object are done by strips, in order to reduce memory usage.

If the data returned from the BlkImgDataSrc source is progressive, then it is requested over and over until it is not progressive any more.

write ( int ulx, int uly, int w, int h ) : void

Writes the data of the specified area to the file, coordinates are relative to the current tile of the source. Before writing, the coefficients are limited to the nominal range.

This method may not be called concurrently from different threads.

If the data returned from the BlkImgDataSrc source is progressive, then it is requested over and over until it is not progressive anymore.

비공개 메소드들

메소드 설명
writeHeaderInfo ( ) : void

Writes the header info of the PPM file : P6
width height
255

메소드 상세

ImgWriterPPM() 공개 메소드

Creates a new writer to the specified File object, to write data from the specified component.

The three components that will be written as R, G and B must be specified through the b1, b2 and b3 arguments.

public ImgWriterPPM ( IFileInfo out_Renamed, BlkImgDataSrc imgSrc, int n1, int n2, int n3 ) : System
out_Renamed IFileInfo
imgSrc BlkImgDataSrc The source from where to get the image data to write. /// ///
n1 int The index of the first component from where to get the data, /// that will be written as the red channel. /// ///
n2 int The index of the second component from where to get the data, /// that will be written as the green channel. /// ///
n3 int The index of the third component from where to get the data, /// that will be written as the green channel. /// ///
리턴 System

ImgWriterPPM() 공개 메소드

Creates a new writer to the specified file, to write data from the specified component.

The three components that will be written as R, G and B must be specified through the b1, b2 and b3 arguments.

public ImgWriterPPM ( System fname, BlkImgDataSrc imgSrc, int n1, int n2, int n3 ) : System
fname System The name of the file where to write the data /// ///
imgSrc BlkImgDataSrc The source from where to get the image data to write. /// ///
n1 int The index of the first component from where to get the data, /// that will be written as the red channel. /// ///
n2 int The index of the second component from where to get the data, /// that will be written as the green channel. /// ///
n3 int The index of the third component from where to get the data, /// that will be written as the green channel. /// ///
리턴 System

ToString() 공개 메소드

Returns a string of information about the object, more than 1 line long. The information string includes information from the underlying RandomAccessFile (its toString() method is called in turn).
public ToString ( ) : System.String
리턴 System.String

close() 공개 메소드

Closes the underlying file or netwrok connection to where the data is written. Any call to other methods of the class become illegal after a call to this one.
If an I/O error occurs. /// ///
public close ( ) : void
리턴 void

flush() 공개 메소드

Writes all buffered data to the file or resource.
If an I/O error occurs. /// ///
public flush ( ) : void
리턴 void

write() 공개 메소드

Writes the source's current tile to the output. The requests of data issued to the source BlkImgDataSrc object are done by strips, in order to reduce memory usage.

If the data returned from the BlkImgDataSrc source is progressive, then it is requested over and over until it is not progressive any more.

If an I/O error occurs. /// ///
public write ( ) : void
리턴 void

write() 공개 메소드

Writes the data of the specified area to the file, coordinates are relative to the current tile of the source. Before writing, the coefficients are limited to the nominal range.

This method may not be called concurrently from different threads.

If the data returned from the BlkImgDataSrc source is progressive, then it is requested over and over until it is not progressive anymore.

If an I/O error occurs. /// ///
public write ( int ulx, int uly, int w, int h ) : void
ulx int The horizontal coordinate of the upper-left corner of the /// area to write, relative to the current tile. /// ///
uly int The vertical coordinate of the upper-left corner of the area /// to write, relative to the current tile. /// ///
w int
h int
리턴 void