d2::trans_multi, d2::align: encapsulate bounds scaling within
[Ale.git] / device / xvp610_640x480.h
blob0d6bd62e3fe5b6500dd55572304db422f370c12c
1 // Copyright 2003, 2004 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it
7 and/or modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 3 of the License,
9 or (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14 Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 // In some circumstances, a better filter might be this one, used with stdin_vg:
23 // 0.16 3 3 3 3 3.2 3.2 4.8 0 3.2 0 3.2 3.2 4.8 1.6 -3.2 1.6 28.8 40 36.8 9.6 16 12.8 3.2 4.44089209850063e-16 1.6 1.6 6.4 1.6 3.2 3.2 3.2 0.8 1 11 1 11 0 -1.6 -1.6 -3.2 -3.2 -3.2 -8 -8 -6.4 1.6 4.8 1.6 12.8 17.6 11.2 28.8 33.6 28.8 3.2 3.2 3.2 -3.2 -3.2 -3.2 -4.8 -6.4 -4.8 0 0 0 0 0 0
25 // (atp-16)
27 #ifndef __xvp610_640x480_h__
28 #define __xvp610_640x480_h__
30 #include "../d2.h"
33 * Device module for the IBM PC Camera Pro (IBM VGA Camera Model XVP610; FCC ID
34 * KSX-X9902).
36 * This module is designed for use with the Linux 2.6.x driver patched with
37 * code available at:
39 * http://auricle.dyndns.org/xvp610/
44 * PSF Data
47 #define LPSF_ROWS 3
48 #define LPSF_COLS 3
50 static const ale_real xvp610_640x480_lpsf_calibrated_response[LPSF_ROWS][LPSF_COLS][3] = {
52 { 1.6, 4.8, 3.2 },
53 { 6.4, 6.4, 8 },
54 { 0, 0, 0 }
55 }, {
56 { 1.6, -6.4, -1.6 },
57 { 58.4, 61.6, 80.8 },
58 { 0, 0, 0 }
59 }, {
60 { -1.6, -1.6, -1.6 },
61 { 0, 0, 0 },
62 { 0, 0, 0 }
66 #define NLPSF_ROWS 1
67 #define NLPSF_COLS 5
69 static const ale_real xvp610_640x480_nlpsf_calibrated_response[NLPSF_ROWS][NLPSF_COLS][3] = {
71 #if 0
72 /* Filter 12 */
73 { -2.9, -4.9, -2.7 },
74 { -11.4, -5.4, -9.1 },
75 { 40.9, 39.4, 34.2 },
76 { -3.8, -3, -3.6 },
77 { -4.1, -4.5, -3.2 }
78 #endif
79 /* Filter 11 */
80 { -6.1, -4.9, -5.9 },
81 { -8.2, -5.4, -5.9 },
82 { 36.1, 34.6, 31 },
83 { -3.8, -3, -3.6 },
84 { -4.1, -4.5, -3.2 }
88 class xvp610_640x480 {
89 public:
92 * Linear colorspace PSF
95 #if 0
96 class lpsf : public d2::psf_template<LPSF_ROWS, LPSF_COLS> {
97 public:
98 lpsf() : d2::psf_template<LPSF_ROWS, LPSF_COLS> (3, 3, xvp610_640x480_lpsf_calibrated_response) {
101 #else
103 * This filter seems to produce nicer results.
105 class lpsf : public d2::box {
106 public:
107 lpsf() : d2::box (0.5) {
110 #endif
113 * Non-linear colorspace PSF
116 class nlpsf : public d2::psf_template<NLPSF_ROWS, NLPSF_COLS> {
117 public:
118 nlpsf() : d2::psf_template<NLPSF_ROWS, NLPSF_COLS> (1, 10, xvp610_640x480_nlpsf_calibrated_response) {
123 * Exposure
126 class exposure : public d2::exposure_default {
129 * Uses defaults for now. (If this is changed, then update
130 * the usage message for --device accordingly.)
136 * View Angle
139 static ale_pos view_angle() {
140 return 30;
144 #undef LPSF_ROWS
145 #undef LPSF_COLS
146 #undef NLPSF_ROWS
147 #undef NLPSF_COLS
149 #endif