This operation can also be referred to as a fit operation because it takes the low and high value of x (referred as a1and b1) and fits them in a linear fashion into a new low and high value (referred to as a2 and b2). If you use the call
remap(x,0,1,1,0), the value of
x will be inverted. Setting the function to
remap(x,0,1,0.25,0.75) will remap the output to
0.25–0.75
float remap(float x,float a1,float b1,float a2,float b2) {
return (x*(b2-a2) - a1*b2 + b1*a2) / (b1-a1);
}
|
s with a remap() of (0,1,1,0) inverts the image |
|
remap() of (0,1,0.25,0.75) limits the image to 0.25 - 0.75. |
No comments:
Post a Comment