Interface ImageWrapper<I>

    • Method Detail

      • getImage

        I getImage()
        Getter for the wrapped image.
        Returns:
        Returns the wrapped image.
      • getWidth

        int getWidth()
        Returns:
        The image width
      • getHeight

        int getHeight()
        Returns:
        The image height
      • getChannels

        default int getChannels()
        Returns:
        The number of channels
      • getChannelType

        ChannelType getChannelType()
        Returns:
        The channelType of the image
      • close

        void close()
        Overrides signature of close method from AutoCloseable Interface to not throw an exception
        Specified by:
        close in interface AutoCloseable
      • getValue

        double getValue​(int x,
                        int y,
                        int channel)
        Returns the value for a specific pixel and channel
        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
      • getValues

        default double[] getValues​(int x,
                                   int y)
        Returns all value for a given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        Returns:
        all pixel values at the given position
      • getValuesAsColor

        default Color getValuesAsColor​(int x,
                                       int y)
        Returns a color value for the given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        Returns:
        color value of the given position
      • setValue

        void setValue​(int x,
                      int y,
                      int channel,
                      double val)
        Sets a value for a specific pixel and channel
        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
      • setValues

        default void setValues​(int x,
                               int y,
                               double[] values)
        Sets values for the given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        values - values for the given coordinate
      • setValues

        default void setValues​(int x,
                               int y,
                               Color color)
        Sets values for the given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        color - to be set at the given coordinate
      • supportsParallelAccess

        default boolean supportsParallelAccess()
        Returns:
        true iff the image wrapper supports parallel write access. Else false
      • applyFunction

        default void applyFunction​(PixelFunction function)
        Applies the given function for every pixel of the image if supportsParallelAccess() this is done parallel. Note: This function does not change pixels per default; only if you call image.setValue() in the given PixelFunction!
        Parameters:
        function - function applied for ever pixel
      • applyFunction

        default void applyFunction​(PixelFunction function,
                                   int startX,
                                   int startY,
                                   int endX,
                                   int endY)
        Applies the given function for the pixels of the image segment defined by [startX, endX] and [startY, endX] if supportsParallelAccess() this is done parallel. Note: This function does not change pixels per default; only if you call image.setValue() in the given PixelFunction!
        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
      • applyFunction

        default void applyFunction​(PixelFunction function,
                                   int startX,
                                   int startY,
                                   int endX,
                                   int endY,
                                   int strideX,
                                   int strideY,
                                   boolean applyParallel)
        Applies the given function for the pixels of the image segment defined by [startX, endX] and [startY, endX]
        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()}!
      • applyColumnFunction

        default void applyColumnFunction​(ColumnFunction function,
                                         int start,
                                         int end,
                                         int stride,
                                         boolean applyParallel)
        Function that is applied for a given column
        Parameters:
        function - to be applied
        start - start column
        end - end column
        stride - 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()}!
      • copyTo

        default void copyTo​(ImageWrapper<?> wrapper)
        Copy the image of this wrapper into the given wrapper
        Parameters:
        wrapper - target
      • createCopy

        default <X> ImageWrapper<X> createCopy​(ImageFactory<X> provider)
        Creates a copy using the given ImageFactory
        Type Parameters:
        X - type of wrapped image
        Parameters:
        provider - provider
        Returns:
        copy of this
      • createCopy

        default <X> ImageWrapper<X> createCopy​(Class<X> targetClass)
        Creates a copy with the given type
        Type Parameters:
        X - type of wrapped image
        Parameters:
        targetClass - type of the copy
        Returns:
        copy of this
        Since:
        2.0
      • getSupportedType

        Class<I> getSupportedType()
        Returns:
        the supported image type.