Blender  V2.93
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Freestyle::GaussianFilter Class Reference

#include <GaussianFilter.h>

Public Member Functions

 GaussianFilter (float iSigma=1.0f)
 
 GaussianFilter (const GaussianFilter &)
 
GaussianFilteroperator= (const GaussianFilter &)
 
virtual ~GaussianFilter ()
 
template<class Map >
float getSmoothedPixel (Map *map, int x, int y)
 
float sigma () const
 
int maskSize () const
 
int getBound ()
 
void setSigma (float sigma)
 

Static Public Member Functions

static int computeMaskSize (float sigma)
 

Protected Member Functions

void computeMask ()
 

Protected Attributes

float _sigma
 
float_mask
 
int _bound
 
int _maskSize
 
int _storedMaskSize
 

Detailed Description

Definition at line 37 of file GaussianFilter.h.

Constructor & Destructor Documentation

◆ GaussianFilter() [1/2]

Freestyle::GaussianFilter::GaussianFilter ( float  iSigma = 1.0f)

Definition at line 28 of file GaussianFilter.cpp.

References _mask, _sigma, and computeMask().

◆ GaussianFilter() [2/2]

Freestyle::GaussianFilter::GaussianFilter ( const GaussianFilter iBrother)

Definition at line 35 of file GaussianFilter.cpp.

References _bound, _mask, _maskSize, _sigma, and _storedMaskSize.

◆ ~GaussianFilter()

Freestyle::GaussianFilter::~GaussianFilter ( )
virtual

Definition at line 56 of file GaussianFilter.cpp.

References _mask.

Member Function Documentation

◆ computeMask()

void Freestyle::GaussianFilter::computeMask ( )
protected

Definition at line 77 of file GaussianFilter.cpp.

References _bound, _mask, _maskSize, _sigma, _storedMaskSize, computeMaskSize(), KDL::exp(), float(), M_PI, and norm().

Referenced by GaussianFilter(), and setSigma().

◆ computeMaskSize()

int Freestyle::GaussianFilter::computeMaskSize ( float  sigma)
static

Compute the mask size and returns the REAL mask size ((2*_maskSize)-1) This method is provided for convenience.

Definition at line 61 of file GaussianFilter.cpp.

References floor(), maskSize(), and sigma().

Referenced by computeMask().

◆ getBound()

int Freestyle::GaussianFilter::getBound ( )
inline

◆ getSmoothedPixel()

template<class Map >
float Freestyle::GaussianFilter::getSmoothedPixel ( Map *  map,
int  x,
int  y 
)

Returns the value for pixel x,y of image "map" after a gaussian blur, made using the sigma value. The sigma value determines the mask size (~ 2 x sigma).

Parameters
mapThe image we wish to work on. The Map template must implement the following methods:
  • float pixel(unsigned int x,unsigned int y) const;
  • unsigned width() const;
  • unsigned height() const;
xThe abscissa of the pixel where we want to evaluate the gaussian blur.
yThe ordinate of the pixel where we want to evaluate the gaussian blur.
sigmaThe sigma value of the gaussian function.

Definition at line 124 of file GaussianFilter.h.

References _bound, _mask, _storedMaskSize, abs(), L, sum(), w(), Freestyle::x, and y.

Referenced by Freestyle::GaussianPyramid::BuildPyramid(), Freestyle::Canvas::loadMap(), Freestyle::Functions0D::DensityF0D::operator()(), and Freestyle::Functions0D::LocalAverageDepthF0D::operator()().

◆ maskSize()

int Freestyle::GaussianFilter::maskSize ( ) const
inline

◆ operator=()

GaussianFilter & Freestyle::GaussianFilter::operator= ( const GaussianFilter iBrother)

Definition at line 45 of file GaussianFilter.cpp.

References _bound, _mask, _maskSize, _sigma, and _storedMaskSize.

◆ setSigma()

void Freestyle::GaussianFilter::setSigma ( float  sigma)

◆ sigma()

float Freestyle::GaussianFilter::sigma ( ) const
inline

accessors

Definition at line 79 of file GaussianFilter.h.

References _sigma.

Referenced by computeMaskSize(), and setSigma().

Member Data Documentation

◆ _bound

int Freestyle::GaussianFilter::_bound
protected

Definition at line 45 of file GaussianFilter.h.

Referenced by computeMask(), GaussianFilter(), getBound(), getSmoothedPixel(), and operator=().

◆ _mask

float* Freestyle::GaussianFilter::_mask
protected

◆ _maskSize

int Freestyle::GaussianFilter::_maskSize
protected

Definition at line 48 of file GaussianFilter.h.

Referenced by computeMask(), GaussianFilter(), maskSize(), and operator=().

◆ _sigma

float Freestyle::GaussianFilter::_sigma
protected

Definition at line 43 of file GaussianFilter.h.

Referenced by computeMask(), GaussianFilter(), operator=(), setSigma(), and sigma().

◆ _storedMaskSize

int Freestyle::GaussianFilter::_storedMaskSize
protected

Definition at line 49 of file GaussianFilter.h.

Referenced by computeMask(), GaussianFilter(), getSmoothedPixel(), and operator=().


The documentation for this class was generated from the following files: