GIMP/Programowanie/Mathmap: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Linia 134:
'''Gradient''' szary :
 
proporcjonalny do wartości x :
filter gray ()
# x is changing from -1 to 1
grayColor(x) # each color component is proportional to x
end
 
proporcjonalny do bezwględnej wartości x :
filter gray2 ()
p=abs(x); # x is changing from -1 to 1
grayColor(p) # each color component is proportional to abs(x)
end
 
Inna wersja z przeskalowaniem zakresu zmiennej "x" z [-1,1] do [0,1] :
filter gray_gradient ()
grayColor(scale(x, -1, 1, 0, 1))
end