17 #ifndef GZ_MSGS_CONVERT_PIXELFORMATTYPE_HH_
18 #define GZ_MSGS_CONVERT_PIXELFORMATTYPE_HH_
21 #include "gz/msgs/image.pb.h"
28 inline namespace GZ_MSGS_VERSION_NAMESPACE {
35 return msgs::PixelFormatType::L_INT8;
37 else if (_str ==
"L_INT16")
39 return msgs::PixelFormatType::L_INT16;
41 else if (_str ==
"RGB_INT8")
43 return msgs::PixelFormatType::RGB_INT8;
45 else if (_str ==
"RGBA_INT8")
47 return msgs::PixelFormatType::RGBA_INT8;
49 else if (_str ==
"BGRA_INT8")
51 return msgs::PixelFormatType::BGRA_INT8;
53 else if (_str ==
"RGB_INT16")
55 return msgs::PixelFormatType::RGB_INT16;
57 else if (_str ==
"RGB_INT32")
59 return msgs::PixelFormatType::RGB_INT32;
61 else if (_str ==
"BGR_INT8")
63 return msgs::PixelFormatType::BGR_INT8;
65 else if (_str ==
"BGR_INT16")
67 return msgs::PixelFormatType::BGR_INT16;
69 else if (_str ==
"BGR_INT32")
71 return msgs::PixelFormatType::BGR_INT32;
73 else if (_str ==
"R_FLOAT16")
75 return msgs::PixelFormatType::R_FLOAT16;
77 else if (_str ==
"RGB_FLOAT16")
79 return msgs::PixelFormatType::RGB_FLOAT16;
81 else if (_str ==
"R_FLOAT32")
83 return msgs::PixelFormatType::R_FLOAT32;
85 else if (_str ==
"RGB_FLOAT32")
87 return msgs::PixelFormatType::RGB_FLOAT32;
89 else if (_str ==
"BAYER_RGGB8")
91 return msgs::PixelFormatType::BAYER_RGGB8;
93 else if (_str ==
"BAYER_BGGR8")
95 return msgs::PixelFormatType::BAYER_BGGR8;
97 else if (_str ==
"BAYER_GBRG8")
99 return msgs::PixelFormatType::BAYER_GBRG8;
101 else if (_str ==
"BAYER_GRBG8")
103 return msgs::PixelFormatType::BAYER_GRBG8;
106 return msgs::PixelFormatType::UNKNOWN_PIXEL_FORMAT;
115 case msgs::PixelFormatType::UNKNOWN_PIXEL_FORMAT:
116 return "UNKNOWN_PIXEL_FORMAT";
117 case msgs::PixelFormatType::L_INT8:
119 case msgs::PixelFormatType::L_INT16:
121 case msgs::PixelFormatType::RGB_INT8:
123 case msgs::PixelFormatType::RGBA_INT8:
125 case msgs::PixelFormatType::BGRA_INT8:
127 case msgs::PixelFormatType::RGB_INT16:
129 case msgs::PixelFormatType::RGB_INT32:
131 case msgs::PixelFormatType::BGR_INT8:
133 case msgs::PixelFormatType::BGR_INT16:
135 case msgs::PixelFormatType::BGR_INT32:
137 case msgs::PixelFormatType::R_FLOAT16:
139 case msgs::PixelFormatType::RGB_FLOAT16:
140 return "RGB_FLOAT16";
141 case msgs::PixelFormatType::R_FLOAT32:
143 case msgs::PixelFormatType::RGB_FLOAT32:
144 return "RGB_FLOAT32";
145 case msgs::PixelFormatType::BAYER_RGGB8:
146 return "BAYER_RGGB8";
147 case msgs::PixelFormatType::BAYER_BGGR8:
148 return "BAYER_BGGR8";
149 case msgs::PixelFormatType::BAYER_GBRG8:
150 return "BAYER_GBRG8";
151 case msgs::PixelFormatType::BAYER_GRBG8:
152 return "BAYER_GRBG8";