d2/align: Remove obsolete set_input_frame call.
[Ale.git] / device / canon_300d_raw_linear_50mm_1_4_1_4.h
blob461f24d911eda00ad6dbdf9fdf651ebaa0583d31
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 #ifndef __canon_300d_raw_linear_50mm_1_4_1_4_h__
22 #define __canon_300d_raw_linear_50mm_1_4_1_4_h__
24 #include "../d2.h"
27 * Extend the Canon 300D (Digital Rebel) device with an EF 50mm f/1.4 lens at 1.4.
30 #define LPSF_ROWS 9
31 #define LPSF_COLS 9
34 * This filter (50-1.4-1.4-1) can produce haloing.
37 static const double canon_300d_raw_linear_50mm_1_4_1_4_lpsf_calibrated_response[LPSF_ROWS][LPSF_COLS][3] = {
39 { 41.6, 32, 118.4, },
40 { 6.4, -3.2, 32, },
41 { -9.6, 35.2, 9.6, },
42 { 12.8, -25.6, 9.6, },
43 { -16, -3.2, 6.4, },
44 { 9.6, 3.2, 35.2, },
45 { 6.4, 8.88178419700125e-16, 25.6, },
46 { -3.2, -6.4, 16, },
47 { -3.2, 8.88178419700125e-16, 92.8000000000001, },
48 }, {
49 { 22.4, 16, 32, },
50 { -41.6, -35.2, -35.2, },
51 { 12.8, -9.6, -19.2, },
52 { -38.4, 3.2, 35.2, },
53 { 25.6, -12.8, -48, },
54 { 19.2, 16, 35.2, },
55 { -38.4, 3.2, -35.2, },
56 { -6.4, 8.88178419700125e-16, -35.2, },
57 { 19.2, 9.6, 28.8, },
58 }, {
59 { 16, 9.6, 25.6, },
60 { 8.88178419700125e-16, -3.2, -9.6, },
61 { 19.2, 25.6, 64, },
62 { 44.8, 73.6, 67.2, },
63 { 67.2, 38.4, 118.4, },
64 { 57.6, 44.8, 105.6, },
65 { 12.8, -22.4, 48, },
66 { -9.6, -9.6, -16, },
67 { -9.6, -16, -2.66453525910038e-15, },
68 }, {
69 { 6.4, -12.8, 25.6, },
70 { 6.4, 28.8, -44.8, },
71 { 57.6, 54.4, 102.4, },
72 { 38.4, 44.8, 64, },
73 { 115.2, 92.8000000000001, 44.8, },
74 { 115.2, 108.8, 115.2, },
75 { 28.8, 44.8, 108.8, },
76 { 12.8, 12.8, 48, },
77 { -12.8, -16, 12.8, },
78 }, {
79 { 9.6, -6.4, 41.6, },
80 { -3.2, 22.4, 6.4, },
81 { 76.8, 115.2, 115.2, },
82 { 9.59999999999999, -28.8, -48, },
83 { 884.799999999998, 948.799999999999, 884.799999999998, },
84 { 115.2, 115.2, 115.2, },
85 { 76.8, 83.2, 115.2, },
86 { 25.6, 25.6, 51.2, },
87 { -25.6, 3.2, 9.6, },
88 }, {
89 { 3.2, 9.6, 60.8, },
90 { 9.6, 19.2, -48, },
91 { 32, 73.6, 115.2, },
92 { 19.2, 3.2, 9.6, },
93 { 64, 73.6, 25.6, },
94 { 112, 96, 115.2, },
95 { 57.6, 64, 92.8, },
96 { -2.66453525910038e-15, -35.2, -22.4, },
97 { 6.4, -25.6, 12.8, },
98 }, {
99 { 22.4, 0, 54.4, },
100 { 9.6, -3.2, -19.2, },
101 { 28.8, 51.2, 76.8, },
102 { 38.4, 32, 67.2, },
103 { 73.6, 41.6, 112, },
104 { 48, 60.8, 80, },
105 { -9.6, -12.8, 60.8, },
106 { -16, -32, -28.8, },
107 { -6.4, 19.2, -2.66453525910038e-15, },
108 }, {
109 { 6.4, 3.2, 22.4, },
110 { -28.8, -22.4, -41.6, },
111 { -12.8, 3.2, -16, },
112 { 12.8, -9.6, 3.2, },
113 { -22.4, 16, -41.6, },
114 { 9.6, -22.4, 6.4, },
115 { -12.8, -12.8, -22.4, },
116 { 12.8, 6.4, -44.8, },
117 { 6.4, 19.2, 60.8, },
118 }, {
119 { 35.2, 28.8, 108.8, },
120 { 3.2, 8.88178419700125e-16, 28.8, },
121 { -9.6, -6.4, 22.4, },
122 { -9.6, -16, 9.6, },
123 { -12.8, -3.2, 16, },
124 { 12.8, 9.6, 32, },
125 { 9.6, 12.8, 28.8, },
126 { -3.2, -3.2, 19.2, },
127 { -9.6, -16, 76.8 }
131 class canon_300d_raw_linear_50mm_1_4_1_4 : public canon_300d_raw_linear_50mm_1_4 {
134 * Calculate lpsf array values for ale_real types not able
135 * to store the entire double range.
137 class lpsf_calculator {
138 protected:
139 ale_real lpsf_array[LPSF_ROWS][LPSF_COLS][3];
140 lpsf_calculator() {
141 const double *origin = (const double *)
142 canon_300d_raw_linear_50mm_1_4_1_4_lpsf_calibrated_response;
143 double maxval = 255;
144 double array_maxval = origin[0];
146 for (int i = 0; i < LPSF_ROWS * LPSF_COLS * 3; i++) {
147 if (origin[i] > array_maxval)
148 array_maxval = origin[i];
151 for (int i = 0; i < LPSF_ROWS; i++)
152 for (int j = 0; j < LPSF_COLS; j++)
153 for (int k = 0; k < 3; k++)
154 lpsf_array[i][j][k] =
155 origin[i * LPSF_COLS * 3 + j * 3 + k]
156 * (maxval / array_maxval);
160 public:
162 * Linear colorspace PSF
165 class lpsf : lpsf_calculator, public d2::psf_template<LPSF_ROWS, LPSF_COLS> {
166 public:
167 lpsf() : lpsf_calculator(),
168 d2::psf_template<LPSF_ROWS, LPSF_COLS> (3, 3, lpsf_array) {
173 #undef LPSF_ROWS
174 #undef LPSF_COLS
175 #undef NLPSF_ROWS
176 #undef NLPSF_COLS
178 #endif