Static Methodswift-png 4.4.5PNG

    deconvolve(_:as:depth:kernel:)

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

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

    Parameters

    pixels

    A pixel array.

    _

    An atom type.

    depth

    A color depth specifying the range of the atom values. This depth can be no greater than A.bitWidth.

    kernel

    A pixel kernel.

    Returns

    An image data buffer. This array has a length of pixels.count, multiplied by the stride of A.

    This function maps the given kernel function over each element in pixels, receiving scalar intensities of type T in return. It then converts them into atoms of type A, scaling each intensity value to the range specified by the given color depth. Each scalar atom is then stored as a big-endian integer 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