private static ProfileTypeCData ParseLensCorrectionTypeCData(byte[] buffer, ref ulong offset) { ProfileTypeCData data = new ProfileTypeCData(); int fields = 16; UInt16[] fStop = new UInt16[4]; fStop[0] = GetUInt16(buffer, offset + 0x00); fStop[1] = GetUInt16(buffer, offset + 0x02); fStop[2] = GetUInt16(buffer, offset + 0x04); fStop[3] = GetUInt16(buffer, offset + 0x06); offset += 0x08; data.CorrectionData = new CorrectionDataTypeC[fields]; for (int field = 0; field < fields; field++) { data.CorrectionData[field] = new CorrectionDataTypeC(); data.CorrectionData[field].Aperture = fStop[field % 4]; data.CorrectionData[field].Coeff = new Int16[0x0C]; for (int coeff = 0; coeff < 0x0C; coeff++) { Int16 val = (Int16)((Int16)GetUInt16(buffer, offset) - (Int16)0x4000); data.CorrectionData[field].Coeff[coeff] = val; offset += 2; } } return(data); }
private static ProfileTypeCData ParseLensCorrectionTypeCData(byte[] buffer, ref ulong offset) { ProfileTypeCData data = new ProfileTypeCData(); int fields = 16; UInt16[] fStop = new UInt16[4]; fStop[0] = GetUInt16(buffer, offset + 0x00); fStop[1] = GetUInt16(buffer, offset + 0x02); fStop[2] = GetUInt16(buffer, offset + 0x04); fStop[3] = GetUInt16(buffer, offset + 0x06); offset += 0x08; data.CorrectionData = new CorrectionDataTypeC[fields]; for (int field = 0; field < fields; field++) { data.CorrectionData[field] = new CorrectionDataTypeC(); data.CorrectionData[field].Aperture = fStop[field % 4]; data.CorrectionData[field].Coeff = new Int16[0x0C]; for (int coeff = 0; coeff < 0x0C; coeff++) { Int16 val = (Int16)((Int16)GetUInt16(buffer, offset) - (Int16)0x4000); data.CorrectionData[field].Coeff[coeff] = val; offset += 2; } } return data; }