75 |
if (f > 1) f = 1; |
if (f > 1) f = 1; |
76 |
if (f < 0) f = 0; |
if (f < 0) f = 0; |
77 |
|
|
78 |
|
float factor = (1 - radius / (width * ripple_scale)); |
79 |
|
if (factor < 0) factor = 0; |
80 |
|
|
81 |
if (components != 2) { |
if (components != 2) { |
82 |
// Scale down to make space for the border |
// Scale down to make space for the border |
83 |
f *= (1 - radius / (width * ripple_scale)); |
f *= factor; |
84 |
if (f < 0) f = 0; |
} else { |
85 |
|
// Scale towards middle to make space for the border |
86 |
|
f = (f - .5) * factor + .5; |
87 |
} |
} |
88 |
|
|
89 |
data[i] = f * scale + bias; |
data[i] = f * scale + bias; |