FileDocCategorySizeDatePackage
SinWaveFilter.javaAPI DocAndroid 5.1 API1816Thu Mar 12 22:22:30 GMT 2015android.filterpacks.numeric

SinWaveFilter

public class SinWaveFilter extends android.filterfw.core.Filter
hide

Fields Summary
private float
mStepSize
private float
mValue
private android.filterfw.core.FrameFormat
mOutputFormat
Constructors Summary
public SinWaveFilter(String name)


       
        super(name);
    
Methods Summary
public voidopen(android.filterfw.core.FilterContext env)

        mValue = 0.0f;
    
public voidprocess(android.filterfw.core.FilterContext env)

        Frame output = env.getFrameManager().newFrame(mOutputFormat);
        output.setObjectValue(((float)Math.sin(mValue) + 1.0f) / 2.0f);
        pushOutput("value", output);
        mValue += mStepSize;
        output.release();
    
public voidsetupPorts()

        mOutputFormat = ObjectFormat.fromClass(Float.class, FrameFormat.TARGET_SIMPLE);
        addOutputPort("value", mOutputFormat);