Class ComponentTransfer
- All Implemented Interfaces:
Proxy
The available functions include linear, piecewise-linear, gamma and step functions.
Note that the transfer function is applied to un-premultiplied values, and all results are clamped to the [0, 1] range.
- Since:
- 4.20
-
Constructor Summary
ConstructorsConstructorDescriptionComponentTransfer(MemorySegment address) Create a ComponentTransfer proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy ofother.static ComponentTransferdiscrete(@org.jspecify.annotations.Nullable float @Nullable [] values) Creates a new component transfer that applies a step function.static booleanequal(MemorySegment self, MemorySegment other) Compares two component transfers for equality.voidfree()Frees a component transfer.static ComponentTransfergamma(float amp, float exp, float ofs) Creates a new component transfer that applies a gamma transform.static @Nullable TypegetType()Get the GType of the ComponentTransfer classstatic ComponentTransferidentity()Creates a new component transfer that doesn't change the component value.static ComponentTransferlevels(float n) Creates a new component transfer that limits the values of the component tonlevels.static ComponentTransferlinear(float m, float b) Creates a new component transfer that applies a linear transform.static ComponentTransfertable(@org.jspecify.annotations.Nullable float @Nullable [] values) Creates a new component transfer that applies a piecewise linear function.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ComponentTransfer
Create a ComponentTransfer proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
Get the GType of the ComponentTransfer class- Returns:
- the GType
-
discrete
public static ComponentTransfer discrete(@org.jspecify.annotations.Nullable float @Nullable [] values) Creates a new component transfer that applies a step function.The new value is computed as
C' = values[k]
where k is the smallest value such that
k / n <= C < (k + 1) / n
<figure>
</figure>- Parameters:
values- Values- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
gamma
Creates a new component transfer that applies a gamma transform.The new value is computed as
C' = amp * pow (C, exp) + ofs
<figure>
</figure>- Parameters:
amp- Amplitudeexp- Exponentofs- Offset- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
identity
Creates a new component transfer that doesn't change the component value.<figure>
</figure>- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
levels
Creates a new component transfer that limits the values of the component tonlevels.The new value is computed as
C' = (floor (C * n) + 0.5) / n
<figure>
</figure>- Parameters:
n- Number of levels- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
linear
Creates a new component transfer that applies a linear transform.The new value is computed as
C' = C * m + b
<figure>
</figure>- Parameters:
m- Slopeb- Offset- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
table
Creates a new component transfer that applies a piecewise linear function.The new value is computed as
C' = values[k] + (C - k / (n - 1)) * n * (values[k + 1] - values[k])
where k is the smallest value such that
k / (n - 1) <= C < (k + 1) / (n - 1)
<figure>
</figure>- Parameters:
values- Values- Returns:
- a new
GskComponentTransfer - Since:
- 4.20
-
equal
Compares two component transfers for equality.- Parameters:
self- a component transferother- another component transfer- Returns:
- true if
selfandotherare equal - Since:
- 4.20
-
copy
Creates a copy ofother.- Returns:
- a newly allocated copy of this ComponentTransfer
- Since:
- 4.20
-
free
public void free()Frees a component transfer.- Since:
- 4.20
-