josx.vision
Class VisionEffect

java.lang.Object
  extended byjosx.vision.VisionEffect
Direct Known Subclasses:
ColorEffect, FlipEffect, MotionDetectionEffect, RegionEffect

public abstract class VisionEffect
extends Object

Abstract Effect that specific Vision Effects inherit from


Field Summary
protected  Format inputFormat
           
protected  Format[] inputFormats
           
protected  Format outputFormat
           
protected  Format[] outputFormats
           
 
Constructor Summary
VisionEffect()
          Create the Effect.
 
Method Summary
 void close()
          Does nothing
 Object getControl(String controlType)
          Returns null
 Object[] getControls()
          Returns null
 Format[] getSupportedInputFormats()
          Get the supported input formats
 Format[] getSupportedOutputFormats(Format input)
          Get the supported output formats that matches the input format
protected  Format matches(Format in, Format[] outs)
          Select the first output format that matches the input format.
 void open()
          Does nothing
 void reset()
          Does nothing
 Format setInputFormat(Format input)
          Set the input format.
 Format setOutputFormat(Format output)
          Set the output format.
protected  byte[] validateByteArraySize(Buffer buffer, int newSize)
          Validate that the Buffer conforms to the expected format, and create a new byte array if not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Field Detail

inputFormat

protected Format inputFormat

outputFormat

protected Format outputFormat

inputFormats

protected Format[] inputFormats

outputFormats

protected Format[] outputFormats
Constructor Detail

VisionEffect

public VisionEffect()
Create the Effect. Only 24-bit color is supported.

Method Detail

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Get the supported input formats

Returns:
the supported input formats

getSupportedOutputFormats

public Format[] getSupportedOutputFormats(Format input)
Get the supported output formats that matches the input format

Returns:
the supported output formats

setInputFormat

public Format setInputFormat(Format input)
Set the input format.

Parameters:
input - the required input format
Returns:
the input format

setOutputFormat

public Format setOutputFormat(Format output)
Set the output format. Ensures size and line stride are in the expected 24-bit 3-byte stride format.

Parameters:
output - the output format
Returns:
the output format

open

public void open()
Does nothing


close

public void close()
Does nothing


reset

public void reset()
Does nothing


getControl

public Object getControl(String controlType)
Returns null

Returns:
null

getControls

public Object[] getControls()
Returns null

Returns:
null

matches

protected Format matches(Format in,
                         Format[] outs)
Select the first output format that matches the input format.

Returns:
first matching output format ot null if none match

validateByteArraySize

protected byte[] validateByteArraySize(Buffer buffer,
                                       int newSize)
Validate that the Buffer conforms to the expected format, and create a new byte array if not.