Class IndexBuffer.Segment

java.lang.Object
heronarts.lx.output.IndexBuffer.Segment
Enclosing class:
IndexBuffer

public static class IndexBuffer.Segment extends Object
A Segment is a continous portion of an index buffer which specifies the indices into the final color buffer which are to be sent, along with the byte ordering.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Parameter to track the brightness level of this segment
    Byte order to use when sending the points in this segment, which implicitly specifies how many bytes are used per pixel
    final int[]
    Globally indexed buffer of point indices in this segment, relative to master color buffer.
    final int
    How many bytes spacing is placed between each pixel value, typically this is byteEncoder.numBytes() but may be specified larger
    final int
    Starting channel in output packet for this segment (e.g.
    final byte[]
    Static bytes to be sent.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Segment(byte[] staticBytes, int channel)
    Segment that represents flat, static byte data
    Segment(int[] indices)
    Default RGB segment for a given set of indices at offset 0
    Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder)
    Segment with specified indices and byte ordering
    Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel)
    Segment with specified indices, byte ordering and channel offset
    Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel, int outputStride, LXParameter brightness)
    Segment with specified indices, byte ordering and channel offset, custom output stride
    Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel, LXParameter brightness)
    Segment with specified indices, byte ordering and channel offset
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the number of channels required in an output packet to send this segment

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • staticBytes

      public final byte[] staticBytes
      Static bytes to be sent.
    • indices

      public final int[] indices
      Globally indexed buffer of point indices in this segment, relative to master color buffer.
    • byteEncoder

      public final LXBufferOutput.ByteEncoder byteEncoder
      Byte order to use when sending the points in this segment, which implicitly specifies how many bytes are used per pixel
    • startChannel

      public final int startChannel
      Starting channel in output packet for this segment (e.g. ArtNet channel)
    • outputStride

      public final int outputStride
      How many bytes spacing is placed between each pixel value, typically this is byteEncoder.numBytes() but may be specified larger
    • brightness

      public final LXParameter brightness
      Parameter to track the brightness level of this segment
  • Constructor Details

    • Segment

      public Segment(int[] indices)
      Default RGB segment for a given set of indices at offset 0
      Parameters:
      indices - Point indices for this segment
    • Segment

      public Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder)
      Segment with specified indices and byte ordering
      Parameters:
      indices - Array of indices into master color buffer
      byteEncoder - Byte encoder to use when sending
    • Segment

      public Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel)
      Segment with specified indices, byte ordering and channel offset
      Parameters:
      indices - Array of indices into master color buffer
      byteEncoder - Byte encoder to use when sending send
      channel - Channel offset in the output packet
    • Segment

      public Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel, LXParameter brightness)
      Segment with specified indices, byte ordering and channel offset
      Parameters:
      indices - Array of indices into master color buffer
      byteEncoder - Byte encoder to send
      channel - Channel offset in the output packet
      brightness - Brightness of this segment
    • Segment

      public Segment(int[] indices, LXBufferOutput.ByteEncoder byteEncoder, int channel, int outputStride, LXParameter brightness)
      Segment with specified indices, byte ordering and channel offset, custom output stride
      Parameters:
      indices - Array of indices into master color buffer
      byteEncoder - Byte encoder to send
      channel - Channel offset in the output packet
      brightness - Brightness of this segment
    • Segment

      public Segment(byte[] staticBytes, int channel)
      Segment that represents flat, static byte data
      Parameters:
      staticBytes - Fixed byte array data in the segment
      channel - Channel to copy data at
  • Method Details

    • getRequiredChannels

      public int getRequiredChannels()
      Gets the number of channels required in an output packet to send this segment
      Returns:
      required channels to send this segment