Simd Library Documentation.

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

Functions to deinterleave images. More...

Functions

SIMD_API void SimdDeinterleaveUv (const uint8_t *uv, size_t uvStride, size_t width, size_t height, uint8_t *u, size_t uStride, uint8_t *v, size_t vStride)
 Deinterleaves 16-bit UV interleaved image into one or two separated 8-bit U and V planar images. More...
 
SIMD_API void SimdDeinterleaveBgr (const uint8_t *bgr, size_t bgrStride, size_t width, size_t height, uint8_t *b, size_t bStride, uint8_t *g, size_t gStride, uint8_t *r, size_t rStride)
 Deinterleaves 24-bit BGR interleaved image into one, two or three separated 8-bit Blue, Green and Red planar images. More...
 
SIMD_API void SimdDeinterleaveBgra (const uint8_t *bgra, size_t bgraStride, size_t width, size_t height, uint8_t *b, size_t bStride, uint8_t *g, size_t gStride, uint8_t *r, size_t rStride, uint8_t *a, size_t aStride)
 Deinterleaves 32-bit BGRA interleaved image into one, two, three or four separated 8-bit Blue, Green, Red and Alpha planar images. More...
 
template<template< class > class A>
SIMD_INLINE void DeinterleaveUv (const View< A > &uv, View< A > &u, View< A > &v)
 Deinterleaves 16-bit UV interleaved image into separated 8-bit U and V planar images. More...
 
template<template< class > class A>
SIMD_INLINE void DeinterleaveBgr (const View< A > &bgr, View< A > &b, View< A > &g, View< A > &r)
 Deinterleaves 24-bit BGR interleaved image into separated 8-bit Blue, Green and Red planar images. More...
 
template<template< class > class A>
SIMD_INLINE void DeinterleaveBgra (const View< A > &bgra, View< A > &b, View< A > &g, View< A > &r, View< A > &a)
 Deinterleaves 32-bit BGRA interleaved image into separated 8-bit Blue, Green, Red and Alpha planar images. More...
 
template<template< class > class A>
SIMD_INLINE void DeinterleaveRgb (const View< A > &rgb, View< A > &r, View< A > &g, View< A > &b)
 Deinterleaves 24-bit RGB interleaved image into separated 8-bit Red, Green and Blue planar images. More...
 
template<template< class > class A>
SIMD_INLINE void DeinterleaveRgba (const View< A > &rgba, View< A > &r, View< A > &g, View< A > &b, View< A > &a)
 Deinterleaves 32-bit RGBA interleaved image into separated 8-bit Red, Green, Blue and Alpha planar images. More...
 

Detailed Description

Functions to deinterleave images.

Function Documentation

◆ SimdDeinterleaveUv()

void SimdDeinterleaveUv ( const uint8_t *  uv,
size_t  uvStride,
size_t  width,
size_t  height,
uint8_t *  u,
size_t  uStride,
uint8_t *  v,
size_t  vStride 
)

Deinterleaves 16-bit UV interleaved image into one or two separated 8-bit U and V planar images.

The input UV image and every non-null output image must have the same width and height. For every point:

u[i] = uv[2*i + 0];
v[i] = uv[2*i + 1];

Any output image pointer can be NULL; in this case corresponding channel is not extracted and its stride is ignored. If both output image pointers are NULL, the function does nothing. This function can be used for extraction of U and/or V planes from NV12 image.

Note
This function has a C++ wrapper Simd::DeinterleaveUv(const View<A>& uv, View<A>& u, View<A>& v).
Parameters
[in]uv- a pointer to pixels data of input 16-bit UV interleaved image.
[in]uvStride- a row size of the uv image.
[in]width- an image width.
[in]height- an image height.
[out]u- a pointer to pixels data of 8-bit U planar image. It can be NULL if you don't need this image.
[in]uStride- a row size of the u image.
[out]v- a pointer to pixels data of 8-bit V planar image. It can be NULL if you don't need this image.
[in]vStride- a row size of the v image.

◆ SimdDeinterleaveBgr()

void SimdDeinterleaveBgr ( const uint8_t *  bgr,
size_t  bgrStride,
size_t  width,
size_t  height,
uint8_t *  b,
size_t  bStride,
uint8_t *  g,
size_t  gStride,
uint8_t *  r,
size_t  rStride 
)

Deinterleaves 24-bit BGR interleaved image into one, two or three separated 8-bit Blue, Green and Red planar images.

The input BGR image and every non-null output image must have the same width and height. For every point:

b[i] = bgr[3*i + 0];
g[i] = bgr[3*i + 1];
r[i] = bgr[3*i + 2];

Any output image pointer can be NULL; in this case corresponding channel is not extracted and its stride is ignored. If all output image pointers are NULL, the function does nothing.

Note
This function has C++ wrappers: Simd::DeinterleaveBgr(const View<A>& bgr, View<A>& b, View<A>& g, View<A>& r), Simd::DeinterleaveRgb(const View<A>& rgb, View<A>& r, View<A>& g, View<A>& b).
Parameters
[in]bgr- a pointer to pixels data of input 24-bit BGR interleaved image.
[in]bgrStride- a row size of the bgr image.
[in]width- an image width.
[in]height- an image height.
[out]b- a pointer to pixels data of 8-bit Blue planar image. It can be NULL if you don't need this image.
[in]bStride- a row size of the b image.
[out]g- a pointer to pixels data of 8-bit Green planar image. It can be NULL if you don't need this image.
[in]gStride- a row size of the g image.
[out]r- a pointer to pixels data of 8-bit Red planar image. It can be NULL if you don't need this image.
[in]rStride- a row size of the r image.

◆ SimdDeinterleaveBgra()

void SimdDeinterleaveBgra ( const uint8_t *  bgra,
size_t  bgraStride,
size_t  width,
size_t  height,
uint8_t *  b,
size_t  bStride,
uint8_t *  g,
size_t  gStride,
uint8_t *  r,
size_t  rStride,
uint8_t *  a,
size_t  aStride 
)

Deinterleaves 32-bit BGRA interleaved image into one, two, three or four separated 8-bit Blue, Green, Red and Alpha planar images.

The input BGRA image and every non-null output image must have the same width and height. For every point:

b[i] = bgra[4*i + 0];
g[i] = bgra[4*i + 1];
r[i] = bgra[4*i + 2];
a[i] = bgra[4*i + 3];

Any output image pointer can be NULL; in this case corresponding channel is not extracted and its stride is ignored. If all output image pointers are NULL, the function does nothing.

Note
This function has C++ wrappers: Simd::DeinterleaveBgra(const View<A>& bgra, View<A>& b, View<A>& g, View<A>& r, View<A>& a), Simd::DeinterleaveRgba(const View<A>& rgba, View<A>& r, View<A>& g, View<A>& b, View<A>& a).
Parameters
[in]bgra- a pointer to pixels data of input 32-bit BGRA interleaved image.
[in]bgraStride- a row size of the bgra image.
[in]width- an image width.
[in]height- an image height.
[out]b- a pointer to pixels data of 8-bit Blue planar image. It can be NULL if you don't need this image.
[in]bStride- a row size of the b image.
[out]g- a pointer to pixels data of 8-bit Green planar image. It can be NULL if you don't need this image.
[in]gStride- a row size of the g image.
[out]r- a pointer to pixels data of 8-bit Red planar image. It can be NULL if you don't need this image.
[in]rStride- a row size of the r image.
[out]a- a pointer to pixels data of 8-bit Alpha planar image. It can be NULL if you don't need this image.
[in]aStride- a row size of the a image.

◆ DeinterleaveUv()

void DeinterleaveUv ( const View< A > &  uv,
View< A > &  u,
View< A > &  v 
)

Deinterleaves 16-bit UV interleaved image into separated 8-bit U and V planar images.

All images must have the same width and height. This function used for NV12 to YUV420P conversion.

Note
This function is a C++ wrapper for function SimdDeinterleaveUv.
Parameters
[in]uv- an input 16-bit UV interleaved image.
[out]u- an output 8-bit U planar image. It can be empty if you don't need it.
[out]v- an output 8-bit V planar image. It can be empty if you don't need it.

◆ DeinterleaveBgr()

void DeinterleaveBgr ( const View< A > &  bgr,
View< A > &  b,
View< A > &  g,
View< A > &  r 
)

Deinterleaves 24-bit BGR interleaved image into separated 8-bit Blue, Green and Red planar images.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdDeinterleaveBgr.
Parameters
[in]bgr- an input 24-bit BGR interleaved image.
[out]b- an output 8-bit Blue planar image. It can be empty if you don't need it.
[out]g- an output 8-bit Green planar image. It can be empty if you don't need it.
[out]r- an output 8-bit Red planar image. It can be empty if you don't need it.

◆ DeinterleaveBgra()

void DeinterleaveBgra ( const View< A > &  bgra,
View< A > &  b,
View< A > &  g,
View< A > &  r,
View< A > &  a 
)

Deinterleaves 32-bit BGRA interleaved image into separated 8-bit Blue, Green, Red and Alpha planar images.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdDeinterleaveBgra.
Parameters
[in]bgra- an input 32-bit BGRA interleaved image.
[out]b- an output 8-bit Blue planar image. It can be empty if you don't need it.
[out]g- an output 8-bit Green planar image. It can be empty if you don't need it.
[out]r- an output 8-bit Red planar image. It can be empty if you don't need it.
[out]a- an output 8-bit Alpha planar image. It can be empty if you don't need it.

◆ DeinterleaveRgb()

void DeinterleaveRgb ( const View< A > &  rgb,
View< A > &  r,
View< A > &  g,
View< A > &  b 
)

Deinterleaves 24-bit RGB interleaved image into separated 8-bit Red, Green and Blue planar images.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdDeinterleaveBgr.
Parameters
[in]rgb- an input 24-bit RGB interleaved image.
[out]r- an output 8-bit Red planar image. It can be empty if you don't need it.
[out]g- an output 8-bit Green planar image. It can be empty if you don't need it.
[out]b- an output 8-bit Blue planar image. It can be empty if you don't need it.

◆ DeinterleaveRgba()

void DeinterleaveRgba ( const View< A > &  rgba,
View< A > &  r,
View< A > &  g,
View< A > &  b,
View< A > &  a 
)

Deinterleaves 32-bit RGBA interleaved image into separated 8-bit Red, Green, Blue and Alpha planar images.

All images must have the same width and height.

Note
This function is a C++ wrapper for function SimdDeinterleaveBgra.
Parameters
[in]rgba- an input 32-bit RGBA interleaved image.
[out]r- an output 8-bit Red planar image. It can be empty if you don't need it.
[out]g- an output 8-bit Green planar image. It can be empty if you don't need it.
[out]b- an output 8-bit Blue planar image. It can be empty if you don't need it.
[out]a- an output 8-bit Alpha planar image. It can be empty if you don't need it.