diff --git a/include/grabthecam/pixelformatsinfo.hpp b/include/grabthecam/pixelformatsinfo.hpp index 4663aec..1bdac59 100644 --- a/include/grabthecam/pixelformatsinfo.hpp +++ b/include/grabthecam/pixelformatsinfo.hpp @@ -2,12 +2,12 @@ #include "grabthecam/frameconverters/anyformat2bgrconverter.hpp" #include "grabthecam/frameconverters/bayer2bgrconverter.hpp" -#include "grabthecam/frameconverters/yuv2bgrconverter.hpp" #include "grabthecam/frameconverters/packedformats2rgbconverter.hpp" +#include "grabthecam/frameconverters/yuv2bgrconverter.hpp" #include "opencv2/imgproc.hpp" #include -#include #include +#include namespace grabthecam { @@ -33,16 +33,26 @@ static std::map()>> {V4L2_PIX_FMT_RGB24, [] { return std::make_shared(cv::COLOR_RGB2BGR, CV_8UC3); }}, {V4L2_PIX_FMT_RGBA32, [] { return std::make_shared(cv::COLOR_RGBA2BGR, CV_8UC4); }}, {V4L2_PIX_FMT_ABGR32, [] { return std::make_shared(cv::COLOR_BGRA2BGR, CV_8UC4); }}, - {V4L2_PIX_FMT_RGB332, [] { return std::make_shared(grabthecam::PACKED_RGB332, CV_8UC1); }}, - {V4L2_PIX_FMT_RGB565, [] { return std::make_shared(grabthecam::PACKED_RGB565, CV_16UC1); }}, - {V4L2_PIX_FMT_ARGB444, [] { return std::make_shared(grabthecam::PACKED_ARGB444, CV_16UC1); }}, - {V4L2_PIX_FMT_ABGR444, [] { return std::make_shared(grabthecam::PACKED_ABGR444, CV_16UC1); }}, - {V4L2_PIX_FMT_RGBA444, [] { return std::make_shared(grabthecam::PACKED_RGBA444, CV_16UC1); }}, - {V4L2_PIX_FMT_BGRA444, [] { return std::make_shared(grabthecam::PACKED_BGRA444, CV_16UC1); }}, - {V4L2_PIX_FMT_ARGB555, [] { return std::make_shared(grabthecam::PACKED_ARGB555, CV_16UC1); }}, - {V4L2_PIX_FMT_ABGR555, [] { return std::make_shared(grabthecam::PACKED_ABGR555, CV_16UC1); }}, - {V4L2_PIX_FMT_RGBA555, [] { return std::make_shared(grabthecam::PACKED_RGBA555, CV_16UC1); }}, - {V4L2_PIX_FMT_BGRA555, [] { return std::make_shared(grabthecam::PACKED_BGRA555, CV_16UC1); }}, + {V4L2_PIX_FMT_RGB332, + [] { return std::make_shared(grabthecam::PACKED_RGB332, CV_8UC1); }}, + {V4L2_PIX_FMT_RGB565, + [] { return std::make_shared(grabthecam::PACKED_RGB565, CV_16UC1); }}, + {V4L2_PIX_FMT_ARGB444, + [] { return std::make_shared(grabthecam::PACKED_ARGB444, CV_16UC1); }}, + {V4L2_PIX_FMT_ABGR444, + [] { return std::make_shared(grabthecam::PACKED_ABGR444, CV_16UC1); }}, + {V4L2_PIX_FMT_RGBA444, + [] { return std::make_shared(grabthecam::PACKED_RGBA444, CV_16UC1); }}, + {V4L2_PIX_FMT_BGRA444, + [] { return std::make_shared(grabthecam::PACKED_BGRA444, CV_16UC1); }}, + {V4L2_PIX_FMT_ARGB555, + [] { return std::make_shared(grabthecam::PACKED_ARGB555, CV_16UC1); }}, + {V4L2_PIX_FMT_ABGR555, + [] { return std::make_shared(grabthecam::PACKED_ABGR555, CV_16UC1); }}, + {V4L2_PIX_FMT_RGBA555, + [] { return std::make_shared(grabthecam::PACKED_RGBA555, CV_16UC1); }}, + {V4L2_PIX_FMT_BGRA555, + [] { return std::make_shared(grabthecam::PACKED_BGRA555, CV_16UC1); }}, {V4L2_PIX_FMT_YUYV, [] { return std::make_shared(cv::COLOR_YUV2BGR_YUYV); }}, {V4L2_PIX_FMT_UYVY, [] { return std::make_shared(cv::COLOR_YUV2BGR_UYVY); }}, {V4L2_PIX_FMT_YVYU, [] { return std::make_shared(cv::COLOR_YUV2BGR_YVYU); }}, @@ -50,11 +60,14 @@ static std::map()>> {V4L2_PIX_FMT_NV21, [] { return std::make_shared(cv::COLOR_YUV2BGR_NV21, CV_8UC1); }}, {V4L2_PIX_FMT_YVU420, [] { return std::make_shared(cv::COLOR_YUV2BGR_YV12, CV_8UC1); }}, {V4L2_PIX_FMT_YUV420, [] { return std::make_shared(cv::COLOR_YUV2BGR_I420, CV_8UC1); }}, - {V4L2_PIX_FMT_SBGGR8, [] { return std::make_shared(cv::COLOR_BayerBGGR2BGR_EA, CV_8UC1, CV_8UC3); }}, - {V4L2_PIX_FMT_SGBRG8, [] { return std::make_shared(cv::COLOR_BayerGBRG2BGR_EA, CV_8UC1, CV_8UC3); }}, - {V4L2_PIX_FMT_SRGGB16, [] { return std::make_shared(cv::COLOR_BayerRGGB2BGR_EA, CV_16UC1, CV_16UC3); }}, - {V4L2_PIX_FMT_SRGGB8, [] { return std::make_shared(cv::COLOR_BayerRGGB2BGR_EA, CV_8UC1, CV_8UC3); }}, - {V4L2_PIX_FMT_SRGGB10, [] { return std::make_shared(cv::COLOR_BayerRGGB2BGR_EA, CV_16UC1, CV_8UC3); }}, - {V4L2_PIX_FMT_SRGGB12, [] { return std::make_shared(cv::COLOR_BayerRGGB2BGR_EA, CV_16UC1, CV_8UC3); }}}; + {V4L2_PIX_FMT_SBGGR8, [] { return std::make_shared(cv::COLOR_BayerBG2BGR, CV_8UC1, CV_8UC3); }}, + {V4L2_PIX_FMT_SGBRG8, [] { return std::make_shared(cv::COLOR_BayerGB2BGR, CV_8UC1, CV_8UC3); }}, + {V4L2_PIX_FMT_SRGGB16, + [] { return std::make_shared(cv::COLOR_BayerRG2BGR, CV_16UC1, CV_16UC3); }}, + {V4L2_PIX_FMT_SRGGB8, [] { return std::make_shared(cv::COLOR_BayerRG2BGR, CV_8UC1, CV_8UC3); }}, + {V4L2_PIX_FMT_SRGGB10, + [] { return std::make_shared(cv::COLOR_BayerRG2BGR, CV_16UC1, CV_8UC3); }}, + {V4L2_PIX_FMT_SRGGB12, + [] { return std::make_shared(cv::COLOR_BayerRG2BGR, CV_16UC1, CV_8UC3); }}}; }; // namespace grabthecam