Exemple #1
0
        public BsgReader(Stream input, BsgMetaData info)
        {
            m_info = info;
            if (m_info.CompressionMode > 2)
            {
                throw new NotSupportedException("Not supported BSS Graphics compression");
            }

            m_input  = new ArcView.Reader(input);
            m_output = new byte[m_info.UnpackedSize];
            switch (m_info.ColorMode)
            {
            case 0:
                Format = PixelFormats.Bgra32;
                Stride = (int)m_info.Width * 4;
                break;

            case 1:
                Format = PixelFormats.Bgr32;
                Stride = (int)m_info.Width * 4;
                break;

            case 2:
                Format  = PixelFormats.Indexed8;
                Stride  = (int)m_info.Width;
                Palette = ReadPalette();
                break;
            }
        }
Exemple #2
0
        public BsgReader(Stream input, BsgMetaData info)
        {
            m_info = info;
            if (m_info.CompressionMode > 2)
                throw new NotSupportedException ("Not supported BSS Graphics compression");

            m_input = new ArcView.Reader (input);
            m_output = new byte[m_info.UnpackedSize];
            switch (m_info.ColorMode)
            {
            case 0:
                Format = PixelFormats.Bgra32;
                Stride = (int)m_info.Width * 4;
                break;
            case 1:
                Format = PixelFormats.Bgr32;
                Stride = (int)m_info.Width * 4;
                break;
            case 2:
                Format = PixelFormats.Indexed8;
                Stride = (int)m_info.Width;
                Palette = ReadPalette();
                break;
            }
        }