Image Arithmetic and Logical Operations

Intel IPP provides functions that modify pixel values of an image buffer using arithmetic or logical operations. It also includes functions that perform image compositing based on opacity (alpha-blending).

Table Arithmetic and Logical Operations lists the functions:

Arithmetic and Logical Functions

Function Base Name

Operation

Arithmetic Functions

Add

Adds pixel values of two image buffers

AddC

Adds a constant to pixel values of an image buffer

AddSquare

Adds squared pixel values of a source image to floating-point pixel values of an accumulator image

AddProduct

Adds product of pixel values of two source images to floating-point pixel values of an accumulator image

AddWeighted

Adds pixel values of a source image multiplied by factor α to floating-point pixel values of an accumulator image multiplied by factor (1-α)

Mul

Multiplies pixel values of two image buffers

MulC

Multiplies pixel values of an image buffer by a constant

MulScale

Multiplies pixel values of two image buffers and scales the products

MulCScale

Multiplies pixel values of an image buffer by a constant and scales the products

Sub

Subtracts pixel values of two image buffers

SubC

Subtracts a constant from pixel values of an image buffer

Div

Divides pixel values of two image buffers

Div_Round

Divides pixel values of an image by pixel values of another image with different rounding modes

DivC

Divides pixel values of an image buffer by a constant

Abs

Computes absolute pixel values of a source image and places them into the destination image

AbsDiff

Finds the absolute difference between two images.

AbsDiffC

Finds the absolute difference between an image and a scalar value.

Sqr

Squares pixel values of an image and writes them into the destination image

Sqrt

Computes square roots of pixel values of a source image and writes them into the destination image

Ln

Computes the natural logarithm of pixel values in a source image and writes the results into the destination image

Exp

Computes the exponential of pixel values in a source image and writes the results into the destination image

Complement

Converts negative number from the complement to direct code.

DotProd

Computes the dot product of pixel values of two source images.

DotProdCol

Calculates the dot product of taps vector and columns of the specified set of rows.

Logical Functions

And

Combines corresponding pixels of two image buffers by a bitwise AND operation.

AndC

Performs a bitwise AND operation on each pixel with a constant.

Or

Combines corresponding pixels of two image buffers by a bitwise OR operation.

OrC

Performs a bitwise OR operation on each pixel with a constant.

Xor

Combines corresponding pixels of two image buffers by a bitwise XOR operation.

XorC

Performs a bitwise OR operation on each pixel with a constant.

Not

Performs a bitwise NOT operation on each pixel

RShiftC

Divides pixel values by a constant power of 2 by shifting bits logically or arithmetically to the right.

LShiftC

Shifts bits in pixel values to the left.

Alpha-Blending Functions

AlphaComp

Combines two image buffers using alpha (opacity) values.

AlphaCompC

Combines two image buffers using constant alpha values

AlphaPremul

Pre-multiplies pixel values of an image buffer by its alpha values.

AlphaPremulC

Pre-multiplies pixel values of an image buffer using constant alpha values.

An additional suffix C, if present in the function name, indicates operation with a constant. Arithmetic functions that operate on integer data perform fixed scaling of the internally computed results. In case of overflow the result value is saturated to the destination data type range.

Note iconNote

Most arithmetic and logical functions support data with 1-,3-, or 4-channel pixel values. In the alpha channel case (AC4), the alpha channels are not processed.

Many solutions and hints for use of these functions can be found in Intel IPP Samples. See Intel® IPP Image Processing and Media Processing Samples downloadable from http://www.intel.com/cd/software/products/asmo-na/eng/220046.htm .


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.