Declarations ​
pascal
function Clamp(const Value: Integer): Integer; overload;
function Clamp(Value, Max: Integer): Integer; overload;
function Clamp(Value, Min, Max: Integer): Integer; overload;Overload Details
Overload 1 ​
pascal
function Clamp(const Value: Integer): Integer; overload;Clamps an integer value to byte range [0..255].
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to clamp. |
| Type | Description |
|---|---|
Integer | Value clamped to range [0..255]. |
Overload 2 ​
pascal
function Clamp(Value, Max: Integer): Integer; overload;Clamps an integer value to range [0..Max].
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to clamp. |
Max | Integer | Maximum upper boundary. |
| Type | Description |
|---|---|
Integer | Value clamped to range [0..Max]. |
Overload 3 ​
pascal
function Clamp(Value, Min, Max: Integer): Integer; overload;Clamps an integer value to range [Min..Max].
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to clamp. |
Min | Integer | Minimum lower boundary. |
Max | Integer | Maximum upper boundary. |
| Type | Description |
|---|---|
Integer | Value clamped to range [Min..Max]. |
Description ​
Clamp restricts an integer value to fit within a specified range.
- The single-parameter overload
Clamp(Value)clamps to byte channel range[0..255]. - The two-parameter overload
Clamp(Value, Max)clamps to[0..Max]. - The three-parameter overload
Clamp(Value, Min, Max)clamps to[Min..Max].