Example #1
0
        public CameraModel GetCameraModel(string cameraDescription)
        {
            var cameraModel = _cameraModelsHistory.FirstOrDefault(c => c.Name == cameraDescription); //try get sensor params from history

            if (cameraModel == null)
            {
                var cameraModelDetector = new CameraModelDetector(new ImageDataProcessor());
                cameraModel = cameraModelDetector.GetCameraModel((IDslrCamera)this, StorePath);//make test shot to determine height/width
            }

            return(cameraModel);
        }
Example #2
0
        public CameraModel GetCameraModel(string cameraDescription)
        {
            var cameraModel = _cameraModelsHistory.FirstOrDefault(c => c?.Name == cameraDescription); //try get sensor params from history

            if (cameraModel == null)
            {
                // TODO: handle an exception here!

                var cameraModelDetector = new CameraModelDetector(new ImageDataProcessor());
                cameraModel = cameraModelDetector.GetCameraModel((IDslrCamera)this, StorePath ?? Path.GetTempPath());//make test shot to determine height/width

                // TODO: handle an exception here!

                if (cameraModel != null)
                {
                    _cameraModelsHistory.Add(cameraModel);
                }
            }

            return(cameraModel);
        }