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

PLTE Palette chunk: this is the only optional critical chunk More...

Inherits Hjg.Pngcs.Chunks.PngChunkSingle.

Public Member Functions

 PngChunkPLTE (ImageInfo info)
 
override ChunkOrderingConstraint GetOrderingConstraint ()
 Get ordering constrain
 
override ChunkRaw CreateRawChunk ()
 Serialization. Creates a Raw chunk, ready for write, from this chunk content
 
override void ParseFromRaw (ChunkRaw chunk)
 Deserialization. Given a Raw chunk, just rad, fills this chunk content
 
override void CloneDataFromRead (PngChunk other)
 Override to make a copy (normally deep) from other chunk
 
void SetNentries (int nentries)
 Also allocates array
 
int GetNentries ()
 
void SetEntry (int n, int r, int g, int b)
 
int GetEntry (int n)
 as packed RGB8
 
void GetEntryRgb (int index, int[] rgb, int offset)
 Gets n'th entry, filling 3 positions of given array, at given offset
 
void GetEntryRgb (int n, int[] rgb)
 shortcut: GetEntryRgb(index, int[] rgb, 0)
 
int MinBitDepth ()
 minimum allowed bit depth, given palette size
 
- Public Member Functions inherited from Hjg.Pngcs.Chunks.PngChunkSingle
 PngChunkSingle (String id, ImageInfo imgInfo)
 
sealed override bool AllowsMultiple ()
 This is implemented in PngChunkMultiple/PngChunSingle
 
override int GetHashCode ()
 
override bool Equals (object obj)
 
- Public Member Functions inherited from Hjg.Pngcs.Chunks.PngChunk
ChunkRaw createEmptyChunk (int len, bool alloc)
 
override String ToString ()
 Basic info: Id, length, Type name
 

Public Attributes

const String ID = ChunkHelper.PLTE
 

Additional Inherited Members

- Public Types inherited from Hjg.Pngcs.Chunks.PngChunk
enum  ChunkOrderingConstraint {
  NONE, BEFORE_PLTE_AND_IDAT, AFTER_PLTE_BEFORE_IDAT, BEFORE_IDAT,
  NA
}
 Restrictions for chunk ordering, for ancillary chunks More...
 
- Static Public Member Functions inherited from Hjg.Pngcs.Chunks.PngChunk
static void FactoryRegister (String chunkId, Type type)
 Registers a Chunk ID in the factory, to instantiate a given type
 
static T CloneChunk< T > (T chunk, ImageInfo info)
 
- Protected Member Functions inherited from Hjg.Pngcs.Chunks.PngChunk
 PngChunk (String id, ImageInfo imgInfo)
 Constructs an empty chunk
 
- Protected Attributes inherited from Hjg.Pngcs.Chunks.PngChunk
readonly ImageInfo ImgInfo
 Image basic info, mostly for some checks
 
- Properties inherited from Hjg.Pngcs.Chunks.PngChunk
bool Priority [get, set]
 For writing. Queued chunks with high priority will be written as soon as possible
 
int ChunkGroup [get, set]
 Chunk group where it was read or writen
 
int Length [get, set]
 
long Offset [get, set]
 

Detailed Description

PLTE Palette chunk: this is the only optional critical chunk

http://www.w3.org/TR/PNG/#11PLTE

Constructor & Destructor Documentation

Hjg.Pngcs.Chunks.PngChunkPLTE.PngChunkPLTE ( ImageInfo  info)

Member Function Documentation

override ChunkOrderingConstraint Hjg.Pngcs.Chunks.PngChunkPLTE.GetOrderingConstraint ( )
virtual

Get ordering constrain

Returns

Implements Hjg.Pngcs.Chunks.PngChunk.

override ChunkRaw Hjg.Pngcs.Chunks.PngChunkPLTE.CreateRawChunk ( )
virtual

Serialization. Creates a Raw chunk, ready for write, from this chunk content

Implements Hjg.Pngcs.Chunks.PngChunk.

override void Hjg.Pngcs.Chunks.PngChunkPLTE.ParseFromRaw ( ChunkRaw  c)
virtual

Deserialization. Given a Raw chunk, just rad, fills this chunk content

Implements Hjg.Pngcs.Chunks.PngChunk.

override void Hjg.Pngcs.Chunks.PngChunkPLTE.CloneDataFromRead ( PngChunk  other)
virtual

Override to make a copy (normally deep) from other chunk

Parameters
other

Implements Hjg.Pngcs.Chunks.PngChunk.

void Hjg.Pngcs.Chunks.PngChunkPLTE.SetNentries ( int  nentries)

Also allocates array

Parameters
nentries1-256
int Hjg.Pngcs.Chunks.PngChunkPLTE.GetNentries ( )
void Hjg.Pngcs.Chunks.PngChunkPLTE.SetEntry ( int  n,
int  r,
int  g,
int  b 
)
int Hjg.Pngcs.Chunks.PngChunkPLTE.GetEntry ( int  n)

as packed RGB8

Parameters
n
Returns
void Hjg.Pngcs.Chunks.PngChunkPLTE.GetEntryRgb ( int  index,
int[]  rgb,
int  offset 
)

Gets n'th entry, filling 3 positions of given array, at given offset

Parameters
index
rgb
offset
void Hjg.Pngcs.Chunks.PngChunkPLTE.GetEntryRgb ( int  n,
int[]  rgb 
)

shortcut: GetEntryRgb(index, int[] rgb, 0)

Parameters
n
rgb
int Hjg.Pngcs.Chunks.PngChunkPLTE.MinBitDepth ( )

minimum allowed bit depth, given palette size

Returns
1-2-4-8

Member Data Documentation

const String Hjg.Pngcs.Chunks.PngChunkPLTE.ID = ChunkHelper.PLTE