| 1 | #cxx . . $ `<file>/src/filter/nosync0r/nosync0r.cpp`/include "frei0r.hpp"cxx . . $ `<file>/include/frei0r.hpp`/ |
| 2 | |
| 3 | #include <algorithm> |
| 4 | #include <cmath> |
| 5 | |
| 6 | class nosync0rcxx . . $ nosync0r# : public frei0rcxx . . $ frei0r/::filtercxx . . $ frei0r/filter# |
| 7 | { |
| 8 | public: |
| 9 | nosync0rcxx . . $ nosync0r#nosync0r(b4d55b1286ff73e8).(unsigned int width, unsigned int height) |
| 10 | { |
| 11 | hsynccxx . . $ nosync0r#hsync. = 0.0; |
| 12 | register_paramcxx . . $ frei0r/fx#register_param(acfd1d4411be0164).(hsynccxx . . $ nosync0r#hsync.,"HSync"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,"the hsync offset"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 13 | vsynccxx . . $ nosync0r#vsync. = 0.0; |
| 14 | register_paramcxx . . $ frei0r/fx#register_param(acfd1d4411be0164).(vsynccxx . . $ nosync0r#vsync.,"VSync"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,"the vsync offset"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 15 | } |
| 16 | |
| 17 | virtual void updatecxx . . $ nosync0r#update(da7b4a17ceb4e697).(double time, |
| 18 | uint32_t* out, |
| 19 | const uint32_t* in) |
| 20 | { |
| 21 | if (hsynccxx . . $ nosync0r#hsync. == 0.0 && vsynccxx . . $ nosync0r#vsync. == 0.0) { |
| 22 | std::copycxx . . $ std/copy(88304b602929f6f4).(in, in+widthcxx . . $ frei0r/fx#width.*heightcxx . . $ frei0r/fx#height., out); |
| 23 | } else if (vsynccxx . . $ nosync0r#vsync. == 0.0) { |
| 24 | unsigned int |
| 25 | first_line=static_cast<unsigned int>(heightcxx . . $ frei0r/fx#height.*std::fmod(std::fabs(hsynccxx . . $ nosync0r#hsync.),1.0)); |
| 26 | |
| 27 | std::copycxx . . $ std/copy(88304b602929f6f4).(in+widthcxx . . $ frei0r/fx#width.*first_line, in+widthcxx . . $ frei0r/fx#width.*heightcxx . . $ frei0r/fx#height., out); |
| 28 | std::copycxx . . $ std/copy(88304b602929f6f4).(in, in+widthcxx . . $ frei0r/fx#width.*first_line, out+widthcxx . . $ frei0r/fx#width.*(heightcxx . . $ frei0r/fx#height.-first_line)); |
| 29 | } else { |
| 30 | unsigned int hoffset=static_cast<unsigned int>(heightcxx . . $ frei0r/fx#height.*std::fmod(std::fabs(hsynccxx . . $ nosync0r#hsync.),1.0)); |
| 31 | unsigned int voffset=static_cast<unsigned int>(widthcxx . . $ frei0r/fx#width.*std::fmod(std::fabs(vsynccxx . . $ nosync0r#vsync.),1.0)); |
| 32 | for (unsigned int src_line = 0; src_line < heightcxx . . $ frei0r/fx#height.; src_line++) { |
| 33 | unsigned int dst_line = (src_line + hoffset) % heightcxx . . $ frei0r/fx#height.; |
| 34 | const uint32_t* src_pix = in + (widthcxx . . $ frei0r/fx#width. * src_line); |
| 35 | uint32_t* dst_pix = out + (widthcxx . . $ frei0r/fx#width. * dst_line); |
| 36 | std::copycxx . . $ std/copy(88304b602929f6f4).(src_pix, src_pix + widthcxx . . $ frei0r/fx#width. - voffset, dst_pix + voffset); |
| 37 | std::copycxx . . $ std/copy(88304b602929f6f4).(src_pix + widthcxx . . $ frei0r/fx#width. - voffset, src_pix + widthcxx . . $ frei0r/fx#width., dst_pix); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | private: |
| 43 | double hsynccxx . . $ nosync0r#hsync.; |
| 44 | double vsynccxx . . $ nosync0r#vsync.; |
| 45 | }; |
| 46 | |
| 47 | |
| 48 | frei0rcxx . . $ frei0r/::constructcxx . . $ frei0r/construct#<nosync0rcxx . . $ nosync0r#> plugincxx . . $ plugin.("nosync0r"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 49 | "broken tv"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 50 | "Martin Bayer"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 51 | 0,2); |
| 52 |