r10436: add cameras.lisp file. avoid reader errors in openmcl
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 21 Apr 2005 15:36:01 +0000 (15:36 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 21 Apr 2005 15:36:01 +0000 (15:36 +0000)
cameras.lisp [new file with mode: 0644]
cl-photo.asd
convert.lisp
debian/changelog
dof.lisp
package.lisp

diff --git a/cameras.lisp b/cameras.lisp
new file mode 100644 (file)
index 0000000..4d5821a
--- /dev/null
@@ -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+)))
+    ))
index da725f3a7e33c1398f4a8bef08a7997b38a38e7b..afffe05b2190bb1e3f6ed5d7cd444be3f3ef4ecf 100644 (file)
@@ -32,8 +32,9 @@
   :components
   ((:file "package")
    (:file "convert" :depends-on ("package"))
   :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))))
    ))
 
 (defmethod perform ((o test-op) (c (eql (find-system 'cl-photo))))
index f663cf8fc98e1651357ea99a0cc8edb70b8ded8f..b73595b56dff828f3ab74490a4d74f983a1118c3 100755 (executable)
     (:yards (/ (mm->inches d) 36))
     (:meters (/ d 1000))))
 
     (: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+)))
-    ))
+
index 0c2449fb5d57019a023e69be70d042c5cf215eae..919c3a1e4541960fc61ba3ed38b9bdd821436331 100644 (file)
@@ -1,3 +1,9 @@
+cl-photo (0.3-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Thu, 21 Apr 2005 09:35:32 -0600
+
 cl-photo (0.2-1) unstable; urgency=low
 
   * New upstream. Add documentation.
 cl-photo (0.2-1) unstable; urgency=low
 
   * New upstream. Add documentation.
index 9cb2486cf719de2373bf9ac45723825423c8c4b0..4dcb7e7586fc2ed2002b03d00d707d5f53ad1463 100755 (executable)
--- 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))))
 
   (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."
 
 (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)
   (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)))
index 283f0e0f708e11ecb3e5f910e46cb0a1e12a18c4..a06fd1a13d572fbce1a0a3c6f3292a66d90c459b 100755 (executable)
   (:use #:common-lisp)
   (:export
 
   (:use #:common-lisp)
   (:export
 
+   ;; cameras.lisp
+   #:sensor-dimensions
+   #:format-dimensions
+   
    ;; fov.lisp
    #:aov
    #:aov-format
    #:aov-distance
    ;; fov.lisp
    #:aov
    #:aov-format
    #:aov-distance
-
+   
    ;; dof.lisp
    #:coc-format
    #:coc-sensor
    ;; dof.lisp
    #:coc-format
    #:coc-sensor