@@ -97,11 +97,9 @@ const char BAYER_GRBG16[] = "bayer_grbg16";
9797// https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-packed-yuv.html#id1
9898// fourcc: UYVY
9999const char UYVY[] = " uyvy" ;
100- [[deprecated(" use sensor_msgs::image_encodings::UYVY" )]]
101100const char YUV422[] = " yuv422" ; // deprecated
102101// fourcc: YUYV
103102const char YUYV[] = " yuyv" ;
104- [[deprecated(" use sensor_msgs::image_encodings::YUYV" )]]
105103const char YUV422_YUY2[] = " yuv422_yuy2" ; // deprecated
106104
107105// YUV 4:2:0 encodings with an 8-bit depth
@@ -122,16 +120,13 @@ const std::regex cv_type_regex("(8|16|32|64)(U|S|F)C([0-9]*)");
122120// Utility functions for inspecting an encoding string
123121static inline bool isColor (const std::string & encoding)
124122{
125- #pragma GCC diagnostic push
126- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
127123 return encoding == RGB8 || encoding == BGR8 ||
128124 encoding == RGBA8 || encoding == BGRA8 ||
129125 encoding == RGB16 || encoding == BGR16 ||
130126 encoding == RGBA16 || encoding == BGRA16 ||
131127 encoding == YUV422 || encoding == YUV422_YUY2 ||
132128 encoding == UYVY || encoding == YUYV ||
133129 encoding == NV21 || encoding == NV24;
134- #pragma GCC diagnostic pop
135130}
136131
137132static inline bool isMono (const std::string & encoding)
@@ -194,8 +189,6 @@ static inline int numChannels(const std::string & encoding)
194189 return (m[3 ] == " " ) ? 1 : std::atoi (m[3 ].str ().c_str ());
195190 }
196191
197- #pragma GCC diagnostic push
198- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
199192 if (encoding == YUV422 ||
200193 encoding == YUV422_YUY2 ||
201194 encoding == UYVY ||
@@ -205,7 +198,6 @@ static inline int numChannels(const std::string & encoding)
205198 {
206199 return 2 ;
207200 }
208- #pragma GCC diagnostic pop
209201
210202 throw std::runtime_error (" Unknown encoding " + encoding);
211203 return -1 ;
@@ -249,8 +241,6 @@ static inline int bitDepth(const std::string & encoding)
249241 return std::atoi (m[0 ].str ().c_str ());
250242 }
251243
252- #pragma GCC diagnostic push
253- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
254244 if (encoding == YUV422 ||
255245 encoding == YUV422_YUY2 ||
256246 encoding == UYVY ||
@@ -260,7 +250,6 @@ static inline int bitDepth(const std::string & encoding)
260250 {
261251 return 8 ;
262252 }
263- #pragma GCC diagnostic pop
264253
265254 throw std::runtime_error (" Unknown encoding " + encoding);
266255 return -1 ;
0 commit comments