Пример #1
0
 public Pb3Reader(Stream input, Pb3MetaData info)
 {
     if (info.Type == 1 && info.SubType != 0x10)
     {
         throw new NotSupportedException();
     }
     m_info  = info;
     m_input = new byte[m_info.InputSize];
     if (m_input.Length != input.Read(m_input, 0, m_input.Length))
     {
         throw new EndOfStreamException();
     }
     m_channels   = m_info.BPP / 8;
     m_stride     = 4 * (int)m_info.Width;
     m_lzss_frame = new byte[0x800];
     Format       = m_channels < 4 ? PixelFormats.Bgr32 : PixelFormats.Bgra32;
     // output array created by unpack methods as needed.
 }
Пример #2
0
 public Pb3Reader(Stream input, Pb3MetaData info)
 {
     if (info.Type == 1 && info.SubType != 0x10)
         throw new NotSupportedException();
     m_info = info;
     m_input = new byte[m_info.InputSize];
     if (m_input.Length != input.Read (m_input, 0, m_input.Length))
         throw new EndOfStreamException();
     m_channels = m_info.BPP / 8;
     m_stride = 4 * (int)m_info.Width;
     m_lzss_frame = new byte[0x800];
     Format = m_channels < 4 ? PixelFormats.Bgr32 : PixelFormats.Bgra32;
     // output array created by unpack methods as needed.
 }