コード例 #1
0
        private static ProfileTypeB ParseLensCorrectionTypeB(byte[] buffer, ref ulong offset)
        {
            ProfileTypeB data = new ProfileTypeB();

            /* zero header */
            offset += 0x10;

            UInt16[] focalLengths = new UInt16[4];
            focalLengths[0] = GetUInt16(buffer, offset + 0x00);
            focalLengths[1] = GetUInt16(buffer, offset + 0x02);
            focalLengths[2] = GetUInt16(buffer, offset + 0x04);
            focalLengths[3] = GetUInt16(buffer, offset + 0x06);
            offset         += 0x08;

            data.UnknownHeaderData = new UInt16[0x0A];
            for (int pos = 0; pos < 0x0A; pos++)
            {
                data.UnknownHeaderData[pos] = GetUInt16(buffer, offset);
                offset += 0x02;
            }

            data.Data = new ProfileTypeBData[4];
            for (int pos = 0; pos < 4; pos++)
            {
                data.Data[pos]             = ParseLensCorrectionTypeBData(buffer, ref offset);
                data.Data[pos].FocalLength = focalLengths[pos];
            }

            return(data);
        }
コード例 #2
0
        private static ProfileTypeB ParseLensCorrectionTypeB(byte[] buffer, ref ulong offset)
        {
            ProfileTypeB data = new ProfileTypeB();

            /* zero header */
            offset += 0x10;

            UInt16[] focalLengths = new UInt16[4];
            focalLengths[0] = GetUInt16(buffer, offset + 0x00);
            focalLengths[1] = GetUInt16(buffer, offset + 0x02);
            focalLengths[2] = GetUInt16(buffer, offset + 0x04);
            focalLengths[3] = GetUInt16(buffer, offset + 0x06);
            offset += 0x08;

            data.UnknownHeaderData = new UInt16[0x0A];
            for (int pos = 0; pos < 0x0A; pos++)
            {
                data.UnknownHeaderData[pos] = GetUInt16(buffer, offset);
                offset += 0x02;
            }

            data.Data = new ProfileTypeBData[4];
            for (int pos = 0; pos < 4; pos++)
            {
                data.Data[pos] = ParseLensCorrectionTypeBData(buffer, ref offset);
                data.Data[pos].FocalLength = focalLengths[pos];
            }

            return data;
        }