vImage Decompression Filtering Reference
| Framework | Accelerate/vImage |
| Companion guide | |
| Declared in | BasicImageTypes.h |
Overview
The vImage framework provides one function for filtering data prior to decompression.
Functions
vImagePNGDecompressionFilter
Performs PNG decompression filtering.
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
kvImageDoNotTileflag 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.
Availability
- Available in iOS 5.0 and later.
Declared In
BasicImageTypes.hConstants
PNG Filter Types
Filtering algorithms to apply to image data before compressing the data.
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_NONENo filtering.
Available in iOS 5.0 and later.
Declared in
BasicImageTypes.h.kvImage_PNG_FILTER_VALUE_SUBA 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 iOS 5.0 and later.
Declared in
BasicImageTypes.h.kvImage_PNG_FILTER_VALUE_UPA 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 iOS 5.0 and later.
Declared in
BasicImageTypes.h.kvImage_PNG_FILTER_VALUE_AVGA filter that predicts a pixel value from the average of the pixels to the left and above the predicted pixel location.
Available in iOS 5.0 and later.
Declared in
BasicImageTypes.h.kvImage_PNG_FILTER_VALUE_PAETHA 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 iOS 5.0 and later.
Declared in
BasicImageTypes.h.
Declared In
BasicImageTypes.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)