MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / changeContrast

Function changeContrast

examples/image_processing/image_editing.cpp:20–23  ·  view source on GitHub ↗

* contrast value should be in the rnage [-1,1] * */

Source from the content-addressed store, hash-verified

18 * contrast value should be in the rnage [-1,1]
19 * */
20array changeContrast(const array &in, const float contrast) {
21 float scale = tan((contrast + 1) * Pi / 4);
22 return (((in / 255.0f - 0.5f) * scale + 0.5f) * 255.0f);
23}
24
25/**
26 * brightness value should be in the rnage [0,1]

Callers 1

mainFunction · 0.85

Calls 1

tanFunction · 0.85

Tested by

no test coverage detected