Simd Library Documentation.

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

Functions for RGB-24 image conversions. More...

Functions

SIMD_API void SimdRgbToBgra (const uint8_t *rgb, size_t width, size_t height, size_t rgbStride, uint8_t *bgra, size_t bgraStride, uint8_t alpha)
 Converts 24-bit RGB image to 32-bit BGRA image. Also it can be used for 24-bit BGR to 32-bit RGBA conversion. More...
 
SIMD_API void SimdRgbToGray (const uint8_t *rgb, size_t width, size_t height, size_t rgbStride, uint8_t *gray, size_t grayStride)
 Converts 24-bit RGB image to 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void RgbToBgr (const View< A > &rgb, View< A > &bgr)
 Converts 24-bit RGB image to 24-bit BGR image. More...
 
template<template< class > class A>
SIMD_INLINE void RgbToBgra (const View< A > &rgb, View< A > &bgra, uint8_t alpha=0xFF)
 Converts 24-bit RGB image to 32-bit BGRA image. More...
 
template<template< class > class A>
SIMD_INLINE void RgbToGray (const View< A > &rgb, View< A > &gray)
 Converts 24-bit RGB image to 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void RgbToRgba (const View< A > &rgb, View< A > &rgba, uint8_t alpha=0xFF)
 Converts 24-bit RGB image to 32-bit RGBA image. More...
 

Detailed Description

Functions for RGB-24 image conversions.

Function Documentation

◆ SimdRgbToBgra()

void SimdRgbToBgra ( const uint8_t *  rgb,
size_t  width,
size_t  height,
size_t  rgbStride,
uint8_t *  bgra,
size_t  bgraStride,
uint8_t  alpha 
)

Converts 24-bit RGB image to 32-bit BGRA image. Also it can be used for 24-bit BGR to 32-bit RGBA conversion.

All images must have the same width and height.

Note
This function has C++ wrappers: Simd::RgbToBgra(const View<A>& rgb, View<A>& bgra, uint8_t alpha) and Simd::BgrToRgba(const View<A>& bgr, View<A>& rgba, uint8_t alpha).
Parameters
[in]rgb- a pointer to pixels data of input 24-bit RGB (or 24-bit BGR) image.
[in]width- an image width.
[in]height- an image height.
[in]rgbStride- a row size of the rgb image.
[out]bgra- a pointer to pixels data of output 32-bit BGRA (or 32-bit RGBA) image.
[in]bgraStride- a row size of the bgra image.
[in]alpha- a value of alpha channel.

◆ SimdRgbToGray()

void SimdRgbToGray ( const uint8_t *  rgb,
size_t  width,
size_t  height,
size_t  rgbStride,
uint8_t *  gray,
size_t  grayStride 
)

Converts 24-bit RGB image to 8-bit gray image.

All images must have the same width and height.

Note
This function has a C++ wrapper Simd::RgbToGray(const View<A>& rgb, View<A>& gray).
Parameters
[in]rgb- a pointer to pixels data of input 24-bit RGB image.
[in]width- an image width.
[in]height- an image height.
[in]rgbStride- a row size of the rgb image.
[out]gray- a pointer to pixels data of output 8-bit gray image.
[in]grayStride- a row size of the gray image.

◆ RgbToBgr()

void RgbToBgr ( const View< A > &  rgb,
View< A > &  bgr 
)

Converts 24-bit RGB image to 24-bit BGR image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgrToRgb.
Parameters
[in]rgb- an input 24-bit RGB image.
[out]bgr- an output 24-bit BGR image.

◆ RgbToBgra()

void RgbToBgra ( const View< A > &  rgb,
View< A > &  bgra,
uint8_t  alpha = 0xFF 
)

Converts 24-bit RGB image to 32-bit BGRA image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdRgbToBgra.
Parameters
[in]rgb- an input 24-bit RGB image.
[out]bgra- an output 32-bit BGRA image.
[in]alpha- a value of alpha channel. It is equal to 256 by default.

◆ RgbToGray()

void RgbToGray ( const View< A > &  rgb,
View< A > &  gray 
)

Converts 24-bit RGB image to 8-bit gray image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdRgbToGray.
Parameters
[in]rgb- an input 24-bit RGB image.
[out]gray- an output 8-bit gray image.

◆ RgbToRgba()

void RgbToRgba ( const View< A > &  rgb,
View< A > &  rgba,
uint8_t  alpha = 0xFF 
)

Converts 24-bit RGB image to 32-bit RGBA image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgrToBgra.
Parameters
[in]rgb- an input 24-bit RGB image.
[out]rgba- an output 32-bit RGBA image.
[in]alpha- a value of alpha channel. It is equal to 256 by default.