]> granicus.if.org Git - php/commit
Refactor imagegammacorrect()
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 25 Sep 2016 07:47:23 +0000 (09:47 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sun, 25 Sep 2016 09:28:39 +0000 (11:28 +0200)
commit65ee87f20dfebb4cde5f908cd6ba57384810e740
tree01b6f421c40c261a285527dd7fc047d621090e56
parent47f1666f7cde616b72cf5461a57db9de3d49ddac
Refactor imagegammacorrect()

We apply the law `(b**r)**s == b**(r*s)` which holds for all non-negative b
and positive r,s, so a single pow() suffices. Furthermore, we precompute the
gamma, so the refactored code is simpler and faster.
ext/gd/gd.c
ext/gd/tests/imagegammacorrect_variation2.phpt [new file with mode: 0644]
ext/gd/tests/imagegammacorrect_variation2_1_1.png [new file with mode: 0644]
ext/gd/tests/imagegammacorrect_variation2_1_2.png [new file with mode: 0644]
ext/gd/tests/imagegammacorrect_variation2_2_1.png [new file with mode: 0644]