Mac Developer Library

Developer

Accelerate Framework Reference vImage Decompression Filtering Reference

Options
Deployment Target:

On This Page
Language:

vImage Decompression Filtering Reference

The vImage framework provides one function for filtering data prior to decompression.

Functions

  • Performs PNG decompression filtering.

    Declaration

    Swift

    func vImagePNGDecompressionFilter(_ buffer: UnsafePointer<vImage_Buffer>, _ startScanline: vImagePixelCount, _ scanlineCount: vImagePixelCount, _ bitsPerPixel: UInt32, _ filterMethodNumber: UInt32, _ filterType: UInt32, _ flags: vImage_Flags) -> vImage_Error

    Objective-C

    vImage_Error vImagePNGDecompressionFilter ( const vImage_Buffer *buffer, vImagePixelCount startScanline, vImagePixelCount scanlineCount, uint32_t bitsPerPixel, uint32_t filterMethodNumber, uint32_t filterType, vImage_Flags flags );

    Parameters

    buffer

    On input, the image data to filter. On output, the filtered data. The filtering is always applied in place.

    startScanline

    The starting scanline.

    scanlineCount

    The number of scanlines in the buffer.

    bitsPerPixel

    The bits per pixel.

    filterMethodNumber

    The filter method number. You must pass 0, because this is the only filtering method offered by this function.

    filterType

    The filtering algorithm to apply to the image data. For filter method 0, you can pass any of the constants described in PNG Filter Types.

    flags

    The options to use when performing this operation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading. See vImage Data Types and Constants Reference for a complete description of vImage processing flags.

    Discussion

    This function implements PNG decompression filtering for filter method 0 of the PNG standard, section 9.2, as described in: http://www.w3.org/TR/PNG-Filters.html. When a pixel that is needed for a filtering calculation falls outside the source buffer, its value is presumed to be 0.

    Import Statement

    import Accelerate

    Availability

    Available in OS X v10.4 and later.

Constants

  • Filtering algorithms to apply to image data before compressing the data.

    Declaration

    Objective-C

    enum { kvImage_PNG_FILTER_VALUE_NONE = 0, kvImage_PNG_FILTER_VALUE_SUB = 1, kvImage_PNG_FILTER_VALUE_UP = 2, kvImage_PNG_FILTER_VALUE_AVG = 3, kvImage_PNG_FILTER_VALUE_PAETH = 4 };

    Constants

    • kvImage_PNG_FILTER_VALUE_NONE

      kvImage_PNG_FILTER_VALUE_NONE

      No filtering.

      Available in OS X v10.4 and later.

    • kvImage_PNG_FILTER_VALUE_SUB

      kvImage_PNG_FILTER_VALUE_SUB

      A filter that computes the difference between each byte of a pixel and the value of the corresponding byte of the pixel located to the left.

      Available in OS X v10.4 and later.

    • kvImage_PNG_FILTER_VALUE_UP

      kvImage_PNG_FILTER_VALUE_UP

      A filter that computes the difference between each byte of a pixel and the value of the corresponding byte of the pixel located above.

      Available in OS X v10.4 and later.

    • kvImage_PNG_FILTER_VALUE_AVG

      kvImage_PNG_FILTER_VALUE_AVG

      A filter that predicts a pixel value from the average of the pixels to the left and above the predicted pixel location.

      Available in OS X v10.4 and later.

    • kvImage_PNG_FILTER_VALUE_PAETH

      kvImage_PNG_FILTER_VALUE_PAETH

      A filter that predicts a pixel value by applying a linear function to the pixels located to the left, above, and to the upper left of the predicted pixel location.

      Available in OS X v10.4 and later.

    Import Statement