/* * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * RawTherapee is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ #define SORT3(a1,a2,a3,b1,b2,b3) \ { \ if ((a1)<(a2)) { \ if ((a2)<(a3)) { \ (b1) = (a1); (b2) = (a2); (b3) = (a3); \ } \ else if ((a1)<(a3)) { \ (b1) = (a1); (b2) = (a3); (b3) = (a2); \ } \ else { \ (b1) = (a3); (b2) = (a1); (b3) = (a2); \ } \ } \ else { \ if ((a3)<(a2)) { \ (b1) = (a3); (b2) = (a2); (b3) = (a1); \ } \ else if ((a3)<(a1)) { \ (b1) = (a2); (b2) = (a3); (b3) = (a1); \ } \ else { \ (b1) = (a2); (b2) = (a1); (b3) = (a3); \ } \ } \ } #define MERGESORT(a1,a2,a3,b1,b2,b3,c1,c2,c3,c4,c5,c6) \ {\ if (a1