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__
27 * Extend the Canon 300D (Digital Rebel) device with an EF 50mm f/1.4 lens at 1.4.
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] = {
42 { 12.8, -25.6, 9.6, },
45 { 6.4, 8.88178419700125e-16, 25.6, },
47 { -3.2, 8.88178419700125e-16, 92.8000000000001, },
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, },
55 { -38.4, 3.2, -35.2, },
56 { -6.4, 8.88178419700125e-16, -35.2, },
60 { 8.88178419700125e-16, -3.2, -9.6, },
62 { 44.8, 73.6, 67.2, },
63 { 67.2, 38.4, 118.4, },
64 { 57.6, 44.8, 105.6, },
67 { -9.6, -16, -2.66453525910038e-15, },
69 { 6.4, -12.8, 25.6, },
70 { 6.4, 28.8, -44.8, },
71 { 57.6, 54.4, 102.4, },
73 { 115.2, 92.8000000000001, 44.8, },
74 { 115.2, 108.8, 115.2, },
75 { 28.8, 44.8, 108.8, },
77 { -12.8, -16, 12.8, },
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, },
96 { -2.66453525910038e-15, -35.2, -22.4, },
97 { 6.4, -25.6, 12.8, },
100 { 9.6, -3.2, -19.2, },
101 { 28.8, 51.2, 76.8, },
103 { 73.6, 41.6, 112, },
105 { -9.6, -12.8, 60.8, },
106 { -16, -32, -28.8, },
107 { -6.4, 19.2, -2.66453525910038e-15, },
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, },
119 { 35.2, 28.8, 108.8, },
120 { 3.2, 8.88178419700125e-16, 28.8, },
121 { -9.6, -6.4, 22.4, },
123 { -12.8, -3.2, 16, },
125 { 9.6, 12.8, 28.8, },
126 { -3.2, -3.2, 19.2, },
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
{
139 ale_real lpsf_array
[LPSF_ROWS
][LPSF_COLS
][3];
141 const double *origin
= (const double *)
142 canon_300d_raw_linear_50mm_1_4_1_4_lpsf_calibrated_response
;
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
);
162 * Linear colorspace PSF
165 class lpsf
: lpsf_calculator
, public d2::psf_template
<LPSF_ROWS
, LPSF_COLS
> {
167 lpsf() : lpsf_calculator(),
168 d2::psf_template
<LPSF_ROWS
, LPSF_COLS
> (3, 3, lpsf_array
) {