Static Methodswift-png 4.4.5PNG

    deconvolve(_:reference:kernel:)

    Converts a pixel array to an image data buffer, using the given pixel kernel and referencing function.

    PNG.swift:941
    static func deconvolve<A, T, C>(_ pixels: [C], reference: ((A, A, A)) -> Int, kernel: (C) -> (T, T, T)) -> [UInt8] where A : FixedWidthInteger, A : UnsignedInteger, T : FixedWidthInteger, T : UnsignedInteger

    Parameters

    pixels

    A pixel array.

    reference

    A referencing function. Its return value must be in the range 0 ... 255. Depending on bit depth of the image it is being used for, there may be further restrictions on the range of the returned indices.

    kernel

    A pixel kernel.

    Returns

    An image data buffer. This array has the same number of elements as pixels.

    This function maps the given kernel function over each element in pixels, receiving (T, T, T) intensity triplets in return. It then converts them into atoms of type A, scaling each intensity value to the range of A. Each (A, A, A) triplet is then converted to an Int index using the given reference function, and stored as a byte in the returned image data buffer.

    A worked example of how to use this function to implement a custom color target can be found in the custom color targets tutorial.

    Other members in extension

    Protocols

    Types

    Show obsolete interfaces (2)

    Hide obsolete interfaces

    Type members