Function

vImageContrastStretch_ARGB8888

Stretches the contrast of an ARGB8888 source image.

Declaration

vImage_Error vImageContrastStretch_ARGB8888(const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags);

Parameters

src

A pointer to a vImage buffer structure that contains the source image.

dest

A pointer to a vImage buffer data structure. You are responsible for filling out the height, width, and rowBytes fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.

flags

The options to use. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.

Set the kvImageLeaveAlphaUnchanged flag to copy the alpha channel to the destination image unchanged.

Return Value

kvImageNoError; otherwise, one of the error codes described in Data Types and Constants.

Discussion

The contrast stretch operation alters the image histogram so that pixel values can be found at both the lowest and highest end of the histogram, with values in between “stretched” in a linear fashion. The contrast stretch operation is done separately for each of the four channels—alpha, red, green, and blue. However, the size and range values are the same for each of the four histograms.

The source and destination buffers must have the same height and the same width.

See Also

Stretching the Contrast

vImageContrastStretch_ARGBFFFF

Stretches the contrast of an ARGBFFFF source image.

vImageContrastStretch_PlanarF

Stretches the contrast of a PlanarF source image.

vImageContrastStretch_Planar8

Stretches the contrast of a Planar8 source image.

vImageEndsInContrastStretch_ARGBFFFF

Performs an ends-in contrast stretch operation on an ARGBFFFF source image.

vImageEndsInContrastStretch_ARGB8888

Performs an ends-in contrast stretch operation on an ARGB8888 source image.

vImageEndsInContrastStretch_PlanarF

Performs an ends-in contrast stretch operation on a PlanarF source image.

vImageEndsInContrastStretch_Planar8

Performs an ends-in contrast stretch operation on a Planar8 source image.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software