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.ProfilerNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsFields inherited from class heronarts.lx.LXModelComponent
modelFields inherited from class heronarts.lx.LXModulatorComponent
modulators, profilerFields inherited from class heronarts.lx.LXComponent
childArrays, 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, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLXLayeredComponent(LX lx) protectedLXLayeredComponent(LX lx, LXBuffer buffer) protectedLXLayeredComponent(LX lx, LXDeviceComponent component) protectedLXLayeredComponent(LX lx, String label) protectedLXLayeredComponent(LX lx, String label, LXBuffer buffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected final LXLayeredComponentaddColor(int i, int c) Adds to the color of point i, using blendColor with ADDprotected final LXLayeredComponentAdds the color to the fixtureprotected final LXLayerprotected voidafterLayers(double deltaMs) protected voidapplyEffects(double deltaMs) protected final LXLayeredComponentblendColor(int i, int c, LXColor.Blend blendMode) Blend the color at index i with its existing valueprotected final LXLayeredComponentblendColor(LXModel model, int c, LXColor.Blend blendMode) protected final LXLayeredComponentClears all colorsvoiddispose()Invoked when a component is being removed from the system and will no longer be used at all.protected LXBufferprotected intgetColor(int i) Retrieves the color at index i.protected intRetrieves the color at a given point.int[]voidloop(double deltaMs) protected voidonLoop(double deltaMs) protected final LXLayerremoveLayer(LXLayer layer) protected LXLayeredComponentsetBuffer(LXDeviceComponent component) protected final LXLayeredComponentsetColor(int i, int c) Sets the color of point iprotected final LXLayeredComponentSets the color of all points in a fixtureprotected final LXLayeredComponentSets the color of a point.protected final LXLayeredComponentsetColors(int c) Sets all points to one colorprotected final LXLayeredComponentsubtractColor(int i, int c) Subtracts from the color of point i, using blendColor with SUBTRACTMethods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModelMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulatorMethods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, 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:
loopin interfaceLXLoopTask- Overrides:
loopin classLXModelComponent
-
onLoop
protected void onLoop(double deltaMs) -
afterLayers
protected void afterLayers(double deltaMs) -
applyEffects
protected void applyEffects(double deltaMs) -
addLayer
-
removeLayer
-
getLayers
-
dispose
public void dispose()Description copied from class:LXComponentInvoked 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:
disposein 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
-