Ejemplo n.º 1
0
        private static ProfileTypeAData ParseLensCorrectionTypeAData(byte[] buffer, ref ulong offset)
        {
            ProfileTypeAData data = new ProfileTypeAData();
            int fields            = 0x10;

            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 CorrectionDataTypeA[fields];
            for (int field = 0; field < fields; field++)
            {
                data.CorrectionData[field]          = new CorrectionDataTypeA();
                data.CorrectionData[field].Aperture = fStop[field % 4];
                data.CorrectionData[field].Coeff    = new Int16[6];
                for (int coeff = 0; coeff < 6; coeff++)
                {
                    Int16 val = (Int16)((Int16)0x2000 - (Int16)GetUInt16(buffer, offset));
                    data.CorrectionData[field].Coeff[coeff] = val;
                    offset += 2;
                }
            }


            return(data);
        }
Ejemplo n.º 2
0
        private static ProfileTypeAData ParseLensCorrectionTypeAData(byte[] buffer, ref ulong offset)
        {
            ProfileTypeAData data = new ProfileTypeAData();
            int fields = 0x10;
            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 CorrectionDataTypeA[fields];
            for (int field = 0; field < fields; field++)
            {
                data.CorrectionData[field] = new CorrectionDataTypeA();
                data.CorrectionData[field].Aperture = fStop[field % 4];
                data.CorrectionData[field].Coeff = new Int16[6];
                for (int coeff = 0; coeff < 6; coeff++)
                {
                    Int16 val = (Int16)((Int16)0x2000 - (Int16)GetUInt16(buffer, offset));
                    data.CorrectionData[field].Coeff[coeff] = val;
                    offset += 2;
                }
            }

            return data;
        }