Пример #1
0
 public GrpReader(Stream input, GrpMetaData info)
 {
     m_info  = info;
     m_input = input;
     if (8 == info.BPP)
     {
         Format = PixelFormats.Indexed8;
     }
     else if (24 == info.BPP)
     {
         Format = PixelFormats.Bgr24;
     }
     else if (32 == info.BPP)
     {
         Format = m_info.AlphaChannel ? PixelFormats.Bgra32 : PixelFormats.Bgr32;
     }
     else
     {
         throw new NotSupportedException("Not supported GRP image depth");
     }
     m_stride = m_info.iWidth * ((Format.BitsPerPixel + 7) / 8);
 }
Пример #2
0
 public GrpReader(Stream input, GrpMetaData info)
 {
     m_info = info;
     m_input = input;
     if (8 == info.BPP)
         Format = PixelFormats.Indexed8;
     else if (24 == info.BPP)
         Format = PixelFormats.Bgr24;
     else if (32 == info.BPP)
         Format = m_info.AlphaChannel ? PixelFormats.Bgra32 : PixelFormats.Bgr32;
     else
         throw new NotSupportedException ("Not supported GRP image depth");
     m_stride = (int)m_info.Width*((Format.BitsPerPixel+7)/8);
 }