Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new archetypes.ImageEncoded with PNG and JPEG support #6874

Merged
merged 19 commits into from
Jul 15, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Jul 12, 2024

What

Has do-no-merge because of current merge-target.

PR train

Coming in follow-up PRs:

  • Fix image picking, hovering, and visualization in spatial view
  • Switch to using ImageEncoded in all examples
  • Remove old code for storing JPEGs in tensors

Fixes

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

Copy link

github-actions bot commented Jul 12, 2024

Deployed docs

Commit Link
db43fd0 https://landing-a3osglksx-rerun.vercel.app/docs

@emilk emilk force-pushed the emilk/image-encoded branch 5 times, most recently from 0fce767 to c755415 Compare July 13, 2024 06:42
@emilk emilk added include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages labels Jul 13, 2024
@emilk emilk force-pushed the emilk/image-encoded branch from c755415 to 462492a Compare July 13, 2024 06:59
@emilk emilk marked this pull request as ready for review July 13, 2024 07:20
@emilk emilk force-pushed the emilk/image-encoded branch from 462492a to 4d46773 Compare July 13, 2024 07:23
@emilk emilk changed the title Add new archetypes.ImageEncoded Add new archetypes.ImageEncoded with PNG and JPEG support Jul 13, 2024
@emilk emilk added the blocked can't make progress right now label Jul 14, 2024
@emilk emilk force-pushed the emilk/image-encoded branch from 44d57f6 to 5b2880b Compare July 14, 2024 07:32
@rerun-io rerun-io deleted a comment from github-actions bot Jul 14, 2024
@emilk emilk changed the base branch from main to emilk/deprecate-image-encoded July 14, 2024 07:47
@emilk emilk added do-not-merge Do not merge this PR and removed blocked can't make progress right now labels Jul 14, 2024
@emilk emilk mentioned this pull request Jul 14, 2024
6 tasks
@rerun-io rerun-io deleted a comment from github-actions bot Jul 14, 2024
@emilk
Copy link
Member Author

emilk commented Jul 14, 2024

@rerun-bot full-check

@rerun-io rerun-io deleted a comment from github-actions bot Jul 14, 2024
Copy link

@emilk emilk changed the title Add new archetypes.ImageEncoded with PNG and JPEG support [2/4] Add new archetypes.ImageEncoded with PNG and JPEG support Jul 14, 2024
@Wumpf Wumpf self-requested a review July 15, 2024 07:39
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so good to fiiiiiinnaly have ImageEncoded in C++ and Rust!

Comment on lines +142 to +144
// Unknown is currently interpreted as "Some Color" in most cases.
// TODO(jleibs): Make this more explicit
let meaning = TensorDataMeaning::Unknown;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crossing my fingers here that by the end of the train we don't have to deal with TensorDataMeaning anymore 😄
(or can clean this up as a follow-up)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the end of this train, but at the end of #6844 for sure

docs/snippets/all/archetypes/image_encoded.cpp Outdated Show resolved Hide resolved
@Wumpf
Copy link
Member

Wumpf commented Jul 15, 2024

emilk added a commit that referenced this pull request Jul 15, 2024
### What
* Part of #6844
* Next PR: #6874
* Next +1: #6883 (where we rename
it to `ImageChromaDownsampled`)
* Next +2: #6884

This is a temporary measure to make room for a new
`archetypes.ImageEncoded` without name collision.
I plan to remove `ImageEncodedHelper` fully before 0.18.

`ImageEncodedHelper` handles both image files (JPEG, PNG, …) and chroma
sub-sampled data (NV12, YUY2).

In the new design, the former will be handled by `ImageEncoded`, but
chroma-subsampled images will be stored directly as `Image`s, with a
special `PixelFormat`.

This means that once 0.18 is done, only users using chroma subsampling
will have to update their code. I'll make sure the new `ImageEncoded`
archetype ctor supports all of the same parameters as the old helper, so
that there are helpful runtime error messages for our users.


### 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/6882?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/6882?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/6882)
- [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`.
Base automatically changed from emilk/deprecate-image-encoded to main July 15, 2024 09:35
An error occurred while trying to automatically change base from emilk/deprecate-image-encoded to main July 15, 2024 09:35
@emilk emilk force-pushed the emilk/image-encoded branch from 9cd1305 to 34efa0d Compare July 15, 2024 09:38
emilk and others added 3 commits July 15, 2024 11:39
Co-authored-by: Andreas Reich <andreas@rerun.io>
Co-authored-by: Andreas Reich <andreas@rerun.io>
@emilk emilk removed the do-not-merge Do not merge this PR label Jul 15, 2024
@emilk emilk merged commit 15db658 into main Jul 15, 2024
38 checks passed
@emilk emilk deleted the emilk/image-encoded branch July 15, 2024 10:11
emilk added a commit that referenced this pull request Jul 15, 2024
### What
* Part of #6844
* Closes #3803

This switches us to use the new `archetype.ImageEncoded` in all
examples.

Logging chroma-downsampled images (NV12/YUY2) is now done with the new
`ImageChromaDownsampled` helper (which will probably go away before
0.18).

### PR train
* Prev: #6882
* Prev: #6874
* Next: #6884

### 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)
* [ ] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6883?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/6883?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/6883)
- [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`.
emilk added a commit that referenced this pull request Jul 15, 2024
…e` (#6884)

* Part of #6844
* Closes #3803

⚠️ This breaks any existing `JPEG`-encoded RRDs

### Rust API
* Removed `TensorBuffer::JPEG`
* Removed `TensorData::from_jpeg_bytes`
* Deprecated `Image::from_file_path` and `from_file_contents`

For all of these, use `ImageEncoded` instead.

### PR train
* Prev: #6882
* Prev: #6874
* Prev: #6883

### 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/6884?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/6884?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/6884)
- [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`.
@teh-cmc teh-cmc changed the title [2/4] Add new archetypes.ImageEncoded with PNG and JPEG support Add new archetypes.ImageEncoded with PNG and JPEG support Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs/Example of of logging jpeg data from C++
2 participants