icommand.vision
Class VisionEffect

java.lang.Object
  extended by icommand.vision.VisionEffect
All Implemented Interfaces:
javax.media.Codec, javax.media.Controls, javax.media.Effect, javax.media.PlugIn
Direct Known Subclasses:
ColorEffect, FlipEffect, MotionDetectionEffect, RegionEffect

public abstract class VisionEffect
extends java.lang.Object
implements javax.media.Effect

Abstract Effect that specific Vision Effects inherit from

Author:
Lawrie Griffiths

Field Summary
protected  javax.media.Format inputFormat
           
protected  javax.media.Format[] inputFormats
           
protected  javax.media.Format outputFormat
           
protected  javax.media.Format[] outputFormats
           
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
VisionEffect()
          Create the Effect.
 
Method Summary
 void close()
          Does nothing
 java.lang.Object getControl(java.lang.String controlType)
          Returns null
 java.lang.Object[] getControls()
          Returns null
 javax.media.Format[] getSupportedInputFormats()
          Get the supported input formats
 javax.media.Format[] getSupportedOutputFormats(javax.media.Format input)
          Get the supported output formats that matches the input format
protected  javax.media.Format matches(javax.media.Format in, javax.media.Format[] outs)
          Select the first output format that matches the input format.
 void open()
          Does nothing
 void reset()
          Does nothing
 javax.media.Format setInputFormat(javax.media.Format input)
          Set the input format.
 javax.media.Format setOutputFormat(javax.media.Format output)
          Set the output format.
protected  byte[] validateByteArraySize(javax.media.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.Codec
process
 
Methods inherited from interface javax.media.PlugIn
getName
 

Field Detail

inputFormat

protected javax.media.Format inputFormat

outputFormat

protected javax.media.Format outputFormat

inputFormats

protected javax.media.Format[] inputFormats

outputFormats

protected javax.media.Format[] outputFormats
Constructor Detail

VisionEffect

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

Method Detail

getSupportedInputFormats

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

Specified by:
getSupportedInputFormats in interface javax.media.Codec
Returns:
the supported input formats

getSupportedOutputFormats

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

Specified by:
getSupportedOutputFormats in interface javax.media.Codec
Returns:
the supported output formats

setInputFormat

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

Specified by:
setInputFormat in interface javax.media.Codec
Parameters:
input - the required input format
Returns:
the input format

setOutputFormat

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

Specified by:
setOutputFormat in interface javax.media.Codec
Parameters:
output - the output format
Returns:
the output format

open

public void open()
Does nothing

Specified by:
open in interface javax.media.PlugIn

close

public void close()
Does nothing

Specified by:
close in interface javax.media.PlugIn

reset

public void reset()
Does nothing

Specified by:
reset in interface javax.media.PlugIn

getControl

public java.lang.Object getControl(java.lang.String controlType)
Returns null

Specified by:
getControl in interface javax.media.Controls
Returns:
null

getControls

public java.lang.Object[] getControls()
Returns null

Specified by:
getControls in interface javax.media.Controls
Returns:
null

matches

protected javax.media.Format matches(javax.media.Format in,
                                     javax.media.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(javax.media.Buffer buffer,
                                       int newSize)
Validate that the Buffer conforms to the expected format, and create a new byte array if not.



Copyright © 2006. All Rights Reserved.