Interface ImageFunction<IN,​OUT>

    • Method Detail

      • closeAfterApply

        static <T extends ImageWrapper<I>,​R,​I> Function<T,​R> closeAfterApply​(Function<T,​R> function)
        We do not have everywhere a ImageFunction, sometimes it is just form the type function. In those cases we need a construct, which allows us to close the image wrapper, after another function. Also closes the input function if apply throws an exception.
        Type Parameters:
        T - the input type which needs to extend Java Image Wrapper
        R - the result
        I - the type of the wrapped element of ImageWrapper
        Parameters:
        function - the function to be executed
        Returns:
        a new function, which executes the function that is passed as parameter and the closes the image wrapper.
      • andThenConsumeInput

        default ImageFunction<IN,​OUT> andThenConsumeInput​(Consumer<ImageWrapper<IN>> consumer)
        This function returns a function, that execute a given consumer after the apply function for the original function was called
        Parameters:
        consumer - the consumer to be executed after the accept function
        Returns:
        a new function, that call the apply function of this function, then executes the consumer and the returns the result of the original function
      • andThenCloseInput

        default ImageFunction<IN,​OUT> andThenCloseInput()
        Closes the input image, after the apply function was executed
        Returns:
        a new function which closes the input of the function after it was executed
      • andThen

        default <X> ImageFunction<IN,​X> andThen​(ImageFunction<OUT,​X> after)
        Chains multiple ImageFunctions. The first input function is applied and its result is passed to the after ImageFunction, which will then calculate the final result. The interim image will be automatically closed.
        Type Parameters:
        X - the resulting type of the applied image functions
        Parameters:
        after - the function to apply after this function is applied
        Returns:
        a composed function that first applies this function and then applies the after function
        Since:
        1.2