| 75 | } |
| 76 | |
| 77 | void FilterViz::DrawModule() |
| 78 | { |
| 79 | if (Minimized() || IsVisible() == false) |
| 80 | return; |
| 81 | |
| 82 | for (int i = 0; i < mFilters.size(); ++i) |
| 83 | mFilters[i]->Draw(); |
| 84 | |
| 85 | float w, h; |
| 86 | GetDimensions(w, h); |
| 87 | |
| 88 | ofPushStyle(); |
| 89 | { |
| 90 | ofSetColor(255, 255, 255); |
| 91 | ofPoint lastPoint(0, 0); |
| 92 | for (int i = 0; i < FILTER_VIZ_BINS / 2 - 1; ++i) |
| 93 | { |
| 94 | float a = float(i) / (FILTER_VIZ_BINS / 2 - 1); |
| 95 | a = sqrtf(a); |
| 96 | ofPoint point(a * w, h - (mFFTOutReal[i] / 12 * h)); |
| 97 | if (i != 0) |
| 98 | ofLine(lastPoint, point); |
| 99 | lastPoint = point; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | { |
| 104 | ofSetColor(255, 0, 255); |
| 105 | ofPoint lastPoint(0, 0); |
| 106 | for (int i = 0; i < FILTER_VIZ_BINS / 2 - 1; ++i) |
| 107 | { |
| 108 | float a = float(i) / (FILTER_VIZ_BINS / 2 - 1); |
| 109 | a = sqrtf(a); |
| 110 | ofPoint point(a * w, h / 2 - (mFFTOutImag[i] / (PI * 2) * h)); |
| 111 | if (i != 0) |
| 112 | ofLine(lastPoint, point); |
| 113 | lastPoint = point; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | ofPopStyle(); |
| 118 | } |
| 119 | |
| 120 | void FilterViz::GraphFilter() |
| 121 | { |
nothing calls this directly
no test coverage detected