Пример #1
0
 public override ImageMetaData ReadMetaData(Stream stream)
 {
     using (var input = new ArcView.Reader (stream))
     {
         input.ReadInt32();
         var info = new DgcMetaData();
         info.Flags  = input.ReadUInt32();
         info.Width  = input.ReadUInt16();
         info.Height = input.ReadUInt16();
         if (info.Width > 0x7fff || info.Height > 0x7fff)
             return null;
         info.BPP    = 0 == (info.Flags & Reader.FlagAlphaChannel) ? 24 : 32;
         return info;
     }
 }
Пример #2
0
        }                                                                 // 'DGC'

        public override ImageMetaData ReadMetaData(IBinaryStream file)
        {
            file.Position = 4;
            var info = new DgcMetaData();

            info.Flags  = file.ReadUInt32();
            info.Width  = file.ReadUInt16();
            info.Height = file.ReadUInt16();
            if (info.Width > 0x7fff || info.Height > 0x7fff)
            {
                return(null);
            }
            info.BPP = 0 == (info.Flags & Reader.FlagAlphaChannel) ? 24 : 32;
            return(info);
        }
Пример #3
0
        }                                                                 // 'DGC'

        public override ImageMetaData ReadMetaData(Stream stream)
        {
            using (var input = new ArcView.Reader(stream))
            {
                input.ReadInt32();
                var info = new DgcMetaData();
                info.Flags  = input.ReadUInt32();
                info.Width  = input.ReadUInt16();
                info.Height = input.ReadUInt16();
                if (info.Width > 0x7fff || info.Height > 0x7fff)
                {
                    return(null);
                }
                info.BPP = 0 == (info.Flags & Reader.FlagAlphaChannel) ? 24 : 32;
                return(info);
            }
        }
Пример #4
0
 public Reader(IBinaryStream input, DgcMetaData info)
 {
     m_width         = (int)info.Width;
     m_height        = (int)info.Height;
     m_input         = input;
     m_use_dict      = 0 != (info.Flags & FlagUseDictionary);
     m_has_alpha     = 0 != (info.Flags & FlagAlphaChannel);
     m_max_dict_size = (int)(info.Flags & 0xffffff);
     if (m_has_alpha)
     {
         Format       = PixelFormats.Bgra32;
         m_pixel_size = 4;
     }
     else
     {
         Format       = PixelFormats.Bgr24;
         m_pixel_size = 3;
     }
     m_stride = m_width * m_pixel_size;
     m_output = new byte[m_stride * m_height];
 }
Пример #5
0
 public Reader(Stream input, DgcMetaData info)
 {
     m_width = (int)info.Width;
     m_height = (int)info.Height;
     m_input = new ArcView.Reader (input);
     m_use_dict  = 0 != (info.Flags & FlagUseDictionary);
     m_has_alpha = 0 != (info.Flags & FlagAlphaChannel);
     m_max_dict_size = (int)(info.Flags & 0xffffff);
     if (m_has_alpha)
     {
         Format = PixelFormats.Bgra32;
         m_pixel_size = 4;
     }
     else
     {
         Format = PixelFormats.Bgr24;
         m_pixel_size = 3;
     }
     m_stride = m_width * m_pixel_size;
     m_output = new byte[m_stride*m_height];
 }