Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

RasterStrategy Class Reference

Base-class for RasterStrategies. More...

#include <RasterStrategy.h>

Inheritance diagram for RasterStrategy:

Inheritance graph
[legend]
Collaboration diagram for RasterStrategy:

Collaboration graph
[legend]
List of all members.

Public Types

typedef const unsigned char * I_Pin
enum  ActivationKeys {
  preScan = 0, postScan, ball,
  flag, goal, lines,
  foes, numberOfActivationKeys
}
 Keys for the several activities can be made by strategies. More...


Public Member Functions

 RasterStrategy (RasterImageProcessor &iProcessor)
 Constructor.

virtual ~RasterStrategy ()
 Destructor.

virtual void init ()=0
 Initializes a strategy and the related specialists.

virtual void execute ()=0
 Executes the strategy.


Public Attributes

bool insideBall
 True if the strategy scans over a ball.

bool insideBox
 True if the strategy scans over a box.

bool insideBridge
 True if the strategy scans over a bridge beacon.

bool insidePlayer
 True if the strategy scans over a player.

bool insideField
 True if the strategy scans over the field.

bool insideLM
 True if the strategy scans over a landmark.


Protected Member Functions

colorClass getColor (Vector2< int > v)
 Implemented with ColorTable interface.

colorClass getColor (int x, int y)
 Implemented with ColorTable interface.

bool checkColor (int x, int y, colorClass color)
 Implemented with ColorTable interface.

bool checkColor (Vector2< int > v, colorClass color)
 Implemented with ColorTable interface.

double theta (int dx, int dy)
 The theta function.


Protected Attributes

RasterImageProcessorrip
 The image processor interfaces.


Detailed Description

Base-class for RasterStrategies.

A RasterStrategy is a object that delegates a collection of specialists. And decides what pixels are scanned on the image. First the image has to be scanned, than the several post-processings of the specialists have to be executed.

Author:
Bernd Schmidt

Definition at line 30 of file RasterStrategy.h.


Member Typedef Documentation

typedef const unsigned char* RasterStrategy::I_Pin
 

Definition at line 46 of file RasterStrategy.h.


Member Enumeration Documentation

enum RasterStrategy::ActivationKeys
 

Keys for the several activities can be made by strategies.

Enumeration values:
preScan 
postScan 
ball 
flag 
goal 
lines 
foes 
numberOfActivationKeys 

Definition at line 35 of file RasterStrategy.h.


Constructor & Destructor Documentation

RasterStrategy::RasterStrategy RasterImageProcessor iProcessor  ) 
 

Constructor.

Parameters:
iProcessor The image processor interfaces.

Definition at line 10 of file RasterStrategy.cpp.

RasterStrategy::~RasterStrategy  )  [virtual]
 

Destructor.

Definition at line 16 of file RasterStrategy.cpp.


Member Function Documentation

virtual void RasterStrategy::init  )  [pure virtual]
 

Initializes a strategy and the related specialists.

Call this before execute().

Implemented in RDefaultStrategy.

Referenced by RasterImageProcessor::init().

virtual void RasterStrategy::execute  )  [pure virtual]
 

Executes the strategy.

Implemented in RDefaultStrategy.

Referenced by RasterImageProcessor::execute().

colorClass RasterStrategy::getColor Vector2< int >  v  )  [inline, protected]
 

Implemented with ColorTable interface.

Corrects the color before classifying.

Parameters:
v input pixel
Returns:
The classified color of the pixel.

Definition at line 84 of file RasterStrategy.h.

References colorClass, Vector2< V >::x, and Vector2< V >::y.

Referenced by checkColor(), and RDefaultStrategy::preScan().

colorClass RasterStrategy::getColor int  x,
int  y
[inline, protected]
 

Implemented with ColorTable interface.

Corrects the color before classifying.

Parameters:
x x-coordinate of the requested pixel
y y-coordinate of the requested pixel
Returns:
The classified color of the pixel.

Definition at line 92 of file RasterStrategy.h.

References colorClass, ImageProcessorInterfaces::colorTable, ColorCorrector::correct(), ColorTable::getColorClass(), Image::image, and ImageProcessorInterfaces::image.

Here is the call graph for this function:

bool RasterStrategy::checkColor int  x,
int  y,
colorClass  color
[inline, protected]
 

Implemented with ColorTable interface.

Parameters:
x X-coordinate of the requested pixel.
y Y-coordinate of the requested pixel.
color The color class to match.
Returns:
True if color equals getColor(x,y).

Definition at line 105 of file RasterStrategy.h.

References getColor().

Here is the call graph for this function:

bool RasterStrategy::checkColor Vector2< int >  v,
colorClass  color
[inline, protected]
 

Implemented with ColorTable interface.

Parameters:
v The requested pixel.
color The color class to match.
Returns:
True if color equals getColor(x,y).

Definition at line 113 of file RasterStrategy.h.

References getColor(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

double RasterStrategy::theta int  dx,
int  dy
[inline, protected]
 

The theta function.

Parameters:
dx first vector of the difference
dy second vector of the difference
Returns:
a number between 0 and 360 with the same order as v.angle()

Definition at line 120 of file RasterStrategy.h.


Member Data Documentation

bool RasterStrategy::insideBall
 

True if the strategy scans over a ball.

Definition at line 49 of file RasterStrategy.h.

Referenced by RBallSpecialist2::invokeOnPreScan().

bool RasterStrategy::insideBox
 

True if the strategy scans over a box.

Definition at line 51 of file RasterStrategy.h.

Referenced by BoxSpecialist::invokeOnPreScan().

bool RasterStrategy::insideBridge
 

True if the strategy scans over a bridge beacon.

Definition at line 53 of file RasterStrategy.h.

Referenced by RBridgeSpecialist::invokeOnPreScan().

bool RasterStrategy::insidePlayer
 

True if the strategy scans over a player.

Definition at line 55 of file RasterStrategy.h.

Referenced by REnemySpecialist::invokeOnPostScan(), and REnemySpecialist::invokeOnPreScan().

bool RasterStrategy::insideField
 

True if the strategy scans over the field.

Definition at line 57 of file RasterStrategy.h.

Referenced by RFieldSpecialist::invokeOnPreScan().

bool RasterStrategy::insideLM
 

True if the strategy scans over a landmark.

Definition at line 59 of file RasterStrategy.h.

RasterImageProcessor* RasterStrategy::rip [protected]
 

The image processor interfaces.

Definition at line 77 of file RasterStrategy.h.


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:11:04 2004 for GT2004 by doxygen 1.3.6