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

Support for wider channel size in f3d::image #858

Merged
merged 24 commits into from
Jul 10, 2023

Conversation

Meakk
Copy link
Member

@Meakk Meakk commented Jun 16, 2023

Fix #854

Also, add the architecture required to deprecate libf3d functions.

@Meakk Meakk self-assigned this Jun 16, 2023
@github-actions
Copy link

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: python, java, webassembly.

@snoyer
Copy link
Contributor

snoyer commented Jun 16, 2023

What does that entail for the data buffer exposed through unsigned char* image::getData()?

For example, in the case of a float-based image would getData() return the raw encoded floating point values as bytes?

library/src/image.cxx Outdated Show resolved Hide resolved
library/src/image.cxx Outdated Show resolved Hide resolved
@Meakk
Copy link
Member Author

Meakk commented Jun 19, 2023

Nevermind, I have another idea to refactor this class.

@Meakk Meakk marked this pull request as draft June 19, 2023 08:11
@Meakk
Copy link
Member Author

Meakk commented Jun 19, 2023

What does that entail for the data buffer exposed through unsigned char* image::getData()?

For example, in the case of a float-based image would getData() return the raw encoded floating point values as bytes?

Just to answer the question. Usually, when you have a buffer of an unknown type, you can just use a buffer of bytes and reinterpret_cast the buffer later. You have to be careful about the endianness though.

@Meakk Meakk force-pushed the image-improvements branch from abbf4d8 to 855c3ac Compare June 19, 2023 22:00
@Meakk Meakk marked this pull request as ready for review June 20, 2023 06:14
@snoyer
Copy link
Contributor

snoyer commented Jun 20, 2023

What does that entail for the data buffer exposed through unsigned char* image::getData()?
For example, in the case of a float-based image would getData() return the raw encoded floating point values as bytes?

Just to answer the question. Usually, when you have a buffer of an unknown type, you can just use a buffer of bytes and reinterpret_cast the buffer later. You have to be careful about the endianness though.

Alright so if the bindings expose this raw data too, multiplying the length by the new channel width here and here should do.

@Meakk
Copy link
Member Author

Meakk commented Jun 20, 2023

You're right! Nice catch :)

@Meakk Meakk requested a review from mwestphal June 20, 2023 14:25
@Meakk
Copy link
Member Author

Meakk commented Jun 20, 2023

@mwestphal I've modified the public API without taking care of backward compatibility. Do you think it's fine?

@mwestphal
Copy link
Contributor

I do not see any non retro compat changes, looks fine

@Meakk
Copy link
Member Author

Meakk commented Jun 20, 2023

I removed some setters to put them in a dedicated constructor.

@mwestphal
Copy link
Contributor

Ideally they should be deprecated, if possible by keeping the feature with a warning, if not, by keeping the method but erroring out.

Not saying this will impact a lot of people but we need to think of a process that works for the future of F3D. I know very well the system in VTK, maybe we need something similar ? I can create an issue about it if you want.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #858 (a84339d) into master (ca76333) will decrease coverage by 0.25%.
The diff coverage is 96.05%.

❗ Current head a84339d differs from pull request most recent head d766c80. Consider uploading reports for the commit d766c80 to get more accurate results

@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
- Coverage   96.06%   95.81%   -0.25%     
==========================================
  Files         113      115       +2     
  Lines        6551     6643      +92     
==========================================
+ Hits         6293     6365      +72     
- Misses        258      278      +20     
Impacted Files Coverage Δ
library/src/image.cxx 97.69% <95.94%> (-2.31%) ⬇️
library/src/window_impl.cxx 98.58% <100.00%> (-0.02%) ⬇️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

library/CMakeLists.txt Outdated Show resolved Hide resolved
@Meakk Meakk force-pushed the image-improvements branch from ca51cbc to 34d390c Compare June 29, 2023 14:12
library/src/image.cxx Outdated Show resolved Hide resolved
@Meakk Meakk force-pushed the image-improvements branch from 80e514b to 07165d4 Compare July 10, 2023 09:29
Copy link
Contributor

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

some changes needed

.github/workflows/ci.yml Show resolved Hide resolved
@Meakk Meakk merged commit e82e5ff into f3d-app:master Jul 10, 2023
@Meakk Meakk deleted the image-improvements branch July 10, 2023 13:26
mwestphal added a commit to mwestphal/f3d that referenced this pull request Jul 10, 2023
@mwestphal mwestphal mentioned this pull request Jul 10, 2023
mwestphal added a commit that referenced this pull request Jul 11, 2023
mwestphal added a commit that referenced this pull request Feb 10, 2024
mwestphal added a commit that referenced this pull request Feb 10, 2024
mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this pull request Feb 10, 2024
mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this pull request Feb 10, 2024
mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this pull request Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image API do not support hdr/exr
3 participants