SMACC2
Classes | Functions
image_tools::anonymous_namespace{cv_mat_sensor_msgs_image_type_adapter.cpp} Namespace Reference

Classes

struct  NotNull
 

Functions

int encoding2mat_type (const std::string &encoding)
 

Function Documentation

◆ encoding2mat_type()

int image_tools::anonymous_namespace{cv_mat_sensor_msgs_image_type_adapter.cpp}::encoding2mat_type ( const std::string &  encoding)

Definition at line 34 of file cv_mat_sensor_msgs_image_type_adapter.cpp.

35{
36 if (encoding == "mono8") {
37 return CV_8UC1;
38 } else if (encoding == "bgr8") {
39 return CV_8UC3;
40 } else if (encoding == "mono16") {
41 return CV_16SC1;
42 } else if (encoding == "rgba8") {
43 return CV_8UC4;
44 } else if (encoding == "bgra8") {
45 return CV_8UC4;
46 } else if (encoding == "32FC1") {
47 return CV_32FC1;
48 } else if (encoding == "rgb8") {
49 return CV_8UC3;
50 } else if (encoding == "yuv422") {
51 return CV_8UC2;
52 } else {
53 throw std::runtime_error("Unsupported encoding type");
54 }
55}