-
Notifications
You must be signed in to change notification settings - Fork 70
[WIP] PR #3 nvimagecodec v0.7.0 #983
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
base: main
Are you sure you want to change the base?
Conversation
- Fix libjpeg-turbo cmake configuration for both cuslide and cuslide2 - Update nvimgcodec cmake dependency configuration - Update examples CMakeLists - Update build scripts and documentation
Signed-off-by: cdinea <cdinea@nvidia.com>
Signed-off-by: cdinea <cdinea@nvidia.com>
Signed-off-by: cdinea <cdinea@nvidia.com>
Signed-off-by: cdinea <cdinea@nvidia.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
Signed-off-by: cdinea <cdinea@nvidia.com>
Signed-off-by: cdinea <cdinea@nvidia.com>
| } | ||
|
|
||
| // Store ImageDescription if available from vendor metadata | ||
| if (!ifd_info.image_description.empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you remove code that sets it based on vendor metadata in a recent commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| try | ||
| { | ||
| // Get compression value from typed variant | ||
| uint16_t compression_value = tiff_tag_value_to_uint16(compression_it->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compression tag should be SHORT right? So maybe it is better to just check if that is the case and throw exception in the unlikely case that it is not? And we can get rid of this whole tiff_tag_value_to_uint16 function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| // Convert value based on type and store as typed variant | ||
| TiffTagValue tag_value; | ||
| bool value_stored = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value_stored is not needed. The variant will be initialized into first type from its list - so std::monotstate. We can just check at the end if type is still monostate with either:
tag_value.index() == 0std::holds_alternative<std::monotstate>(tag_value))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| uint16_t compression_value = tiff_tag_value_to_uint16(compression_it->second); | ||
| // COMPRESSION tag is always SHORT (uint16_t) per TIFF spec | ||
| // If it's not, that indicates a bug in nvImageCodec or our parsing | ||
| uint16_t compression_value = std::get<uint16_t>(compression_it->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to directly check if type is correct via https://en.cppreference.com/w/cpp/utility/variant/holds_alternative.html instead of relying on exceptions? But I don't have strong opinions on that, we can leave catch too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/ok to test 2716b26 |
|
/ok to test c944ffd |
|
/ok to test 7b402de |
|
@KyleFromNVIDIA @jakirkham - The CI is experiencing persistent conda-forge network timeouts. |
| - libnvjpeg | ||
| - libnvimgcodec0 {{ nvimgcodec_version }} # nvImageCodec runtime library | ||
| run_constrained: | ||
| - {{ pin_compatible('openslide') }} | ||
| - libnvimgcodec-dev {{ nvimgcodec_version }} # Optional: for development/debugging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - libnvjpeg | |
| - libnvimgcodec0 {{ nvimgcodec_version }} # nvImageCodec runtime library | |
| run_constrained: | |
| - {{ pin_compatible('openslide') }} | |
| - libnvimgcodec-dev {{ nvimgcodec_version }} # Optional: for development/debugging | |
| - libnvjpeg | |
| run_constrained: | |
| - {{ pin_compatible('openslide') }} |
These constraints aren't necessary. libnvimgcodec-dev has appropriate run_exports, and your constraints are less strict than the run_exports.
Update cuslide2 plugin for nvImageCodec v0.7.0
Description
This PR updates the
cucim.kit.cuslide2plugin to support nvImageCodec v0.7.0 from internal release, which includes new features for direct TIFF tag retrieval and API changes.Key Changes
1. CMake Configuration (
cmake/deps/nvimgcodec.cmake)0.6.0to0.7.0NVIMGCODEC_DIRandNVIMGCODEC_ROOTvariables for local installations2. API Compatibility Fix (
nvimgcodec_decoder.cpp)buffer_sizeassignment fromnvimgcodecImageInfo_tbuffer_sizemember was removed in v0.7.0; buffer size is now inferred fromplane_info3. TIFF Tag Support (
nvimgcodec_tiff_parser.cpp)NVIMGCODEC_METADATA_KIND_TIFF_TAGSUBFILETYPE(254) - for associated image classificationCOMPRESSION(259) - compression method detectionIMAGEDESCRIPTION(270) - vendor metadataSUBIFD(330) - sub-IFD referencesJPEGTABLES(347) - JPEG quantization/huffman tables4. Dependencies (
dependencies.yaml)libnvimgcodecandnvimgcodecversions to0.7.0Related
buffer_sizefromnvimgcodecImageInfo_t