Skip to content

Conversation

ram-mohan
Copy link

@ram-mohan ram-mohan commented Apr 6, 2025

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

@ram-mohan ram-mohan force-pushed the master branch 2 times, most recently from dce9a85 to 7440574 Compare April 6, 2025 20:09
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; }
Copy link
Contributor

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.

Copy link
Author

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

#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();
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@farindk
Copy link
Contributor

farindk commented Apr 7, 2025

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.

@farindk
Copy link
Contributor

farindk commented Apr 7, 2025

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
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.

2 participants