---
title: "multiply(by:divisor:preBias:postBias:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/multiply(by:divisor:prebias:postbias:destination:)-4q614"
---

# multiply(by:divisor:preBias:postBias:destination:)

Multiplies each four channel pixel in an 8-bit-per channel, 4-channel pixel buffer by a four element matrix to produce a single channel result.

## Declaration

```swift
func multiply(by matrix: (Int, Int, Int, Int), divisor: Int, preBias: (Int, Int, Int, Int), postBias: Int, destination: vImage.PixelBuffer<vImage.Planar8>)
```

## Parameters

- `matrix`: The 4 x 4 multiplication matrix values in row-major order.
- `divisor`: A value that the function divides the result by.
- `preBias`: Values that the function adds to the source before multiplication.
- `postBias`: A value that the function adds to the result after multiplication.
- `destination`: The destination pixel buffer.

## Discussion

Discussion This function applies the following operation to each pixel: p = (source.0 + preBias.0) * matrix.0 +     (source.1 + preBias.1) * matrix.1 +     (source.2 + preBias.2) * matrix.2 +     (source.3 + preBias.3) * matrix.3 destination = (p + postBias) / divisor The operation clamps the destination pixel to 0...255.

## See Also

### Pixel Multiplication

- [multiply(by:preBias:postBias:destination:)](accelerate/vimage/pixelbuffer/multiply(by:prebias:postbias:destination:)-1sp5l.md)
