Ogre Procedural  0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Procedural::RandomPixels Class Reference

Draw a number of pixels at random positions. More...

#include <ProceduralTextureModifiers.h>

Inheritance diagram for Procedural::RandomPixels:
Inheritance graph
[legend]

Public Member Functions

 RandomPixels (TextureBufferPtr pBuffer)
 Default constructor. More...
 
RandomPixelssetColour (Ogre::ColourValue colour)
 Set the colour of the pixel to paint. More...
 
RandomPixelssetColour (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the colour of the pixel to paint. More...
 
RandomPixelssetSeed (Ogre::uint seed)
 Set the seed for "random" number generator. More...
 
RandomPixelssetCount (Ogre::uint count)
 Set the number of random painted pixels. More...
 
TextureBufferPtr process ()
 Run image manipulation. More...
 
Ogre::String getName ()
 Get name of the filter as string. More...
 
void setLog (bool enable=true)
 Enable/Disable logging. More...
 

Protected Member Functions

void logMsg (Ogre::String msg)
 

Protected Attributes

TextureBufferPtr mBuffer
 
Ogre::String mName
 
bool mLog
 

Detailed Description

Draw a number of pixels at random positions.

Paint a specific number of pixels at random positions in a given colour.

Example:

dot_texture_23.png

Constructor & Destructor Documentation

◆ RandomPixels()

Procedural::RandomPixels::RandomPixels ( TextureBufferPtr  pBuffer)

Default constructor.

Parameters
pBufferImage buffer where to modify the image.

References Ogre::Math::Sqrt().

Member Function Documentation

◆ getName()

Ogre::String Procedural::TextureProcessing::getName ( )
inherited

Get name of the filter as string.

◆ logMsg()

void Procedural::TextureProcessing::logMsg ( Ogre::String  msg)
protectedinherited

◆ process()

TextureBufferPtr Procedural::RandomPixels::process ( )
virtual

Run image manipulation.

Returns
Pointer to image buffer which has been set in the constructor.

Implements Procedural::TextureProcessing.

◆ setColour() [1/2]

RandomPixels& Procedural::RandomPixels::setColour ( Ogre::ColourValue  colour)

Set the colour of the pixel to paint.

Parameters
colourNew colour for painting pixels (default Ogre::ColourValue::White)

◆ setColour() [2/2]

RandomPixels& Procedural::RandomPixels::setColour ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the colour of the pixel to paint.

Parameters
redRed value of the pixel colour [0.0, 1.0] (default 1.0)
greenGreen value of the pixel colour [0.0, 1.0] (default 1.0)
blueBlue value of the pixel colour [0.0, 1.0] (default 1.0)
alphaAlpha value of the pixel colour [0.0, 1.0] (default 1.0)

◆ setCount()

RandomPixels& Procedural::RandomPixels::setCount ( Ogre::uint  count)

Set the number of random painted pixels.

Parameters
countNumber of pixels to paint (maximum: image height * image weight, default: (Sqrt(image width) + Sqrt(image height)) * 10)

◆ setLog()

void Procedural::TextureProcessing::setLog ( bool  enable = true)
inherited

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setSeed()

RandomPixels& Procedural::RandomPixels::setSeed ( Ogre::uint  seed)

Set the seed for "random" number generator.

Parameters
seedSeed value where to set the random number generator (default 5120)

Member Data Documentation

◆ mBuffer

TextureBufferPtr Procedural::TextureProcessing::mBuffer
protectedinherited

◆ mLog

bool Procedural::TextureProcessing::mLog
protectedinherited

◆ mName

Ogre::String Procedural::TextureProcessing::mName
protectedinherited

The documentation for this class was generated from the following file:
Procedural::RandomPixels::setCount
RandomPixels & setCount(Ogre::uint count)
Set the number of random painted pixels.
Procedural::RandomPixels::setColour
RandomPixels & setColour(Ogre::ColourValue colour)
Set the colour of the pixel to paint.
Ogre::ColourValue::Red
static const ColourValue Red
Ogre::ColourValue
Procedural::RandomPixels::process
TextureBufferPtr process()
Run image manipulation.
Procedural::Solid
Fills full image with given colour.
Definition: ProceduralTextureGenerator.h:563
Procedural::TextureBuffer
class to store image data while processing
Definition: ProceduralTextureBuffer.h:50
Procedural::Solid::process
TextureBufferPtr process()
Run image generation.
Procedural::Solid::setColour
Solid & setColour(Ogre::ColourValue colour)
Sets the fill colour of the image.
Procedural::RandomPixels
Draw a number of pixels at random positions.
Definition: ProceduralTextureModifiers.h:2241