Debian Codegraph @

foned/MovieArea.cpp

raw
1 /* MovieArea.cpp
2 *
3 * Copyright (C) 2011-2020,2022 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "MovieArea.h"
20
21 Thing_implement (MovieArea, FunctionArea, 0);
22
23 void structMovieArea :: v_drawInside () {
24 Graphics_setWindow (our graphics(), our startWindow(), our endWindow(), 0.0, 1.0);
25 const integer firstFrame = Melder_clippedLeft (1_integer, Sampled_xToNearestIndex (our movie(), our startWindow()));
26 const integer lastFrame = Melder_clippedRight (Sampled_xToNearestIndex (our movie(), our endWindow()), our movie() -> nx);
27 for (integer iframe = firstFrame; iframe <= lastFrame; iframe ++) {
28 const double time = Sampled_indexToX (our movie(), iframe);
29 const double timeLeft = Melder_clippedLeft (our startWindow(), time - 0.5 * movie() -> dx);
30 const double timeRight = Melder_clippedRight (time + 0.5 * our movie() -> dx, our endWindow());
31 Movie_paintOneImageInside (our movie(), our graphics(), iframe, timeLeft, timeRight, 0.0, 1.0);
32 }
33 }
34
35 /* End of file MovieArea.cpp */