forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Video hover interaction like on images (rerun-io#7457)
### What * Fixes rerun-io#7353 This makes image interaction on videos look the same as on image! https://github.com/user-attachments/assets/279bf6c3-2d87-4f99-bda5-78ba291e4e5f There's once again quite a bit of code movement: Commit by commit review recommended to easier skip over these pure refactors. Image & video hover share almost all code. There's a few places where it looks we did repeated image->gputexture creation which are now eliminated since everything re-uses the textures acquired during visualization (most of that happens in [this commit](rerun-io@7e24d92). At the very end (both in the commit history & in the codeflow of the hover interaction) there's a very special piece of code for read-back of the texture values from the video. This necessary since we never have the entire video frame accessible in regular ram. We don't want to grab the entire picture since this may be slow for high resolution video and we don't want to grab a single pixel either, because by the time the result arrives, the mouse might have moved on (delay depends on various factors but we expect 1-3 frames). Our strategy is similar to our picking read-back: we query a region around the mouse cursor and once it arrives see where the mouse is inside this region. This a bit more complicated than picking though, because there we already have a small enough texture whereas where we have to do a read from a bigger one. Details see comments. I validated the rgb values displayed by taking screenshots of a running video and then compare with an external color picker. In my experiments the rgb numbers have always been accurate with no delay albeit in theory they may lag behind ever so slightly. Small style change: Both images/videos and regular hovers show the entity path now formatted the same: ![image](https://github.com/user-attachments/assets/b4a30462-952a-41eb-9a63-9fe9d71f8edc) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7457?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7457?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7457) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
19 changed files
with
1,003 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.