f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Feature/1187 Read EXR files from memory

Open nabielkandiel opened this issue 1 year ago • 6 comments
trafficstars

Issue for reference https://github.com/f3d-app/f3d/issues/1187

Below is an image of what currently happens when reading a .usda file in f3d master

This is what it looks like on this branch my_branch

file is pulled from here https://github.com/mwestphal/assets/tree/main/full_assets/StandardShaderBall

Please note you have to change some options in the cmake build files to enable USD and EXR CMakeLists.txt line 58 turn on module_exr plugins/CMakeLists.txt line 6 turn on build_usd

MemStream is a private class created inside F3DEXRReader, this is needed as Imf::RgbaInputFile needs an input that has stream like functionality or is derived from Imf::IStream https://openexr.com/en/latest/ReadingAndWritingImageFiles.html#low-level-i-o

I'm not sure if this is the best design choice to have it be a private class, i can change that if desired but im not sure if any other class is going to need to use this functionality.

nabielkandiel avatar May 31 '24 22:05 nabielkandiel

Codecov Report

Attention: Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.65%. Comparing base (afe3870) to head (0f910f8). Report is 152 commits behind head on master.

Files with missing lines Patch % Lines
vtkext/private/module/vtkF3DEXRReader.cxx 88.57% 4 Missing :warning:
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1448    +/-   ##
========================================
  Coverage   96.64%   96.65%            
========================================
  Files         103      105     +2     
  Lines        7756     7861   +105     
========================================
+ Hits         7496     7598   +102     
- Misses        260      263     +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 01 '24 01:06 codecov[bot]

@Meakk I tried using grayscale.exr but i get the following errors

Error reading EXR file: only RGB and RGBA channels are supported Could not find expected scalar array

(im not sure why but i couldn't reply to your original message in the thread)

nabielkandiel avatar Jun 03 '24 08:06 nabielkandiel

@Meakk I tried using grayscale.exr but i get the following errors

Error reading EXR file: only RGB and RGBA channels are supported Could not find expected scalar array

(im not sure why but i couldn't reply to your original message in the thread)

Ok fair enough. Let's use your image then, but please double check the license and add it in testing/data/DATA_LICENSES.md

Meakk avatar Jun 03 '24 09:06 Meakk

Small change required for cppcheck job:

/__w/f3d/f3d/source/vtkext/private/module/vtkF3DEXRReader.cxx:63:12: error: use default member initializer for 'pos' [modernize-use-default-member-init,-warnings-as-errors]
  uint64_t pos;
           ^
              {0}

Meakk avatar Jun 05 '24 18:06 Meakk

please rebase on master

mwestphal avatar Jun 22 '24 15:06 mwestphal

hey @nabielkandiel , need any help moving forward ?

mwestphal avatar Jul 13 '24 16:07 mwestphal