Пример #1
0
        ///<summary>
        /// Decodes the fast text data
        ///</summary>
        ///<param name="pageData">Teletext page data</param>
        public void Decode(byte[] pageData)
        {
            _redPage    = -1;
            _greenPage  = -1;
            _yellowPage = -1;
            _bluePage   = -1;
            _whitePage  = -1;

            int maxRows = pageData.Length / 42;

            if (maxRows < 1)
            {
                return;
            }

            int pageNumber = 0;

            for (int rowNr = 0; rowNr < maxRows; rowNr++)
            {
                int packetNumber = Hamming.GetPacketNumber(rowNr * 42, ref pageData);
                if (packetNumber == 0)
                {
                    pageNumber = Hamming.GetPageNumber(rowNr * 42, ref pageData);
                }
                if (packetNumber == 27)
                {
                    DecodePacket27(pageNumber, rowNr * 42, pageData);
                    return;
                }
            }
        }