Related functions for Simd::View structure. More...
Functions | |
| template<template< class > class A, class T > | |
| const T & | At (const View< A > &view, size_t x, size_t y) |
| template<template< class > class A, class T > | |
| T & | At (View< A > &view, size_t x, size_t y) |
| template<template< class > class A, template< class > class B> | |
| bool | EqualSize (const View< A > &a, const View< B > &b) |
| template<template< class > class A> | |
| bool | EqualSize (const View< A > &a, const View< A > &b, const View< A > &c) |
| template<template< class > class A> | |
| bool | EqualSize (const View< A > &a, const View< A > &b, const View< A > &c, const View< A > &d) |
| template<template< class > class A, template< class > class B> | |
| bool | Compatible (const View< A > &a, const View< B > &b) |
| template<template< class > class A> | |
| bool | Compatible (const View< A > &a, const View< A > &b, const View< A > &c) |
| template<template< class > class A> | |
| bool | Compatible (const View< A > &a, const View< A > &b, const View< A > &c, const View< A > &d) |
| template<template< class > class A> | |
| bool | Compatible (const View< A > &a, const View< A > &b, const View< A > &c, const View< A > &d, const View< A > &e) |
Detailed Description
Related functions for Simd::View structure.
Function Documentation
◆ At() [1/2]
| const T & At | ( | const View< A > & | view, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Returns a const pixel of a view.
The pixel is ((const T*)(view.data + y * view.stride))[x]. The function asserts x < view.width and y < view.height. sizeof(T) is the pixel size. View::At is the method form of this function, and Simd::Pixel::At checks the view format before using it.
- Parameters
-
[in] view - an image. [in] x - x coordinate of the pixel. [in] y - y coordinate of the pixel.
- Returns
- a const reference to the pixel.
◆ At() [2/2]
| T & At | ( | View< A > & | view, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Returns a pixel of a view.
The address is the same as for the const overload.
- Parameters
-
[in,out] view - an image. [in] x - x coordinate of the pixel. [in] y - y coordinate of the pixel.
- Returns
- a reference to the pixel.
◆ EqualSize() [1/3]
| template< template< class > class A, template< class > class B > bool EqualSize | ( | const View< A > & | a, |
| const View< B > & | b | ||
| ) |
Checks that two views have the same width and height.
The formats and strides may differ. The two views may use different allocator templates. Simd::Convert asserts EqualSize and then converts between Gray8, Bgr24, Bgra32, Rgb24 and Rgba32. TestCheckCpp relies on that for a 6x6 Bgra32 source and a 6x6 Gray8 destination.
- Parameters
-
[in] a - a first image. [in] b - a second image.
- Returns
- true when the widths are equal and the heights are equal.
◆ EqualSize() [2/3]
| template< template< class > class A > bool EqualSize | ( | const View< A > & | a, |
| const View< A > & | b, | ||
| const View< A > & | c | ||
| ) |
Checks that three views have the same width and height.
The formats and strides may differ. b and c are both compared with a.
- Parameters
-
[in] a - a first image. [in] b - a second image. [in] c - a third image.
- Returns
- true when all three views have the size of
a.
◆ EqualSize() [3/3]
| template< template< class > class A > bool EqualSize | ( | const View< A > & | a, |
| const View< A > & | b, | ||
| const View< A > & | c, | ||
| const View< A > & | d | ||
| ) |
Checks that four views have the same width and height.
The formats and strides may differ. b, c and d are compared with a.
- Parameters
-
[in] a - a first image. [in] b - a second image. [in] c - a third image. [in] d - a fourth image.
- Returns
- true when all four views have the size of
a.
◆ Compatible() [1/4]
| template< template< class > class A, template< class > class B > bool Compatible | ( | const View< A > & | a, |
| const View< B > & | b | ||
| ) |
Checks that two views have the same width, height and format.
The strides may differ, and the views may use different allocator templates. Simd::Copy asserts Compatible and then copies width * PixelSize() bytes of each row. A Gray8 pyramid level and a Gray8 image of that size are compatible. A Bgra32 view and a Gray8 view of the same size are not; Simd::Convert accepts that pair because it checks EqualSize.
- Parameters
-
[in] a - a first image. [in] b - a second image.
- Returns
- true when the sizes and formats are equal.
◆ Compatible() [2/4]
| template< template< class > class A > bool Compatible | ( | const View< A > & | a, |
| const View< A > & | b, | ||
| const View< A > & | c | ||
| ) |
Checks that three views have the same width, height and format.
The strides may differ. b and c are both compared with a.
- Parameters
-
[in] a - a first image. [in] b - a second image. [in] c - a third image.
- Returns
- true when all three views have the size and format of
a.
◆ Compatible() [3/4]
| template< template< class > class A > bool Compatible | ( | const View< A > & | a, |
| const View< A > & | b, | ||
| const View< A > & | c, | ||
| const View< A > & | d | ||
| ) |
Checks that four views have the same width, height and format.
The strides may differ. b, c and d are compared with a.
- Parameters
-
[in] a - a first image. [in] b - a second image. [in] c - a third image. [in] d - a fourth image.
- Returns
- true when all four views have the size and format of
a.
◆ Compatible() [4/4]
| template< template< class > class A > bool Compatible | ( | const View< A > & | a, |
| const View< A > & | b, | ||
| const View< A > & | c, | ||
| const View< A > & | d, | ||
| const View< A > & | e | ||
| ) |
Checks that five views have the same width, height and format.
The strides may differ. b, c, d and e are compared with a.
- Parameters
-
[in] a - a first image. [in] b - a second image. [in] c - a third image. [in] d - a fourth image. [in] e - a fifth image.
- Returns
- true when all five views have the size and format of
a.