public static AImageScheme GetScheme(string title) { AImageScheme scheme = null; if (string.IsNullOrEmpty(title) || !KnownSchemes.TryGetValue(title, out scheme)) { return(null); } return(scheme); }
protected override IImageDecoder DecryptImage(IBinaryStream input, AImageScheme scheme) { int id = input.ReadByte(); if (id == scheme.Value2) { return(new AImageReader(input, scheme)); } input.Position = 0; return(new ImageFormatDecoder(input)); }
protected virtual IImageDecoder DecryptImage(IBinaryStream input, AImageScheme scheme) { int type = input.ReadByte(); if ('c' == type || 'b' == type) { uint img_size = Binary.BigEndian(input.ReadUInt32()); long start_pos = input.Length - img_size; input = BinaryStream.FromStream(new StreamRegion(input.AsStream, start_pos, img_size), input.Name); } else if (scheme != null && ('a' == type || 'd' == type) && input.Length > 21) { int id = input.ReadByte(); if (id == scheme.Value2) { return(new AImageReader(input, scheme, type)); } } input.Position = 0; return(new ImageFormatDecoder(input)); }
public BellArchive(ArcView arc, ArchiveFormat impl, ICollection <Entry> dir, AImageScheme scheme) : base(arc, impl, dir) { Scheme = scheme; }
public AImageReader(IBinaryStream input, AImageScheme scheme, int type = 'a') { m_input = input; m_scheme = scheme; m_type = type; }
public AImageReader(IBinaryStream input, AImageScheme scheme) { m_input = input; m_scheme = scheme; }