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

IMG_CanvasRGBA32 Class Reference

A drawable IMG_PixmapRGBA32 pixmap. More...

#include <IMG_CanvasRGBA32.h>

Inheritance diagram for IMG_CanvasRGBA32:

IMG_PixmapRGBA32 IMG_Pixmap List of all members.

Public Methods

 IMG_CanvasRGBA32 (TUns32 width,TUns32 height)
 Constructor. More...

 IMG_CanvasRGBA32 (void *image,TUns32 width,TUns32 height,TUns32 rowBytes)
 Constructor. More...

virtual void startStroke ()
 Starts a stroke. More...

virtual void drawStroke (TInt32 x1,TInt32 y1,TInt32 x2,TInt32 y2,const IMG_BrushRGBA32 &brush)
 Continues the stroke by drawing a line from the location 1 to location 2. More...

virtual void drawStroke (float u1,float v1,float u2,float v2,const IMG_BrushRGBA32 &brush)
 Continues the stroke by drawing a line from the location 1 to location 2. More...

virtual IMG_CanvasRGBA32ActionendStroke ()
 Ends a stroke. More...


Protected Methods

virtual ~IMG_CanvasRGBA32 ()
 Destructor. More...

virtual void draw (TInt32 xStart,TInt32 yStart,TInt32 xEnd,TInt32 yEnd,const IMG_BrushRGBA32 &brush,bool drawEndPoint=true)
 Draws a line from the start to the end point with the brush given. More...


Protected Attributes

IMG_PixmapRGBA32m_undoPixmap
IMG_Rect m_undoRect

Detailed Description

A drawable IMG_PixmapRGBA32 pixmap.

A IMG_BrushRGBA32 is used as brush for strokes. Strokes are a collection of lines drawn between points. When a stroke is finished, the canvas returns an action that can be used to undo/redo the stroke.

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


Constructor & Destructor Documentation

IMG_CanvasRGBA32::IMG_CanvasRGBA32 ( TUns32 width,
TUns32 height )
 

Constructor.

Exceptions:
IMG_MemPtr::Size   > when an invalid width and/or height is passed.
IMG_MemPtr::Memory   > when a there is not enough memory to allocate the image.
Parameters:
width   the width in pixels of the image.
height   the height in pixels of the image.

IMG_CanvasRGBA32::IMG_CanvasRGBA32 ( void * image,
TUns32 width,
TUns32 height,
TUns32 rowBytes )
 

Constructor.

The image data will not be freed upon destruction of this object. The owner of this object is reponsible for that.

Exceptions:
IMG_MemPtr::Size   > when an invalid width and/or height is passed.
Parameters:
image   pointer to the image data.
width   the width in pixels of the image.
height   the height in pixels of the image.

IMG_CanvasRGBA32::~IMG_CanvasRGBA32 ( ) [protected, virtual]
 

Destructor.

The destructor is protected since the canvas is a shared object.


Member Function Documentation

void IMG_CanvasRGBA32::draw ( TInt32 xStart,
TInt32 yStart,
TInt32 xEnd,
TInt32 yEnd,
const IMG_BrushRGBA32 & brush,
bool drawEndPoint = true ) [protected, virtual]
 

Draws a line from the start to the end point with the brush given.

Repeatedly pastes the given brush centered at the given line into this pixmap. The alpha information in the brush is used to blend.

Parameters:
xStart   The x-coordinate of the start of the line.
yStart   The y-coordinate of the start of the line.
xEnd   The x-coordinate of the end of the line.
yEnd   The y-coordinate of the end of the line.
brush   The brush used for drawing.

void IMG_CanvasRGBA32::drawStroke ( float u1,
float v1,
float u2,
float v2,
const IMG_BrushRGBA32 & brush ) [virtual]
 

Continues the stroke by drawing a line from the location 1 to location 2.

This will update the dirty rectangle.

Parameters:
u1   u-coordinate of the start location of the stroke.
v1   v-coordinate of the start location of the stroke.
u2   u-coordinate of the end location of the stroke.
v2   v-coordinate of the end location of the stroke.
brush   the brush used for drawing.

void IMG_CanvasRGBA32::drawStroke ( TInt32 x1,
TInt32 y1,
TInt32 x2,
TInt32 y2,
const IMG_BrushRGBA32 & brush ) [virtual]
 

Continues the stroke by drawing a line from the location 1 to location 2.

This will update the dirty rectangle.

Parameters:
x1   x-coordinate of the start location of the stroke.
y1   y-coordinate of the start location of the stroke.
x2   x-coordinate of the end location of the stroke.
y2   y-coordinate of the end location of the stroke.
brush   the brush used for drawing.

IMG_CanvasRGBA32Action * IMG_CanvasRGBA32::endStroke ( ) [virtual]
 

Ends a stroke.

This will return an action that can be used to undo/redo the drawing of the stroke.

Returns:
an image action that can be used to undo/redo the drawing of the stroke.

void IMG_CanvasRGBA32::startStroke ( ) [virtual]
 

Starts a stroke.

This will save the image and clear the dirty rectangle.


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