BitmapEffectBase Class Reference

Base class for all bitmap effects. More...

#include <bfxbase.h>

Inheritance diagram for BitmapEffectBase:

ListItem CCObject SimpleCCObject BitmapEffect BitmapEffectAtom StringToBitmap TraceControl AccusoftBitmapEffect TestBitmapEffect BitmapEffectSILT ABFXBayerColour ABFXBayerMono ABFXBrightnessContrast ABFXDiffusionColour ABFXDiffusionMono ABFXFlipX ABFXFlipY ABFXHalftoneMono ABFXMakeGreyscale ABFXOctree ABFXPopularityColour ABFXRemoveDither ABFXResize ABFXRotate180 ABFXRotate270 ABFXRotate90 ABFXSharpenBlur ABFXSpecialEffect List of all members.

Public Member Functions

 BitmapEffectBase ()
 Default constructor for bitmap effect object.
virtual ~BitmapEffectBase ()
 Default constructor for bitmap effect object.
virtual BOOL SetParameters ()
 Sets the bitmap effect params up to the default.
virtual BOOL SetSourceImage (KernelBitmap *theSource)
 Sets up the effect to use a chosen bitmap.
virtual BOOL GetEffectInfo (UINT32 *pOrderBitmap, UINT32 *pOrderEffect, UINT32 *pPlotEstimate)
 Gets information about the given effect.
virtual BOOL GetDestinationInfo (UINT32 *pDestinationSize, INT32 *pDestinationDepth, UINT32 *pDestinationWidth, UINT32 *pDestinationHeight)
 Gets information about the given effect.
virtual BOOL UseDestinationBitmap (KernelBitmap *theDestination)
 Indicates the Run method should use this bitmap for output.
virtual BOOL Run ()
 Runs a transform!
virtual KernelBitmapGetDestination ()
 Returns a pointer to the destination image.
virtual BOOL IsSourceSpecified ()
 Indicates whether or a source image has been specified yet.
virtual BOOL IsAbleToRun ()
 Indicates whether you've done enough setting up to do a Run.

Static Public Member Functions

static BOOL Init ()
 Initialises the bitmap effect subsystem.
static BOOL DeInit ()
 Initialises the bitmap effect subsystem.
static void TestGD ()

Protected Attributes

KernelBitmapSource
KernelBitmapDestination

Static Protected Attributes

static BfxALUALU = NULL

Private Member Functions

 CC_DECLARE_DYNCREATE (BitmapEffectBase)

Detailed Description

Base class for all bitmap effects.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/1994
All bitmap effects and atoms are derived from this class.

Definition at line 120 of file bfxbase.h.


Constructor & Destructor Documentation

BitmapEffectBase::BitmapEffectBase  ) 
 

Default constructor for bitmap effect object.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
Constructs object [OUTPUTS]
Returns:
Nothing

Errors: Causes a level 3 if the setting the parameters to the default fails

See also:
-
This constructs an object and sets the parameters to the default set. As contructors can't fail we explode if we can't set the parameters to the default set on the basis that this is an operation defined algorithmically to work 100% of the time!

Definition at line 142 of file bfxbase.cpp.

00143 {
00144     Source = NULL;
00145     Destination = NULL;
00146 //  Monitor = NULL;
00147 
00148     if (!(SetParameters())) /* virtual */
00149     {
00150         ERROR3("Bitmap effect default parameter set failed in constructor");
00151     }
00152 }

BitmapEffectBase::~BitmapEffectBase  )  [virtual]
 

Default constructor for bitmap effect object.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
Constructs object [OUTPUTS]
Returns:
Nothing

Errors: Causes a level 3 if the setting the parameters to the default fails

See also:
-
This constructs an object and sets the parameters to the default set. As contructors can't fail we explode if we can't set the parameters to the default set on the basis that this is an operation defined algorithmically to work 100% of the time!

Definition at line 173 of file bfxbase.cpp.

00174 {
00175     ERROR3IF((Destination!=NULL),"Bitmap effect destructor called when destination exists");
00176     // Unforunately we habe to use ERROR3 not ERROR2 as we can't return a flag  
00177 }


Member Function Documentation

BitmapEffectBase::CC_DECLARE_DYNCREATE BitmapEffectBase   )  [private]
 

BOOL BitmapEffectBase::DeInit  )  [static]
 

Initialises the bitmap effect subsystem.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/94
Parameters:
None [INPUTS]
DeInitialises subsystem [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
This call's primary purposes is to deinitialise the BfxALU.

Definition at line 224 of file bfxbase.cpp.

00225 {
00226     if ( (ALU) && (ALU->DeInit()) )
00227     {
00228         delete(ALU);
00229         ALU=NULL;
00230         return TRUE;
00231     }
00232     else return FALSE;
00233 }

KernelBitmap * BitmapEffectBase::GetDestination  )  [virtual]
 

Returns a pointer to the destination image.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
Pointer to destination imagwe

Errors: None from this one as yet

See also:
-
The dest image will be present if it has been set using UseDestinationBitmap, or if the effect has been run and UseDestinationBitmap has not been set to NULL subsequently.

Definition at line 405 of file bfxbase.cpp.

00406 {
00407     return (Destination);
00408 }

BOOL BitmapEffectBase::GetDestinationInfo UINT32 pDestinationSize,
INT32 *  pDestinationDepth,
UINT32 pDestinationWidth,
UINT32 pDestinationHeight
[virtual]
 

Gets information about the given effect.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
pDestinationSize filled with size in bytes of dest bitmap [OUTPUTS] pDestinationDepth filled with bpp of dest bitmap pDestinationWidth|Height filled with width height of dest in pixels
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: Error2 if source hasn't been set up

See also:
-
This should be overridden to give an accurate representation of what the dest bitmap will look like. It is an error to call this without setting the source up.

Definition at line 340 of file bfxbase.cpp.

00344 {
00345     
00346     ERROR2IF(!Source,FALSE,"No source for bitmap effect");
00347 
00348     if (pDestinationSize) *pDestinationSize=0;
00349     if (pDestinationDepth) *pDestinationDepth=0;
00350     if (pDestinationWidth) *pDestinationWidth=0;
00351     if (pDestinationHeight) *pDestinationHeight=0;
00352     
00353     return(TRUE);
00354 }

BOOL BitmapEffectBase::GetEffectInfo UINT32 pOrderBitmap,
UINT32 pOrderEffect,
UINT32 pPlotEstimate
[virtual]
 

Gets information about the given effect.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
pOrderBitmap filled in with the order of the operation wrt size of bitmap [OUTPUTS] pOrderEffect filled in with the order of the operation wrt size of effect pPlotEstimate filled in with the number of sprite plots this is roughly equivalent to in time terms.
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
This should be overridden to give the user some idea of how long a bitmap operation is going to take, so they can be marked as fast, slow or whatever. If the source image is not set up, pPlotEstimate should be returned as zero.

Any parameters passed as NULL will not be filled

Definition at line 306 of file bfxbase.cpp.

00308 {
00309     
00310     if (pOrderBitmap) *pOrderBitmap=0;
00311     if (pOrderEffect) *pOrderEffect=0;
00312     if (pPlotEstimate) *pPlotEstimate=0;
00313     return(TRUE);
00314 }

BOOL BitmapEffectBase::Init void   )  [static]
 

Initialises the bitmap effect subsystem.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/94
Parameters:
None [INPUTS]
Initialises subsystem [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
This call's primary purposes is to initialise the BfxALU, getting its static pointer.

Reimplemented from SimpleCCObject.

Definition at line 196 of file bfxbase.cpp.

00197 {
00198     ALU=new BfxALU;
00199     return (ALU) ? (ALU->Init()) : FALSE;
00200 }

BOOL BitmapEffectBase::IsAbleToRun  )  [virtual]
 

Indicates whether you've done enough setting up to do a Run.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if you've done enough setting up to do a Run

Errors: None from this one as yet

See also:
-
For now just requires IsSourceSpecified

Definition at line 451 of file bfxbase.cpp.

00452 {
00453     return IsSourceSpecified();
00454 }

BOOL BitmapEffectBase::IsSourceSpecified  )  [virtual]
 

Indicates whether or a source image has been specified yet.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if source image is specified else false

Errors: None from this one as yet

See also:
-
The source image will be specified if the last call to SetSourceImage was non null. Overridden if multiple source images need to be specified.

Definition at line 428 of file bfxbase.cpp.

00429 {
00430     return (Source != NULL);
00431 }

BOOL BitmapEffectBase::Run  )  [virtual]
 

Runs a transform!

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if failed

Errors: ERROR2 if called when parameters aren't set up properly

See also:
-
It's obviously important to override this!

Reimplemented in BitmapEffectSILT, and TestBitmapEffect.

Definition at line 473 of file bfxbase.cpp.

00474 {
00475     ERROR2IF(!IsAbleToRun(),FALSE,"BitmapEffectRun called at inappropriate time");
00476     return TRUE;
00477 }

BOOL BitmapEffectBase::SetParameters  )  [virtual]
 

Sets the bitmap effect params up to the default.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
None [INPUTS]
Sets up the parameters to the default [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
Normally this would be overridden to det a default set of parameters, but the base class version might be used if the effect has no parameters

Definition at line 253 of file bfxbase.cpp.

00254 {
00255     return TRUE;
00256 }

BOOL BitmapEffectBase::SetSourceImage KernelBitmap theSource  )  [virtual]
 

Sets up the effect to use a chosen bitmap.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
theSource is pointer to the bitmap to use, or NULL to unset it [INPUTS]
Records a pointer to the bitmap [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
Normally this would be overridden to check the bitmap was suitable.

Definition at line 275 of file bfxbase.cpp.

00276 {
00277     Source = theSource;
00278     return TRUE;
00279 }

void BitmapEffectBase::TestGD  )  [static]
 

Definition at line 202 of file bfxbase.cpp.

00203 {
00204     ALU->TestGD();
00205 }

BOOL BitmapEffectBase::UseDestinationBitmap KernelBitmap theDestination  )  [virtual]
 

Indicates the Run method should use this bitmap for output.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/94
Parameters:
theDestination is pointer to the bitmap to use, or NULL to unset it [INPUTS]
Records a pointer to the dest bitmap [OUTPUTS]
Returns:
TRUE if succeeded, FALSE & error set if not

Errors: None from this one as yet

See also:
-
Normally this would be overridden to check the bitmap was suitable. The bitmap specified will be used if specified, else a new KernelBitmap will be used. If the KernelBitmap does not have an OilBitmap attached and created of the correct size, it will be created and attached. If a NULL is passed (this is the default situation) then a new KernelBitmap will be created.

This routine can also be called with NULL to indicate that responsibility for an output image after a run has been assumed by the caller. The object won't destruct when it has a destination bitmap.

Definition at line 381 of file bfxbase.cpp.

00382 {
00383     Destination = theDestination;
00384     return TRUE;
00385 }


Member Data Documentation

BfxALU * BitmapEffectBase::ALU = NULL [static, protected]
 

Definition at line 156 of file bfxbase.h.

KernelBitmap* BitmapEffectBase::Destination [protected]
 

Definition at line 154 of file bfxbase.h.

KernelBitmap* BitmapEffectBase::Source [protected]
 

Definition at line 153 of file bfxbase.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:15 2007 for Camelot by  doxygen 1.4.4