Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Protected Attributes | Private Types | Static Private Attributes | List of all members
cIntGenSmooth< SizeX, SizeZ > Class Template Reference

Smoothes out some artifacts generated by the zooming - mostly single-pixel values. More...

#include <IntGen.h>

Inheritance diagram for cIntGenSmooth< SizeX, SizeZ >:
Inheritance graph
[legend]
Collaboration diagram for cIntGenSmooth< SizeX, SizeZ >:
Collaboration graph
[legend]

Public Types

using Underlying = std::shared_ptr< cIntGen< m_LowerSizeX, m_LowerSizeZ > >
 
- Public Types inherited from cIntGen< SizeX, SizeZ >
using IntGenType = cIntGen< SizeX, SizeZ >
 
using Values = int[SizeX *SizeZ]
 Holds the array of values generated by this class (descendant). More...
 

Public Member Functions

 cIntGenSmooth (int a_Seed, Underlying a_Underlying)
 
virtual void GetInts (int a_MinX, int a_MinZ, typename Super::Values &a_Values) override
 Generates the array of templated size into a_Values, based on given min coords. More...
 
- Public Member Functions inherited from cIntGenWithNoise< SizeX, SizeX >
 cIntGenWithNoise (int a_Seed)
 
- Public Member Functions inherited from cIntGen< SizeX, SizeZ >
virtual ~cIntGen ()
 Force a virtual destructor in all descendants. More...
 

Protected Attributes

Underlying m_Underlying
 
- Protected Attributes inherited from cIntGenWithNoise< SizeX, SizeX >
cNoise m_Noise
 

Private Types

using Super = cIntGenWithNoise< SizeX, SizeZ >
 

Static Private Attributes

static const int m_LowerSizeX = SizeX + 2
 
static const int m_LowerSizeZ = SizeZ + 2
 

Additional Inherited Members

- Protected Member Functions inherited from cIntGenWithNoise< SizeX, SizeX >
int ChooseRandomOne (int a_RndX, int a_RndZ, int a_Val1, int a_Val2)
 Chooses one of a_Val1 or a_Val2, based on m_Noise and the coordinates for querying the noise. More...
 
int ChooseRandomOne (int a_RndX, int a_RndZ, int a_Val1, int a_Val2, int a_Val3, int a_Val4)
 Chooses one of a_ValN, based on m_Noise and the coordinates for querying the noise. More...
 

Detailed Description

template<int SizeX, int SizeZ = SizeX>
class cIntGenSmooth< SizeX, SizeZ >

Smoothes out some artifacts generated by the zooming - mostly single-pixel values.

Compares each pixel to its neighbors and if the neighbors are equal, changes the pixel to their value.

Definition at line 333 of file IntGen.h.

Member Typedef Documentation

◆ Super

template<int SizeX, int SizeZ = SizeX>
using cIntGenSmooth< SizeX, SizeZ >::Super = cIntGenWithNoise<SizeX, SizeZ>
private

Definition at line 336 of file IntGen.h.

◆ Underlying

template<int SizeX, int SizeZ = SizeX>
using cIntGenSmooth< SizeX, SizeZ >::Underlying = std::shared_ptr<cIntGen<m_LowerSizeX, m_LowerSizeZ> >

Definition at line 343 of file IntGen.h.

Constructor & Destructor Documentation

◆ cIntGenSmooth()

template<int SizeX, int SizeZ = SizeX>
cIntGenSmooth< SizeX, SizeZ >::cIntGenSmooth ( int  a_Seed,
Underlying  a_Underlying 
)
inline

Definition at line 346 of file IntGen.h.

Member Function Documentation

◆ GetInts()

template<int SizeX, int SizeZ = SizeX>
virtual void cIntGenSmooth< SizeX, SizeZ >::GetInts ( int  a_MinX,
int  a_MinZ,
typename Super::Values a_Values 
)
inlineoverridevirtual

Generates the array of templated size into a_Values, based on given min coords.

Implements cIntGen< SizeX, SizeZ >.

Definition at line 353 of file IntGen.h.

Member Data Documentation

◆ m_LowerSizeX

template<int SizeX, int SizeZ = SizeX>
const int cIntGenSmooth< SizeX, SizeZ >::m_LowerSizeX = SizeX + 2
staticprivate

Definition at line 338 of file IntGen.h.

◆ m_LowerSizeZ

template<int SizeX, int SizeZ = SizeX>
const int cIntGenSmooth< SizeX, SizeZ >::m_LowerSizeZ = SizeZ + 2
staticprivate

Definition at line 339 of file IntGen.h.

◆ m_Underlying

template<int SizeX, int SizeZ = SizeX>
Underlying cIntGenSmooth< SizeX, SizeZ >::m_Underlying
protected

Definition at line 402 of file IntGen.h.


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