C# (CSharp) CSJ2K.j2k.image.output Namespace

Сlasses

Name Description
ImgWriterPGM This class writes a component from an image in 8 bit unsigned data to a binary PGM file. The size of the image that is written to the file is the size of the component from which to get the data, not the size of the source image (they differ if there is some sub-sampling).

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.

ImgWriterPGX This class extends the ImgWriter abstract class for writing PGX files. PGX is a custom monochrome file format invented specifically to simplify the use of VM3A with images of different bit-depths in the range 1 to 31 bits per pixel.

The file consists of a one line text header followed by the data.

Header: "PG"+ ws +<endianess>+ ws +[sign]+ws + <bit-depth>+" "+<width>+" "+<height>+'\n'

where:

  • ws (white-spaces) is any combination of characters ' ' and '\t'.
  • endianess equals "LM" or "ML"(resp. little-endian or big-endian)
  • sign equals "+" or "-" (resp. unsigned or signed). If omited, values are supposed to be unsigned.
  • bit-depth that can be any number between 1 and 31.
  • width and height are the image dimensions (in pixels).
Data: The image binary values appear one after the other (in raster order) immediately after the last header character ('\n') and are byte-aligned (they are packed into 1,2 or 4 bytes per sample, depending upon the bit-depth value).

If the data is unsigned, level shifting is applied adding 2^(bit depth - 1)

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

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.