ARM Compute Library
17.04
|
Describe a multidimensional execution window. More...
#include <Window.h>
Data Structures | |
class | Dimension |
Describe one of the image's dimensions with a start, end and step. More... | |
Public Member Functions | |
constexpr | Window () |
Default constructor: create a window containing a single element. More... | |
Window (const Window &src) | |
Copy constructor. More... | |
constexpr const Dimension & | operator[] (size_t dimension) const |
Read only access to a given dimension of the window. More... | |
constexpr const Dimension & | x () const |
Alias to access the first dimension of the window. More... | |
constexpr const Dimension & | y () const |
Alias to access the second dimension of the window. More... | |
constexpr const Dimension & | z () const |
Alias to access the third dimension of the window. More... | |
void | set (size_t dimension, const Dimension &dim) |
Set the values of a given dimension. More... | |
void | use_tensor_dimensions (const TensorInfo *info, size_t first_dimension=Window::DimX) |
Use the tensor's dimensions to fill the window dimensions. More... | |
void | shift (size_t dimension, int shift_value) |
Shift the values of a given dimension by the given shift_value. More... | |
void | scale (size_t dimension, float scale_value) |
Scale the values of a given dimension by the given scale_value. More... | |
void | set_dimension_step (size_t dimension, int step) |
Set the step of a given dimension. More... | |
void | validate () const |
Will validate all the window's dimensions' values when asserts are enabled. More... | |
constexpr size_t | num_iterations (size_t dimension) const |
Return the number of iterations needed to iterate through a given dimension. More... | |
Window | split_window (size_t dimension, size_t id, size_t total) const |
Split a window into a set of sub windows along a given dimension. More... | |
Window | first_slice_window_1D () const |
First 1D slice of the window. More... | |
Window | first_slice_window_2D () const |
First 2D slice of the window. More... | |
Window | first_slice_window_3D () const |
First 3D slice of the window. More... | |
bool | slide_window_slice_1D (Window &slice) const |
Slide the passed 1D window slice. More... | |
bool | slide_window_slice_2D (Window &slice) const |
Slide the passed 2D window slice. More... | |
bool | slide_window_slice_3D (Window &slice) const |
Slide the passed 3D window slice. More... | |
void | set_thread_id (unsigned int id) |
Sets the ID of the thread that the window is associated with. More... | |
void | set_num_threads (unsigned int num_threads) |
Sets the number of threads dispatched that the window is associated with. More... | |
constexpr unsigned int | thread_id () const |
Get the ID of the thread that the window is associated with. More... | |
constexpr unsigned int | num_threads () const |
Get the number of threads dispatched that the window is associated with. More... | |
Static Public Attributes | |
static constexpr size_t | DimX = 0 |
Alias for dimension 0 also known as X dimension. More... | |
static constexpr size_t | DimY = 1 |
Alias for dimension 1 also known as Y dimension. More... | |
static constexpr size_t | DimZ = 2 |
Alias for dimension 2 also known as Z dimension. More... | |
|
inline |
Copy constructor.
[in] | src | Copy the values from src to a new object |
Definition at line 26 of file Window.inl.
References Dimensions< int >::num_max_dimensions.
|
inline |
|
inline |
|
inline |
|
inline |
Return the number of iterations needed to iterate through a given dimension.
[in] | dimension | The requested dimension |
Definition at line 78 of file Window.inl.
Referenced by Window::split_window(), and Window::z().
|
inline |
Get the number of threads dispatched that the window is associated with.
Definition at line 304 of file Window.h.
Referenced by Window::set_num_threads().
|
inline |
Read only access to a given dimension of the window.
[in] | dimension | The dimension to access |
Definition at line 35 of file Window.inl.
Referenced by Window::Dimension::set_step().
|
inline |
Scale the values of a given dimension by the given scale_value.
[in] | dimension | The dimension to scale |
[in] | scale_value | Value to scale the start, end and step values of. |
Definition at line 53 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, arm_compute::ceil_to_multiple(), Window::Dimension::end(), Dimensions< int >::num_max_dimensions, and Window::Dimension::step().
Referenced by Window::z().
|
inline |
Set the values of a given dimension.
[in] | dimension | The dimension to set |
[in] | dim | The values to set the dimension to |
Definition at line 40 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, and Dimensions< int >::num_max_dimensions.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), PPMLoader::fill_image(), test_helpers::save_to_ppm(), and Window::split_window().
|
inline |
Set the step of a given dimension.
[in] | dimension | Dimension to update |
[in] | step | The new dimension's step value |
Definition at line 62 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, and Dimensions< int >::num_max_dimensions.
Referenced by Window::z().
|
inline |
Sets the number of threads dispatched that the window is associated with.
num_threads | The number of threads dispatched that the window is associated with. |
Definition at line 288 of file Window.h.
References Window::num_threads().
|
inline |
|
inline |
Shift the values of a given dimension by the given shift_value.
[in] | dimension | The dimension to shift |
[in] | shift_value | Value to shift the start and end values of. |
Definition at line 46 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, Window::Dimension::end(), Dimensions< int >::num_max_dimensions, Window::Dimension::start(), and Window::Dimension::step().
Referenced by Window::z().
|
inline |
Slide the passed 1D window slice.
If slice contains the last slice then it will remain unchanged and false will be returned.
[in,out] | slice | Current slice, to be updated to the next slice. |
|
inline |
Slide the passed 2D window slice.
If slice contains the last slice then it will remain unchanged and false will be returned.
[in,out] | slice | Current slice, to be updated to the next slice. |
|
inline |
Slide the passed 3D window slice.
If slice contains the last slice then it will remain unchanged and false will be returned.
[in,out] | slice | Current slice, to be updated to the next slice. |
|
inline |
Split a window into a set of sub windows along a given dimension.
For example to split a window into 3 sub-windows along the Y axis, you would have to do:
Window sub0 = window.split_window( 1, 0, 3);
Window sub1 = window.split_window( 1, 1, 3);
Window sub2 = window.split_window( 1, 2, 3);
[in] | dimension | Dimension along which the split will be performed |
[in] | id | Id of the sub-window to return. Must be in the range (0, total-1) |
[in] | total | Total number of sub-windows the window will be split into. |
Definition at line 85 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, Window::num_iterations(), Dimensions< int >::num_max_dimensions, and Window::set().
Referenced by Window::z().
|
inline |
|
inline |
Use the tensor's dimensions to fill the window dimensions.
[in] | info | Tensor information to copy the dimensions from. |
[in] | first_dimension | Only copy dimensions which are greater or equal to this value. |
Definition at line 160 of file Window.inl.
References TensorInfo::dimension(), and TensorInfo::num_dimensions().
Referenced by main_neon_copy_objects(), and Window::z().
|
inline |
Will validate all the window's dimensions' values when asserts are enabled.
No-op when asserts are disabled
Definition at line 68 of file Window.inl.
References ARM_COMPUTE_ERROR_ON, and Dimensions< int >::num_max_dimensions.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_rgb_to_yuv4(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), and Window::z().
|
inline |
Alias to access the first dimension of the window.
Definition at line 128 of file Window.h.
References Window::DimX.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), and main_neon_copy_objects().
|
inline |
Alias to access the second dimension of the window.
Definition at line 137 of file Window.h.
References Window::DimY.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), and main_neon_copy_objects().
|
inline |
Alias to access the third dimension of the window.
Definition at line 146 of file Window.h.
References Window::DimX, Window::DimZ, Window::num_iterations(), Window::scale(), Window::set_dimension_step(), Window::shift(), Window::split_window(), Window::Dimension::step(), Window::use_tensor_dimensions(), and Window::validate().
Referenced by main_neon_copy_objects().
|
static |
Alias for dimension 0 also known as X dimension.
Definition at line 43 of file Window.h.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), PPMLoader::fill_image(), test_helpers::save_to_ppm(), Window::x(), and Window::z().
|
static |
Alias for dimension 1 also known as Y dimension.
Definition at line 45 of file Window.h.
Referenced by arm_compute::colorconvert_iyuv_to_nv12(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_iyuv_to_yuv4(), arm_compute::colorconvert_nv12_to_iyuv(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::colorconvert_nv12_to_yuv4(), arm_compute::colorconvert_rgb_to_iyuv(), arm_compute::colorconvert_rgb_to_nv12(), arm_compute::colorconvert_yuyv_to_iyuv(), arm_compute::colorconvert_yuyv_to_nv12(), PPMLoader::fill_image(), main_neon_copy_objects(), test_helpers::save_to_ppm(), and Window::y().
|
static |
Alias for dimension 2 also known as Z dimension.
Definition at line 47 of file Window.h.
Referenced by Window::z().