Class IndexBuffer

java.lang.Object
heronarts.lx.output.IndexBuffer

public class IndexBuffer extends Object
An IndexBuffer is a representation of all the pixels that an output packet will send. It can be comprised of multiple segments at various offsets, each of which may have its own byte ordering. The segments are not required to be strictly ordered or continuous, there may be gaps in the buffer (for instance DMX channels 1-10 may be send along with channels 30-40, leaving the space between blank). Each segment itself is continuous, specifying the indices into the master color buffer that are to be sent, along with their byte ordering.
  • Field Details

    • segments

      public final IndexBuffer.Segment[] segments
      All of the segments in this index buffer
    • numChannels

      public final int numChannels
      The total number of single-byte DMX channels in this index buffer
  • Constructor Details

    • IndexBuffer

      public IndexBuffer(int[] indices)
      Makes an IndexBuffer with a single segment, RGB with offset 0
      Parameters:
      indices - Indices for segment
    • IndexBuffer

      public IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder)
      Makes an IndexBuffer with a single segment, given indices and byte order, at offset 0
      Parameters:
      indices - Indices for single segment
      byteOrder - Byte order
    • IndexBuffer

      public IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder, int channel)
      Makes a single-semgent IndexBuffer with specified indices, byte ordering and channel offset
      Parameters:
      indices - Array of indices into master color buffer
      byteOrder - Byte ordering to send
      channel - Channel offset in the output packet
    • IndexBuffer

      public IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder, int channel, LXParameter brightness)
      Makes a single-semgent IndexBuffer with specified indices, byte ordering and channel offset
      Parameters:
      indices - Array of indices into master color buffer
      byteOrder - Byte ordering to send
      channel - Channel offset in the output packet
      brightness - Brightness for the output packet
    • IndexBuffer

      public IndexBuffer(List<IndexBuffer.Segment> segments)
      Makes an IndexBuffer with the given list of segments.
      Parameters:
      segments - Segments to include in index buffer
    • IndexBuffer

      public IndexBuffer(IndexBuffer.Segment... segments)
      Makes an IndexBuffer with the given list of segments.
      Parameters:
      segments - Segments to include in index buffer