Project

General

Profile

« Previous | Next » 

Revision 59759251

Added by Leszek Koltunski almost 8 years ago

Major push towards simplifying DistortedObject's public API.
All Fragment effects are using the new API - the 'DataND' marker interfaces.

View differences:

src/main/java/org/distorted/examples/macroblock/MacroblockRenderer.java
47 47
{
48 48
    private GLSurfaceView mView;
49 49
    private DistortedBitmap macroblock;
50
    private Static4D Region;
50
    private Static4D macRegion, alphaRegion;
51 51
    private int bmpHeight, bmpWidth;
52
    private Static2D traP, macP;
53
    
52

  
54 53
///////////////////////////////////////////////////////////////////////////////////////////////////
55 54

  
56 55
    public MacroblockRenderer(GLSurfaceView v) 
57 56
      {   
58 57
      mView = v;
59 58
      
60
      Region = new Static4D(0,0,100,100);
61
      macP   = new Static2D(530,200);
62
      traP   = new Static2D(230,200);
59
        macRegion = new Static4D( 530, 200,100,100);
60
      alphaRegion = new Static4D( 230, 200,100,100);
63 61
      }
64 62

  
65 63
///////////////////////////////////////////////////////////////////////////////////////////////////
......
95 93
      bmpHeight = bitmap.getHeight();
96 94
      bmpWidth  = bitmap.getWidth();
97 95
      
98
      macroblock = new DistortedBitmap(bitmap, 30);    
99
      macroblock.macroblock(  30, Region, macP, 3000, 0.0f);
100
      macroblock.alpha     (0.0f, Region, traP, 3000, 0.0f);
96
      macroblock = new DistortedBitmap(bitmap, 30);
97

  
98
      Dynamic1D macroblockDyn = new Dynamic1D();
99
      macroblockDyn.setDuration(3000);
100
      macroblockDyn.setCount(0);
101
      macroblockDyn.add(new Static1D( 1));
102
      macroblockDyn.add(new Static1D(30));
103

  
104
      macroblock.macroblock(macroblockDyn, macRegion);
105

  
106
      Dynamic1D alphaDyn = new Dynamic1D();
107
      alphaDyn.setDuration(3000);
108
      alphaDyn.setCount(0);
109
      alphaDyn.add(new Static1D(1));
110
      alphaDyn.add(new Static1D(0));
111

  
112
      macroblock.alpha( alphaDyn, alphaRegion, false );
101 113
      
102 114
      try
103 115
        {

Also available in: Unified diff