Class DataClip


public class DataClip extends OSPRuntime.Supported
This defines a subset of data elements called steps. The steps are the elements with array index that meets the conditions: 1. index >= startIndex 2. index <= startIndex + (clipLength-1)*stride 3. (index-startIndex) % stride = 0.
Version:
1.0
Author:
Douglas Brown
  • Field Details

  • Constructor Details

    • DataClip

      public DataClip()
  • Method Details

    • setDataLength

      public void setDataLength(int length)
      Sets the data length (number of data elements in the Data object).
      Parameters:
      length - the data length
    • getDataLength

      public int getDataLength()
      Gets the data length (number of data elements in the Data object).
      Returns:
      the data length
    • setClipLength

      public int setClipLength(int length)
      Sets the clip length (number of video frames on which the data is displayed). If the clip length is set to zero or less then it is reported as equal to the entire data length.
      Parameters:
      clipLength - the desired clip length
      Returns:
      the resulting clip length
    • getClipLength

      public int getClipLength()
      Gets the clip length (number of video frames on which the data is displayed unless limited by the video clip or stride).
      Returns:
      the clip length
    • setStartIndex

      public int setStartIndex(int start)
      Sets the start index.
      Parameters:
      start - the desired start index
      Returns:
      the resulting start index
    • getStartIndex

      public int getStartIndex()
      Gets the start index.
      Returns:
      the start index
    • setStride

      public int setStride(int stride)
      Sets the stride (number of data elements per step).
      Parameters:
      stride - the desired stride
      Returns:
      the resulting stride
    • getStride

      public int getStride()
      Gets the stride (number of data elements per step).
      Returns:
      the stride
    • getAvailableClipLength

      public int getAvailableClipLength()
      Gets the available clip length (step count). A step is available if it's index is less than the data length. Available clip length <= clip length
      Returns:
      the index
    • stepToIndex

      public int stepToIndex(int stepNumber)
      Converts step number to data index.
      Parameters:
      stepNumber - the step number
      Returns:
      the data index
    • indexToStep

      public int indexToStep(int index)
      Converts data index to step number. An index that falls between two steps maps to the previous step.
      Parameters:
      index - the data index
      Returns:
      the step number
    • includesIndex

      public boolean includesIndex(int n)
      Determines whether the specified index is a step index.
      Parameters:
      n - the index number
      Returns:
      true if the index is a step index
    • setAdjusting

      public void setAdjusting(boolean adjusting)
      Sets the adjusting flag.
      Parameters:
      adjusting - true if adjusting
    • isAdjusting

      public boolean isAdjusting()
      Gets the adjusting flag.
      Returns:
      true if adjusting
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load data for this class.
      Returns:
      the object loader