Documentation of 'boofcv.misc.CircularIndex' Java class
CircularIndex
boofcv.misc

Class CircularIndex



  • public class CircularIndex
    extends java.lang.Object
    Function for use when referencing the index in a circular list
    • Constructor Summary

      Constructors 
      Constructor and Description
      CircularIndex() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int addOffset(int index, int offset, int size)
      Adds offset (positive or negative) to index in a circular buffer.
      static int distance(int index0, int index1, int size)
      Returns the smallest distance you would need to travel (positive or negative) to go from index0 to index1.
      static int distanceP(int index0, int index1, int size)
      Returns how many elements away in the positive direction you need to travel to get from index0 to index1.
      static int minusPOffset(int index, int offset, int size)
      Subtracts a positive offset to index in a circular buffer.
      static int plusPOffset(int index, int offset, int size)
      Adds a positive offset to index in a circular buffer.
      static int subtract(int index0, int index1, int size)
      Subtracts index1 from index0.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CircularIndex

        public CircularIndex()
    • Method Detail

      • plusPOffset

        public static int plusPOffset(int index,
                                      int offset,
                                      int size)
        Adds a positive offset to index in a circular buffer.
        Parameters:
        index - element in circular buffer
        offset - integer which is positive and less than size
        size - size of the circular buffer
        Returns:
        new index
      • minusPOffset

        public static int minusPOffset(int index,
                                       int offset,
                                       int size)
        Subtracts a positive offset to index in a circular buffer.
        Parameters:
        index - element in circular buffer
        offset - integer which is positive and less than size
        size - size of the circular buffer
        Returns:
        new index
      • addOffset

        public static int addOffset(int index,
                                    int offset,
                                    int size)
        Adds offset (positive or negative) to index in a circular buffer.
        Parameters:
        index - element in circular buffer
        offset - offset. |offset| < size
        size - size of the circular buffer
        Returns:
        new index
      • distanceP

        public static int distanceP(int index0,
                                    int index1,
                                    int size)
        Returns how many elements away in the positive direction you need to travel to get from index0 to index1.
        Parameters:
        index0 - element in circular buffer
        index1 - element in circular buffer
        size - size of the circular buffer
        Returns:
        positive distance
      • distance

        public static int distance(int index0,
                                   int index1,
                                   int size)
        Returns the smallest distance you would need to travel (positive or negative) to go from index0 to index1.
        Parameters:
        index0 - element in circular buffer
        index1 - element in circular buffer
        size - size of the circular buffer
        Returns:
        smallest distance
      • subtract

        public static int subtract(int index0,
                                   int index1,
                                   int size)
        Subtracts index1 from index0. positive number if its closer in the positive direction or negative if closer in the negative direction. if equal distance then it will return a negative number.
        Parameters:
        index0 - element in circular buffer
        index1 - element in circular buffer
        size - size of the circular buffer
        Returns:
        new index

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.