Example #1
0
 public override void ParseFromRaw(ChunkRaw c)
 {
     if (c.Length != 1)
     {
         throw new PngjException("bad chunk length " + c?.ToString());
     }
     Intent = PngHelperInternal.ReadInt1fromByte(c.Data, 0);
 }
Example #2
0
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Length != 1)
     {
         throw new PngjException("bad chunk length " + chunk?.ToString());
     }
     Mode = chunk.Data[0];
 }
Example #3
0
        public override void ParseFromRaw(ChunkRaw chunk)
        {
            if (chunk.Length != 4)
            {
                throw new PngjException("bad chunk " + chunk?.ToString());
            }
            int num = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 0);

            gamma = (double)num / 100000.0;
        }
Example #4
0
 public override void ParseFromRaw(ChunkRaw c)
 {
     if (c.Length != 32)
     {
         throw new PngjException("bad chunk " + c?.ToString());
     }
     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));
 }
Example #5
0
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Length != 9)
     {
         throw new PngjException("bad chunk length " + chunk?.ToString());
     }
     posX = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 0);
     if (posX < 0)
     {
         posX += 4294967296L;
     }
     posY = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 4);
     if (posY < 0)
     {
         posY += 4294967296L;
     }
     units = PngHelperInternal.ReadInt1fromByte(chunk.Data, 8);
 }
Example #6
0
 public override void ParseFromRaw(ChunkRaw c)
 {
     if (c.Length != GetLen())
     {
         throw new PngjException("bad chunk length " + c?.ToString());
     }
     if (ImgInfo.Greyscale)
     {
         Graysb = PngHelperInternal.ReadInt1fromByte(c.Data, 0);
         if (ImgInfo.Alpha)
         {
             Alphasb = PngHelperInternal.ReadInt1fromByte(c.Data, 1);
         }
         return;
     }
     Redsb   = PngHelperInternal.ReadInt1fromByte(c.Data, 0);
     Greensb = PngHelperInternal.ReadInt1fromByte(c.Data, 1);
     Bluesb  = PngHelperInternal.ReadInt1fromByte(c.Data, 2);
     if (ImgInfo.Alpha)
     {
         Alphasb = PngHelperInternal.ReadInt1fromByte(c.Data, 3);
     }
 }