Exemple #1
0
 public override IImageDecoder OpenImage(ArcFile arc, Entry entry)
 {
     if (entry.Name.EndsWith(".BGD") || entry.Name.EndsWith(".CRGB"))
     {
         var input = arc.File.CreateStream(entry.Offset, entry.Size);
         var info  = new ImageMetaData {
             Width = 800, Height = 600, BPP = 24
         };
         return(new CgdReader(input, info));
     }
     else if (entry.Name.EndsWith(".CHAR"))
     {
         var input = arc.File.CreateStream(entry.Offset, entry.Size);
         var info  = new ChrMetaData {
             Width      = 800, Height = 600, BPP = 32,
             DataOffset = 0, RgbSize = (int)input.Length,
         };
         return(new ChrReader(input, info));
     }
     return(base.OpenImage(arc, entry));
 }
Exemple #2
0
 public override IImageDecoder OpenImage(ArcFile arc, Entry entry)
 {
     if (entry.Name.HasAnyOfExtensions(".BGD", ".CRGB"))
     {
         var input = OpenEntry(arc, entry);
         var info  = new ImageMetaData {
             Width = 800, Height = 600, BPP = 24
         };
         return(new CgdReader(BinaryStream.FromStream(input, entry.Name), info));
     }
     else if (entry.Name.HasExtension(".edg"))
     {
         var input = OpenEntry(arc, entry);
         var info  = new ImageMetaData {
             Width = 460, Height = 345, BPP = 24
         };
         return(new ImgReader(BinaryStream.FromStream(input, entry.Name), info));
     }
     else if (entry.Name.HasExtension(".rol"))
     {
         var  input  = OpenEntry(arc, entry);
         uint width  = 202;
         uint height = (uint)input.Length / (((width * 3u) + 3u) & ~3u);
         var  info   = new ImageMetaData {
             Width = width, Height = height, BPP = 24
         };
         return(new ImgReader(BinaryStream.FromStream(input, entry.Name), info));
     }
     else if (entry.Name.HasExtension(".CHAR"))
     {
         var input = OpenEntry(arc, entry);
         var info  = new ChrMetaData {
             Width      = 800, Height = 600, BPP = 32,
             DataOffset = 0, RgbSize = (int)input.Length,
         };
         return(new ChrReader(BinaryStream.FromStream(input, entry.Name), info));
     }
     return(base.OpenImage(arc, entry));
 }
Exemple #3
0
 public ChrDecoder(IBinaryStream input, ChrMetaData info) : base(input, info)
 {
 }
Exemple #4
0
 public ChrReader(IBinaryStream input, ChrMetaData info) : base(input, info)
 {
     m_info   = info;
     m_stride = (int)m_info.Width * 4;
     m_output = new byte[m_stride * (int)m_info.Height];
 }