Skip to content

Commit

Permalink
Update to Rerun 0.18.0 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Oct 16, 2024
1 parent f052b25 commit 073fdd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

# Rerun:
include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.17.0/rerun_cpp_sdk.zip)
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.18.0/rerun_cpp_sdk.zip)
FetchContent_MakeAvailable(rerun_sdk)

# VRS:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ If you choose not to use pixi, you will need to install a few things yourself be
The Rerun C++ SDK works by connecting to an awaiting Rerun Viewer over TCP.

If you need to install the viewer, follow the [installation guide](https://www.rerun.io/docs/getting-started/installing-viewer). Two of the more common ways to install the Rerun Viewer are:
* Via cargo: `cargo install rerun-cli@0.17.0`
* Via pip: `pip install rerun-sdk==0.17.0`
* Via cargo: `cargo install rerun-cli@0.18.0`
* Via pip: `pip install rerun-sdk==0.18.0`

After you have installed it, you should be able to type `rerun` in your terminal to start the viewer.

Expand Down
13 changes: 9 additions & 4 deletions src/frame_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ namespace rerun_vrs {
// NOTE Rerun assumes row major ordering for Images (i.e., TensorData) without any stride.
// Right now we don't check this properly, and just assume that there is no extra padding
// per pixel and / or per row.
auto channels = frame->getSpec().getChannelCountPerPixel();
auto color_model = channels == 1 ? rerun::ColorModel::L
: channels == 3 ? rerun::ColorModel::RGB
: rerun::ColorModel::RGBA;

_rec->log(
_entity_path,
rerun::Image(
{frame->getHeight(),
frame->getWidth(),
frame->getSpec().getChannelCountPerPixel()},
frame->getBuffer()
frame->getBuffer(),
{frame->getWidth(), frame->getHeight()},
color_model,
rerun::datatypes::ChannelDatatype::U8
)
);
} else {
Expand Down

0 comments on commit 073fdd6

Please sign in to comment.