Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Operations

Various mathematical operations with images. More...

Functions

SIMD_API void SimdOperationBinary8u (const uint8_t *a, size_t aStride, const uint8_t *b, size_t bStride, size_t width, size_t height, size_t channelCount, uint8_t *dst, size_t dstStride, SimdOperationBinary8uType type)
 Performs an element-wise binary operation between two 8-bit images. More...
 
SIMD_API void SimdOperationBinary16i (const uint8_t *a, size_t aStride, const uint8_t *b, size_t bStride, size_t width, size_t height, uint8_t *dst, size_t dstStride, SimdOperationBinary16iType type)
 Performs an element-wise binary operation between two signed 16-bit images. More...
 
template<template< class > class A>
SIMD_INLINE void OperationBinary8u (const View< A > &a, const View< A > &b, View< A > &dst, SimdOperationBinary8uType type)
 Performs an element-wise binary operation between two 8-bit images. More...
 
template<template< class > class A>
SIMD_INLINE void OperationBinary16i (const View< A > &a, const View< A > &b, View< A > &dst, SimdOperationBinary16iType type)
 Performs an element-wise binary operation between two signed 16-bit images. More...
 

Detailed Description

Various mathematical operations with images.

Function Documentation

◆ SimdOperationBinary8u()

void SimdOperationBinary8u ( const uint8_t *  a,
size_t  aStride,
const uint8_t *  b,
size_t  bStride,
size_t  width,
size_t  height,
size_t  channelCount,
uint8_t *  dst,
size_t  dstStride,
SimdOperationBinary8uType  type 
)

Performs an element-wise binary operation between two 8-bit images.

All images must have the same width, height and number of channels. The function processes width*channelCount unsigned 8-bit values in every row; every channel is handled independently. The exact operation is selected by type (average, bitwise AND/OR, maximum, minimum, saturated subtraction or saturated addition).

Note
This function has a C++ wrapper: Simd::OperationBinary8u(const View<A>& a, const View<A>& b, View<A>& dst, SimdOperationBinary8uType type).
Parameters
[in]a- a pointer to pixels data of the first input image.
[in]aStride- a row size of the first image.
[in]b- a pointer to pixels data of the second input image.
[in]bStride- a row size of the second image.
[in]width- an image width.
[in]height- an image height.
[in]channelCount- a number of 8-bit channels per pixel.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image.
[in]type- a type of operation (see SimdOperationBinary8uType).

◆ SimdOperationBinary16i()

void SimdOperationBinary16i ( const uint8_t *  a,
size_t  aStride,
const uint8_t *  b,
size_t  bStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride,
SimdOperationBinary16iType  type 
)

Performs an element-wise binary operation between two signed 16-bit images.

All images must have the same width, height and SimdPixelFormatInt16 pixel format. The function treats every row as an array of width signed 16-bit values and applies the non-saturated operation selected by type (addition or subtraction). Strides are specified in bytes and must be multiples of sizeof(int16_t).

Note
This function has a C++ wrapper: Simd::OperationBinary16i(const View<A>& a, const View<A>& b, View<A>& dst, SimdOperationBinary16iType type).
Parameters
[in]a- a pointer to pixels data of the first input image.
[in]aStride- a row size of the first image.
[in]b- a pointer to pixels data of the second input image.
[in]bStride- a row size of the second image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image.
[in]type- a type of operation (see SimdOperationBinary16iType).

◆ OperationBinary8u()

void OperationBinary8u ( const View< A > &  a,
const View< A > &  b,
View< A > &  dst,
SimdOperationBinary8uType  type 
)

Performs an element-wise binary operation between two 8-bit images.

All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR/RGB or 32-bit BGRA/RGBA). Every channel is handled independently. The exact operation is selected by type (average, bitwise AND/OR, maximum, minimum, saturated subtraction or saturated addition).

Note
This function is a C++ wrapper for function SimdOperationBinary8u.
Parameters
[in]a- a first input image.
[in]b- a second input image.
[out]dst- an output image.
[in]type- a type of operation (see SimdOperationBinary8uType).

◆ OperationBinary16i()

void OperationBinary16i ( const View< A > &  a,
const View< A > &  b,
View< A > &  dst,
SimdOperationBinary16iType  type 
)

Performs an element-wise binary operation between two signed 16-bit images.

All images must have the same width, height and Simd::View::Int16 pixel format. The function applies the non-saturated operation selected by type (addition or subtraction).

Note
This function is a C++ wrapper for function SimdOperationBinary16i.
Parameters
[in]a- a first input image.
[in]b- a second input image.
[out]dst- an output image.
[in]type- a type of operation (see SimdOperationBinary16iType).