Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Gaussian Blur Filters

Gaussian blur image filters. More...

Functions

SIMD_API void SimdGaussianBlur3x3 (const uint8_t *src, size_t srcStride, size_t width, size_t height, size_t channelCount, uint8_t *dst, size_t dstStride)
 Performs Gaussian blur filtration with window 3x3. More...
 
SIMD_API void * SimdGaussianBlurInit (size_t width, size_t height, size_t channels, const float *radius)
 Creates Gaussian blur filter context. More...
 
SIMD_API void SimdGaussianBlurRun (const void *filter, const uint8_t *src, size_t srcStride, uint8_t *dst, size_t dstStride)
 Performs image Gaussian bluring. More...
 

Detailed Description

Gaussian blur image filters.

Function Documentation

◆ SimdGaussianBlur3x3()

void SimdGaussianBlur3x3 ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
size_t  channelCount,
uint8_t *  dst,
size_t  dstStride 
)

Performs Gaussian blur filtration with window 3x3.

For every point:

dst[x, y] = (src[x-1, y-1] + 2*src[x, y-1] + src[x+1, y-1] +
            2*(src[x-1, y] + 2*src[x, y] + src[x+1, y]) +
            src[x-1, y+1] + 2*src[x, y+1] + src[x+1, y+1] + 8) / 16;

All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

Note
This function has a C++ wrapper Simd::GaussianBlur3x3(const View<A>& src, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of source image.
[in]srcStride- a row size of the src image.
[in]width- an image width.
[in]height- an image height.
[in]channelCount- a channel count.
[out]dst- a pointer to pixels data of destination image.
[in]dstStride- a row size of the dst image.

◆ SimdGaussianBlurInit()

void * SimdGaussianBlurInit ( size_t  width,
size_t  height,
size_t  channels,
const float *  radius 
)

Creates Gaussian blur filter context.

Parameters
[in]width- a width of input and output image.
[in]height- a height of input and output image.
[in]channels- a channel number of input and output image.
[in]radius- a pointer to radius of Gaussian blur.
Returns
a pointer to filter context. On error it returns NULL. This pointer is used in functions SimdGaussianBlurRun. It must be released with using of function SimdRelease.

◆ SimdGaussianBlurRun()

void SimdGaussianBlurRun ( const void *  filter,
const uint8_t *  src,
size_t  srcStride,
uint8_t *  dst,
size_t  dstStride 
)

Performs image Gaussian bluring.

Parameters
[in]filter- a filter context. It must be created by function SimdGaussianBlurInit and released by function SimdRelease.
[in]src- a pointer to pixels data of the original input image.
[in]srcStride- a row size (in bytes) of the input image.
[out]dst- a pointer to pixels data of the filtered output image.
[in]dstStride- a row size (in bytes) of the output image.