PngCs  1.1.4
A C# library for read/write PNG images
Static Public Member Functions | List of all members
Hjg.Pngcs.ImageLineHelper Class Reference

Bunch of utility static methods to process/analyze an image line. More...

Static Public Member Functions

static int[] Palette2rgb (ImageLine line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf)
 Given an indexed line with a palette, unpacks as a RGB array
 
static int[] Palette2rgb (ImageLine line, PngChunkPLTE pal, int[] buf)
 
static int ToARGB8 (int r, int g, int b)
 
static int ToARGB8 (int r, int g, int b, int a)
 
static int ToARGB8 (int[] buff, int offset, bool alpha)
 
static int ToARGB8 (byte[] buff, int offset, bool alpha)
 
static void FromARGB8 (int val, int[] buff, int offset, bool alpha)
 
static void FromARGB8 (int val, byte[] buff, int offset, bool alpha)
 
static int GetPixelToARGB8 (ImageLine line, int column)
 
static void SetPixelFromARGB8 (ImageLine line, int column, int argb)
 
static void SetPixel (ImageLine line, int col, int r, int g, int b, int a)
 
static void SetPixel (ImageLine line, int col, int r, int g, int b)
 
static double ReadDouble (ImageLine line, int pos)
 
static void WriteDouble (ImageLine line, double d, int pos)
 
static int Interpol (int a, int b, int c, int d, double dx, double dy)
 
static int ClampTo_0_255 (int i)
 
static double ClampDouble (double i)
 
static int ClampTo_0_65535 (int i)
 
static int ClampTo_128_127 (int x)
 
static int[] Unpack (ImageInfo imgInfo, int[] src, int[] dst, bool scale)
 
static byte[] Unpack (ImageInfo imgInfo, byte[] src, byte[] dst, bool scale)
 
static int[] Pack (ImageInfo imgInfo, int[] src, int[] dst, bool scale)
 
static byte[] Pack (ImageInfo imgInfo, byte[] src, byte[] dst, bool scale)
 

Detailed Description

Bunch of utility static methods to process/analyze an image line.

Not essential at all, some methods are probably to be removed if future releases.

TODO: document this better

Member Function Documentation

static int [] Hjg.Pngcs.ImageLineHelper.Palette2rgb ( ImageLine  line,
PngChunkPLTE  pal,
PngChunkTRNS  trns,
int[]  buf 
)
static

Given an indexed line with a palette, unpacks as a RGB array

Parameters
lineImageLine as returned from PngReader
palPalette chunk
trnsTRNS chunk (optional)
bufPreallocated array, optional
Returns
R G B (one byte per sample)
static int [] Hjg.Pngcs.ImageLineHelper.Palette2rgb ( ImageLine  line,
PngChunkPLTE  pal,
int[]  buf 
)
static
static int Hjg.Pngcs.ImageLineHelper.ToARGB8 ( int  r,
int  g,
int  b 
)
static
static int Hjg.Pngcs.ImageLineHelper.ToARGB8 ( int  r,
int  g,
int  b,
int  a 
)
static
static int Hjg.Pngcs.ImageLineHelper.ToARGB8 ( int[]  buff,
int  offset,
bool  alpha 
)
static
static int Hjg.Pngcs.ImageLineHelper.ToARGB8 ( byte[]  buff,
int  offset,
bool  alpha 
)
static
static void Hjg.Pngcs.ImageLineHelper.FromARGB8 ( int  val,
int[]  buff,
int  offset,
bool  alpha 
)
static
static void Hjg.Pngcs.ImageLineHelper.FromARGB8 ( int  val,
byte[]  buff,
int  offset,
bool  alpha 
)
static
static int Hjg.Pngcs.ImageLineHelper.GetPixelToARGB8 ( ImageLine  line,
int  column 
)
static
static void Hjg.Pngcs.ImageLineHelper.SetPixelFromARGB8 ( ImageLine  line,
int  column,
int  argb 
)
static
static void Hjg.Pngcs.ImageLineHelper.SetPixel ( ImageLine  line,
int  col,
int  r,
int  g,
int  b,
int  a 
)
static
static void Hjg.Pngcs.ImageLineHelper.SetPixel ( ImageLine  line,
int  col,
int  r,
int  g,
int  b 
)
static
static double Hjg.Pngcs.ImageLineHelper.ReadDouble ( ImageLine  line,
int  pos 
)
static
static void Hjg.Pngcs.ImageLineHelper.WriteDouble ( ImageLine  line,
double  d,
int  pos 
)
static
static int Hjg.Pngcs.ImageLineHelper.Interpol ( int  a,
int  b,
int  c,
int  d,
double  dx,
double  dy 
)
static
static int Hjg.Pngcs.ImageLineHelper.ClampTo_0_255 ( int  i)
static
static double Hjg.Pngcs.ImageLineHelper.ClampDouble ( double  i)
static

[0,1)

static int Hjg.Pngcs.ImageLineHelper.ClampTo_0_65535 ( int  i)
static
static int Hjg.Pngcs.ImageLineHelper.ClampTo_128_127 ( int  x)
static
static int [] Hjg.Pngcs.ImageLineHelper.Unpack ( ImageInfo  imgInfo,
int[]  src,
int[]  dst,
bool  scale 
)
static
static byte [] Hjg.Pngcs.ImageLineHelper.Unpack ( ImageInfo  imgInfo,
byte[]  src,
byte[]  dst,
bool  scale 
)
static
static int [] Hjg.Pngcs.ImageLineHelper.Pack ( ImageInfo  imgInfo,
int[]  src,
int[]  dst,
bool  scale 
)
static
static byte [] Hjg.Pngcs.ImageLineHelper.Pack ( ImageInfo  imgInfo,
byte[]  src,
byte[]  dst,
bool  scale 
)
static