Skip to content

Commit

Permalink
fix contrast matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed May 28, 2016
1 parent dd7b9f1 commit c2a13f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ColorTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,12 @@ class ColorTransform::Private : public QSharedData
0, 1, 0, b,
0, 0, 1, b,
0, 0, 0, 1);
const float c = contrast+1.0;
// Contrast (offset) R,G,B
QMatrix4x4 C(c, 0, 0, 0,
0, c, 0, 0,
0, 0, c, 0,
const float c = contrast+1.0;
const float t = (1.0 - c) / 2.0;
QMatrix4x4 C(c, 0, 0, t,
0, c, 0, t,
0, 0, c, t,
0, 0, 0, 1);
// Saturation
const float wr = 0.3086f;
Expand Down

0 comments on commit c2a13f7

Please sign in to comment.