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

Document steps to add a new compression method in ImfCompression.h #1672

Conversation

pleprince
Copy link
Contributor

Suggested by @cary-ilm

Signed-off-by: Philippe Leprince <[email protected]>
Signed-off-by: Philippe Leprince <[email protected]>
@pleprince
Copy link
Contributor Author

Hi @peterhillman. Would you be kind enough to review ? Cheers.

Copy link
Contributor

@peterhillman peterhillman left a comment

Choose a reason for hiding this comment

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

Very clear and complete.
I would perhaps have put this in ImfCompressor.cpp, as most people viewing this header file are only looking up values of the enum or the function declarations. There's little point having the documentation in installs of the OpenEXR library, since you can only add compression types by modifying the source. A one-line comment in ImfCompression.h could point readers at those details.

It would also be better for compression types to have a single implementation in the Core library, with the C++ library then calling low level functionality in Core to implement the compression/decompression

@pleprince
Copy link
Contributor Author

pleprince commented Mar 13, 2024

It would also be better for compression types to have a single implementation in the Core library, with the C++ library then calling low level functionality in Core to implement the compression/decompression.

I totally agree. I didn't really know about the C API at the time and it would be better to refactor the compressors in the future.

@peterhillman
Copy link
Contributor

Perhaps switch the order round, so step 2 is the C implementation and step 3 the C++ integration, and add a suggestion in the C++ integration section about having it call the C implementation? If the entire implementation is just compressWithThirdPartyLibrary(data,size) then there's not much point in having the C++ code call the C code, but if its 50,000 lines of clever wavelet code, then you shouldn't write it twice.

@cary-ilm
Copy link
Member

This looks good to me, too, thanks! I see you added Zstd support to OpenEXRCore in #1604, which is great, and the compressWithThirdPartyLibrary amounts to 115 lines, probably right at the threshold of what you'd want to duplicate. I agree that listing the C API first helps make sure that's not an afterthought.

@cary-ilm
Copy link
Member

@pleprince, we're happy to accept this, but with @peterhillman's suggestion of moving the comment to ImfCompression.cpp since it's not relevant to the external API, and switching the order of the steps as described above. Thanks!

@pleprince
Copy link
Contributor Author

pleprince commented Mar 18, 2024 via email

@pleprince
Copy link
Contributor Author

Sorry for the delay. I hope this will be ok now. Cheers

@cary-ilm
Copy link
Member

Thanks. Sorry to be a stickler here, but our project coding standards are to format comments with each line prefixed with //, rather than /* ... */. Look at any other file in the library as a reference. Would you mind reformat using //?

@pleprince
Copy link
Contributor Author

no worries.

@cary-ilm cary-ilm merged commit 272e4b3 into AcademySoftwareFoundation:main Mar 23, 2024
28 checks passed
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.

3 participants