This repository has been archived on 2021-03-01. You can view files and clone it, but cannot push or open issues or pull requests.
prpa/src/filterSample/reverse.cc

21 lines
351 B
C++

#include "reverse.hh"
#include "opencv2/opencv.hpp"
void* Reverse::operator()(void* para)
{
cv::Mat* mat = (cv::Mat*)para;
if (mat == nullptr)
return nullptr;
for (auto it = mat->begin<cv::Vec3b>(); it != mat->end<cv::Vec3b>(); ++it)
{
(*it)[0] = ~(*it)[0];
(*it)[1] = ~(*it)[1];
(*it)[2] = ~(*it)[2];
}
return mat;
}