Simd Library Documentation.

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

Functions for BGRA-32 image conversions. More...

Functions

SIMD_API void SimdBgraToBayer (const uint8_t *bgra, size_t width, size_t height, size_t bgraStride, uint8_t *bayer, size_t bayerStride, SimdPixelFormatType bayerFormat)
 Converts 32-bit BGRA image to 8-bit Bayer image. More...
 
SIMD_API void SimdBgraToBgr (const uint8_t *bgra, size_t width, size_t height, size_t bgraStride, uint8_t *bgr, size_t bgrStride)
 Converts 32-bit BGRA image to 24-bit BGR image. Also it can be used for 32-bit RGBA to 24-bit RGB conversion. More...
 
SIMD_API void SimdBgraToGray (const uint8_t *bgra, size_t width, size_t height, size_t bgraStride, uint8_t *gray, size_t grayStride)
 Converts 32-bit BGRA image to 8-bit gray image. More...
 
SIMD_API void SimdBgraToRgb (const uint8_t *bgra, size_t width, size_t height, size_t bgraStride, uint8_t *rgb, size_t rgbStride)
 Converts 32-bit BGRA image to 24-bit RGB image. Also it can be used for 32-bit RGBA to 24-bit BGR conversion. More...
 
SIMD_API void SimdBgraToRgba (const uint8_t *bgra, size_t width, size_t height, size_t bgraStride, uint8_t *rgba, size_t rgbaStride)
 Converts 32-bit BGRA image to 32-bit RGBA image. Also it can be used for 32-bit RGBA to 32-bit BGRA conversion. More...
 
SIMD_API void SimdBgraToYuv420pV2 (const uint8_t *bgra, size_t bgraStride, size_t width, size_t height, uint8_t *y, size_t yStride, uint8_t *u, size_t uStride, uint8_t *v, size_t vStride, SimdYuvType yuvType)
 Converts 32-bit BGRA image to YUV420P. More...
 
SIMD_API void SimdBgraToYuv422pV2 (const uint8_t *bgra, size_t bgraStride, size_t width, size_t height, uint8_t *y, size_t yStride, uint8_t *u, size_t uStride, uint8_t *v, size_t vStride, SimdYuvType yuvType)
 Converts 32-bit BGRA image to YUV422P. More...
 
SIMD_API void SimdBgraToYuv444pV2 (const uint8_t *bgra, size_t bgraStride, size_t width, size_t height, uint8_t *y, size_t yStride, uint8_t *u, size_t uStride, uint8_t *v, size_t vStride, SimdYuvType yuvType)
 Converts 32-bit BGRA image to YUV444P. More...
 
SIMD_API void SimdBgraToYuva420pV2 (const uint8_t *bgra, size_t bgraStride, size_t width, size_t height, uint8_t *y, size_t yStride, uint8_t *u, size_t uStride, uint8_t *v, size_t vStride, uint8_t *a, size_t aStride, SimdYuvType yuvType)
 Converts 32-bit BGRA image to YUVA420P. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToBayer (const View< A > &bgra, View< A > &bayer)
 Converts 32-bit BGRA image to 8-bit Bayer image. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToBgr (const View< A > &bgra, View< A > &bgr)
 Converts 32-bit BGRA image to 24-bit BGR image. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToGray (const View< A > &bgra, View< A > &gray)
 Converts 32-bit BGRA image to 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToRgb (const View< A > &bgra, View< A > &rgb)
 Converts 32-bit BGRA image to 24-bit RGB image. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToRgba (const View< A > &bgra, View< A > &rgba)
 Converts 32-bit BGRA image to 32-bit RGBA image. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToYuv420p (const View< A > &bgra, View< A > &y, View< A > &u, View< A > &v, SimdYuvType yuvType=SimdYuvBt601)
 Converts 32-bit BGRA image to YUV420P. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToYuv422p (const View< A > &bgra, View< A > &y, View< A > &u, View< A > &v, SimdYuvType yuvType=SimdYuvBt601)
 Converts 32-bit BGRA image to YUV422P. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToYuv444p (const View< A > &bgra, View< A > &y, View< A > &u, View< A > &v, SimdYuvType yuvType=SimdYuvBt601)
 Converts 32-bit BGRA image to YUV444P. More...
 
template<template< class > class A>
SIMD_INLINE void BgraToYuva420p (const View< A > &bgra, View< A > &y, View< A > &u, View< A > &v, View< A > &a, SimdYuvType yuvType=SimdYuvBt601)
 Converts 32-bit BGRA image to YUVA420P. More...
 

Detailed Description

Functions for BGRA-32 image conversions.

Function Documentation

◆ SimdBgraToBayer()

void SimdBgraToBayer ( const uint8_t *  bgra,
size_t  width,
size_t  height,
size_t  bgraStride,
uint8_t *  bayer,
size_t  bayerStride,
SimdPixelFormatType  bayerFormat 
)

Converts 32-bit BGRA image to 8-bit Bayer image.

All images must have the same width and height. The width and the height must be even.

Note
This function has a C++ wrapper Simd::BgraToBayer(const View<A>& bgra, View<A>& bayer).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA image.
[in]width- an image width.
[in]height- an image height.
[in]bgraStride- a row size of the bgra image.
[out]bayer- a pointer to pixels data of output 8-bit Bayer image.
[in]bayerStride- a row size of the bayer image.
[in]bayerFormat- a format of the output bayer image. It can be SimdPixelFormatBayerGrbg, SimdPixelFormatBayerGbrg, SimdPixelFormatBayerRggb or SimdPixelFormatBayerBggr.

◆ SimdBgraToBgr()

void SimdBgraToBgr ( const uint8_t *  bgra,
size_t  width,
size_t  height,
size_t  bgraStride,
uint8_t *  bgr,
size_t  bgrStride 
)

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

All images must have the same width and height.

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

◆ SimdBgraToGray()

void SimdBgraToGray ( const uint8_t *  bgra,
size_t  width,
size_t  height,
size_t  bgraStride,
uint8_t *  gray,
size_t  grayStride 
)

Converts 32-bit BGRA image to 8-bit gray image.

All images must have the same width and height.

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

◆ SimdBgraToRgb()

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

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

All images must have the same width and height.

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

◆ SimdBgraToRgba()

void SimdBgraToRgba ( const uint8_t *  bgra,
size_t  width,
size_t  height,
size_t  bgraStride,
uint8_t *  rgba,
size_t  rgbaStride 
)

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

All images must have the same width and height.

Note
This function has C++ wrappers: Simd::BgraToRgba(const View<A>& bgra, View<A>& rgba) and Simd::RgbaToBgra(const View<A>& rgba, View<A>& bgra).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA (or 32-bit RGBA) image.
[in]width- an image width.
[in]height- an image height.
[in]bgraStride- a row size of the bgra image.
[out]rgba- a pointer to pixels data of output 32-bit RGBA (or 32-bit BGRA) image.
[in]rgbaStride- a row size of the rgb image.

◆ SimdBgraToYuv420pV2()

void SimdBgraToYuv420pV2 ( const uint8_t *  bgra,
size_t  bgraStride,
size_t  width,
size_t  height,
uint8_t *  y,
size_t  yStride,
uint8_t *  u,
size_t  uStride,
uint8_t *  v,
size_t  vStride,
SimdYuvType  yuvType 
)

Converts 32-bit BGRA image to YUV420P.

The input BGRA and output Y images must have the same width and height. The output U and V images must have the same width and height (half size relative to Y component).

Note
This function has a C++ wrapper Simd::BgraToYuv420p(const View& bgra, View& y, View& u, View& v, SimdYuvType yuvType = SimdYuvBt601).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA image.
[in]bgraStride- a row size of the BGRA image.
[in]width- an image width.
[in]height- an image height.
[out]y- a pointer to pixels data of output 8-bit image with Y color plane.
[in]yStride- a row size of the y image.
[out]u- a pointer to pixels data of output 8-bit image with U color plane.
[in]uStride- a row size of the u image.
[out]v- a pointer to pixels data of output 8-bit image with V color plane.
[in]vStride- a row size of the v image.
[in]yuvType- a type of output YUV image (see descriprion of SimdYuvType).

◆ SimdBgraToYuv422pV2()

void SimdBgraToYuv422pV2 ( const uint8_t *  bgra,
size_t  bgraStride,
size_t  width,
size_t  height,
uint8_t *  y,
size_t  yStride,
uint8_t *  u,
size_t  uStride,
uint8_t *  v,
size_t  vStride,
SimdYuvType  yuvType 
)

Converts 32-bit BGRA image to YUV422P.

The input BGRA and output Y images must have the same width and height. The input U and V images must have the same width and height (their width is equal to half width of Y component).

Note
This function has a C++ wrapper Simd::BgraToYuv422p(const View& bgra, View& y, View& u, View& v, SimdYuvType yuvType = SimdYuvBt601).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA image.
[in]bgraStride- a row size of the BGRA image.
[in]width- an image width.
[in]height- an image height.
[out]y- a pointer to pixels data of output 8-bit image with Y color plane.
[in]yStride- a row size of the y image.
[out]u- a pointer to pixels data of output 8-bit image with U color plane.
[in]uStride- a row size of the u image.
[out]v- a pointer to pixels data of output 8-bit image with V color plane.
[in]vStride- a row size of the v image.
[in]yuvType- a type of output YUV image (see descriprion of SimdYuvType).

◆ SimdBgraToYuv444pV2()

void SimdBgraToYuv444pV2 ( const uint8_t *  bgra,
size_t  bgraStride,
size_t  width,
size_t  height,
uint8_t *  y,
size_t  yStride,
uint8_t *  u,
size_t  uStride,
uint8_t *  v,
size_t  vStride,
SimdYuvType  yuvType 
)

Converts 32-bit BGRA image to YUV444P.

The input BGRA and output Y, U and V images must have the same width and height.

Note
This function has a C++ wrapper Simd::BgraToYuv444p(const View& bgra, View& y, View& u, View& v, SimdYuvType yuvType = SimdYuvBt601).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA image.
[in]bgraStride- a row size of the BGRA image.
[in]width- an image width.
[in]height- an image height.
[out]y- a pointer to pixels data of output 8-bit image with Y color plane.
[in]yStride- a row size of the y image.
[out]u- a pointer to pixels data of output 8-bit image with U color plane.
[in]uStride- a row size of the u image.
[out]v- a pointer to pixels data of output 8-bit image with V color plane.
[in]vStride- a row size of the v image.
[in]yuvType- a type of output YUV image (see descriprion of SimdYuvType).

◆ SimdBgraToYuva420pV2()

void SimdBgraToYuva420pV2 ( const uint8_t *  bgra,
size_t  bgraStride,
size_t  width,
size_t  height,
uint8_t *  y,
size_t  yStride,
uint8_t *  u,
size_t  uStride,
uint8_t *  v,
size_t  vStride,
uint8_t *  a,
size_t  aStride,
SimdYuvType  yuvType 
)

Converts 32-bit BGRA image to YUVA420P.

The input BGRA and output Y and A images must have the same width and height. The input U and V images must have the same width and height (half size relative to Y component).

Note
This function has a C++ wrapper Simd::BgraToYuva420p(const View & bgra, View & y, View & u, View & v, View & a, SimdYuvType yuvType = SimdYuvBt601).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA image.
[in]bgraStride- a row size of the BGRA image.
[in]width- an image width.
[in]height- an image height.
[out]y- a pointer to pixels data of output 8-bit image with Y color plane.
[in]yStride- a row size of the y image.
[out]u- a pointer to pixels data of output 8-bit image with U color plane.
[in]uStride- a row size of the u image.
[out]v- a pointer to pixels data of output 8-bit image with V color plane.
[in]vStride- a row size of the v image.
[out]a- a pointer to pixels data of output 8-bit image with alpha plane.
[in]aStride- a row size of the a image.
[in]yuvType- a type of output YUV image (see descriprion of SimdYuvType).

◆ BgraToBayer()

void BgraToBayer ( const View< A > &  bgra,
View< A > &  bayer 
)

Converts 32-bit BGRA image to 8-bit Bayer image.

All images must have the same width and height. The width and the height must be even.

Note
This function is a C++ wrapper for function SimdBgraToBayer.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]bayer- an output 8-bit Bayer image.

◆ BgraToBgr()

void BgraToBgr ( const View< A > &  bgra,
View< A > &  bgr 
)

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

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgraToBgr.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]bgr- an output 24-bit BGR image.

◆ BgraToGray()

void BgraToGray ( const View< A > &  bgra,
View< A > &  gray 
)

Converts 32-bit BGRA image to 8-bit gray image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgraToGray.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]gray- an output 8-bit gray image.

◆ BgraToRgb()

void BgraToRgb ( const View< A > &  bgra,
View< A > &  rgb 
)

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

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgraToRgb.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]rgb- an output 24-bit RGB image.

◆ BgraToRgba()

void BgraToRgba ( const View< A > &  bgra,
View< A > &  rgba 
)

Converts 32-bit BGRA image to 32-bit RGBA image.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgraToRgba.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]rgba- an output 32-bit RGBA image.

◆ BgraToYuv420p()

void BgraToYuv420p ( const View< A > &  bgra,
View< A > &  y,
View< A > &  u,
View< A > &  v,
SimdYuvType  yuvType = SimdYuvBt601 
)

Converts 32-bit BGRA image to YUV420P.

The input BGRA and output Y images must have the same width and height. The input U and V images must have the same width and height (half size relative to Y component).

Note
This function is a C++ wrapper for function SimdBgraToYuv420pV2.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]y- an output 8-bit image with Y color plane.
[out]u- an output 8-bit image with U color plane.
[out]v- an output 8-bit image with V color plane.
[in]yuvType- a type of input YUV image (see descriprion of SimdYuvType).By default it is equal to SimdYuvBt601.

◆ BgraToYuv422p()

void BgraToYuv422p ( const View< A > &  bgra,
View< A > &  y,
View< A > &  u,
View< A > &  v,
SimdYuvType  yuvType = SimdYuvBt601 
)

Converts 32-bit BGRA image to YUV422P.

The input BGRA and output Y images must have the same width and height. The input U and V images must have the same width and height (their width is equal to half width of Y component).

Note
This function is a C++ wrapper for function SimdBgraToYuv422pV2.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]y- an output 8-bit image with Y color plane.
[out]u- an output 8-bit image with U color plane.
[out]v- an output 8-bit image with V color plane.
[in]yuvType- a type of input YUV image (see descriprion of SimdYuvType).By default it is equal to SimdYuvBt601.

◆ BgraToYuv444p()

void BgraToYuv444p ( const View< A > &  bgra,
View< A > &  y,
View< A > &  u,
View< A > &  v,
SimdYuvType  yuvType = SimdYuvBt601 
)

Converts 32-bit BGRA image to YUV444P.

The input BGRA and output Y, U and V images must have the same width and height.

Note
This function is a C++ wrapper for function SimdBgraToYuv444pV2.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]y- an output 8-bit image with Y color plane.
[out]u- an output 8-bit image with U color plane.
[out]v- an output 8-bit image with V color plane.
[in]yuvType- a type of input YUV image (see descriprion of SimdYuvType).By default it is equal to SimdYuvBt601.

◆ BgraToYuva420p()

void BgraToYuva420p ( const View< A > &  bgra,
View< A > &  y,
View< A > &  u,
View< A > &  v,
View< A > &  a,
SimdYuvType  yuvType = SimdYuvBt601 
)

Converts 32-bit BGRA image to YUVA420P.

The input BGRA and output Y and A images must have the same width and height. The input U and V images must have the same width and height (half size relative to Y component).

Note
This function is a C++ wrapper for function SimdBgraToYuva420pV2.
Parameters
[in]bgra- an input 32-bit BGRA image.
[out]y- an output 8-bit image with Y color plane.
[out]u- an output 8-bit image with U color plane.
[out]v- an output 8-bit image with V color plane.
[out]a- an output 8-bit image with alpha plane.
[in]yuvType- a type of input YUV image (see descriprion of SimdYuvType).By default it is equal to SimdYuvBt601.