Skip to content

Commit 5ee0f89

Browse files
authored
Revert "mark YUV encodings as deprecated (#247)"
This reverts commit 1d1c294.
1 parent 1d1c294 commit 5ee0f89

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

sensor_msgs/include/sensor_msgs/image_encodings.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
9999
const char UYVY[] = "uyvy";
100-
[[deprecated("use sensor_msgs::image_encodings::UYVY")]]
101100
const char YUV422[] = "yuv422"; // deprecated
102101
// fourcc: YUYV
103102
const char YUYV[] = "yuyv";
104-
[[deprecated("use sensor_msgs::image_encodings::YUYV")]]
105103
const 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
123121
static 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

137132
static 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;

sensor_msgs/test/test_image_encodings.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ TEST(sensor_msgs, NumChannels)
4848
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("64FC"), 1);
4949
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("64FC3"), 3);
5050
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("64FC10"), 10);
51-
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("uyvy"), 2);
52-
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("yuyv"), 2);
51+
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("yuv422"), 2);
52+
ASSERT_EQ(sensor_msgs::image_encodings::numChannels("yuv422_yuy2"), 2);
5353
}
5454

5555
TEST(sensor_msgs, bitDepth)
@@ -68,6 +68,6 @@ TEST(sensor_msgs, bitDepth)
6868
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("64FC"), 64);
6969
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("64FC3"), 64);
7070
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("64FC10"), 64);
71-
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("uyvy"), 8);
72-
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("yuyv"), 8);
71+
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("yuv422"), 8);
72+
ASSERT_EQ(sensor_msgs::image_encodings::bitDepth("yuv422_yuy2"), 8);
7373
}

0 commit comments

Comments
 (0)