Package heronarts.lx
Class LXLayeredComponent
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXModulatorComponent
heronarts.lx.LXModelComponent
heronarts.lx.LXLayeredComponent
- All Implemented Interfaces:
LXLoopTask
,LXPath
,LXSerializable
,LXParameterListener
- Direct Known Subclasses:
LXDeviceComponent
,LXLayer
Base class for system components that run in the engine, which have common
attributes, such as parameters, modulators, and layers. For instance,
patterns, transitions, and effects are all LXComponents.
-
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.LXModelComponent
model
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
ModifierConstructorDescriptionprotected
LXLayeredComponent
(LX lx) protected
LXLayeredComponent
(LX lx, LXBuffer buffer) protected
LXLayeredComponent
(LX lx, LXDeviceComponent component) protected
LXLayeredComponent
(LX lx, String label) protected
LXLayeredComponent
(LX lx, String label, LXBuffer buffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected final LXLayeredComponent
addColor
(int i, int c) Adds to the color of point i, using blendColor with ADDprotected final LXLayeredComponent
Adds the color to the fixtureprotected final LXLayer
protected void
afterLayers
(double deltaMs) protected final LXLayeredComponent
blendColor
(int i, int c, LXColor.Blend blendMode) Blend the color at index i with its existing valueprotected final LXLayeredComponent
blendColor
(LXModel model, int c, LXColor.Blend blendMode) protected final LXLayeredComponent
Clears all colorsvoid
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.protected LXBuffer
protected int
getColor
(int i) Retrieves the color at index i.protected int
Retrieves the color at a given point.int[]
void
loop
(double deltaMs) protected void
onLoop
(double deltaMs) protected final LXLayer
removeLayer
(LXLayer layer) protected LXLayeredComponent
setBuffer
(LXDeviceComponent component) protected final LXLayeredComponent
setColor
(int i, int c) Sets the color of point iprotected final LXLayeredComponent
Sets the color of all points in a fixtureprotected final LXLayeredComponent
Sets the color of a point.protected final LXLayeredComponent
setColors
(int c) Sets all points to one colorprotected final LXLayeredComponent
subtractColor
(int i, int c) Subtracts from the color of point i, using blendColor with SUBTRACTMethods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModel
Methods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, 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, getLabel, 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, 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
-
Field Details
-
colors
protected int[] colors -
layers
-
palette
-
-
Constructor Details
-
LXLayeredComponent
-
LXLayeredComponent
-
LXLayeredComponent
-
LXLayeredComponent
-
LXLayeredComponent
-
-
Method Details
-
getBuffer
-
getColors
public int[] getColors() -
setBuffer
-
setBuffer
-
loop
public void loop(double deltaMs) - Specified by:
loop
in interfaceLXLoopTask
- Overrides:
loop
in classLXModelComponent
-
onLoop
protected void onLoop(double deltaMs) -
afterLayers
protected void afterLayers(double deltaMs) -
addLayer
-
removeLayer
-
getLayers
-
dispose
public void dispose()Description copied from class:LXComponent
Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally callsuper.dispose()
at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.- Overrides:
dispose
in classLXModulatorComponent
-
getColor
protected int getColor(int i) Retrieves the color at index i. This is provided mainly as documentation, but you should not generally use this method. You're better of just indexing directly to this.colors[i] and saving function call overhead.- Parameters:
i
- Color index- Returns:
- Color at that buffer index
-
getColor
Retrieves the color at a given point. This is provided mainly as documentation, you should not generally use this method. You're better off just indexing directly by calling this.colors[p.index] and saving the function call overhead for a single point.- Parameters:
p
- Point- Returns:
- Color at that point
-
setColor
Sets the color of point i- Parameters:
i
- Point indexc
- color- Returns:
- this
-
setColor
Sets the color of a point. This is provided for clarity, but if you're working with large pixel counts you may just skip calling this method and set colors[p.index] to avoid per-pixel function call overhead.- Parameters:
p
- Pointc
- color- Returns:
- this
-
blendColor
Blend the color at index i with its existing value- Parameters:
i
- Indexc
- New colorblendMode
- blending mode- Returns:
- this
-
blendColor
-
addColor
Adds to the color of point i, using blendColor with ADD- Parameters:
i
- Point indexc
- color- Returns:
- this
-
addColor
Adds the color to the fixture- Parameters:
model
- modelc
- New color- Returns:
- this
-
subtractColor
Subtracts from the color of point i, using blendColor with SUBTRACT- Parameters:
i
- Point indexc
- color- Returns:
- this
-
setColors
Sets all points to one color- Parameters:
c
- Color- Returns:
- this
-
setColor
Sets the color of all points in a fixture- Parameters:
model
- Modelc
- color- Returns:
- this
-
clearColors
Clears all colors- Returns:
- this
-