namespace BitMiracle.LibJpeg
{
using BitMiracle.LibJpeg.Classic;
///
/// Holds parameters of image for decompression (IDecomressDesination)
///
class LoadedImageAttributes
{
///
/// The m_colorspace.
///
private Colorspace m_colorspace;
///
/// The m_quantize colors.
///
private bool m_quantizeColors;
///
/// The m_width.
///
private int m_width;
///
/// The m_height.
///
private int m_height;
///
/// The m_components per sample.
///
private int m_componentsPerSample;
///
/// The m_components.
///
private int m_components;
///
/// The m_actual number of colors.
///
private int m_actualNumberOfColors;
///
/// The m_colormap.
///
private byte[][] m_colormap;
///
/// The m_density unit.
///
private DensityUnit m_densityUnit;
///
/// The m_density x.
///
private int m_densityX;
///
/// The m_density y.
///
private int m_densityY;
/* Decompression processing parameters --- these fields must be set before
* calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
* them to default values.
*/
// colorspace for output
///
/// Gets the colorspace.
///
public Colorspace Colorspace
{
get
{
return this.m_colorspace;
}
internal set
{
this.m_colorspace = value;
}
}
// true=colormapped output wanted
///
/// Gets a value indicating whether quantize colors.
///
public bool QuantizeColors
{
get
{
return this.m_quantizeColors;
}
internal set
{
this.m_quantizeColors = value;
}
}
/* Description of actual output image that will be returned to application.
* These fields are computed by jpeg_start_decompress().
* You can also use jpeg_calc_output_dimensions() to determine these values
* in advance of calling jpeg_start_decompress().
*/
// scaled image width
///
/// Gets the width.
///
public int Width
{
get
{
return this.m_width;
}
internal set
{
this.m_width = value;
}
}
// scaled image height
///
/// Gets the height.
///
public int Height
{
get
{
return this.m_height;
}
internal set
{
this.m_height = value;
}
}
// # of color components in out_color_space
///
/// Gets the components per sample.
///
public int ComponentsPerSample
{
get
{
return this.m_componentsPerSample;
}
internal set
{
this.m_componentsPerSample = value;
}
}
// # of color components returned. it is 1 (a colormap index) when
// quantizing colors; otherwise it equals out_color_components.
///
/// Gets the components.
///
public int Components
{
get
{
return this.m_components;
}
internal set
{
this.m_components = value;
}
}
/* When quantizing colors, the output colormap is described by these fields.
* The application can supply a colormap by setting colormap non-null before
* calling jpeg_start_decompress; otherwise a colormap is created during
* jpeg_start_decompress or jpeg_start_output.
* The map has out_color_components rows and actual_number_of_colors columns.
*/
// number of entries in use
///
/// Gets the actual number of colors.
///
public int ActualNumberOfColors
{
get
{
return this.m_actualNumberOfColors;
}
internal set
{
this.m_actualNumberOfColors = value;
}
}
// The color map as a 2-D pixel array
///
/// Gets the colormap.
///
public byte[][] Colormap
{
get
{
return this.m_colormap;
}
internal set
{
this.m_colormap = value;
}
}
// These fields record data obtained from optional markers
// recognized by the JPEG library.
// JFIF code for pixel size units
///
/// Gets the density unit.
///
public DensityUnit DensityUnit
{
get
{
return this.m_densityUnit;
}
internal set
{
this.m_densityUnit = value;
}
}
// Horizontal pixel density
///
/// Gets the density x.
///
public int DensityX
{
get
{
return this.m_densityX;
}
internal set
{
this.m_densityX = value;
}
}
// Vertical pixel density
///
/// Gets the density y.
///
public int DensityY
{
get
{
return this.m_densityY;
}
internal set
{
this.m_densityY = value;
}
}
}
}