Skip to content

Commit

Permalink
Use the updated Image msg. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
caguero authored May 9, 2019
1 parent b5dd793 commit 4457dc6
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/convert_builtin_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,63 +363,63 @@ convert_1_to_ign(

if (ros1_msg.encoding == "mono8")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::L_INT8);
num_channels = 1;
octets_per_channel = 1u;
}
else if (ros1_msg.encoding == "mono16")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::L_INT16);
num_channels = 1;
octets_per_channel = 2u;
}
else if (ros1_msg.encoding == "rgb8")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::RGB_INT8);
num_channels = 3;
octets_per_channel = 1u;
}
else if (ros1_msg.encoding == "rgba8")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::RGBA_INT8);
num_channels = 4;
octets_per_channel = 1u;
}
else if (ros1_msg.encoding == "bgra8")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::BGRA_INT8);
num_channels = 4;
octets_per_channel = 1u;
}
else if (ros1_msg.encoding == "rgb16")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::RGB_INT16);
num_channels = 3;
octets_per_channel = 2u;
}
else if (ros1_msg.encoding == "bgr8")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::BGR_INT8);
num_channels = 3;
octets_per_channel = 1u;
}
else if (ros1_msg.encoding == "bgr16")
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::BGR_INT16);
num_channels = 3;
octets_per_channel = 2u;
}
else
{
ign_msg.set_pixel_format(
ign_msg.set_pixel_format_type(
ignition::msgs::PixelFormatType::UNKNOWN_PIXEL_FORMAT);
std::cerr << "Unsupported pixel format [" << ros1_msg.encoding << "]"
<< std::endl;
Expand All @@ -445,56 +445,56 @@ convert_ign_to_1(
unsigned int num_channels;
unsigned int octets_per_channel;

if (ign_msg.pixel_format() ==
if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::L_INT8)
{
ros1_msg.encoding = "mono8";
num_channels = 1;
octets_per_channel = 1u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::L_INT16)
{
ros1_msg.encoding = "mono16";
num_channels = 1;
octets_per_channel = 2u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::RGB_INT8)
{
ros1_msg.encoding = "rgb8";
num_channels = 3;
octets_per_channel = 1u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::RGBA_INT8)
{
ros1_msg.encoding = "rgba8";
num_channels = 4;
octets_per_channel = 1u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::BGRA_INT8)
{
ros1_msg.encoding = "bgra8";
num_channels = 4;
octets_per_channel = 1u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::RGB_INT16)
{
ros1_msg.encoding = "rgb16";
num_channels = 3;
octets_per_channel = 2u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::BGR_INT8)
{
ros1_msg.encoding = "bgr8";
num_channels = 3;
octets_per_channel = 1u;
}
else if (ign_msg.pixel_format() ==
else if (ign_msg.pixel_format_type() ==
ignition::msgs::PixelFormatType::BGR_INT16)
{
ros1_msg.encoding = "bgr16";
Expand All @@ -503,7 +503,7 @@ convert_ign_to_1(
}
else
{
std::cerr << "Unsupported pixel format [" << ign_msg.pixel_format() << "]"
std::cerr << "Unsupported pixel format [" << ign_msg.pixel_format_type() << "]"
<< std::endl;
return;
}
Expand Down

0 comments on commit 4457dc6

Please sign in to comment.