Functions for image filling. More...
Functions | |
| SIMD_API void | SimdFill (uint8_t *dst, size_t stride, size_t width, size_t height, size_t pixelSize, uint8_t value) |
| Fills every byte of image pixel data with the given 8-bit value. More... | |
| SIMD_API void | SimdFillFrame (uint8_t *dst, size_t stride, size_t width, size_t height, size_t pixelSize, size_t frameLeft, size_t frameTop, size_t frameRight, size_t frameBottom, uint8_t value) |
| Fills image pixel data outside of the given inner frame with the given 8-bit value. More... | |
| SIMD_API void | SimdFillBgr (uint8_t *dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red) |
| Fills every pixel of a 24-bit BGR image with the given color. More... | |
| SIMD_API void | SimdFillBgra (uint8_t *dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha) |
| Fills every pixel of a 32-bit BGRA image with the given color. More... | |
| SIMD_API void | SimdFillPixel (uint8_t *dst, size_t stride, size_t width, size_t height, const uint8_t *pixel, size_t pixelSize) |
| Fills every image pixel with the given pixel value. More... | |
| SIMD_API void | SimdFill32f (float *dst, size_t size, const float *value) |
| Fills a 32-bit float array with the given value. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | Fill (View< A > &dst, uint8_t value) |
| Fills pixels data of image by given value. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | FillFrame (View< A > &dst, const Rectangle< ptrdiff_t > &frame, uint8_t value) |
| Fills pixels data of image except for the portion bounded frame by given value. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | FillBgr (View< A > &dst, uint8_t blue, uint8_t green, uint8_t red) |
| Fills pixels data of 24-bit BGR image by given color(blue, green, red). More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | FillBgra (View< A > &dst, uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha=0xFF) |
| Fills pixels data of 32-bit BGRA image by given color(blue, green, red, alpha). More... | |
| template<template< class > class A, class Pixel > | |
| SIMD_INLINE void | FillPixel (View< A > &dst, const Pixel &pixel) |
| Fills image by value of given pixel. More... | |
Detailed Description
Functions for image filling.
Function Documentation
◆ SimdFill()
| void SimdFill | ( | uint8_t * | dst, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | pixelSize, | ||
| uint8_t | value | ||
| ) |
Fills every byte of image pixel data with the given 8-bit value.
For each row the function writes width*pixelSize bytes with value and then moves to the next row by stride bytes. Padding bytes after width*pixelSize in each row are not modified.
- Note
- This function has a C++ wrapper Simd::Fill(View<A>& dst, uint8_t value).
- Parameters
-
[out] dst - a pointer to pixels data of destination image. [in] stride - a row size of the dst image (in bytes). [in] width - an image width (in pixels). [in] height - an image height (in pixels). [in] pixelSize - a size of one image pixel (in bytes). [in] value - a byte value to fill image pixel data.
◆ SimdFillFrame()
| void SimdFillFrame | ( | uint8_t * | dst, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | pixelSize, | ||
| size_t | frameLeft, | ||
| size_t | frameTop, | ||
| size_t | frameRight, | ||
| size_t | frameBottom, | ||
| uint8_t | value | ||
| ) |
Fills image pixel data outside of the given inner frame with the given 8-bit value.
The function fills four areas: rows above frameTop, rows below frameBottom, columns before frameLeft inside frame vertical range, and columns after frameRight inside frame vertical range. The rectangle [frameLeft, frameRight) x [frameTop, frameBottom) is left unchanged. Frame coordinates must satisfy frameLeft <= frameRight <= width and frameTop <= frameBottom <= height.
- Note
- This function has a C++ wrapper Simd::FillFrame(View<A>& dst, const Rectangle<ptrdiff_t> & frame, uint8_t value).
- Parameters
-
[out] dst - a pointer to pixels data of destination image. [in] stride - a row size of the dst image (in bytes). [in] width - an image width (in pixels). [in] height - an image height (in pixels). [in] pixelSize - a size of one image pixel (in bytes). [in] frameLeft - a left side of the inner frame. [in] frameTop - a top side of the inner frame. [in] frameRight - a right side of the inner frame. [in] frameBottom - a bottom side of the inner frame. [in] value - a byte value to fill image pixel data outside of the frame.
◆ SimdFillBgr()
| void SimdFillBgr | ( | uint8_t * | dst, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint8_t | blue, | ||
| uint8_t | green, | ||
| uint8_t | red | ||
| ) |
Fills every pixel of a 24-bit BGR image with the given color.
For every output pixel: dst[0] = blue, dst[1] = green, dst[2] = red. Padding bytes after width*3 in each row are not modified.
- Note
- This function has a C++ wrapper Simd::FillBgr(View<A>& dst, uint8_t blue, uint8_t green, uint8_t red).
- Parameters
-
[out] dst - a pointer to pixels data of destination image. [in] stride - a row size of the dst image (in bytes). [in] width - an image width (in pixels). [in] height - an image height (in pixels). [in] blue - a blue channel value of BGR color. [in] green - a green channel value of BGR color. [in] red - a red channel value of BGR color.
◆ SimdFillBgra()
| void SimdFillBgra | ( | uint8_t * | dst, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint8_t | blue, | ||
| uint8_t | green, | ||
| uint8_t | red, | ||
| uint8_t | alpha | ||
| ) |
Fills every pixel of a 32-bit BGRA image with the given color.
For every output pixel: dst[0] = blue, dst[1] = green, dst[2] = red, dst[3] = alpha. Padding bytes after width*4 in each row are not modified.
- Note
- This function has a C++ wrapper Simd::FillBgra(View<A>& dst, uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha).
- Parameters
-
[out] dst - a pointer to pixels data of destination image. [in] stride - a row size of the dst image (in bytes). [in] width - an image width (in pixels). [in] height - an image height (in pixels). [in] blue - a blue channel value of BGRA color. [in] green - a green channel value of BGRA color. [in] red - a red channel value of BGRA color. [in] alpha - an alpha channel value of BGRA color.
◆ SimdFillPixel()
| void SimdFillPixel | ( | uint8_t * | dst, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| const uint8_t * | pixel, | ||
| size_t | pixelSize | ||
| ) |
Fills every image pixel with the given pixel value.
The function supports pixel sizes from 1 to 4 bytes. For pixelSize equal to 1, 2, 3 or 4 it fills the image as 8-bit gray, 16-bit two-channel, 24-bit BGR or 32-bit BGRA data respectively. Padding bytes after width*pixelSize in each row are not modified.
- Note
- This function has a C++ wrapper Simd::FillPixel(View<A> & dst, const Pixel & pixel).
- Parameters
-
[out] dst - a pointer to pixels data of destination image. [in] stride - a row size of the dst image (in bytes). [in] width - an image width (in pixels). [in] height - an image height (in pixels). [in] pixel - a pointer to pixel value to fill image. It must point to pixelSize bytes. [in] pixelSize - a size of one image pixel (in bytes). It must be in range [1, 4].
◆ SimdFill32f()
| void SimdFill32f | ( | float * | dst, |
| size_t | size, | ||
| const float * | value | ||
| ) |
Fills a 32-bit float array with the given value.
If value is NULL or value[0] is equal to 0.0, the function fills dst with zeros. Otherwise every dst element is set to value[0].
- Parameters
-
[out] dst - a pointer to 32-bit float array. [in] size - a number of elements in the array. [in] value - a pointer to value to fill. It can be NULL; in this case filling value is assumed to be zero.
◆ Fill()
| void Fill | ( | View< A > & | dst, |
| uint8_t | value | ||
| ) |
Fills pixels data of image by given value.
- Note
- This function is a C++ wrapper for function SimdFill.
- Parameters
-
[out] dst - a destination image. [in] value - a value to fill image.
◆ FillFrame()
Fills pixels data of image except for the portion bounded frame by given value.
- Note
- This function is a C++ wrapper for function SimdFillFrame.
- Parameters
-
[out] dst - a destination image. [in] frame - a frame rectangle. [in] value - a value to fill image.
◆ FillBgr()
| void FillBgr | ( | View< A > & | dst, |
| uint8_t | blue, | ||
| uint8_t | green, | ||
| uint8_t | red | ||
| ) |
Fills pixels data of 24-bit BGR image by given color(blue, green, red).
- Note
- This function is a C++ wrapper for function SimdFillBgr.
- Parameters
-
[out] dst - a destination image. [in] blue - a blue channel of BGR to fill image. [in] green - a green channel of BGR to fill image. [in] red - a red channel of BGR to fill image.
◆ FillBgra()
| void FillBgra | ( | View< A > & | dst, |
| uint8_t | blue, | ||
| uint8_t | green, | ||
| uint8_t | red, | ||
| uint8_t | alpha = 0xFF |
||
| ) |
Fills pixels data of 32-bit BGRA image by given color(blue, green, red, alpha).
- Note
- This function is a C++ wrapper for function SimdFillBgra.
- Parameters
-
[out] dst - a destination image. [in] blue - a blue channel of BGRA to fill image. [in] green - a green channel of BGRA to fill image. [in] red - a red channel of BGRA to fill image. [in] alpha - a alpha channel of BGRA to fill image. It is equal to 255 by default.
◆ FillPixel()
| void FillPixel | ( | View< A > & | dst, |
| const Pixel & | pixel | ||
| ) |
Fills image by value of given pixel.
- Note
- This function is a C++ wrapper for function SimdFillPixel.
- Parameters
-
[out] dst - a destination image. [in] pixel - a pixel of type which correspond to image format. The size of the type is restricted by range [1, 4].