Class ComponentMappingTransform

    • Field Detail

      • component

        protected final int[] component
        for each component of the target vector: from which source vector component should it be taken.
    • Constructor Detail

      • ComponentMappingTransform

        public ComponentMappingTransform​(int targetDim)
      • ComponentMappingTransform

        public ComponentMappingTransform​(int[] component)
        Parameters:
        component - array specifying for each component of the target vector from which source vector component should it be taken.
    • Method Detail

      • getComponentMapping

        public void getComponentMapping​(int[] component)
        Description copied from interface: Mixed
        Get an array indicating for each target dimensions from which source dimension it is taken.

        For instance, if the transform maps 2D (x,y) coordinates to the first two components of a 3D (x,y,z) coordinate, the result will be [0, 1, x]. Here, the value of x is undefined because the third target dimension does not correspond to any source dimension. See Mixed.getComponentZero(boolean[]).

        Specified by:
        getComponentMapping in interface Mixed
        Overrides:
        getComponentMapping in class AbstractMixedTransform
        Parameters:
        component - array of size at least the target dimension to store the result.
      • setComponentMapping

        public void setComponentMapping​(int[] component)
        Set for each target dimensions from which source dimension it is taken.

        For instance, if the transform maps 3D (x,y,z) coordinates to 2D (z,x,y) coordinate this will be [2, 0, 1].

        Parameters:
        component - array that says for each component of the target vector from which source vector component it should be taken.
      • getMatrix

        public double[][] getMatrix()
        Description copied from interface: Mixed
        Get the matrix that transforms homogeneous source points to homogeneous target points. For testing purposes.
        Specified by:
        getMatrix in interface Mixed
      • apply

        public void apply​(long[] source,
                          long[] target)
        Description copied from interface: Transform
        Apply the Transform to a source vector to obtain a target vector.
        Specified by:
        apply in interface Transform
        Parameters:
        source - source coordinates.
        target - set this to the target coordinates.
      • apply

        public void apply​(int[] source,
                          int[] target)
        Description copied from interface: Transform
        Apply the Transform to a source vector to obtain a target vector.
        Specified by:
        apply in interface Transform
        Parameters:
        source - source coordinates.
        target - set this to the target coordinates.
      • concatenate

        public ComponentMappingTransform concatenate​(ComponentMapping t)
        Description copied from interface: Concatenable
        Concatenate this object with a. The result will be an object that can be concatenated with another A. The conventional meaning for concatenating transformations is the following: Let ba = b.concatenate(a). Applying ba to x is equivalent to first applying a to x and then applying b to the result.
        Specified by:
        concatenate in interface Concatenable<ComponentMapping>
      • preConcatenate

        public ComponentMappingTransform preConcatenate​(ComponentMapping t)
        Description copied from interface: PreConcatenable
        Pre-concatenate this object with a. The result will be an object that can be pre-concatenated with another A. The conventional meaning for concatenating transformations is the following: Let ba = a.preConcatenate(b). Applying ba to x is equivalent to first applying a to x and then applying b to the result.
        Specified by:
        preConcatenate in interface PreConcatenable<ComponentMapping>