Skip to content

Commit d47684c

Browse files
committed
add comments
1 parent a8c4f1c commit d47684c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tone_mapping.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ cv::Mat* apply_hdr_to_sdr_tone_mapping(
2323
}
2424

2525
// Load ICC profile
26+
// NOTE: it may not be reliable to use just the icc profile for detecting HDR. some formats contain
27+
// flags and not profiles, but going to go with this for a first pass
2628
cmsHPROFILE src_profile = cmsOpenProfileFromMem(icc_data, icc_len);
2729
if (!src_profile) {
2830
return nullptr;
@@ -65,6 +67,8 @@ cv::Mat* apply_hdr_to_sdr_tone_mapping(
6567
}
6668

6769
// Apply Reinhard tone mapping
70+
// Tried to use OpenCV's built in tone mapping, but ran into issues with
71+
// dimming blown out/deep fried images. Using this as a first pass
6872
std::unique_ptr<cv::Mat> dst_bgr = std::make_unique<cv::Mat>(src_for_transform->rows, src_for_transform->cols, CV_8UC3);
6973

7074
// Apply luminance-based tone mapping to preserve color relationships

0 commit comments

Comments
 (0)