Skip to content

Commit 503b5a4

Browse files
committed
format: apply clang-format
1 parent 30c8339 commit 503b5a4

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

rerun_bridge/src/rerun_bridge/collection_adapters.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ struct rerun::CollectionAdapter<TElement, cv::Mat> {
2323
};
2424

2525
inline rerun::WidthHeight width_height(const cv::Mat& img) {
26-
return rerun::WidthHeight(
27-
static_cast<size_t>(img.cols),
28-
static_cast<size_t>(img.rows)
29-
);
26+
return rerun::WidthHeight(static_cast<size_t>(img.cols), static_cast<size_t>(img.rows));
3027
};
3128

32-
template<typename T>
29+
template <typename T>
3330
rerun::Collection<T> img_data_as_collection(const cv::Mat& img) {
3431
const T* img_data = reinterpret_cast<const T*>(img.data);
3532

@@ -38,4 +35,4 @@ rerun::Collection<T> img_data_as_collection(const cv::Mat& img) {
3835
std::vector<T> img_vec(img_data, img_data + img_size);
3936

4037
return rerun::Collection<T>::take_ownership(std::move(img_vec));
41-
}
38+
}

rerun_bridge/src/rerun_bridge/rerun_ros_interface.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ void log_image(
116116
cv::Mat img = cv_bridge::toCvCopy(msg)->image;
117117
rec.log(
118118
entity_path,
119-
rerun::DepthImage(
120-
img_data_as_collection<uint16_t>(img),
121-
{static_cast<size_t>(img.rows), static_cast<size_t>(img.cols)}
122-
)
123-
.with_meter(1000)
119+
rerun::DepthImage(rerun::TensorBuffer::u16(img), width_height(img)).with_meter(1000)
124120
);
125121
} else if (msg->encoding == "32FC1") {
126122
cv::Mat img = cv_bridge::toCvCopy(msg)->image;
@@ -132,15 +128,14 @@ void log_image(
132128
}
133129
rec.log(
134130
entity_path,
135-
rerun::DepthImage(
136-
img_data_as_collection<float>(img),
137-
{static_cast<size_t>(img.rows), static_cast<size_t>(img.cols)}
138-
)
139-
.with_meter(1.0)
131+
rerun::DepthImage(img_data_as_collection<float>(img), width_height(img)).with_meter(1.0)
140132
);
141133
} else {
142134
cv::Mat img = cv_bridge::toCvCopy(msg, "rgb8")->image;
143-
rec.log(entity_path, rerun::Image::from_rgb24(img_data_as_collection<uint8_t>(img), width_height(img)));
135+
rec.log(
136+
entity_path,
137+
rerun::Image::from_rgb24(img_data_as_collection<uint8_t>(img), width_height(img))
138+
);
144139
}
145140
}
146141

@@ -156,7 +151,11 @@ void log_pose_stamped(
156151
rec.log(
157152
entity_path,
158153
rerun::Transform3D(
159-
rerun::components::Translation3D(msg->pose.position.x, msg->pose.position.y, msg->pose.position.z),
154+
rerun::components::Translation3D(
155+
msg->pose.position.x,
156+
msg->pose.position.y,
157+
msg->pose.position.z
158+
),
160159
rerun::Quaternion::from_wxyz(
161160
msg->pose.orientation.w,
162161
msg->pose.orientation.x,

0 commit comments

Comments
 (0)