Simd Library Documentation.

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

Functions for image drawing. More...

Functions

SIMD_API void SimdAlphaBlending (const uint8_t *src, size_t srcStride, size_t width, size_t height, size_t channelCount, const uint8_t *alpha, size_t alphaStride, uint8_t *dst, size_t dstStride)
 Performs alpha blending operation. More...
 
SIMD_API void SimdAlphaFilling (uint8_t *dst, size_t dstStride, size_t width, size_t height, const uint8_t *channel, size_t channelCount, const uint8_t *alpha, size_t alphaStride)
 Performs alpha filling operation. More...
 
template<template< class > class A>
SIMD_INLINE void AlphaBlending (const View< A > &src, const View< A > &alpha, View< A > &dst)
 Performs alpha blending operation. More...
 
template<template< class > class A, class Pixel >
SIMD_INLINE void AlphaFilling (View< A > &dst, const Pixel &pixel, const View< A > &alpha)
 Performs alpha filling operation. More...
 

Detailed Description

Functions for image drawing.

Function Documentation

◆ SimdAlphaBlending()

void SimdAlphaBlending ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
size_t  channelCount,
const uint8_t *  alpha,
size_t  alphaStride,
uint8_t *  dst,
size_t  dstStride 
)

Performs alpha blending operation.

All images must have the same width and height. Source and destination images must have the same format (8 bit per channel, for example GRAY8, BGR24 or BGRA32). Alpha must be 8-bit gray image.

For every point:

dst[x, y, c] = (src[x, y, c]*alpha[x, y] + dst[x, y, c]*(255 - alpha[x, y]))/255;

This function is used for image drawing.

Note
This function has a C++ wrapper Simd::AlphaBlending(const View<A>& src, const View<A>& alpha, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of foreground image.
[in]srcStride- a row size of the foreground image.
[in]width- an image width.
[in]height- an image height.
[in]channelCount- a channel count for foreground and background images (1 <= channelCount <= 4).
[in]alpha- a pointer to pixels data of image with alpha channel.
[in]alphaStride- a row size of the alpha image.
[in,out]dst- a pointer to pixels data of background image.
[in]dstStride- a row size of the background image.

◆ SimdAlphaFilling()

void SimdAlphaFilling ( uint8_t *  dst,
size_t  dstStride,
size_t  width,
size_t  height,
const uint8_t *  channel,
size_t  channelCount,
const uint8_t *  alpha,
size_t  alphaStride 
)

Performs alpha filling operation.

All images must have the same width and height. Destination images must have 8 bit per channel (for example GRAY8, BGR24 or BGRA32). Alpha must be 8-bit gray image.

For every point:

dst[x, y, c] = (channel[c]*alpha[x, y] + dst[x, y, c]*(255 - alpha[x, y]))/255;

This function is used for image drawing.

Note
This function has a C++ wrapper Simd::AlphaFilling(View<A> & dst, const Pixel & pixel, const View<A> & alpha).
Parameters
[in,out]dst- a pointer to pixels data of background image.
[in]dstStride- a row size of the background image.
[in]width- an image width.
[in]height- an image height.
[in]channel- a pointer to pixel with foreground color.
[in]channelCount- a channel count for foreground color and background images (1 <= channelCount <= 4).
[in]alpha- a pointer to pixels data of image with alpha channel.
[in]alphaStride- a row size of the alpha image.

◆ AlphaBlending()

void AlphaBlending ( const View< A > &  src,
const View< A > &  alpha,
View< A > &  dst 
)

Performs alpha blending operation.

All images must have the same width and height. Source and destination images must have the same format (8 bit per channel, for example GRAY8, BGR24 or BGRA32). Alpha must be 8-bit gray image.

For every point:

dst[x, y, c] = (src[x, y, c]*alpha[x, y] + dst[x, y, c]*(255 - alpha[x, y]))/255;

This function is used for image drawing.

Note
This function is a C++ wrapper for function SimdAlphaBlending.
Parameters
[in]src- a foreground image.
[in]alpha- an image with alpha channel.
[in,out]dst- a background image.

◆ AlphaFilling()

void AlphaFilling ( View< A > &  dst,
const Pixel &  pixel,
const View< A > &  alpha 
)

Performs alpha filling operation.

All images must have the same width and height. Destination images must have 8 bit per channel (for example GRAY8, BGR24 or BGRA32). Alpha must be 8-bit gray image.

For every point:

dst[x, y, c] = (pixel[c]*alpha[x, y] + dst[x, y, c]*(255 - alpha[x, y]))/255;

This function is used for image drawing.

Note
This function is a C++ wrapper for function SimdAlphaFilling.
Parameters
[in,out]dst- a background image.
[in]pixel- a foreground color.
[in]alpha- an image with alpha channel.