Class VectorAccessor

java.lang.Object
imagingbook.common.image.access.ImageAccessor
imagingbook.common.image.access.VectorAccessor
Direct Known Subclasses:
RgbAccessor

public abstract class VectorAccessor extends ImageAccessor
Accessor for vector-valued images with arbitrary depth (number of components).
  • Method Details

    • getDepth

      public int getDepth()
      Description copied from class: ImageAccessor
      Returns the depth (number of components) of this image accessor. 1 is returned if the image is scalar-valued.
      Specified by:
      getDepth in class ImageAccessor
      Returns:
      the image depth.
    • getComponentAccessor

      Description copied from class: ImageAccessor
      Returns the ImageAccessor for the k-th component; the result is a sub-type of ScalarAccessor. In the case of a scalar-valued image, THIS object is returned.
      Specified by:
      getComponentAccessor in class ImageAccessor
      Parameters:
      k - the component index
      Returns:
      the component accessor.
    • getVal

      public float getVal(int u, int v, int k)
      Description copied from class: ImageAccessor
      Returns the value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See also ImageAccessor.getDepth().
      Specified by:
      getVal in class ImageAccessor
      Parameters:
      u - the x-coordinate
      v - the y-coordinate
      k - the component index
      Returns:
      the component value (float)
    • getVal

      public float getVal(double x, double y, int k)
      Description copied from class: ImageAccessor
      Returns the interpolated value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See also ImageAccessor.getDepth().
      Specified by:
      getVal in class ImageAccessor
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      k - the component index
      Returns:
      the interpolated component value (float[])
    • setVal

      public void setVal(int u, int v, int k, float val)
      Description copied from class: ImageAccessor
      Sets the value of the pixel's k-th component at the specified position. If the associated image is scalar-valued, this is equivalent to component 0. See also ImageAccessor.getDepth().
      Specified by:
      setVal in class ImageAccessor
      Parameters:
      u - the x-coordinate
      v - the y-coordinate
      k - the component index
      val - the new component value