Class SubImageWrapper<I>

    • Constructor Detail

      • SubImageWrapper

        public SubImageWrapper​(ImageWrapper<I> reference,
                               int startX,
                               int startY,
                               int width,
                               int height)
    • Method Detail

      • getWidth

        public int getWidth()
        Specified by:
        getWidth in interface ImageWrapper<I>
        Returns:
        The image width
      • getHeight

        public int getHeight()
        Specified by:
        getHeight in interface ImageWrapper<I>
        Returns:
        The image height
      • getValue

        public double getValue​(int x,
                               int y,
                               int channel)
        Description copied from interface: ImageWrapper
        Returns the value for a specific pixel and channel
        Specified by:
        getValue in interface ImageWrapper<I>
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        channel - the channel to select of a specific pixel
        Returns:
        the value for the pixel and channel
      • setValue

        public void setValue​(int x,
                             int y,
                             int channel,
                             double val)
        Description copied from interface: ImageWrapper
        Sets a value for a specific pixel and channel
        Specified by:
        setValue in interface ImageWrapper<I>
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        channel - the channel to select of a specific pixel
        val - the value for the pixel and channel
      • getChannels

        public int getChannels()
        Specified by:
        getChannels in interface ImageWrapper<I>
        Returns:
        The number of channels
      • supportsParallelAccess

        public boolean supportsParallelAccess()
        Specified by:
        supportsParallelAccess in interface ImageWrapper<I>
        Returns:
        true iff the image wrapper supports parallel write access. Else false
      • applyFunction

        public void applyFunction​(PixelFunction function,
                                  int startX,
                                  int startY,
                                  int endX,
                                  int endY,
                                  int strideX,
                                  int strideY,
                                  boolean applyParallel)
        Description copied from interface: ImageWrapper
        Applies the given function for the pixels of the image segment defined by [startX, endX] and [startY, endX]
        Specified by:
        applyFunction in interface ImageWrapper<I>
        Parameters:
        function - function applied for ever pixel
        startX - start x coordinate of image segment
        startY - start y coordinate of image segment
        endX - end x coordinate of image segment
        endY - end y coordinate of image segment
        strideX - stride for the x coordinate (e.g. take every, every-second, every-third, ... element)
        strideY - stride for the y coordinate (e.g. take every, every-second, every-third, ... element)
        applyParallel - flag which decides if function is applied in parallel (ATTENTION: when using this in combination with for the given image; Always check {@link ImageWrapper#supportsParallelAccess()}!