Clamping (graphics) (original) (raw)
In computer graphics, clamping is the process of limiting a position to an area. Unlike wrapping, clamping merely moves the point to the nearest available value. To put clamping into perspective, pseudocode (in Python) for clamping is as follows: def clamp(x, minimum, maximum): if x < minimum: x = minimum elif x > maximum: x = maximum return x