Exemple #1
0
        private int[] GetData(bool correctSensetivity = true)
        {
            int    pixels = extendedParameters.nNumPixelsH * 1;//ExtendParams.nNumPixelsH * ExtendParams.nNumPixelsV * ExtendParams.nNumReadOuts;
            int    cb     = pixels * sizeof(uint);
            IntPtr pData  = Marshal.AllocHGlobal(cb);

            bool res = UsbCCD.CCD_InitMeasuring(0);

            UsbCCD.CCD_StartWaitMeasuring(0);

            int[]  data  = new int[pixels];
            byte[] bData = new byte[cb];
            UsbCCD.CCD_GetData(0, pData);

            Marshal.Copy(pData, data, 0, data.Length);
            Marshal.FreeHGlobal(pData);

            if (correctSensetivity)
            {
                for (int i = 0; i < data.Length; i++)
                {
                    data[i] = (int)(data[i] / sensitivitys[i]);
                }
            }

            return(data);
        }
Exemple #2
0
        public int[] GetData()
        {
            int    pixels = extendedParameters.nNumPixelsH * 1;//ExtendParams.nNumPixelsH * ExtendParams.nNumPixelsV * ExtendParams.nNumReadOuts;
            int    cb     = pixels * sizeof(uint);
            IntPtr pData  = Marshal.AllocHGlobal(cb);

            bool res = UsbCCD.CCD_InitMeasuring(0);

            UsbCCD.CCD_StartWaitMeasuring(0);

            int[]  data  = new int[pixels];
            byte[] bData = new byte[cb];
            UsbCCD.CCD_GetData(0, pData);

            Marshal.Copy(pData, data, 0, data.Length);
            Marshal.FreeHGlobal(pData);

            return(data);
        }