///////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Captures an image from the camera.
        /// </summary>
        /// <param name="image">A reference to the CameraImage or DarkCameraImage that is to store the newly taken camera image.</param>
        public async Task <CameraImage> AcquireImageAsync(AcquireParams acquireParams,
                                                          CancellationToken ct, IProgress <CameraProgressEventArgs> progress = null)
        {
            await _device.SetExposure(acquireParams.ExposureTime, ct);

            if (acquireParams.ExposureType)
            {
                await _device.LaserTurnOn(ct);
            }

            var takeParams = new TakeParams(
                acquireParams.ExposureType,
                acquireParams.ExposureTime,
                acquireParams.AnalogGain,
                acquireParams.MinGain,
                acquireParams.MaxGain);
            var image = await _device.TakeImage(takeParams, ct);

            if (acquireParams.ExposureType)
            {
                await _device.LaserTurnOff(ct);
            }

            return(new CameraImage(image, _imageWidth, _imageHeight, acquireParams.ExposureType, 1, 35f, acquireParams.ExposureTime, false, false));
        }
Exemple #2
0
        public async Task <ushort[, ]> TakeImage(
            TakeParams acquireParams, CancellationToken ct, IProgress <TakeProgressEventArgs> progress = null)
        {
            await Task.Delay(0); // temporary for eliminating warning message.

            //return MakeSimulateImage(ct, progress);
            return(MakeSimulateImage2(ct));
        }