예제 #1
0
 protected HgReader(Stream input, HgMetaData info)
 {
     m_input      = new ArcView.Reader(input);
     m_info       = info;
     m_pixel_size = m_info.BPP / 8;
     Stride       = (int)m_info.Width * m_pixel_size;
 }
예제 #2
0
 protected HgReader(IBinaryStream input, HgMetaData info)
 {
     m_input      = input;
     m_info       = info;
     m_pixel_size = m_info.BPP / 8;
     Stride       = (int)m_info.Width * m_pixel_size;
 }
예제 #3
0
파일: ArcHG3.cs 프로젝트: y111303tut/GARbro
        public override IImageDecoder OpenImage(ArcFile arc, Entry entry)
        {
            var offset = entry.Offset + 8;
            var info   = new HgMetaData
            {
                HeaderSize   = arc.File.View.ReadUInt32(offset),
                Width        = arc.File.View.ReadUInt32(offset + 8),
                Height       = arc.File.View.ReadUInt32(offset + 0xC),
                BPP          = arc.File.View.ReadInt32(offset + 0x10),
                OffsetX      = arc.File.View.ReadInt32(offset + 0x14),
                OffsetY      = arc.File.View.ReadInt32(offset + 0x18),
                CanvasWidth  = arc.File.View.ReadUInt32(offset + 0x1C),
                CanvasHeight = arc.File.View.ReadUInt32(offset + 0x20),
            };
            var input = arc.File.CreateStream(entry.Offset, entry.Size);

            return(new Hg3Reader(input, info));
        }
예제 #4
0
        public override Stream OpenEntry(ArcFile arc, Entry entry)
        {
            // emulate TGA image
            var offset = entry.Offset + 8;
            var info   = new HgMetaData
            {
                HeaderSize   = arc.File.View.ReadUInt32(offset),
                Width        = arc.File.View.ReadUInt32(offset + 8),
                Height       = arc.File.View.ReadUInt32(offset + 0xC),
                BPP          = arc.File.View.ReadInt32(offset + 0x10),
                OffsetX      = arc.File.View.ReadInt32(offset + 0x14),
                OffsetY      = arc.File.View.ReadInt32(offset + 0x18),
                CanvasWidth  = arc.File.View.ReadUInt32(offset + 0x1C),
                CanvasHeight = arc.File.View.ReadUInt32(offset + 0x20),
            };

            using (var input = arc.File.CreateStream(entry.Offset, entry.Size))
                using (var reader = new Hg3Reader(input, info))
                {
                    var pixels = reader.Unpack();
                    return(TgaStream.Create(info, pixels, reader.Flipped));
                }
        }
예제 #5
0
 public Hg3Reader(Stream input, HgMetaData info) : base(input, info)
 {
 }