@@ -97,9 +97,11 @@ const char BAYER_GRBG16[] = "bayer_grbg16";
97
97
// https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-packed-yuv.html#id1
98
98
// fourcc: UYVY
99
99
const char UYVY[] = " uyvy" ;
100
+ [[deprecated(" use sensor_msgs::image_encodings::UYVY" )]]
100
101
const char YUV422[] = " yuv422" ; // deprecated
101
102
// fourcc: YUYV
102
103
const char YUYV[] = " yuyv" ;
104
+ [[deprecated(" use sensor_msgs::image_encodings::YUYV" )]]
103
105
const char YUV422_YUY2[] = " yuv422_yuy2" ; // deprecated
104
106
105
107
// YUV 4:2:0 encodings with an 8-bit depth
@@ -120,13 +122,16 @@ const std::regex cv_type_regex("(8|16|32|64)(U|S|F)C([0-9]*)");
120
122
// Utility functions for inspecting an encoding string
121
123
static inline bool isColor (const std::string & encoding)
122
124
{
125
+ #pragma GCC diagnostic push
126
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
123
127
return encoding == RGB8 || encoding == BGR8 ||
124
128
encoding == RGBA8 || encoding == BGRA8 ||
125
129
encoding == RGB16 || encoding == BGR16 ||
126
130
encoding == RGBA16 || encoding == BGRA16 ||
127
131
encoding == YUV422 || encoding == YUV422_YUY2 ||
128
132
encoding == UYVY || encoding == YUYV ||
129
133
encoding == NV21 || encoding == NV24;
134
+ #pragma GCC diagnostic pop
130
135
}
131
136
132
137
static inline bool isMono (const std::string & encoding)
@@ -189,6 +194,8 @@ static inline int numChannels(const std::string & encoding)
189
194
return (m[3 ] == " " ) ? 1 : std::atoi (m[3 ].str ().c_str ());
190
195
}
191
196
197
+ #pragma GCC diagnostic push
198
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
192
199
if (encoding == YUV422 ||
193
200
encoding == YUV422_YUY2 ||
194
201
encoding == UYVY ||
@@ -198,6 +205,7 @@ static inline int numChannels(const std::string & encoding)
198
205
{
199
206
return 2 ;
200
207
}
208
+ #pragma GCC diagnostic pop
201
209
202
210
throw std::runtime_error (" Unknown encoding " + encoding);
203
211
return -1 ;
@@ -241,6 +249,8 @@ static inline int bitDepth(const std::string & encoding)
241
249
return std::atoi (m[0 ].str ().c_str ());
242
250
}
243
251
252
+ #pragma GCC diagnostic push
253
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
244
254
if (encoding == YUV422 ||
245
255
encoding == YUV422_YUY2 ||
246
256
encoding == UYVY ||
@@ -250,6 +260,7 @@ static inline int bitDepth(const std::string & encoding)
250
260
{
251
261
return 8 ;
252
262
}
263
+ #pragma GCC diagnostic pop
253
264
254
265
throw std::runtime_error (" Unknown encoding " + encoding);
255
266
return -1 ;
0 commit comments