コード例 #1
0
ファイル: PngChunkOFFS.cs プロジェクト: Chapmania/Juniper
        public override void ParseFromRaw(ChunkRaw c)
        {
            if (c is null)
            {
                throw new System.ArgumentNullException(nameof(c));
            }

            if (c.Len != 9)
            {
                throw new PngjException("bad chunk length " + c);
            }

            posX = PngHelperInternal.ReadInt4fromBytes(c.Data, 0);
            if (posX < 0)
            {
                posX += 0x100000000L;
            }

            posY = PngHelperInternal.ReadInt4fromBytes(c.Data, 4);
            if (posY < 0)
            {
                posY += 0x100000000L;
            }

            units = PngHelperInternal.ReadInt1fromByte(c.Data, 8);
        }
コード例 #2
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;
        }
コード例 #3
0
        public override void ParseFromRaw(ChunkRaw chunk)
        {
            if (chunk.Len != 4)
            {
                throw new System.Exception($"bad chunk {chunk}");
            }
            int g = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 0);

            gamma = ((double)g) / 100000.0d;
        }
コード例 #4
0
ファイル: PngChunkCHRM.cs プロジェクト: Computdroid/pngcs
 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));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Len != 9)
     {
         throw new PngjException("bad chunk length " + chunk);
     }
     posX = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 0);
     if (posX < 0)
     {
         posX += 0x100000000L;
     }
     posY = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 4);
     if (posY < 0)
     {
         posY += 0x100000000L;
     }
     units = PngHelperInternal.ReadInt1fromByte(chunk.Data, 8);
 }
コード例 #7
0
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Length != 9)
     {
         throw new PngjException("bad chunk length " + chunk?.ToString());
     }
     PixelsxUnitX = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 0);
     if (PixelsxUnitX < 0)
     {
         PixelsxUnitX += 4294967296L;
     }
     PixelsxUnitY = PngHelperInternal.ReadInt4fromBytes(chunk.Data, 4);
     if (PixelsxUnitY < 0)
     {
         PixelsxUnitY += 4294967296L;
     }
     Units = PngHelperInternal.ReadInt1fromByte(chunk.Data, 8);
 }
コード例 #8
0
 public override void ParseFromRaw(ChunkRaw chunk)
 {
     byte[] data = chunk.Data;
     if (chunk.Len != 9)
     {
         throw new System.Exception($"bad chunk length {chunk}");
     }
     posX = PngHelperInternal.ReadInt4fromBytes(data, 0);
     if (posX < 0)
     {
         posX += 0x100000000L;
     }
     posY = PngHelperInternal.ReadInt4fromBytes(data, 4);
     if (posY < 0)
     {
         posY += 0x100000000L;
     }
     units = PngHelperInternal.ReadInt1fromByte(data, 8);
 }