Beispiel #1
0
 public override void ParseFromRaw(ChunkRaw c)
 {
     if (c.Len != 32)
     {
         throw new PngjException("bad chunk " + c);
     }
     whitex = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 0));
     whitey = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 4));
     redx   = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 8));
     redy   = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 12));
     greenx = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 16));
     greeny = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 20));
     bluex  = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 24));
     bluey  = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(c.Data, 28));
 }
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Len != 32)
     {
         throw new System.Exception($"bad chunk {chunk}");
     }
     byte[] data = chunk.Data;
     whitex = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 0));
     whitey = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 4));
     redx   = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 8));
     redy   = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 12));
     greenx = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 16));
     greeny = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 20));
     bluex  = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 24));
     bluey  = PngHelperInternal.IntToDouble100000(PngHelperInternal.ReadInt4fromBytes(data, 28));
 }