2 * Copyright 2009 David Hilvert <dhilvert@gmail.com>
4 * This file is part of libale.
6 * libale is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU Affero General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
11 * libale is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
16 * You should have received a copy of the GNU Affero General Public License
17 * along with libale. If not, see <http://www.gnu.org/licenses/>.
40 ale_trans
ale_new_trans(ale_context ac
, ale_image ai
) {
41 #warning NULL image argument should produce the (Euclidean) identity (e.g., for a 2x2 image, as in legacy ALE).
42 if (!ale_context_valid(ac
))
45 if (!ale_image_valid(ai
))
48 ale_trans at
= ale_trans_alloc(ac
);
50 if (!ale_trans_valid(at
))
53 DQ(ale_trans
, at
, atp
)
55 atp
->width
= ale_image_get_width(ai
);
56 atp
->height
= ale_image_get_height(ai
);
66 * Set original bounds for a Libale transformation.
69 int ale_trans_set_original_bounds(ale_trans at
, ale_image ai
) {
70 #warning raw imported code should be revised for Libale
73 * Original ALE header copyright notice gives '2002, 2004, 2007 David Hilvert'
74 * for the following, but git-blame (correctly) gives 2008.
77 * Set the bounds of the reference image after incorporation
78 * of the original frame.
80 void set_original_bounds(const image
*i
) {
81 assert (orig_ref_width
== 0);
82 assert (orig_ref_height
== 0);
84 orig_ref_height
= i
->height();
85 orig_ref_width
= i
->width();
86 orig_offset
= i
->offset();
88 assert (orig_ref_width
!= 0);
89 assert (orig_ref_height
!= 0);
98 PARAMETER_RW(ale_trans
, bayer
, int)
99 PARAMETER_RW(ale_trans
, exposure
, double)
100 PARAMETER_RW(ale_trans
, gamma
, double)
101 PARAMETER_RW(ale_trans
, black
, double)