Revision 5ec42229
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java | ||
---|---|---|
34 | 34 |
{ |
35 | 35 |
private static final int MAX_RADIUS = 50; |
36 | 36 |
|
37 |
private Data2D mBlurHaloAndRadius; |
|
37 |
private final Data2D mBlurHaloAndRadius;
|
|
38 | 38 |
|
39 | 39 |
private static final float[] GAUSSIAN = // G(0.00), G(0.03), G(0.06), ..., G(3.00), 0 |
40 | 40 |
{ // where G(x)= (1/(sqrt(2*PI))) * e^(-(x^2)/2). The last 0 terminates. |
... | ... | |
56 | 56 |
// i.e. k(i)=floor((i+3)/2). (the 'i' in k(i) means 'blur taking into account the present pixel and 'i' pixels |
57 | 57 |
// in all 4 directions) |
58 | 58 |
// We need room for MAX_BLUR of them, and sum(i=0...N, floor((i+3)/2)) = N + floor(N*N/4) |
59 |
private static float[] weightsCache = new float[MAX_RADIUS + MAX_RADIUS*MAX_RADIUS/4]; |
|
60 |
private static float[] offsetsCache = new float[MAX_RADIUS + MAX_RADIUS*MAX_RADIUS/4]; |
|
61 |
private static float[] mWeights = new float[MAX_RADIUS]; |
|
62 |
private static float[] mOffsets = new float[MAX_RADIUS]; |
|
59 |
private static final float[] weightsCache = new float[MAX_RADIUS + MAX_RADIUS*MAX_RADIUS/4];
|
|
60 |
private static final float[] offsetsCache = new float[MAX_RADIUS + MAX_RADIUS*MAX_RADIUS/4];
|
|
61 |
private static final float[] mWeights = new float[MAX_RADIUS];
|
|
62 |
private static final float[] mOffsets = new float[MAX_RADIUS];
|
|
63 | 63 |
|
64 | 64 |
private static DistortedProgram mProgram1, mProgram2; |
65 | 65 |
private static int mIndex1, mIndex2; |
Also available in: Unified diff
Workaround for the fact that one some devices (for example the LG K30's V@415 driver on the Adreno 308) the Glow halo wasn't visible.