1 /** 2 * @brief Contrast mapping TMO 3 * 4 * From: 5 * 6 * Rafal Mantiuk, Karol Myszkowski, Hans-Peter Seidel. 7 * A Perceptual Framework for Contrast Processing of High Dynamic Range Images 8 * In: ACM Transactions on Applied Perception 3 (3), pp. 286-308, 2006 9 * http://www.mpi-inf.mpg.de/~mantiuk/contrast_domain/ 10 * 11 * This file is a part of PFSTMO package. 12 * ---------------------------------------------------------------------- 13 * Copyright (C) 2007 Grzegorz Krawczyk 14 * 15 * This program is free software; you can redistribute it and/or modify 16 * it under the terms of the GNU General Public License as published by 17 * the Free Software Foundation; either version 2 of the License, or 18 * (at your option) any later version. 19 * 20 * This program is distributed in the hope that it will be useful, 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 * GNU General Public License for more details. 24 * 25 * You should have received a copy of the GNU General Public License 26 * along with this program; if not, write to the Free Software 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 28 * ---------------------------------------------------------------------- 29 * 30 * @author Radoslaw Mantiuk, <radoslaw.mantiuk@gmail.com> 31 * @author Rafal Mantiuk, <mantiuk@gmail.com> 32 * Updated 2007/12/17 by Ed Brambley <E.J.Brambley@damtp.cam.ac.uk> 33 * 34 * $Id: contrast_domain.h,v 1.7 2008/06/16 22:17:47 rafm Exp $ 35 */ 36 #ifndef CONTRAST_DOMAIN_H 37 #define CONTRAST_DOMAIN_H 38 39 #include "pfstmo.h" 40 41 /** 42 * @brief: Tone mapping algorithm [Mantiuk2006] 43 * 44 * @param R red channel 45 * @param G green channel 46 * @param B blue channel 47 * @param Y luminance channel 48 * @param contrastFactor contrast scaling factor (in 0-1 range) 49 * @param saturationFactor color desaturation (in 0-1 range) 50 * @param bcg true if to use BiConjugate Gradients, false if to use Conjugate Gradients 51 * @param itmax maximum number of iterations for convergence (typically 50) 52 * @param tol tolerence to get within for convergence (typically 1e-3) 53 * @param progress_cb callback function that reports progress 54 * @return PFSTMO_OK if tone-mapping was sucessful, PFSTMO_ABORTED if 55 * it was stopped from a callback function and PFSTMO_ERROR if an 56 * error was encountered. 57 */ 58 int tmo_mantiuk06_contmap( int cols, int rows, float* R, float* G, float* B, float* Y, 59 float contrastFactor, float saturationFactor, bool bcg, 60 int itmax = 200, float tol = 1e-3, pfstmo_progress_callback progress_cb = NULL); 61 62 #endif 63