Пример #1
0
        /// <summary>
        /// Decodes the data for the zone
        /// </summary>
        /// <param name="reader"></param>
        private void DecodeZoneData(DjvuReader reader, TextZone sibling, TextChunk chunkParent)
        {
            _zoneType = (ZoneTypes)reader.ReadByte();
            _x        = reader.ReadUInt16BigEndian() - 0x8000;
            _y        = reader.ReadUInt16BigEndian() - 0x8000;
            _width    = reader.ReadUInt16BigEndian() - 0x8000;
            _height   = reader.ReadUInt16BigEndian() - 0x8000;

            _textOffset = reader.ReadUInt16BigEndian() - 0x8000;
            _textLength = reader.ReadInt24BigEndian();

            ResolveOffsets(_parent, sibling);

            _rectangle = new Rectangle(_x, _y, _width, _height);

            int             childrenZones = reader.ReadInt24BigEndian();
            List <TextZone> children      = new List <TextZone>();

            TextZone childrenSibling = null;

            for (int x = 0; x < childrenZones; x++)
            {
                TextZone newZone = new TextZone(reader, this, childrenSibling, chunkParent);
                childrenSibling = newZone;

                children.Add(newZone);
            }

            _children = children.ToArray();
        }