Functions for Bayer image conversions. More...
Functions | |
| SIMD_API void | SimdBayerToBgr (const uint8_t *bayer, size_t width, size_t height, size_t bayerStride, SimdPixelFormatType bayerFormat, uint8_t *bgr, size_t bgrStride) |
| Converts an 8-bit Bayer image to a 24-bit BGR image using edge-directed demosaicing. More... | |
| SIMD_API void | SimdBayerToBgra (const uint8_t *bayer, size_t width, size_t height, size_t bayerStride, SimdPixelFormatType bayerFormat, uint8_t *bgra, size_t bgraStride, uint8_t alpha) |
| Converts an 8-bit Bayer image to a 32-bit BGRA image using edge-directed demosaicing. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | BayerToBgr (const View< A > &bayer, View< A > &bgr) |
| Converts 8-bit Bayer image to 24-bit BGR. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | BayerToBgra (const View< A > &bayer, View< A > &bgra, uint8_t alpha=0xFF) |
| Converts 8-bit Bayer image to 32-bit BGRA. More... | |
Detailed Description
Functions for Bayer image conversions.
Function Documentation
◆ SimdBayerToBgr()
| void SimdBayerToBgr | ( | const uint8_t * | bayer, |
| size_t | width, | ||
| size_t | height, | ||
| size_t | bayerStride, | ||
| SimdPixelFormatType | bayerFormat, | ||
| uint8_t * | bgr, | ||
| size_t | bgrStride | ||
| ) |
Converts an 8-bit Bayer image to a 24-bit BGR image using edge-directed demosaicing.
The function performs demosaicing of a raw Bayer-patterned image into a full-color 24-bit BGR image. Missing color samples at each pixel are reconstructed using a gradient-based interpolation that selects between vertical and horizontal neighbors according to local edge strength, producing sharper results along edges than simple bilinear interpolation. Both images must have the same width and height, and both dimensions must be even.
- Note
- This function has a C++ wrapper Simd::BayerToBgr(const View<A>& bayer, View<A>& bgr).
- Parameters
-
[in] bayer - a pointer to pixels data of input 8-bit Bayer image. [in] width - an image width. Must be even and at least 4. [in] height - an image height. Must be even and at least 4. [in] bayerStride - a row size (in bytes) of the bayer image. [in] bayerFormat - a format of the input bayer image. It can be SimdPixelFormatBayerGrbg, SimdPixelFormatBayerGbrg, SimdPixelFormatBayerRggb or SimdPixelFormatBayerBggr. [out] bgr - a pointer to pixels data of output 24-bit BGR image. [in] bgrStride - a row size (in bytes) of the bgr image.
◆ SimdBayerToBgra()
| void SimdBayerToBgra | ( | const uint8_t * | bayer, |
| size_t | width, | ||
| size_t | height, | ||
| size_t | bayerStride, | ||
| SimdPixelFormatType | bayerFormat, | ||
| uint8_t * | bgra, | ||
| size_t | bgraStride, | ||
| uint8_t | alpha | ||
| ) |
Converts an 8-bit Bayer image to a 32-bit BGRA image using edge-directed demosaicing.
The function performs demosaicing of a raw Bayer-patterned image into a full-color 32-bit BGRA image. Missing color samples at each pixel are reconstructed using a gradient-based interpolation that selects between vertical and horizontal neighbors according to local edge strength. The alpha channel of every output pixel is set to the constant value specified by the alpha parameter. Both images must have the same width and height, and both dimensions must be even.
- Note
- This function has a C++ wrapper Simd::BayerToBgra(const View<A>& bayer, View<A>& bgra, uint8_t alpha).
- Parameters
-
[in] bayer - a pointer to pixels data of input 8-bit Bayer image. [in] width - an image width. Must be even and at least 4. [in] height - an image height. Must be even and at least 4. [in] bayerStride - a row size (in bytes) of the bayer image. [in] bayerFormat - a format of the input bayer image. It can be SimdPixelFormatBayerGrbg, SimdPixelFormatBayerGbrg, SimdPixelFormatBayerRggb or SimdPixelFormatBayerBggr. [out] bgra - a pointer to pixels data of output 32-bit BGRA image. [in] bgraStride - a row size (in bytes) of the bgra image. [in] alpha - a constant value to fill the alpha channel of every output pixel.
◆ BayerToBgr()
Converts 8-bit Bayer image to 24-bit BGR.
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 SimdBayerToBgr.
- Parameters
-
[in] bayer - an input 8-bit Bayer image. [out] bgr - an output 24-bit BGR image.
◆ BayerToBgra()
Converts 8-bit Bayer image to 32-bit BGRA.
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 SimdBayerToBgra.
- Parameters
-
[in] bayer - an input 8-bit Bayer image. [out] bgra - an output 32-bit BGRA image. [in] alpha - a value of alpha channel. It is equal to 256 by default.