30 |
FPARAM(eps, .25); |
FPARAM(eps, .25); |
31 |
FPARAM(invert, 0); |
FPARAM(invert, 0); |
32 |
FPARAM(quantize, 255); |
FPARAM(quantize, 255); |
33 |
|
FPARAM(angle, 0); |
34 |
int angles = (int)params->getFloat("angles", 0); |
int angles = (int)params->getFloat("angles", 0); |
35 |
|
|
36 |
// Note: radius is specified in texels |
// Note: radius is specified in texels |
95 |
|
|
96 |
for (int comp = 0; comp < angles && comp < components; comp++) { |
for (int comp = 0; comp < angles && comp < components; comp++) { |
97 |
|
|
98 |
float dx = cos(comp * M_PI / angles); |
float dx = cos(comp * M_PI / angles + angle * (M_PI / 180)); |
99 |
float dy = sin(comp * M_PI / angles); |
float dy = sin(comp * M_PI / angles + angle * (M_PI / 180)); |
100 |
|
|
101 |
ind = 0; |
ind = 0; |
102 |
for (j = 0, y = 0; j < height; j++, y += ystep) { |
for (j = 0, y = 0; j < height; j++, y += ystep) { |
106 |
|
|
107 |
float maxh = -1E+10; |
float maxh = -1E+10; |
108 |
for (float r = -radius; r <= radius; r += eps) { |
for (float r = -radius; r <= radius; r += eps) { |
109 |
float h = filter(data + 3, width, height, components, |
float h = filter(data + 3, width, height, 4, |
110 |
i + dx * r, j + dy * r); |
i + dx * r, j + dy * r); |
111 |
|
|
112 |
h += sqrt(radius * radius - r * r) * m; |
h += sqrt(radius * radius - r * r) * m; |