-
-
Notifications
You must be signed in to change notification settings - Fork 350
Add support for handling 'tmap' items #1503
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: master
Are you sure you want to change the base?
Conversation
dce9a85
to
7440574
Compare
libheif/context.h
Outdated
std::shared_ptr<ImageItem> get_primary_image(bool return_error_image); | ||
|
||
#if WITH_EXPERIMENTAL_GAIN_MAP | ||
std::shared_ptr<ImageItem> get_gain_map_image() { return m_gain_map_image; } |
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.
This only works if there is only a single gain map in the file. The gain map should probably be stored in the ImageItem
like the alpha image or the depth map.
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.
Thank you for the review, As indicated, i have moved the gainmap info inside ImageItem
libheif/context.h
Outdated
#if WITH_EXPERIMENTAL_GAIN_MAP | ||
std::shared_ptr<ImageItem> get_gain_map_image() { return m_gain_map_image; } | ||
|
||
std::shared_ptr<ImageMetadata> get_gain_map_metadata(); |
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.
Same here, the gain map metadata has to be part of ImageItem
to work correctly when there are several images in a file.
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.
Done
Thank you. Note that there is also some work for this in #1121. I will have a closer look at this when we switched to the v1.20.x branch and can do API additions. |
Gain map technology offers a way to create an image (henceforth referred as derived image) from one base input image and a secondary input image called as a gainmap input image. Reconstruction is done by applying the gain map to the base image according to iso 21496-1 section 6. This change provides API to read, write base input image, gain map input image, gain map metadata. Third party applications can make use of this API to render only base image or reconstruct the derived image and render the same. By default these API is disabled and can be enabled at configure time using option -DWITH_EXPERIMENTAL_GAIN_MAP=1 TODO: add plugins for encoding, decoding uhdr images
Gain map technology offers a way to create an image (henceforth referred
as derived image) from one base input image and a secondary input image
called as a gainmap input image. Reconstruction is done by applying the
gain map to the base image according to iso 21496-1 section 6.
This change provides API to read, write base input image, gain map input
image, gain map metadata. Third party applications can make use of this
API to render only base image or reconstruct the derived image and
render the same.
By default these API is disabled and can be enabled at configure time
using option -DWITH_EXPERIMENTAL_GAIN_MAP=1
TODO: add plugins for encoding, decoding uhdr images