Exemplo n.º 1
0
        protected override ImageData GetImageData()
        {
            var info = ArchPacOpener.CtFormat.Value.ReadMetaData(m_input) as SeraphMetaData;

            if (null == info)
            {
                return(ImageFormat.Read(m_input));
            }
            var overlay = new SeraphReader(m_input.AsStream, info);

            overlay.UnpackCt();
            var dst = m_baseline.Data;
            var src = overlay.Data;

            if (dst.Length != src.Length)
            {
                return(ImageData.Create(overlay.Info, PixelFormats.Bgra32, null, src));
            }
            for (int i = 0; i < src.Length; i += 4)
            {
                if (src[i + 3] != 0)
                {
                    dst[i]     = src[i];
                    dst[i + 1] = src[i + 1];
                    dst[i + 2] = src[i + 2];
                    dst[i + 3] = src[i + 3];
                }
                else
                {
                    dst[i + 3] = 0xFF;
                }
            }
            return(ImageData.Create(Info, PixelFormats.Bgra32, null, dst));
        }
Exemplo n.º 2
0
        public override ImageData Read(IBinaryStream stream, ImageMetaData info)
        {
            var reader = new SeraphReader(stream.AsStream, (SeraphMetaData)info, 4);

            reader.UnpackCx();
            return(ImageData.Create(info, reader.Format, null, reader.Data));
        }
Exemplo n.º 3
0
        public override ImageData Read(IBinaryStream stream, ImageMetaData info)
        {
            var meta   = (SeraphMetaData)info;
            var reader = new SeraphReader(stream.AsStream, meta, 1);

            reader.UnpackCb();
            return(ImageData.Create(info, reader.Format, reader.Palette, reader.Data));
        }
Exemplo n.º 4
0
        public override ImageData Read(IBinaryStream stream, ImageMetaData info)
        {
            var meta   = (SeraphMetaData)info;
            var reader = new SeraphReader(stream.AsStream, meta);

            reader.UnpackCf();
            return(ImageData.Create(info, PixelFormats.Bgr24, null, reader.Data));
        }
Exemplo n.º 5
0
        public override ImageData Read(Stream stream, ImageMetaData info)
        {
            var meta = info as SeraphMetaData;

            if (null == meta)
            {
                throw new ArgumentException("SeraphCfImage.Read should be supplied with SeraphMetaData", "info");
            }

            var reader = new SeraphReader(stream, meta);

            reader.UnpackCf();
            return(ImageData.Create(info, PixelFormats.Bgr24, null, reader.Data));
        }
Exemplo n.º 6
0
 SeraphReader OpenCtImage(ArcFile arc, Entry entry)
 {
     using (var input = arc.OpenBinaryEntry(entry))
     {
         if (input.Signature != CtFormat.Value.Signature)
         {
             return(null);
         }
         var info = CtFormat.Value.ReadMetaData(input) as SeraphMetaData;
         if (null == info)
         {
             return(null);
         }
         var reader = new SeraphReader(input.AsStream, info);
         reader.UnpackCt();
         return(reader);
     }
 }
Exemplo n.º 7
0
 public CtOverlayDecoder(IBinaryStream input, SeraphReader baseline)
     : base(input, baseline.Info)
 {
     m_baseline = baseline;
 }