Clamps integer value to range
function ClampInt(Number: LongInt; Min: LongInt; Max: LongInt): LongInt;
ImagingUtility (at line 170)