sk.robotics.rlcs.agents.image
Class ImageFilterAgent

java.lang.Object
  extended by sk.robotics.rlcs.agentspace.Agent
      extended by sk.robotics.rlcs.agents.image.ImageFilterAgent
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ConvolutionAgent, GrayScaleAgent, InvertAgent, SobelAgent, TransformAgent, TresholdAgent, ViewPosAgent

public class ImageFilterAgent
extends Agent

Base class for image processing agents.

This agent alone (without deriving from it) can be used for converting images to different size and/or type, by setting non-zero width/height (to change size), outputImageType other than SRC (to change type), together with copyBeforeFilter. Note that changing the image size does not scale the image, you have to use TransformAgent to do that.

It there is already an image in the target block, and is compatible (is of corrent size and type), this agent modifies that image (synchronizing on it), rather than creating a new one, to save memory.


Nested Class Summary
static class ImageFilterAgent.Cfg
           
 
Nested classes/interfaces inherited from class sk.robotics.rlcs.agentspace.Agent
Agent.AgentThread, Agent.Hidden, Agent.ThreadCreator, Agent.WorkerThreadGroup
 
Field Summary
 
Fields inherited from class sk.robotics.rlcs.agentspace.Agent
logTimeFormat, space, thread, workerThreads
 
Constructor Summary
ImageFilterAgent(ImageFilterAgent.Cfg cfg)
           
 
Method Summary
protected  void filter(java.awt.image.BufferedImage target)
           
protected  void filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage target)
          Filtering method.
protected  void senseSelectAct()
           
 
Methods inherited from class sk.robotics.rlcs.agentspace.Agent
cleanup, exit, getConfig, getIdleTime, getWorkerThreadGroup, isAlive, kill, log, log, log, log, log, run, senseSelectAct, setLogLevel, setPeriodicTrigger, setPeriodicTrigger, sleep, start, startup, toString, trigger, trigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageFilterAgent

public ImageFilterAgent(ImageFilterAgent.Cfg cfg)
Method Detail

filter

protected void filter(java.awt.image.BufferedImage source,
                      java.awt.image.BufferedImage target)
Filtering method. One of these two should be overriden. Overriding the second overload makes sense if copyBeforeFilter is set.


filter

protected void filter(java.awt.image.BufferedImage target)

senseSelectAct

protected void senseSelectAct()
Overrides:
senseSelectAct in class Agent