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

Draw a rectangle. More...

#include <ProceduralTextureModifiers.h>

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

Public Member Functions

 RectangleTexture (TextureBufferPtr pBuffer)
 Default constructor. More...
 
RectangleTexturesetColour (Ogre::ColourValue colour)
 Set the fill colour of the rectangle. More...
 
RectangleTexturesetColour (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the fill colour of the rectangle. More...
 
RectangleTexturesetX1 (size_t x1)
 Set absolute x position of top left start point of the rectangle in px. More...
 
RectangleTexturesetX1 (Ogre::Real x1)
 Set relative x position of top left start point of the rectangle as Real. More...
 
RectangleTexturesetY1 (size_t y1)
 Set absolute y position of top left start point of the rectangle in px. More...
 
RectangleTexturesetY1 (Ogre::Real y1)
 Set relative y position of top left start point of the rectangle as Real. More...
 
RectangleTexturesetX2 (size_t x2)
 Set absolute x position of bottom right end point of the rectangle in px. More...
 
RectangleTexturesetX2 (Ogre::Real x2)
 Set relative x position of bottom right end point of the rectangle as Real. More...
 
RectangleTexturesetY2 (size_t y2)
 Set absolute y position of bottom right end point of the rectangle in px. More...
 
RectangleTexturesetY2 (Ogre::Real y2)
 Set relative y position of bottom right end point of the rectangle as Real. More...
 
RectangleTexturesetRectangle (Ogre::RealRect rect, bool relative=true)
 Set the full rectangle coordinates. More...
 
RectangleTexturesetRectangle (Ogre::Rect rect)
 Set the full rectangle coordinates. More...
 
RectangleTexturesetRectangle (Ogre::Vector2 pos1, Ogre::Vector2 pos2, bool relative=true)
 Set the full rectangle coordinates. More...
 
RectangleTexturesetRectangle (size_t x1, size_t y1, size_t x2, size_t y2)
 Set the full rectangle coordinates. More...
 
RectangleTexturesetRectangle (Ogre::Real x1, Ogre::Real y1, Ogre::Real x2, Ogre::Real y2)
 Set the full rectangle coordinates. 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 rectangle.

Draw a filled rectangle on top of previous content.

Example:

Procedural::TextureBuffer bufferSolid(256);
Procedural::Solid(&bufferSolid).setColour(Ogre::ColourValue(0.0f, 0.5f, 1.0f, 1.0f)).process();

dot_texture_24.png

Constructor & Destructor Documentation

◆ RectangleTexture()

Procedural::RectangleTexture::RectangleTexture ( TextureBufferPtr  pBuffer)

Default constructor.

Parameters
pBufferImage buffer where to modify the image.

References Procedural::TextureBuffer::getHeight(), and Procedural::TextureBuffer::getWidth().

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::RectangleTexture::process ( )
virtual

Run image manipulation.

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

Implements Procedural::TextureProcessing.

◆ setColour() [1/2]

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

Set the fill colour of the rectangle.

Parameters
colourNew colour for processing (default Ogre::ColourValue::White)

◆ setColour() [2/2]

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

Set the fill colour of the rectangle.

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

◆ setLog()

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

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setRectangle() [1/5]

RectangleTexture& Procedural::RectangleTexture::setRectangle ( Ogre::Real  x1,
Ogre::Real  y1,
Ogre::Real  x2,
Ogre::Real  y2 
)

Set the full rectangle coordinates.

Parameters
x1New relative x position of rectangle start [0.0, 1.0] (default 0.0)
y1New relative y position of rectangle start [0.0, 1.0] (default 0.0)
x2New relative x position of rectangle end [0.0, 1.0] (default 1.0)
y2New relative y position of rectangle end [0.0, 1.0] (default 1.0)

◆ setRectangle() [2/5]

RectangleTexture& Procedural::RectangleTexture::setRectangle ( Ogre::RealRect  rect,
bool  relative = true 
)

Set the full rectangle coordinates.

Parameters
rectFull rectangle description (default: left=0.0, top=0.0, right=1.0, bottom=1.0)
relativeIf this is set to true (default) the rectangle data are relative [0.0, 1.0]; else absolut [px]

◆ setRectangle() [3/5]

RectangleTexture& Procedural::RectangleTexture::setRectangle ( Ogre::Rect  rect)

Set the full rectangle coordinates.

Parameters
rectFull absolute rectangle description (default: left=0, top=0, right=image width, bottom=image height)

◆ setRectangle() [4/5]

RectangleTexture& Procedural::RectangleTexture::setRectangle ( Ogre::Vector2  pos1,
Ogre::Vector2  pos2,
bool  relative = true 
)

Set the full rectangle coordinates.

Parameters
pos1Vector to top left start point of the rectangle (default: x=0.0, y=0.0)
pos2Vector to bottom right end point of the rectangle (default: x=1.0, y=1.0)
relativeIf this is set to true (default) the vector data are relative [0.0, 1.0]; else absolut [px]

◆ setRectangle() [5/5]

RectangleTexture& Procedural::RectangleTexture::setRectangle ( size_t  x1,
size_t  y1,
size_t  x2,
size_t  y2 
)

Set the full rectangle coordinates.

Parameters
x1New absolute x position of rectangle start (default 0)
y1New absolute y position of rectangle start (default 0)
x2New absolute x position of rectangle end (default: image width)
y2New absolute y position of rectangle end (default: image height)

◆ setX1() [1/2]

RectangleTexture& Procedural::RectangleTexture::setX1 ( Ogre::Real  x1)

Set relative x position of top left start point of the rectangle as Real.

Parameters
x1New relative x position of rectangle start [0.0, 1.0] (default 0.0)

◆ setX1() [2/2]

RectangleTexture& Procedural::RectangleTexture::setX1 ( size_t  x1)

Set absolute x position of top left start point of the rectangle in px.

Parameters
x1New absolute x position of rectangle start (default 0)

◆ setX2() [1/2]

RectangleTexture& Procedural::RectangleTexture::setX2 ( Ogre::Real  x2)

Set relative x position of bottom right end point of the rectangle as Real.

Parameters
x2New relative x position of rectangle end [0.0, 1.0] (default 1.0)

◆ setX2() [2/2]

RectangleTexture& Procedural::RectangleTexture::setX2 ( size_t  x2)

Set absolute x position of bottom right end point of the rectangle in px.

Parameters
x2New absolute x position of rectangle end (default: image width)

◆ setY1() [1/2]

RectangleTexture& Procedural::RectangleTexture::setY1 ( Ogre::Real  y1)

Set relative y position of top left start point of the rectangle as Real.

Parameters
y1New relative y position of rectangle start [0.0, 1.0] (default 0.0)

◆ setY1() [2/2]

RectangleTexture& Procedural::RectangleTexture::setY1 ( size_t  y1)

Set absolute y position of top left start point of the rectangle in px.

Parameters
y1New absolute x position of rectangle start (default 0)

◆ setY2() [1/2]

RectangleTexture& Procedural::RectangleTexture::setY2 ( Ogre::Real  y2)

Set relative y position of bottom right end point of the rectangle as Real.

Parameters
y2New relative y position of rectangle end [0.0, 1.0] (default 1.0)

◆ setY2() [2/2]

RectangleTexture& Procedural::RectangleTexture::setY2 ( size_t  y2)

Set absolute y position of bottom right end point of the rectangle in px.

Parameters
y2New absolute x position of rectangle end (default: image height)

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:
Ogre::ColourValue::Red
static const ColourValue Red
Procedural::RectangleTexture
Draw a rectangle.
Definition: ProceduralTextureModifiers.h:2305
Ogre::ColourValue
Procedural::RectangleTexture::setRectangle
RectangleTexture & setRectangle(Ogre::RealRect rect, bool relative=true)
Set the full rectangle coordinates.
Procedural::Solid
Fills full image with given colour.
Definition: ProceduralTextureGenerator.h:563
Procedural::RectangleTexture::setColour
RectangleTexture & setColour(Ogre::ColourValue colour)
Set the fill colour of the rectangle.
Procedural::RectangleTexture::process
TextureBufferPtr process()
Run image manipulation.
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.