[cscore] CvSink: Allow specifying output PixelFormat (#5943)

This commit is contained in:
Joseph Farkas
2023-11-22 14:35:42 -05:00
committed by GitHub
parent 25b7dca46b
commit 437cc91af5
10 changed files with 70 additions and 35 deletions

View File

@@ -709,8 +709,9 @@ Image* Frame::GetImageImpl(int width, int height,
return ConvertImpl(cur, pixelFormat, requiredJpegQuality, defaultJpegQuality);
}
bool Frame::GetCv(cv::Mat& image, int width, int height) {
Image* rawImage = GetImage(width, height, VideoMode::kBGR);
bool Frame::GetCv(cv::Mat& image, int width, int height,
VideoMode::PixelFormat pixelFormat) {
Image* rawImage = GetImage(width, height, pixelFormat);
if (!rawImage) {
return false;
}