Commit adbaec28 authored by axel's avatar axel
Browse files

mise en forme du code

parent ec4264ae
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -18,32 +18,40 @@

#include "LrAntiAliasing.h"

/*---------------------------------------------------------------------------*
 * constructors and destructor                                               *
 *---------------------------------------------------------------------------*/
// ############################################################################

LrAntiAliasing::LrAntiAliasing()
: m_coeffAA(1)
{
    
}

// ############################################################################

LrAntiAliasing::LrAntiAliasing(const LrAntiAliasing &source)
: m_coeffAA(source.m_coeffAA)
{
}

// ############################################################################

LrAntiAliasing::LrAntiAliasing(const int coeffAA)
{
    m_coeffAA = coeffAA;
}

// ############################################################################ 

LrAntiAliasing::~LrAntiAliasing()
{
}

// ############################################################################

int LrAntiAliasing::getCoeffAA() const
{
    return m_coeffAA;
}

// ############################################################################
+15 −17
Original line number Diff line number Diff line
@@ -15,12 +15,10 @@
#ifndef LRANTIALIASING_H
#define LRANTIALIASING_H



/**
 * @brief ANTIALIASING : le type d'anti aliasing a appliquer a la scene
 * 
 * Classe abstraite pour la gestion de l'anti-aliasing
 * Classe pour la gestion de l'anti-aliasing centre
 */
class LrAntiAliasing
{
+20 −10
Original line number Diff line number Diff line
/**
 * @brief Classe pour la gestion de l'anti-aliasing
 * @brief Classe pour la gestion de l'anti-aliasing centre
 * @file LrAntiAliasingCentre.cpp
 * @date Mardi 27 Mai 2008
 * @note
@@ -9,38 +9,47 @@
 * @author Hervé Souchaud
 * @author Emeric Verschuur
 *
 * Classe pour la gestion de l'anti-aliasing
 * Classe pour la gestion de l'anti-aliasing centre
 */

#if defined HAVE_CONFIG_H
#include "config.h"
#endif

#include "LrAntiAliasingCentre.h"
#include "math.h"
/*---------------------------------------------------------------------------*
 * constructors and destructor                                               *
 *---------------------------------------------------------------------------*/
#include "LrAntiAliasingCentre.h"

// ############################################################################

LrAntiAliasingCentre::LrAntiAliasingCentre()
:   LrAntiAliasing()
{
}

// ############################################################################

LrAntiAliasingCentre::LrAntiAliasingCentre(const LrAntiAliasingCentre &source)
:   LrAntiAliasing(source)
{
}

// ############################################################################

LrAntiAliasingCentre::LrAntiAliasingCentre(const int coeffAA)
:   LrAntiAliasing(coeffAA)
{
}

// ############################################################################

LrAntiAliasingCentre::~LrAntiAliasingCentre()
{
}

void LrAntiAliasingCentre::getCoordUV(const int coeffAA, const int numCase, Real *u, Real *v) const
// ############################################################################

void LrAntiAliasingCentre::getCoordUV(const int coeffAA, const int numCase, 
                                      Real *u, Real *v) const
{
    //le pas
    float pas = (1.0/(coeffAA*2));
@@ -54,3 +63,4 @@ void LrAntiAliasingCentre::getCoordUV(const int coeffAA, const int numCase, Real
    (*v) = pas * ((numLigne*2)-1);
}

// ############################################################################
+14 −14
Original line number Diff line number Diff line
/**
 * @brief Classe pour la gestion de l'anti-aliasing
 * @brief Classe pour la gestion de l'anti-aliasing centre
 * @file LrAntiAliasingCentre.h
 * @date Mardi 27 Mai 2008
 * @note 
@@ -9,7 +9,7 @@
 * @author Hervé Souchaud
 * @author Emeric Verschuur
 * 
 * Classe pour la gestion de l'anti-aliasing
 * Classe pour la gestion de l'anti-aliasing centre
 */ 

#ifndef LRANTIALIASINGCENTRE_H
@@ -20,7 +20,7 @@
/**
 * @brief ANTIALIASING : le type d'anti aliasing a appliquer a la scene
 * 
 * Classe pour la gestion de l'anti-aliasing
 * Classe pour la gestion de l'anti-aliasing centre
 */
class LrAntiAliasingCentre : public LrAntiAliasing
{
+11 −12
Original line number Diff line number Diff line
@@ -16,45 +16,45 @@
#include "config.h"
#endif

#include "LrAntiAliasingRandom.h"
#include "math.h"
#include <stdlib.h>
#include <iostream>
#include "LrAntiAliasingRandom.h"

// ############################################################################

//static float randMinMax(float min, float max)
//{
//    return (1.0 * rand()/RAND_MAX)*;
//}

/*---------------------------------------------------------------------------*
 * constructors and destructor                                               *
 *---------------------------------------------------------------------------*/
LrAntiAliasingRandom::LrAntiAliasingRandom()
: LrAntiAliasing()
{
}

// ############################################################################

LrAntiAliasingRandom::LrAntiAliasingRandom(const LrAntiAliasingRandom &source)
: LrAntiAliasing(source)
{
}

// ############################################################################

LrAntiAliasingRandom::LrAntiAliasingRandom(const int coeffAA)
: LrAntiAliasing(coeffAA)
{
}

// ############################################################################

LrAntiAliasingRandom::~LrAntiAliasingRandom()
{
}

// ############################################################################

void LrAntiAliasingRandom::getCoordUV(const int coeffAA, const int numCase, Real *u, Real *v) const
{

     //le pas
    float pas = (1.0/(coeffAA*2));
    //std::cout<<"pas : "<<pas<<std::endl;
    
    //Le num de ligne et de colonne
    int numLigne = (int)(floor(numCase / coeffAA)+1);
@@ -62,11 +62,10 @@ void LrAntiAliasingRandom::getCoordUV(const int coeffAA, const int numCase, Real

    //random de -pas a pas
    float variation = -pas + (1.0 * rand()/RAND_MAX) * (pas*2);
    //std::cout<<"variation : "<<variation<<std::endl;

    // 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