Disable second 'graph' pass if nessecary (& other formatting), see #97
This commit is contained in:
48
render.c
48
render.c
@@ -639,48 +639,48 @@ void transform_fft(struct gl_data* d, void** _, void* in) {
|
||||
float wtemp, wr, wpr, wpi, wi, theta;
|
||||
float tempr, tempi;
|
||||
|
||||
// reverse-binary reindexing
|
||||
n = nn<<1;
|
||||
j=1;
|
||||
for (i=1; i<n; i+=2) {
|
||||
if (j>i) {
|
||||
/* reverse-binary reindexing */
|
||||
n = nn << 1;
|
||||
j = 1;
|
||||
for (i = 1; i < n; i += 2) {
|
||||
if (j > i) {
|
||||
swap(data[j-1], data[i-1]);
|
||||
swap(data[j], data[i]);
|
||||
}
|
||||
m = nn;
|
||||
while (m>=2 && j>m) {
|
||||
while (m >= 2 && j > m) {
|
||||
j -= m;
|
||||
m >>= 1;
|
||||
}
|
||||
j += m;
|
||||
};
|
||||
|
||||
// here begins the Danielson-Lanczos section
|
||||
mmax=2;
|
||||
while (n>mmax) {
|
||||
istep = mmax<<1;
|
||||
theta = -(2*M_PI/mmax);
|
||||
wtemp = sin(0.5*theta);
|
||||
wpr = -2.0*wtemp*wtemp;
|
||||
/* here begins the Danielson-Lanczos section */
|
||||
mmax = 2;
|
||||
while (n > mmax) {
|
||||
istep = mmax << 1;
|
||||
theta = -(2 * M_PI / mmax);
|
||||
wtemp = sin(0.5 * theta);
|
||||
wpr = -2.0 * wtemp * wtemp;
|
||||
wpi = sin(theta);
|
||||
wr = 1.0;
|
||||
wi = 0.0;
|
||||
for (m=1; m < mmax; m += 2) {
|
||||
for (i=m; i <= n; i += istep) {
|
||||
j=i+mmax;
|
||||
tempr = wr*data[j-1] - wi*data[j];
|
||||
tempi = wr * data[j] + wi*data[j-1];
|
||||
for (m = 1; m < mmax; m += 2) {
|
||||
for (i = m; i <= n; i += istep) {
|
||||
j= i + mmax;
|
||||
tempr = wr * data[j-1] - wi * data[j];
|
||||
tempi = wr * data[j] + wi * data[j-1];
|
||||
|
||||
data[j-1] = data[i-1] - tempr;
|
||||
data[j] = data[i] - tempi;
|
||||
data[j] = data[i] - tempi;
|
||||
data[i-1] += tempr;
|
||||
data[i] += tempi;
|
||||
data[i] += tempi;
|
||||
}
|
||||
wtemp=wr;
|
||||
wr += wr*wpr - wi*wpi;
|
||||
wi += wi*wpr + wtemp*wpi;
|
||||
wtemp = wr;
|
||||
wr += wr * wpr - wi * wpi;
|
||||
wi += wi * wpr + wtemp * wpi;
|
||||
}
|
||||
mmax=istep;
|
||||
mmax = istep;
|
||||
}
|
||||
|
||||
/* abs and log scale */
|
||||
|
||||
@@ -9,6 +9,10 @@ out vec4 fragment; /* output */
|
||||
#include "@graph.glsl"
|
||||
#include ":graph.glsl"
|
||||
|
||||
#if DRAW_OUTLINE == 0 && DRAW_HIGHLIGHT == 0
|
||||
#error __disablestage
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user