Skip to content

Commit 2e6876c

Browse files
committed
latest version. no datatypes
1 parent 6480a82 commit 2e6876c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
99
endif()
1010

1111
include(FetchContent)
12-
FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/d5153cb/rerun_cpp_sdk.zip) # TODO: 2023-11-24. Update to latest commit.
12+
FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/746dbf3/rerun_cpp_sdk.zip) # TODO: 2023-11-28. Update to latest commit.
1313
FetchContent_MakeAvailable(rerun_sdk)
1414

1515
find_package(Eigen3 REQUIRED)

src/collection_adapters.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct rerun::CollectionAdapter<rerun::Position3D, std::vector<Eigen::Vector3f>>
1515
return Collection<rerun::Position3D>::borrow(container.data(), container.size());
1616
}
1717

18-
// Do a full copy for temporaries (otherwise the data will be deleted when the temporary is destroyed).
18+
// Do a full copy for temporaries (otherwise the data might be deleted when the temporary is destroyed).
1919
Collection<rerun::Position3D> operator()(std::vector<Eigen::Vector3f>&& container) {
2020
std::vector<rerun::Position3D> positions(container.size());
2121
memcpy(positions.data(), container.data(), container.size() * sizeof(Eigen::Vector3f));
@@ -42,7 +42,7 @@ struct rerun::CollectionAdapter<rerun::Position3D, Eigen::Matrix3Xf> {
4242
);
4343
}
4444

45-
// Do a full copy for temporaries (otherwise the data will be deleted when the temporary is destroyed).
45+
// Do a full copy for temporaries (otherwise the data might be deleted when the temporary is destroyed).
4646
Collection<rerun::Position3D> operator()(Eigen::Matrix3Xf&& matrix) {
4747
std::vector<rerun::Position3D> positions(matrix.cols());
4848
memcpy(positions.data(), matrix.data(), matrix.size() * sizeof(rerun::Position3D));
@@ -62,7 +62,7 @@ struct rerun::CollectionAdapter<uint8_t, cv::Mat> {
6262
return Collection<uint8_t>::borrow(img.data, img.total() * img.channels());
6363
}
6464

65-
// Do a full copy for temporaries (otherwise the data will be deleted when the temporary is destroyed).
65+
// Do a full copy for temporaries (otherwise the data might be deleted when the temporary is destroyed).
6666
Collection<uint8_t> operator()(cv::Mat&& img) {
6767
assert(
6868
"OpenCV matrix was expected have bit depth CV_U8" && CV_MAT_DEPTH(img.type()) == CV_8U
@@ -75,11 +75,10 @@ struct rerun::CollectionAdapter<uint8_t, cv::Mat> {
7575
};
7676

7777
// Adapter for extracting tensor dimensions from an OpenCV matrix.
78-
// TODO(https://github.com/rerun-io/rerun/pull/4331): remove `datatypes::`
7978
template <>
80-
struct rerun::CollectionAdapter<rerun::datatypes::TensorDimension, cv::Mat> {
79+
struct rerun::CollectionAdapter<rerun::TensorDimension, cv::Mat> {
8180
/// Only overload the const& operator since there is no way of borrowing the dimensions anyways.
82-
Collection<rerun::datatypes::TensorDimension> operator()(const cv::Mat& img) {
81+
Collection<rerun::TensorDimension> operator()(const cv::Mat& img) {
8382
return {
8483
static_cast<size_t>(img.rows),
8584
static_cast<size_t>(img.cols),

src/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ int main() {
6565
}
6666

6767
// Log image to Rerun
68-
// TODO(https://github.com/rerun-io/rerun/pull/4331): remove `datatypes::`
6968
cv::cvtColor(img, img, cv::COLOR_BGR2RGB); // Rerun expects RGB format
70-
rec.log("image", rerun::Image(img, rerun::datatypes::TensorBuffer::u8(img)));
69+
rec.log("image", rerun::Image(img, rerun::TensorBuffer::u8(img)));
7170

7271
return 0;
7372
}

0 commit comments

Comments
 (0)