Method clamp
clamp(Int32, Int32, Int32)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are int values.
Declaration
public static int clamp(int x, int a, int b)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | Input value to be clamped. |
Int32 | a | Lower bound of the interval. |
Int32 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
Int32 | The clamping of the input x into the interval [a, b]. |
clamp(int2, int2, int2)
Returns the result of a componentwise clamping of the int2 x into the interval [a, b], where a and b are int2 vectors.
Declaration
public static int2 clamp(int2 x, int2 a, int2 b)
Parameters
Type | Name | Description |
---|---|---|
int2 | x | Input value to be clamped. |
int2 | a | Lower bound of the interval. |
int2 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
int2 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(int3, int3, int3)
Returns the result of a componentwise clamping of the int3 x into the interval [a, b], where x, a and b are int3 vectors.
Declaration
public static int3 clamp(int3 x, int3 a, int3 b)
Parameters
Type | Name | Description |
---|---|---|
int3 | x | Input value to be clamped. |
int3 | a | Lower bound of the interval. |
int3 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
int3 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(int4, int4, int4)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are int4 vectors.
Declaration
public static int4 clamp(int4 x, int4 a, int4 b)
Parameters
Type | Name | Description |
---|---|---|
int4 | x | Input value to be clamped. |
int4 | a | Lower bound of the interval. |
int4 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
int4 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(UInt32, UInt32, UInt32)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are uint values.
Declaration
public static uint clamp(uint x, uint a, uint b)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | x | Input value to be clamped. |
UInt32 | a | Lower bound of the interval. |
UInt32 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
UInt32 | The clamping of the input x into the interval [a, b]. |
clamp(uint2, uint2, uint2)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are uint2 vectors.
Declaration
public static uint2 clamp(uint2 x, uint2 a, uint2 b)
Parameters
Type | Name | Description |
---|---|---|
uint2 | x | Input value to be clamped. |
uint2 | a | Lower bound of the interval. |
uint2 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
uint2 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(uint3, uint3, uint3)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are uint3 vectors.
Declaration
public static uint3 clamp(uint3 x, uint3 a, uint3 b)
Parameters
Type | Name | Description |
---|---|---|
uint3 | x | Input value to be clamped. |
uint3 | a | Lower bound of the interval. |
uint3 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
uint3 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(uint4, uint4, uint4)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are uint4 vectors.
Declaration
public static uint4 clamp(uint4 x, uint4 a, uint4 b)
Parameters
Type | Name | Description |
---|---|---|
uint4 | x | Input value to be clamped. |
uint4 | a | Lower bound of the interval. |
uint4 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
uint4 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(Int64, Int64, Int64)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are long values.
Declaration
public static long clamp(long x, long a, long b)
Parameters
Type | Name | Description |
---|---|---|
Int64 | x | Input value to be clamped. |
Int64 | a | Lower bound of the interval. |
Int64 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
Int64 | The clamping of the input x into the interval [a, b]. |
clamp(UInt64, UInt64, UInt64)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are ulong values.
Declaration
public static ulong clamp(ulong x, ulong a, ulong b)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | x | Input value to be clamped. |
UInt64 | a | Lower bound of the interval. |
UInt64 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
UInt64 | The clamping of the input x into the interval [a, b]. |
clamp(Single, Single, Single)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are float values.
Declaration
public static float clamp(float x, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
Single | x | Input value to be clamped. |
Single | a | Lower bound of the interval. |
Single | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
Single | The clamping of the input x into the interval [a, b]. |
clamp(float2, float2, float2)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are float2 vectors.
Declaration
public static float2 clamp(float2 x, float2 a, float2 b)
Parameters
Type | Name | Description |
---|---|---|
float2 | x | Input value to be clamped. |
float2 | a | Lower bound of the interval. |
float2 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
float2 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(float3, float3, float3)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are float3 vectors.
Declaration
public static float3 clamp(float3 x, float3 a, float3 b)
Parameters
Type | Name | Description |
---|---|---|
float3 | x | Input value to be clamped. |
float3 | a | Lower bound of the interval. |
float3 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
float3 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(float4, float4, float4)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are float4 vectors.
Declaration
public static float4 clamp(float4 x, float4 a, float4 b)
Parameters
Type | Name | Description |
---|---|---|
float4 | x | Input value to be clamped. |
float4 | a | Lower bound of the interval. |
float4 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
float4 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(Double, Double, Double)
Returns the result of clamping the value x into the interval [a, b], where x, a and b are double values.
Declaration
public static double clamp(double x, double a, double b)
Parameters
Type | Name | Description |
---|---|---|
Double | x | Input value to be clamped. |
Double | a | Lower bound of the interval. |
Double | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
Double | The clamping of the input x into the interval [a, b]. |
clamp(double2, double2, double2)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are double2 vectors.
Declaration
public static double2 clamp(double2 x, double2 a, double2 b)
Parameters
Type | Name | Description |
---|---|---|
double2 | x | Input value to be clamped. |
double2 | a | Lower bound of the interval. |
double2 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
double2 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(double3, double3, double3)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are double3 vectors.
Declaration
public static double3 clamp(double3 x, double3 a, double3 b)
Parameters
Type | Name | Description |
---|---|---|
double3 | x | Input value to be clamped. |
double3 | a | Lower bound of the interval. |
double3 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
double3 | The componentwise clamping of the input x into the interval [a, b]. |
clamp(double4, double4, double4)
Returns the result of a componentwise clamping of the value x into the interval [a, b], where x, a and b are double4 vectors.
Declaration
public static double4 clamp(double4 x, double4 a, double4 b)
Parameters
Type | Name | Description |
---|---|---|
double4 | x | Input value to be clamped. |
double4 | a | Lower bound of the interval. |
double4 | b | Upper bound of the interval. |
Returns
Type | Description |
---|---|
double4 | The componentwise clamping of the input x into the interval [a, b]. |