ar.com.hjg.pngj.chunks
Class PngChunkPHYS

java.lang.Object
  extended by ar.com.hjg.pngj.chunks.PngChunk
      extended by ar.com.hjg.pngj.chunks.PngChunkSingle
          extended by ar.com.hjg.pngj.chunks.PngChunkPHYS

public class PngChunkPHYS
extends PngChunkSingle

pHYs chunk.

see http://www.w3.org/TR/PNG/#11pHYs


Nested Class Summary
 
Nested classes/interfaces inherited from class ar.com.hjg.pngj.chunks.PngChunk
PngChunk.ChunkOrderingConstraint
 
Field Summary
static java.lang.String ID
           
 
Fields inherited from class ar.com.hjg.pngj.chunks.PngChunk
crit, id, pub, safe
 
Constructor Summary
PngChunkPHYS(ImageInfo info)
           
 
Method Summary
 void cloneDataFromRead(PngChunk other)
          Makes a copy of the chunk.
 ChunkRaw createRawChunk()
          Creates the physical chunk.
 double getAsDpi()
          returns -1 if the physicial unit is unknown, or X-Y are not equal
 double[] getAsDpi2()
          returns -1 if the physicial unit is unknown
 PngChunk.ChunkOrderingConstraint getOrderingConstraint()
          see PngChunk.ChunkOrderingConstraint
 long getPixelsxUnitX()
           
 long getPixelsxUnitY()
           
 int getUnits()
           
 void parseFromRaw(ChunkRaw chunk)
          Parses raw chunk and fill inside data.
 void setAsDpi(double dpi)
           
 void setAsDpi2(double dpix, double dpiy)
           
 void setPixelsxUnitX(long pixelsxUnitX)
           
 void setPixelsxUnitY(long pixelsxUnitY)
           
 void setUnits(int units)
           
 
Methods inherited from class ar.com.hjg.pngj.chunks.PngChunkSingle
allowsMultiple, equals, hashCode
 
Methods inherited from class ar.com.hjg.pngj.chunks.PngChunk
cloneChunk, factory, factoryFromId, factoryRegister, getChunkGroup, getLength, getOffset, hasPriority, isKnown, setChunkGroup, setLength, setOffset, setPriority, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

PngChunkPHYS

public PngChunkPHYS(ImageInfo info)
Method Detail

cloneDataFromRead

public void cloneDataFromRead(PngChunk other)
Description copied from class: PngChunk
Makes a copy of the chunk.

This is used when copying chunks from a reader to a writer

It should normally be a deep copy, and after the cloning this.equals(other) should return true

Specified by:
cloneDataFromRead in class PngChunk

createRawChunk

public ChunkRaw createRawChunk()
Description copied from class: PngChunk
Creates the physical chunk. This is used when writing (serialization). Each particular chunk class implements its own logic.

Specified by:
createRawChunk in class PngChunk
Returns:
A newly allocated and filled raw chunk

getAsDpi

public double getAsDpi()
returns -1 if the physicial unit is unknown, or X-Y are not equal


getAsDpi2

public double[] getAsDpi2()
returns -1 if the physicial unit is unknown


getOrderingConstraint

public PngChunk.ChunkOrderingConstraint getOrderingConstraint()
Description copied from class: PngChunk
see PngChunk.ChunkOrderingConstraint

Specified by:
getOrderingConstraint in class PngChunk

getPixelsxUnitX

public long getPixelsxUnitX()

getPixelsxUnitY

public long getPixelsxUnitY()

getUnits

public int getUnits()

parseFromRaw

public void parseFromRaw(ChunkRaw chunk)
Description copied from class: PngChunk
Parses raw chunk and fill inside data. This is used when reading (deserialization). Each particular chunk class implements its own logic.

Specified by:
parseFromRaw in class PngChunk

setAsDpi

public void setAsDpi(double dpi)

setAsDpi2

public void setAsDpi2(double dpix,
                      double dpiy)

setPixelsxUnitX

public void setPixelsxUnitX(long pixelsxUnitX)

setPixelsxUnitY

public void setPixelsxUnitY(long pixelsxUnitY)

setUnits

public void setUnits(int units)