Transform

Apply color transformations to images.

Overview

Transformation functions alter the values of pixels in the image. Unlike convolutions, transformation functions do not depend on the values of nearby pixels. The vImage transformation functions fall into four broad categories:

  • Gamma correction functions correct the brightness profile of an image by multiplying each pixel by the value of the function. Gamma correction prepares an image for display or printing on a particular device.

  • Lookup table functions are like the piecewise polynomial functions, but instead of applying a polynomial they use a lookup table that you supply.

  • Matrix multiplication functions have a variety of uses, such as to convert between color spaces (RGB and YUV, for example), change a color image to a grayscale one, and for “color twisting.”

  • Piecewise functions are similar to the gamma correction functions, but instead of applying a predefined gamma function they apply one or more polynomials that you supply. The number of polynomials must be an integer power of 2, and they must all be of the same order.

Transformation functions use a vImage buffer structure (vImage_Buffer—see Data Types and Constants) to receive and supply image data. This buffer contains a pointer to image data, the height and width (in pixels) of the image data, and the number of row bytes. You actually pass a pointer to a vImage buffer structure.

Some transformation functions “work in place”. That is, the source and destination images can occupy the same memory if the they are strictly aligned pixel for pixel. For these, you can can provide a pointer to the same vImage buffer structure for one of the source images and the destination image.

Topics

Transforming with a Lookup Table

vImageLookupTable_PlanarFtoPlanar8

Uses a lookup table to transform an image in PlanarF format to an image in Planar8 format.

vImageLookupTable_Planar8toPlanarF

Uses a lookup table to transform an image in Planar8 format to an image in PlanarF format.

vImageLookupTable_Planar8toPlanar24

Uses a lookup table to transform an image in Planar8 format to an image in Planar24 format.

vImageLookupTable_Planar8toPlanar16

Uses a lookup table to transform an image in Planar8 format to an image in Planar16 format.

vImageLookupTable_Planar8toPlanar48

Uses a lookup table to transform an image in Planar8 format to an image in Planar48 format.

vImageLookupTable_Planar8toPlanar96

Uses a lookup table to transform an image in Planar8 format to an image in Planar96 format.

vImageLookupTable_Planar8toPlanar128

Uses a lookup table to transform an image in Planar8 format to an image in Planar128 format.

vImageLookupTable_Planar16

Uses a lookup table to remap values in a Planar16 format image.

vImageLookupTable_8to64U

Uses a lookup table to remap 8-bit unsigned integers in a source image to 64-bit unsigned values.

vImageInterpolatedLookupTable_PlanarF

Uses a lookup table to transform an image in PlanarF format.

Transforming with a Multidimensional Lookup Table

vImage_MultidimensionalTable

A structure representing a multidimensional table for use with vImage's multidimensional interpolated lookup functions.

vImageMultidimensionalTable_Create

Creates a multidimensional table for use with vImage's multidimensional interpolated lookup functions.

vImageMDTableUsageHint

Constants that indicate how a multidimensional table will be used.

vImageMultiDimensionalInterpolatedLookupTable_PlanarF

Uses a multidimensional lookup table to transform an image in PlanarF format.

vImageMultiDimensionalInterpolatedLookupTable_Planar16Q12

Uses a multidimensional lookup table to transform an image in Planar16Q12 format.

vImage_InterpolationMethod

Constants that represent different interpolation methods.

vImageMultidimensionalTable_Retain

Retains a multidimensional table.

vImageMultidimensionalTable_Release

Releases a multidimensional table.

Applying a Polynomial

vImagePiecewisePolynomial_PlanarF

Applies a set of piecewise polynomials to an image in PlanarF format.

vImagePiecewisePolynomial_Planar8toPlanarF

Applies a set of piecewise polynomials to transform an image in Planar8 format to an image in PlanarF format.

vImagePiecewisePolynomial_PlanarFtoPlanar8

Applies a set of piecewise polynomials to transform an image in PlanarF format to an image in Planar8 format.

vImagePiecewiseRational_PlanarF

Applies a piecewise rational expression to an image in PlanarF format.

vImageSymmetricPiecewisePolynomial_PlanarF

Applies a set of symmetric piecewise polynomials to an image in PlanarF format.

Multiplying Pixels by a Matrix

vImageMatrixMultiply_Planar8

Operates on a set of 8-bit source image planes, multiplying each pixel by the provided matrix to produce a set of 8-bit destination image planes.

vImageMatrixMultiply_Planar16S

Operates on a set of 16-bit source image planes, multiplying each pixel by the provided matrix to produce a set of 16-bit destination image planes.

vImageMatrixMultiply_PlanarF

Operates on a set of floating-point source image planes, multiplying each pixel by the provided matrix to produce a set of floating-point destination image planes.

vImageMatrixMultiply_ARGB8888

Operates on an interleaved 8-bit source image, multiplying each pixel by the provided matrix to produce an interleaved 8-bit destination image.

vImageMatrixMultiply_ARGBFFFF

Operates on an interleaved floating-point source image, multiplying each pixel by the provided matrix to produce an interleaved floating-point destination image.

vImageMatrixMultiply_ARGB8888ToPlanar8

Operates on an interleaved 8-bit source image, multiplying each pixel by the provided matrix to produce a one-channel 8-bit destination image.

vImageMatrixMultiply_ARGBFFFFToPlanarF

Operates on an interleaved 32-bit source image, multiplying each pixel by the provided matrix to produce a one-channel 32-bit destination image.

Correcting Gamma

vImageCreateGammaFunction

Returns a gamma function object.

vImageDestroyGammaFunction

Destroys a gamma function object created.

vImageGamma_Planar8toPlanarF

Applies a gamma function to a Planar8 image to produce a PlanarF image.

vImageGamma_PlanarFtoPlanar8

Applies a gamma function to an image in PlanarF format to an image in Planar8 format.

vImageGamma_PlanarF

Applies a gamma function to a PlanarF image.

vImagePiecewiseGamma_Planar8

Applies a piecewise gamma function to a Planar8 image.

vImagePiecewiseGamma_Planar8toPlanar16Q12

Applies a piecewise gamma function to a Planar8 image to produce a Planar16Q12 image.

vImagePiecewiseGamma_Planar8toPlanarF

Applies a piecewise gamma function to a Planar8 image to produce a PlanarF image.

vImagePiecewiseGamma_Planar16Q12

Applies a piecewise gamma function to a Planar16Q12 image.

vImagePiecewiseGamma_Planar16Q12toPlanar8

Applies a piecewise gamma function to a Planar16Q12 image to produce a Planar8 image.

vImagePiecewiseGamma_PlanarF

Applies a piecewise gamma function to a PlanarF image.

vImagePiecewiseGamma_PlanarFtoPlanar8

Applies a piecewise gamma function to a PlanarF image to produce a Planar8 image.

vImageSymmetricPiecewiseGamma_Planar16Q12

Applies a symmetric piecewise gamma function to a Planar16Q12 image.

vImageSymmetricPiecewiseGamma_PlanarF

Applies a symmetric piecewise gamma function to a PlanarF image.

Constants

Gamma Function Types

Types of full- or half-precision gamma functions.

See Also