Loading LrAntiAliasingRandom.cpp +8 −10 Original line number Diff line number Diff line Loading @@ -22,12 +22,10 @@ #include <iostream> static float randMinMax(float min, float max) { return (1.0 * rand()/RAND_MAX)*0.5; } //static float randMinMax(float min, float max) //{ // return (1.0 * rand()/RAND_MAX)*; //} /*---------------------------------------------------------------------------* * constructors and destructor * Loading Loading @@ -56,16 +54,16 @@ void LrAntiAliasingRandom::getCoordUV(const int coeffAA, const int numCase, Real //le pas float pas = (1.0/(coeffAA*2)); std::cout<<"pas : "<<pas<<std::endl; //std::cout<<"pas : "<<pas<<std::endl; //Le num de ligne et de colonne int numLigne = (int)(floor(numCase / coeffAA)+1); int numColonne = (int)(floor(numCase % coeffAA)+1); //random de -pas a pas float variation = (1.0 * rand()/RAND_MAX) * (pas*2); float variation = -pas + (1.0 * rand()/RAND_MAX) * (pas*2); //std::cout<<"variation : "<<variation<<std::endl; std::cout<<variation<<" "; // tirer u et v aleatoirement dans le pixel ou le sous-pixel (*u) = (pas * ((numColonne*2)-1)) + variation; (*v) = (pas * ((numLigne*2)-1)) + variation; Loading Loading
LrAntiAliasingRandom.cpp +8 −10 Original line number Diff line number Diff line Loading @@ -22,12 +22,10 @@ #include <iostream> static float randMinMax(float min, float max) { return (1.0 * rand()/RAND_MAX)*0.5; } //static float randMinMax(float min, float max) //{ // return (1.0 * rand()/RAND_MAX)*; //} /*---------------------------------------------------------------------------* * constructors and destructor * Loading Loading @@ -56,16 +54,16 @@ void LrAntiAliasingRandom::getCoordUV(const int coeffAA, const int numCase, Real //le pas float pas = (1.0/(coeffAA*2)); std::cout<<"pas : "<<pas<<std::endl; //std::cout<<"pas : "<<pas<<std::endl; //Le num de ligne et de colonne int numLigne = (int)(floor(numCase / coeffAA)+1); int numColonne = (int)(floor(numCase % coeffAA)+1); //random de -pas a pas float variation = (1.0 * rand()/RAND_MAX) * (pas*2); float variation = -pas + (1.0 * rand()/RAND_MAX) * (pas*2); //std::cout<<"variation : "<<variation<<std::endl; std::cout<<variation<<" "; // tirer u et v aleatoirement dans le pixel ou le sous-pixel (*u) = (pas * ((numColonne*2)-1)) + variation; (*v) = (pas * ((numLigne*2)-1)) + variation; Loading