Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
isp:brightness [2023/09/10 19:17] – [Algorithm] Igor Yefmov | isp:brightness [2023/09/10 20:56] – [Algorithm] Igor Yefmov | ||
---|---|---|---|
Line 11: | Line 11: | ||
Here's the algorithm to follow, assuming \(R, G, B \in [0..4095]\) and \(br \in [-1024..+1023]\): | Here's the algorithm to follow, assuming \(R, G, B \in [0..4095]\) and \(br \in [-1024..+1023]\): | ||
- calculate luminosity | - calculate luminosity | ||
- | - figure out the slope for each components based on whether luma is below or above 50% | + | |
- | - figure out if the new luma is going to cross the 50% boundary | + | |
- | - if luma does cross the 50% boundary figure out the knee point' | + | - figure out if the new luma is going to cross the 50% boundary |
- | | + | |
- | - just adjust the brightness additively and clamp the value to range \([0..4095]\) | + | |
- recalculate RGB components | - recalculate RGB components | ||