Class Cell<A>

    • Field Detail

      • n

        protected final int n
      • dimensions

        protected final int[] dimensions
      • steps

        protected final int[] steps
      • min

        protected final long[] min
      • numPixels

        private final int numPixels
      • data

        private final A data
    • Constructor Detail

      • Cell

        public Cell​(int[] dimensions,
                    long[] min,
                    A data)
        Create a new Cell.

        The arguments are not copied. Therefore, dimensions and min arrays may be modified and re-used to create other Cells.

      • Cell

        public Cell​(CellGrid.CellDimensionsAndSteps dims,
                    long[] min,
                    A data)
        Create a new Cell.

        Note that the arguments are not copied. So for example, the min array should not be modified and re-used to create other Cells.

        Parameters:
        dims - dimensions, steps, and numPixels of the cell
        min - min coordinate of the cell
        data - pixel storage
    • Method Detail

      • getData

        public A getData()
        Get the basic type array that stores this cell's pixels.
        Returns:
        underlying basic type array.
      • size

        public long size()
      • indexToGlobalPosition

        public long indexToGlobalPosition​(int index,
                                          int d)
      • indexToGlobalPosition

        public void indexToGlobalPosition​(int index,
                                          long[] position)
      • globalPositionToIndex

        public int globalPositionToIndex​(long[] position)
        Compute the index in the underlying flat array of this cell which corresponds to the specified global position.
        Parameters:
        position - a global position
        Returns:
        corresponding index
      • min

        public long min​(int d)
        Get the minimum in dimension d.
        Specified by:
        min in interface Interval
        Parameters:
        d - dimension
        Returns:
        minimum in dimension d.
      • max

        public long max​(int d)
        Get the maximum in dimension d.
        Specified by:
        max in interface Interval
        Parameters:
        d - dimension
        Returns:
        maximum in dimension d.
      • dimension

        public long dimension​(int d)
        Get the number of pixels in a given dimension d.
        Specified by:
        dimension in interface Dimensions
        Specified by:
        dimension in interface Interval
        Parameters:
        d -
      • dimensions

        public void dimensions​(int[] dim)
        Write the number of pixels in each dimension into int[].
        Parameters:
        dim -