From: Kevin M. Rosenberg Date: Thu, 21 Apr 2005 15:36:01 +0000 (+0000) Subject: r10436: add cameras.lisp file. avoid reader errors in openmcl X-Git-Tag: v0.13~42 X-Git-Url: http://git.kpe.io/?p=cl-photo.git;a=commitdiff_plain;h=4779a391e5c45e56ea3cb2c35787354f07e6d362 r10436: add cameras.lisp file. avoid reader errors in openmcl --- diff --git a/cameras.lisp b/cameras.lisp new file mode 100644 index 0000000..4d5821a --- /dev/null +++ b/cameras.lisp @@ -0,0 +1,77 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10; Package: photo -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: cameras.lisp +;;;; Purpose: Camera-specific data for cl-photo +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: April 2005 +;;;; +;;;; $Id: dof.lisp 10421 2005-04-19 21:57:00Z kevin $ +;;;; +;;;; This file, part of cl-photo, is Copyright (c) 2005 by Kevin M. Rosenberg +;;;; +;;;; cl-photo users are granted the rights to distribute and use this software +;;;; as governed by the terms of the GNU General Public License v2 +;;;; (http://www.gnu.org/licenses/gpl.html) +;;;; +;;;; ************************************************************************* + +(in-package #:photo) + +(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 format-dimensions (format) + "Returns format dimensions in mm." + (ecase format + (:aps-c (cons 22.7 15.1)) + ((:aps :dx :24x16mm) (cons 24 16)) + ((:35mm :36x24mm) (cons 36 24)) + (:6x4.5cm (cons 60 45)) + ((:6x6 :6x6cm) (cons 60 60)) + ((:6x7 :6x7cm) (cons 60 70)) + ((:6x9 :6x9cm) (cons 60 90)) + ((:4x5 :4x5in) (cons (* 4 +inches->mm+) (* 5 +inches->mm+))) + ((:5x7 :5x7in) (cons (* 5 +inches->mm+) (* 7 +inches->mm+))) + ((:8x10 :8x10in) (cons (* 8 +inches->mm+) (* 10 +inches->mm+))) + (:11x13.75in (cons (* 11 +inches->mm+) (* 13.75 +inches->mm+))) + (:11x16.5in (cons (* 11 +inches->mm+) (* 16.5 +inches->mm+))) + (:13x19in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:16x20in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:16x24in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:18x22.5in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:18x24in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:24x30in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + (:24x36in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) + )) diff --git a/cl-photo.asd b/cl-photo.asd index da725f3..afffe05 100644 --- a/cl-photo.asd +++ b/cl-photo.asd @@ -32,8 +32,9 @@ :components ((:file "package") (:file "convert" :depends-on ("package")) - (:file "fov" :depends-on ("convert")) - (:file "dof" :depends-on ("convert")) + (:file "cameras" :depends-on ("convert")) + (:file "fov" :depends-on ("cameras")) + (:file "dof" :depends-on ("cameras")) )) (defmethod perform ((o test-op) (c (eql (find-system 'cl-photo)))) diff --git a/convert.lisp b/convert.lisp index f663cf8..b73595b 100755 --- a/convert.lisp +++ b/convert.lisp @@ -68,26 +68,4 @@ (:yards (/ (mm->inches d) 36)) (:meters (/ d 1000)))) -(defun format-dimensions (format) - "Returns format dimensions in mm." - (ecase format - (:aps-c (cons 22.7 15.1)) - ((:aps :dx) (cons 24 16)) - ((:35 :35mm) (cons 36 24)) - ((:645 :6x4.5cm) (cons 60 45)) - ((:6x6 :6x6cm) (cons 60 60)) - ((:6x7 :6x7cm) (cons 60 70)) - ((:6x9 :6x9cm) (cons 60 90)) - ((:4x5 :4x5in) (cons (* 4 +inches->mm+) (* 5 +inches->mm+))) - ((:5x7 :5x7in) (cons (* 5 +inches->mm+) (* 7 +inches->mm+))) - ((:8x10 :8x10in) (cons (* 8 +inches->mm+) (* 10 +inches->mm+))) - (:11x13.75in (cons (* 11 +inches->mm+) (* 13.75 +inches->mm+))) - (:11x16.5in (cons (* 11 +inches->mm+) (* 16.5 +inches->mm+))) - (:13x19in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:16x20in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:16x24in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:18x22.5in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:18x24in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:24x30in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - (:24x36in (cons (* 13 +inches->mm+) (* 19 +inches->mm+))) - )) + diff --git a/debian/changelog b/debian/changelog index 0c2449f..919c3a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-photo (0.3-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Thu, 21 Apr 2005 09:35:32 -0600 + cl-photo (0.2-1) unstable; urgency=low * New upstream. Add documentation. diff --git a/dof.lisp b/dof.lisp index 9cb2486..4dcb7e7 100755 --- a/dof.lisp +++ b/dof.lisp @@ -47,37 +47,9 @@ Default resolving power is 5 lpm at 25cm." (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) "Return the circle of confusion based on the airy disk." @@ -145,4 +117,4 @@ Pupil factor is the ratio of the exit to enterance pupil diameters." (1+ (magnification focal-length distance))) (defun effective-aperture (focal-length distance aperture) - (* aperture (bellows-factor focal-length distance))) \ No newline at end of file + (* aperture (bellows-factor focal-length distance))) diff --git a/package.lisp b/package.lisp index 283f0e0..a06fd1a 100755 --- a/package.lisp +++ b/package.lisp @@ -23,11 +23,15 @@ (:use #:common-lisp) (:export + ;; cameras.lisp + #:sensor-dimensions + #:format-dimensions + ;; fov.lisp #:aov #:aov-format #:aov-distance - + ;; dof.lisp #:coc-format #:coc-sensor