<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 5.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImageInterpolatedLookupTable_PlanarF(_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vImageInterpolatedLookupTable_PlanarF"
  },
  "title" : "vImageInterpolatedLookupTable_PlanarF(_:_:_:_:_:_:_:)"
}
-->

# vImageInterpolatedLookupTable_PlanarF(_:_:_:_:_:_:_:)

Uses an interpolated lookup table to transform a 32-bit planar image.

```
func vImageInterpolatedLookupTable_PlanarF(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ table: UnsafePointer<Pixel_F>, _ tableEntries: vImagePixelCount, _ maxFloat: Float, _ minFloat: Float, _ flags: vImage_Flags) -> vImage_Error
```

## Parameters

`src`

The source vImage buffer.

`dest`

A pointer to the destination vImage buffer structure. You’re 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 this structure points to contains the destination image data. When you no longer need the data buffer, deallocate the memory to prevent memory leaks.

`table`

A lookup table that contains [`Pixel_F`](/documentation/Accelerate/Pixel_F) values.

`tableEntries`

The number of values in the lookup table.

`maxFloat`

A value of type `float`.

`minFloat`

A value of type `float`.

`flags`

The options to use when performing the operation. If your code implements its own tiling or its own multithreading, pass [`kvImageDoNotTile`](/documentation/Accelerate/kvImageDoNotTile).

## Return Value

[`kvImageNoError`](/documentation/Accelerate/kvImageNoError); otherwise, one of the error codes in <doc://com.apple.documentation/documentation/Accelerate/data-types-and-constants>.

## Discussion

Provide this function with a lookup table with any number of values, but with a minimum value of `minFloat` and a maximum value of `maxFloat`. The function generates lookup values by linearly interpolating between the supplied values. The per-pixel conversion calculation is equivalent to the following:

```objc
float clippedPixel = MAX( MIN( src_pixel, maxFloat ), minFloat );    //clip src_pixel to be in range
float fIndex = (float) (tableEntries - 1) * (clippedPixel - minFloat ) / (maxFloat - minFloat);
float fract = fIndex - floor( fIndex );
unsigned long index =  fIndex;
float result = table[ index ] * ( 1.0f - fract ) + table[ index + 1] * fract;
```

The following code shows a lookup table that contains two values, `1` and `0`. The result is that the lookup transformation maps the source values `0...1` to the destination values `1...0`.

```swift
let lookupTable: [Float] = [1, 0]

let source = vImage.PixelBuffer<vImage.PlanarF>(
    pixelValues: [0.2, 0.4, 0.6, 0.8],
    size: .init(width: 4, height: 1))

let destination = vImage.PixelBuffer<vImage.PlanarF>(
    size: source.size)

source.withUnsafePointerToVImageBuffer{ src in
    destination.withUnsafePointerToVImageBuffer { dest in
        
        _ = vImageInterpolatedLookupTable_PlanarF(
            src,
            dest,
            lookupTable,
            vImagePixelCount(lookupTable.count),
            1, 0,
            vImage_Flags(kvImageNoFlags))
    }
}

// Prints "[0.8, 0.6, 0.4, 0.2]".
print(destination.array)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)