FileDocCategorySizeDatePackage
Mandelbrot.javaAPI DocAndroid 5.1 API2749Thu Mar 12 22:22:54 GMT 2015com.android.rs.image2

Mandelbrot

public class Mandelbrot extends TestBase

Fields Summary
private ScriptC_mandelbrot
mScript
Constructors Summary
Methods Summary
public voidcreateTest(android.content.res.Resources res)

        int width = mOutPixelsAllocation.getType().getX();
        int height = mOutPixelsAllocation.getType().getY();

        mScript = new ScriptC_mandelbrot(mRS);
        mScript.set_gDimX(width);
        mScript.set_gDimY(height);
        mScript.set_gMaxIteration(50);
    
public voidonBar1Changed(int progress)

        int iters = progress * 3 + 50;
        mScript.set_gMaxIteration(iters);
    
public booleanonBar1Setup(android.widget.SeekBar b, android.widget.TextView t)

        t.setText("Iterations");
        b.setProgress(0);
        return true;
    
public voidonBar2Changed(int progress)

        float scaleFactor = mScript.get_scaleFactor();
        // allow viewport to be moved by 2x scale factor
        float lowerBoundX = -2.f + ((progress / scaleFactor) / 50.f);
        mScript.set_lowerBoundX(lowerBoundX);
    
public booleanonBar2Setup(android.widget.SeekBar b, android.widget.TextView t)

        t.setText("Lower Bound: X");
        b.setProgress(0);
        return true;
    
public voidonBar3Changed(int progress)

        float scaleFactor = mScript.get_scaleFactor();
        // allow viewport to be moved by 2x scale factor
        float lowerBoundY = -2.f + ((progress / scaleFactor) / 50.f);
        mScript.set_lowerBoundY(lowerBoundY);
    
public booleanonBar3Setup(android.widget.SeekBar b, android.widget.TextView t)

        t.setText("Lower Bound: Y");
        b.setProgress(0);
        return true;
    
public voidonBar4Changed(int progress)

        float scaleFactor = 4.f - (3.96f * (progress / 100.f));
        mScript.set_scaleFactor(scaleFactor);
    
public booleanonBar4Setup(android.widget.SeekBar b, android.widget.TextView t)

        t.setText("Scale Factor");
        b.setProgress(0);
        return true;
    
public voidrunTest()

        mScript.forEach_root(mOutPixelsAllocation);
        mRS.finish();