jAER project on SourceForge

net.sf.jaer.event
Class OrientationEvent

java.lang.Object
  extended by net.sf.jaer.event.BasicEvent
      extended by net.sf.jaer.event.TypedEvent
          extended by net.sf.jaer.event.PolarityEvent
              extended by net.sf.jaer.event.OrientationEvent
All Implemented Interfaces:
EventInterface<BasicEvent>
Direct Known Subclasses:
MotionOrientationEvent

public class OrientationEvent
extends PolarityEvent

Represents an event with an orientation that can take 4 values.

Orientation type output takes values 0-3; 0 is a horizontal edge (0 deg), 1 is an edge tilted up and to right (rotated CCW 45 deg), 2 is a vertical edge (rotated 90 deg), 3 is tilted up and to left (rotated 135 deg from horizontal edge).

Author:
tobi

Nested Class Summary
static class OrientationEvent.UnitVector
          represents a unit orientation.
 
Nested classes/interfaces inherited from class net.sf.jaer.event.PolarityEvent
PolarityEvent.Polarity
 
Field Summary
 boolean hasOrientation
          Defaults to true; set to false to indicate unknown orientation.
 byte orientation
          The orientation value.
static OrientationEvent.UnitVector[] unitVectors
          An array of 4 nearest-neighbor unit vectors going CCW from horizontal.
 
Fields inherited from class net.sf.jaer.event.PolarityEvent
polarity
 
Fields inherited from class net.sf.jaer.event.TypedEvent
type
 
Fields inherited from class net.sf.jaer.event.BasicEvent
timestamp, x, y
 
Constructor Summary
OrientationEvent()
          Creates a new instance of OrientationEvent
 
Method Summary
 void copyFrom(BasicEvent src)
          copies fields from source event src to this event
 int getNumCellTypes()
          Returns the number of types this type of event has, e.g.
 int getType()
          Orientation type output takes values 0-3; 0 is a horizontal edge (0 deg), 1 is an edge tilted up and to right (rotated CCW 45 deg), 2 is a vertical edge (rotated 90 deg), 3 is tilted up and to left (rotated 135 deg from horizontal edge).
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jaer.event.BasicEvent
getTimestamp, getX, getY, setTimestamp, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

orientation

public byte orientation
The orientation value.


hasOrientation

public boolean hasOrientation
Defaults to true; set to false to indicate unknown orientation.


unitVectors

public static final OrientationEvent.UnitVector[] unitVectors
An array of 4 nearest-neighbor unit vectors going CCW from horizontal.

these unitDirs are indexed by inputType, then by (inputType+4)%4 (opposite direction) when input type is orientation, then input type 0 is 0 deg horiz edge, so first index could be to down, second to up so list should start with down

Constructor Detail

OrientationEvent

public OrientationEvent()
Creates a new instance of OrientationEvent

Method Detail

getType

public int getType()
Orientation type output takes values 0-3; 0 is a horizontal edge (0 deg), 1 is an edge tilted up and to right (rotated CCW 45 deg), 2 is a vertical edge (rotated 90 deg), 3 is tilted up and to left (rotated 135 deg from horizontal edge).

Specified by:
getType in interface EventInterface<BasicEvent>
Overrides:
getType in class PolarityEvent
Returns:
the type
See Also:
hasOrientation

toString

public java.lang.String toString()
Overrides:
toString in class PolarityEvent

getNumCellTypes

public int getNumCellTypes()
Description copied from interface: EventInterface
Returns the number of types this type of event has, e.g. 2 for a PolarityEvent or 4 for an OrientationEvent

Specified by:
getNumCellTypes in interface EventInterface<BasicEvent>
Overrides:
getNumCellTypes in class PolarityEvent
Returns:
number of types

copyFrom

public void copyFrom(BasicEvent src)
copies fields from source event src to this event

Specified by:
copyFrom in interface EventInterface<BasicEvent>
Overrides:
copyFrom in class PolarityEvent
Parameters:
src - the event to copy from

jAER project on SourceForge