Пример #1
0
 public C24Decoder(IBinaryStream file, C24MetaData info, bool leave_open = false)
 {
     m_input          = file;
     m_info           = info;
     m_output         = new byte[3 * m_info.Width * m_info.Height];
     m_should_dispose = !leave_open;
 }
Пример #2
0
 public CDecoderBase(IBinaryStream file, C24MetaData info, PixelFormat format, bool leave_open = false)
 {
     m_input          = file;
     m_info           = info;
     m_output         = new byte[(info.BPP / 8) * (int)m_info.Width * (int)m_info.Height];
     m_should_dispose = !leave_open;
     Format           = format;
 }
Пример #3
0
        internal C24MetaData ReadMetaData(IBinaryStream file, long offset, int bpp)
        {
            file.Position = offset;
            var info = new C24MetaData {
                BPP = bpp
            };

            info.Width      = file.ReadUInt32();
            info.Height     = file.ReadUInt32();
            info.OffsetX    = file.ReadInt32();
            info.OffsetY    = file.ReadInt32();
            info.DataOffset = (uint)file.Position;
            return(info);
        }
Пример #4
0
        public override IImageDecoder OpenImage(ArcFile arc, Entry entry)
        {
            var offset = entry.Offset;
            var info   = new C24MetaData
            {
                Width      = arc.File.View.ReadUInt32(offset),
                Height     = arc.File.View.ReadUInt32(offset + 4),
                OffsetX    = arc.File.View.ReadInt32(offset + 8),
                OffsetY    = arc.File.View.ReadInt32(offset + 12),
                BPP        = 24,
                DataOffset = (uint)(offset + 0x10),
            };
            var input = arc.File.CreateStream(0, (uint)arc.File.MaxOffset);

            return(new C24Decoder(input, info));
        }
Пример #5
0
        }                                                                 // 'C24'

        public override ImageMetaData ReadMetaData(IBinaryStream file)
        {
            var header = file.ReadHeader(12);
            int count  = header.ToInt32(4);

            if (count <= 0)
            {
                return(null);
            }
            file.Position = header.ToUInt32(8);
            var info = new C24MetaData {
                BPP = 24
            };

            info.Width      = file.ReadUInt32();
            info.Height     = file.ReadUInt32();
            info.OffsetX    = file.ReadInt32();
            info.OffsetY    = file.ReadInt32();
            info.DataOffset = (uint)file.Position;
            return(info);
        }
Пример #6
0
 public C25Decoder(IBinaryStream file, C24MetaData info, bool leave_open = false)
     : base(file, info, PixelFormats.Bgra32, leave_open)
 {
 }