Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

IMG_BrushRGBA32 Class Reference

A brush used for drawing in pixmaps. More...

#include <IMG_BrushRGBA32.h>

Inheritance diagram for IMG_BrushRGBA32:

IMG_PixmapRGBA32 IMG_Pixmap List of all members.

Public Methods

 IMG_BrushRGBA32 (TUns32 w,TUns32 h,const IMG_ColorRGB &c,float a=0.8f)
 Constructs a brush image with the dimensions and color given. More...

virtual void setColor (const IMG_ColorRGB &c)
 Sets the color of the brush. More...

virtual void getColor (IMG_ColorRGB &c)const
 Returns the color of the brush. More...

virtual void setTransparency (float a)
 Sets the transparency of the brush. More...

virtual float getTransparency ()const
 Returns the transparency of the brush. More...

virtual void setRadii (TUns32 rI,TUns32 rO)
 Sets the shape of the brush from two radii (inner and outer). More...

virtual void getRadii (TUns32 &rI,TUns32 &rO)const
 Returns the radii that determine the shape of the brush. More...


Protected Methods

virtual void updateImage ()
 Updates the image of this brush. More...


Protected Attributes

IMG_ColorRGB m_color
float m_alpha
 The color of the brush.

TUns32 m_ri
 The transparency of the brush.

TUns32 m_ro
 The inner radius of the brush.


Detailed Description

A brush used for drawing in pixmaps.

The brush is a pixmap as well. Drawing can be implemented by blending the brush into the pixmap.

Author(s):
Maarten Gribnau
Date:
March 7, 2001


Constructor & Destructor Documentation

IMG_BrushRGBA32::IMG_BrushRGBA32 ( TUns32 w,
TUns32 h,
const IMG_ColorRGB & c,
float a = 0.8f )
 

Constructs a brush image with the dimensions and color given.

Parameters:
w   width of the brush image
h   height of the brush image
c   color of the brush
a   transparency in the center of the brush


Member Function Documentation

void IMG_BrushRGBA32::getColor ( IMG_ColorRGB & c ) const [inline, virtual]
 

Returns the color of the brush.

Parameters:
c   color of the brush

void IMG_BrushRGBA32::getRadii ( TUns32 & rI,
TUns32 & rO ) const [inline, virtual]
 

Returns the radii that determine the shape of the brush.

Parameters:
rI   inner radius
rO   outer radius

float IMG_BrushRGBA32::getTransparency ( ) const [inline, virtual]
 

Returns the transparency of the brush.

Parameters:
a   transparency of the brush

void IMG_BrushRGBA32::setColor ( const IMG_ColorRGB & c ) [virtual]
 

Sets the color of the brush.

Parameters:
c   color of the brush

void IMG_BrushRGBA32::setRadii ( TUns32 rI,
TUns32 rO ) [virtual]
 

Sets the shape of the brush from two radii (inner and outer).

This creates a brush with alpha==0 inside the inner radius and gradually fades to alpha==1 at the outer radius. Inner radius should be smaller or equal to the outer radius. If not, the outer radius is made equal to the inner radius. If the either radius is larger than the bounds of the brush, they are clipped.

Parameters:
rI   inner radius
rO   outer radius

void IMG_BrushRGBA32::setTransparency ( float a ) [virtual]
 

Sets the transparency of the brush.

Parameters:
a   transparency of the brush

void IMG_BrushRGBA32::updateImage ( ) [protected, virtual]
 

Updates the image of this brush.

The image is created using the current color, transparency and shape radii.


The documentation for this class was generated from the following files:
Generated at Thu May 3 17:29:38 2001 for ImgLib by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000