Project

General

Profile

« Previous | Next » 

Revision faa3ff56

Added by Leszek Koltunski almost 7 years ago

Javadoc.

View differences:

src/main/java/org/distorted/library/effect/FragmentEffectBrightness.java
24 24
import org.distorted.library.type.Static4D;
25 25

  
26 26
///////////////////////////////////////////////////////////////////////////////////////////////////
27

  
27
/**
28
 * Make a certain Region change its brightness level.
29
 */
28 30
public class FragmentEffectBrightness extends FragmentEffect
29 31
  {
30 32
  private Data1D mBrightness;
31 33
  private Data4D mRegion;
32 34

  
35

  
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37
/**
38
 * Only for use by the library itself.
39
 *
40
 * @y.exclude
41
 */
42
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
43
    {
44
    mRegion.get(uniforms,index+4,currentDuration,step);
45
    return mBrightness.get(uniforms,index,currentDuration,step);
46
    }
47

  
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49
// PUBLIC API
33 50
///////////////////////////////////////////////////////////////////////////////////////////////////
34 51
/**
35 52
 * Makes a certain sub-region of the Object smoothly change its brightness level.
......
59 76
    }
60 77

  
61 78
///////////////////////////////////////////////////////////////////////////////////////////////////
62

  
63
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
64
    {
65
    mRegion.get(uniforms,index+4,currentDuration,step);
66
    return mBrightness.get(uniforms,index,currentDuration,step);
67
    }
68

  
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70

  
79
/**
80
 * Have to call this before the shaders get compiled (i.e before Distorted.onCreate()) for the Effect to work.
81
 */
71 82
  public static void enable()
72 83
    {
73 84
    addEffect( EffectName.BRIGHTNESS,EffectName.SMOOTH_BRIGHTNESS,

Also available in: Unified diff