public interface LedDriverInterface extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
allOff()
Turn off all pixels and render.
|
void |
close() |
default int |
getBlueComponent(int pixel)
Get the 8-bit blue component value for the specified pixel.
|
default int |
getGreenComponent(int pixel)
Get the 8-bit green component value for the specified pixel.
|
int |
getNumPixels() |
int |
getPixelColour(int pixel)
Get the current colour for the specified pixel.
|
default int |
getRedComponent(int pixel)
Get the 8-bit red component value for the specified pixel.
|
void |
render()
Push any updated colours to the LED strip.
|
default void |
setBlueComponent(int pixel,
int blue)
Set the 8-bit blue component value for the specified pixel.
|
default void |
setGreenComponent(int pixel,
int green)
Set the 8-bit green component value for the specified pixel.
|
void |
setPixelColour(int pixel,
int colour)
Set the colour for the specified pixel.
|
default void |
setPixelColourHSB(int pixel,
float hue,
float saturation,
float brightness)
Set the colour for the specified pixel using Hue Saturation Brightness (HSB) values.
|
default void |
setPixelColourHSL(int pixel,
float hue,
float saturation,
float luminance)
Set the colour for the specified pixel using Hue Saturation Luminance (HSL) values.
|
default void |
setPixelColourRGB(int pixel,
int red,
int green,
int blue)
Set the colour for the specified pixel using individual red / green / blue 8-bit values.
|
default void |
setRedComponent(int pixel,
int red)
Set the 8-bit red component value for the specified pixel.
|
void close()
close in interface AutoCloseableclose in interface Closeableint getNumPixels()
void render()
void allOff()
int getPixelColour(int pixel)
pixel - Pixel number.void setPixelColour(int pixel,
int colour)
pixel - Pixel number.colour - Colour represented as a 24bit RGB integer (0x0RGB).default void setPixelColourRGB(int pixel,
int red,
int green,
int blue)
pixel - Pixel number.red - 8-bit value for the red component.green - 8-bit value for the green component.blue - 8-bit value for the blue component.default void setPixelColourHSB(int pixel,
float hue,
float saturation,
float brightness)
pixel - Pixel number.hue - Float value in the range 0..1 representing the hue.saturation - Float value in the range 0..1 representing the colour saturation.brightness - Float value in the range 0..1 representing the colour brightness.default void setPixelColourHSL(int pixel,
float hue,
float saturation,
float luminance)
Set the colour for the specified pixel using Hue Saturation Luminance (HSL) values.
HSL colour mapping code taken from this HSL Color class by Rob Camick.
pixel - Pixel number.hue - Represents the colour (think colours of the rainbow), specified in degrees from 0 - 360. Red is 0, green is 120 and blue is 240.saturation - Represents the purity of the colour. Range is 0..1 with 1 fully saturated and 0 gray.luminance - Represents the brightness of the colour. Range is 0..1 with 1 white 0 black.default int getRedComponent(int pixel)
pixel - Pixel number.default void setRedComponent(int pixel,
int red)
pixel - Pixel number.red - 8-bit red component value.default int getGreenComponent(int pixel)
pixel - Pixel number.default void setGreenComponent(int pixel,
int green)
pixel - Pixel number.green - 8-bit green component value.default int getBlueComponent(int pixel)
pixel - Pixel number.default void setBlueComponent(int pixel,
int blue)
pixel - Pixel number.blue - 8-bit blue component value.Copyright © 2016–2018 mattjlewis. All rights reserved.