예제 #1
0
        public AdvImageSection(BinaryReader reader)
        {
            byte version = reader.ReadByte();

            if (version >= 1)
            {
                Width = reader.ReadUInt32();
                Height = reader.ReadUInt32();
                BitsPerPixel = reader.ReadByte();

                byte lyCnt = reader.ReadByte();
                for (int i = 0; i < lyCnt; i++)
                {
                    byte layoutId = reader.ReadByte();
                    var layout = new AdvImageLayout(this, layoutId, Width, Height, reader);
                    ImageLayouts.Add(layoutId, layout);
                }

                byte propCnt = reader.ReadByte();
                for (int i = 0; i < propCnt; i++)
                {
                    string propName = reader.ReadAsciiString256();
                    string propValue = reader.ReadAsciiString256();

                    ImageSerializationProperties.Add(propName, propValue);
                }

                InitSerializationProperties();
            }
        }
예제 #2
0
파일: AdvFile.cs 프로젝트: hpavlov/occurec
        public void GetFrameImageSectionHeader(int frameNo, out byte layoutId, out AdvImageLayout.GetByteMode byteMode)
        {
            AdvFramesIndexEntry idxEntry = m_Index.Index[frameNo];
            m_InputFile.Seek(idxEntry.Offset, SeekOrigin.Begin);

            uint frameDataMagic = m_FileReader.ReadUInt32();
            Trace.Assert(frameDataMagic == 0xEE0122FF);

            // 8 bytes timestamp + 4 bytes exposure + 4 bytes image section length
            m_InputFile.Seek(16, SeekOrigin.Current);

            layoutId = m_FileReader.ReadByte();
            byteMode = (AdvImageLayout.GetByteMode)m_FileReader.ReadByte();
        }