"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tmo/fattal02/pfstmo_fattal02.cpp" between
pfstools-2.1.0.tgz and pfstools-2.2.0.tgz

About: pfstools are a set of command line programs (and one GUI program) for reading, writing, manipulating, and viewing high-dynamic range (HDR) images and video frames (similar as the netpbm package does for low-dynamic range images).

pfstmo_fattal02.cpp  (pfstools-2.1.0.tgz):pfstmo_fattal02.cpp  (pfstools-2.2.0.tgz)
skipping to change at line 44 skipping to change at line 44
#include <config.h> #include <config.h>
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <math.h> #include <math.h>
#include <pfs.h> #include <pfs.h>
#include <algorithm>
#include "tmo_fattal02.h" #include "tmo_fattal02.h"
using namespace std; using namespace std;
#define PROG_NAME "pfstmo_fattal02" #define PROG_NAME "pfstmo_fattal02"
/// verbose mode /// verbose mode
bool verbose = false; bool verbose = false;
class QuietException class QuietException
skipping to change at line 229 skipping to change at line 231
// in-place color space transform // in-place color space transform
pfs::Array2DImpl *G = new pfs::Array2DImpl( w, h ); // copy for G to preserv e Y pfs::Array2DImpl *G = new pfs::Array2DImpl( w, h ); // copy for G to preserv e Y
pfs::Array2D *R = X, *B = Z; pfs::Array2D *R = X, *B = Z;
pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, R, G, B ); pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, R, G, B );
// Color correction // Color correction
for( int i=0; i < w*h; i++ ) for( int i=0; i < w*h; i++ )
{ {
const float epsilon = 1e-4f; const float epsilon = 1e-4f;
float y = max( (*Y)(i), epsilon ); float y = std::max( (*Y)(i), epsilon );
float l = max( (*L)(i), epsilon ); float l = std::max( (*L)(i), epsilon );
(*R)(i) = powf( max((*R)(i)/y,0.f), opt_saturation ) * l; (*R)(i) = powf( std::max((*R)(i)/y,0.f), opt_saturation ) * l;
(*G)(i) = powf( max((*G)(i)/y,0.f), opt_saturation ) * l; (*G)(i) = powf( std::max((*G)(i)/y,0.f), opt_saturation ) * l;
(*B)(i) = powf( max((*B)(i)/y,0.f), opt_saturation ) * l; (*B)(i) = powf( std::max((*B)(i)/y,0.f), opt_saturation ) * l;
} }
pfs::transformColorSpace( pfs::CS_RGB, R, G, B, pfs::CS_XYZ, X, Y, Z ); pfs::transformColorSpace( pfs::CS_RGB, R, G, B, pfs::CS_XYZ, X, Y, Z );
delete G; delete G;
delete L; delete L;
//--- //---
pfsio.writeFrame( frame, stdout ); pfsio.writeFrame( frame, stdout );
pfsio.freeFrame( frame ); pfsio.freeFrame( frame );
 End of changes. 2 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)