MCPcopy Create free account
hub / github.com/audacity/audacity / ValueOfPixel

Function ValueOfPixel

src/TrackArt.cpp:122–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122float ValueOfPixel(int yy, int height, bool offset,
123 bool dB, double dBRange, float zoomMin, float zoomMax)
124{
125 wxASSERT(height > 0);
126 // Map 0 to max and height - 1 (not height) to min
127 float v =
128 height == 1 ? (zoomMin + zoomMax) / 2 :
129 zoomMax - (yy / (float)(height - 1)) * (zoomMax - zoomMin);
130 if (offset) {
131 if (v > 0.0)
132 v += .5;
133 else
134 v -= .5;
135 }
136
137 if (dB)
138 v = FromDB(v, dBRange);
139
140 return v;
141}
142
143void TrackArt::DrawNegativeOffsetTrackArrows(
144 TrackPanelDrawingContext &context, const wxRect &rect )

Callers 4

ValueOfPixelMethod · 0.85
HandleMouseButtonDownMethod · 0.85
MoveDragPointMethod · 0.85

Calls 1

FromDBFunction · 0.85

Tested by

no test coverage detected