Package heronarts.lx.blend
Class LXBlend
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXModulatorComponent
heronarts.lx.blend.LXBlend
- All Implemented Interfaces:
LXLoopTask
,LXPath
,LXSerializable
,LXParameterListener
- Direct Known Subclasses:
DissolveBlend
,LXBlend.FunctionalBlend
An LXBlend is a loop-based implementation of a compositing algorithm.
Two color buffers are blended together using some logic, typically
a standard alpha-compositing technique. However, more complex blend
modes may be authored, taking into account position information from
the model, for instance.
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.LXModulatorComponent
LXModulatorComponent.Profiler
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Hidden, LXComponent.Placeholder, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Fields inherited from class heronarts.lx.LXModulatorComponent
modulators, profiler
Fields inherited from class heronarts.lx.LXComponent
children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFile
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Blends the src buffer onto the destination buffer at the specified alpha amount.void
getLabel()
Gets the name of this blend.getName()
Returns the name of this blend, to be shown in UIvoid
Transitions from one buffer to another.void
onActive()
Subclasses may override this method.void
Subclasses may override this method.Sets name of this blend modetoString()
Name of the blendMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, dispose, getModulator, getModulators, loop, moveModulator, removeModulator, startModulator
Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, contains, copyParameters, getCategory, getChild, getComponentName, getComponentName, getComponentName, getDescription, getId, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, load, loadParameters, loadPreset, onParameterChanged, removeParameter, removeParameter, removeParameter, removeParameter, save, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Constructor Details
-
LXBlend
-
-
Method Details
-
setName
Sets name of this blend mode- Parameters:
name
- UI name of blend- Returns:
- this
-
getName
Returns the name of this blend, to be shown in UI- Returns:
- Blend name
-
getLabel
Gets the name of this blend.- Specified by:
getLabel
in interfaceLXPath
- Overrides:
getLabel
in classLXComponent
- Returns:
- Label for this component
-
toString
Name of the blend- Overrides:
toString
in classLXComponent
- Returns:
- Debug string identifying this component
-
blend
-
blend
Blends the src buffer onto the destination buffer at the specified alpha amount.- Parameters:
dst
- Destination buffer (lower layer)src
- Source buffer (top layer)alpha
- Alpha blend, from 0-1output
- Output buffer, which may be the same as src or dstmodel
- A model which indicates the set of points to blend
-
lerp
Transitions from one buffer to another. By default, this is used by first blending from-to with alpha 0-1, then blending to-from with alpha 1-0. Blends which are asymmetrical may override this method for custom functionality. This method is used by pattern transitions on channels as well as the crossfader.- Parameters:
from
- First bufferto
- Second bufferamt
- Interpolation from-to (0-1)output
- Output buffer, which may be the same as from or tomodel
- The model with points that should be blended
-
onActive
public void onActive()Subclasses may override this method. It will be invoked when the blend is about to become active for a transition. Blends may take care of any initialization needed or reset parameters if desired. Note that a blend used on a channel fader or crossfader will only receive this message once. -
onInactive
public void onInactive()Subclasses may override this method. It will be invoked when the transition is no longer active. Resources may be freed if desired. Note that this method will only be received once blends used on channel faders or crossfaders.
-