Functions for other image format conversions. More...
Functions | |
SIMD_API void | SimdBgr48pToBgra32 (const uint8_t *blue, size_t blueStride, size_t width, size_t height, const uint8_t *green, size_t greenStride, const uint8_t *red, size_t redStride, uint8_t *bgra, size_t bgraStride, uint8_t alpha) |
Converts 48-bit planar BGR image to 32-bit BGRA image. More... | |
SIMD_API void | SimdFloat32ToUint8 (const float *src, size_t size, const float *lower, const float *upper, uint8_t *dst) |
Converts numbers in the array from 32-bit float to 8-bit unsigned integer format. More... | |
SIMD_API void | SimdUint8ToFloat32 (const uint8_t *src, size_t size, const float *lower, const float *upper, float *dst) |
Converts numbers in the array from 8-bit unsigned integer to 32-bit float format. More... | |
SIMD_API void | SimdInt16ToGray (const uint8_t *src, size_t width, size_t height, size_t srcStride, uint8_t *dst, size_t dstStride) |
Converts 16-bit signed integer image to 8-bit gray image with saturation. More... | |
template<template< class > class A> | |
SIMD_INLINE void | Bgr48pToBgra32 (const View< A > &blue, const View< A > &green, const View< A > &red, View< A > &bgra, uint8_t alpha=0xFF) |
Converts 48-bit planar BGR image to 32-bit BGRA image. More... | |
template<template< class > class A> | |
SIMD_INLINE void | Int16ToGray (const View< A > &src, View< A > &dst) |
Converts 16-bit signed integer image to 8-bit gray image with saturation. More... | |
Detailed Description
Functions for other image format conversions.
Function Documentation
◆ SimdBgr48pToBgra32()
void SimdBgr48pToBgra32 | ( | const uint8_t * | blue, |
size_t | blueStride, | ||
size_t | width, | ||
size_t | height, | ||
const uint8_t * | green, | ||
size_t | greenStride, | ||
const uint8_t * | red, | ||
size_t | redStride, | ||
uint8_t * | bgra, | ||
size_t | bgraStride, | ||
uint8_t | alpha | ||
) |
Converts 48-bit planar BGR image to 32-bit BGRA image.
All images must have the same width and height.
- Note
- This function has a C++ wrapper Simd::Bgr48pToBgra32(const View<A>& blue, const View<A>& green, const View<A>& red, View<A>& bgra, uint8_t alpha).
- Parameters
-
[in] blue - a pointer to pixels data of input 16-bit image with blue color plane. [in] blueStride - a row size of the blue image. [in] width - an image width. [in] height - an image height. [in] green - a pointer to pixels data of input 16-bit image with green color plane. [in] greenStride - a row size of the blue image. [in] red - a pointer to pixels data of input 16-bit image with red color plane. [in] redStride - a row size of the red image. [out] bgra - a pointer to pixels data of output 32-bit BGRA image. [in] bgraStride - a row size of the bgra image. [in] alpha - a value of alpha channel.
◆ SimdFloat32ToUint8()
void SimdFloat32ToUint8 | ( | const float * | src, |
size_t | size, | ||
const float * | lower, | ||
const float * | upper, | ||
uint8_t * | dst | ||
) |
Converts numbers in the array from 32-bit float to 8-bit unsigned integer format.
For every element:
dst[i] = (min(max(src[i], lower), upper) - lower)*255/(upper - lower);
- Parameters
-
[in] src - a pointer to the input array with 32-bit float point numbers. [in] size - a size of input and output array. [in] lower - a pointer to lower saturated bound of the input array. [in] upper - a pointer to upper saturated bound of the input array. [out] dst - a pointer to the output array with 8-bit unsigned integer numbers.
◆ SimdUint8ToFloat32()
void SimdUint8ToFloat32 | ( | const uint8_t * | src, |
size_t | size, | ||
const float * | lower, | ||
const float * | upper, | ||
float * | dst | ||
) |
Converts numbers in the array from 8-bit unsigned integer to 32-bit float format.
For every element:
dst[i] = src[i]*(upper - lower)/255 + lower;
- Parameters
-
[in] src - a pointer to the input array with 8-bit unsigned integer numbers. [in] size - a size of input and output array. [in] lower - a pointer to lower bound of the output array. [in] upper - a pointer to upper bound of the output array. [out] dst - a pointer to the output array with 32-bit float point numbers.
◆ SimdInt16ToGray()
void SimdInt16ToGray | ( | const uint8_t * | src, |
size_t | width, | ||
size_t | height, | ||
size_t | srcStride, | ||
uint8_t * | dst, | ||
size_t | dstStride | ||
) |
Converts 16-bit signed integer image to 8-bit gray image with saturation.
All images must have the same width and height.
For every point:
dst[i] = Max(0, Min(255, src[i]));
- Note
- This function has a C++ wrapper Simd::Int16ToGray(const View<A> & src, View<A> & dst).
- Parameters
-
[in] src - a pointer to pixels data of input 16-bit signed integer image. [in] width - an image width. [in] height - an image height. [in] srcStride - a row size of the 16-bit signed integer image. [out] dst - a pointer to pixels data of input 8-bit gray image. [out] dstStride - a row size of the gray image.
◆ Bgr48pToBgra32()
void Bgr48pToBgra32 | ( | const View< A > & | blue, |
const View< A > & | green, | ||
const View< A > & | red, | ||
View< A > & | bgra, | ||
uint8_t | alpha = 0xFF |
||
) |
Converts 48-bit planar BGR image to 32-bit BGRA image.
All images must have the same width and height.
- Note
- This function is a C++ wrapper for function SimdBgr48pToBgra32.
- Parameters
-
[in] blue - an input 16-bit image with blue color plane. [in] green - an input 16-bit image with green color plane. [in] red - an input 16-bit image with red color plane. [out] bgra - an output 32-bit BGRA image. [in] alpha - a value of alpha channel. It is equal to 256 by default.
◆ Int16ToGray()
Converts 16-bit signed integer image to 8-bit gray image with saturation.
All images must have the same width and height.
For every point:
dst[i] = Max(0, Min(255, src[i]));
- Note
- This function is a C++ wrapper for function SimdInt16ToGray.
- Parameters
-
[in] src - an input 16-bit signed integer image [out] dst - an output 8-bit gray image.