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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    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
    static final int
    Placeholder value that can be used in index buffers to output an empty pixel with all byte values of 0, rather than a value from the colors array.
    final int
    The total number of single-byte DMX channels required by this index buffer to fit all of the data it contains
    All of the segments in this index buffer
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndexBuffer(int[] indices)
    Makes an IndexBuffer with a single segment, RGB with offset 0
    IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder)
    Makes an IndexBuffer with a single segment, given indices and byte order, at offset 0
    IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder, int channel)
    Makes a single-semgent IndexBuffer with specified indices, byte ordering and channel offset
    IndexBuffer(int[] indices, LXBufferOutput.ByteOrder byteOrder, int channel, LXParameter brightness)
    Makes a single-semgent IndexBuffer with specified indices, byte ordering and channel offset
    Makes an IndexBuffer with the given list of segments.
    Makes an IndexBuffer with the given list of segments.
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • EMPTY_PIXEL

      public static final int EMPTY_PIXEL
      Placeholder value that can be used in index buffers to output an empty pixel with all byte values of 0, rather than a value from the colors array.
      See Also:
    • 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 required by this index buffer to fit all of the data it contains
  • 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