@@ -48,143 +48,3 @@ int main(int argc, const char* argv[]) {
4848
4949 return 0 ;
5050}
51-
52- /* template <> */
53- /* struct rerun::ComponentBatchAdapter<rerun::components::Position3D,
54- * std::vector<Eigen::Vector3f>> { */
55- /* // Sanity check that this is binary compatible. */
56- /* static_assert(sizeof(components::Position3D) == sizeof(Eigen::Vector3f));
57- */
58- /* static_assert(alignof(components::Position3D) <=
59- * alignof(Eigen::Vector3f)); */
60-
61- /* ComponentBatch<components::Position3D> operator()(const
62- * std::vector<Eigen::Vector3f> &container */
63- /* ) { */
64- /* return ComponentBatch<components::Position3D>::borrow( */
65- /* reinterpret_cast<const components::Position3D
66- * *>(container.data()), */
67- /* container.size() */
68- /* ); */
69- /* } */
70-
71- /* ComponentBatch<components::Position3D>
72- * operator()(std::vector<Eigen::Vector3f> &&container) { */
73- /* throw std::runtime_error("Not implemented for temporaries"); */
74- /* } */
75- /* }; */
76-
77- /* template <> */
78- /* struct rerun::ComponentBatchAdapter<rerun::components::Position3D,
79- * Eigen::MatrixX3f> { */
80- /* // Sanity check that this is binary compatible. */
81- /* static_assert( */
82- /* sizeof(components::Position3D) == */
83- /* sizeof(Eigen::MatrixX3f::Scalar) *
84- * Eigen::MatrixX3f::ColsAtCompileTime */
85- /* ); */
86- /* static_assert(alignof(components::Position3D) <=
87- * alignof(Eigen::MatrixX3f)); */
88-
89- /* ComponentBatch<components::Position3D> operator()(const Eigen::MatrixX3f
90- * &matrix) { */
91- /* return ComponentBatch<components::Position3D>::borrow( */
92- /* reinterpret_cast<const components::Position3D *>(matrix.data()),
93- */
94- /* matrix.rows() */
95- /* ); */
96- /* } */
97-
98- /* ComponentBatch<components::Position3D>
99- * operator()(std::vector<Eigen::MatrixX3f> &&container) { */
100- /* throw std::runtime_error("Not implemented for temporaries"); */
101- /* } */
102- /* }; */
103-
104- /* std::vector<Eigen::Vector3f> generate_random_points_vector(int num_points) {
105- */
106- /* std::vector<Eigen::Vector3f> points(num_points); */
107- /* for (auto &point : points) { */
108- /* point.setRandom(); */
109- /* } */
110- /* return points; */
111- /* } */
112-
113- /* int main() { */
114- /* auto rec = rerun::RecordingStream("rerun_cpp_example_opencv_eigen"); */
115- /* rec.connect("127.0.0.1:9876").throw_on_failure(); */
116-
117- /* const int num_points = 1000; */
118-
119- /* // Points represented by std::vector<Eigen::Vector3f> */
120- /* auto points3d_vector = generate_random_points_vector(1000); */
121- /* rec.log("world/points_from_vector", rerun::Points3D(points3d_vector)); */
122-
123- /* // Points represented by Eigen::MatX3f (Nx3 matrix) */
124- /* Eigen::MatrixX3f points3d_matrix = Eigen::MatrixX3f::Random(num_points,
125- * 3); */
126- /* rec.log("world/points_from_matrix", rerun::Points3D(points3d_matrix)); */
127-
128- /* // Posed pinhole camera */
129- /* float width = 640.0f; */
130- /* float height = 480.0f; */
131- /* Eigen::Matrix3f projection_matrix = Eigen::Matrix3f::Identity(); */
132- /* projection_matrix(0, 0) = 500.0f; */
133- /* projection_matrix(1, 1) = 500.0f; */
134- /* projection_matrix(0, 2) = (width - 1) / 2.0; */
135- /* projection_matrix(1, 2) = (height - 1) / 2.0; */
136- /* rec.log( */
137- /* "world/camera", */
138- /* rerun::Pinhole(rerun::components::PinholeProjection( */
139- /* *reinterpret_cast<float(*)[9]>(projection_matrix.data())
140- */
141- /* )) */
142- /* .with_resolution(rerun::components::Resolution({width, height}))
143- */
144- /* ); */
145- /* Eigen::Vector3f camera_position{0.0, -1.0, 0.0}; */
146- /* Eigen::Matrix3f camera_orientation; */
147- /* // clang-format off */
148- /* camera_orientation << */
149- /* 0.0, 1.0, 0.0, */
150- /* 0.0, 0.0, 1.0, */
151- /* 1.0, 0.0, 0.0; */
152- /* // clang-format on */
153- /* rec.log( */
154- /* "world/camera", */
155- /* rerun::Transform3D( */
156- /* rerun::datatypes::Vec3D(*reinterpret_cast<float(*)[3]>(camera_position.data())),
157- */
158- /* rerun::datatypes::Mat3x3(*reinterpret_cast<float(*)[9]>(camera_orientation.data()))
159- */
160- /* ) */
161- /* ); */
162-
163- /* // Read image */
164- /* std::string image_path = "rerun-logo.png"; */
165- /* cv::Mat img = imread(image_path, cv::IMREAD_COLOR); */
166- /* if (img.empty()) { */
167- /* std::cout << "Could not read the image: " << image_path << std::endl;
168- */
169- /* return 1; */
170- /* } */
171-
172- /* // Log image to Rerun */
173- /* cv::cvtColor(img, img, cv::COLOR_BGR2RGB); // Rerun expects RGB format */
174- /* // NOTE currently we need to construct a vector to log an image, this
175- * will change in the future */
176- /* // see https://github.com/rerun-io/rerun/issues/3794 */
177- /* std::vector<uint8_t> img_vec(img.total() * img.channels()); */
178- /* img_vec.assign(img.data, img.data + img.total() * img.channels()); */
179- /* rec.log( */
180- /* "image", */
181- /* rerun::Image( */
182- /* {static_cast<size_t>(img.rows), */
183- /* static_cast<size_t>(img.cols), */
184- /* static_cast<size_t>(img.channels())}, */
185- /* std::move(img_vec) */
186- /* ) */
187- /* ); */
188-
189- /* return 0; */
190- /* } */
0 commit comments