Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "facefilter.h"
- #include <QVideoFrame>
- QVideoFilterRunnable *FaceFilter::createFilterRunnable() {
- return new Runnable(this);
- }
- QVideoFrame FaceFilter::Runnable::run(QVideoFrame *input, const QVideoSurfaceFormat &,
- QVideoFilterRunnable::RunFlags )
- {
- if( input->isValid() && input->map(QAbstractVideoBuffer::ReadWrite))
- {
- auto ptr = input->bits();
- for(auto i= 0; i <input->width() * input->height() * 4; i++)
- {
- if(i%4 == 2)
- ptr[i] = 0 ;
- }
- input->unmap();
- }
- return *input;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement