- (let* ((dim (format-dimensions format))
- (pixel-width (/ (car dim) nx))
- (pixel-height (/ (cdr dim) ny)))
- (values (float (* 2 pixel-width))
- (float (* 2 pixel-height)))))
-
-(defun coc-sensor-camera (camera &key (format :aps))
- (let ((dim (sensor-dimensions camera :format format)))
- (coc-sensor format (car dim) (cdr dim))))
-
-(defun sensor-dimensions-megapixels (format megapixels)
- (let* ((dim (format-dimensions format))
- (aspect-ratio (/ (car dim) (cdr dim)))
- (width (round (sqrt (* aspect-ratio 1000000 megapixels)))))
- (cons width (round (/ width aspect-ratio)))))
-
-
-(defun sensor-dimensions (sensor-spec &key (format :aps))
- "Returns the number of pixels for a sensor.
-CAMERA-SPEC is either a keyword designating the camera or
-the number of megapixels of the sensor.
-FORMAT should be defined if the CAMERA-SPEC is the number of megapixels
-so the proper aspect ratio is used."
- (etypecase sensor-spec
- (keyword
- (ecase sensor-spec
- ;; nikon
- (:d2x (cons 4288 2848))
- (:d100 (cons 3037 2024))
- (:d2h (cons 2464 1632))
- (:d70 (cons 3008 2000))
-
- ;; canon
- (:1d (cons 2464 1648))
- (:1d2 (cons 3504 2336))
- (:1ds (cons 4064 2704))
- (:1ds2 (cons 4992 3328))
-
- ))
- (number
- (sensor-dimensions-megapixels format sensor-spec))))
-
-(defun coc-airy (f-stop)