Compute Library
 19.08
CLRemap Class Reference

Basic function to execute remap. More...

#include <CLRemap.h>

Collaboration diagram for CLRemap:
[legend]

Public Member Functions

void configure (ICLTensor *input, const ICLTensor *map_x, const ICLTensor *map_y, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value=0)
 Initialise the function's sources, destination, interpolation policy and border mode. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction ()
 Default constructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Detailed Description

Basic function to execute remap.

This function calls the following OpenCL kernels:

  1. CLFillBorderKernel (executed if border_mode == CONSTANT or border_mode == REPLICATE)
  2. CLRemapKernel

Definition at line 41 of file CLRemap.h.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input,
const ICLTensor map_x,
const ICLTensor map_y,
ICLTensor output,
InterpolationPolicy  policy,
BorderMode  border_mode,
uint8_t  constant_border_value = 0 
)

Initialise the function's sources, destination, interpolation policy and border mode.

Parameters
[in,out]inputSource tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED)
[in]map_xMap for X coords. Data types supported: F32.
[in]map_yMap for Y coords. Data types supported: F32.
[out]outputOutput tensor. Data types supported: U8.
[in]policyInterpolation policy to use. Only NEAREST and BILINEAR are supported.
[in]border_modeBorder mode to use on the input tensor.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 38 of file CLRemap.cpp.

39 {
44  ARM_COMPUTE_ERROR_ON_MSG(policy == InterpolationPolicy::AREA, "Area interpolation is not supported");
45 
46  auto k = arm_compute::support::cpp14::make_unique<CLRemapKernel>();
47  k->configure(input, map_x, map_y, output, policy, border_mode == BorderMode::UNDEFINED);
48  _kernel = std::move(k);
49  _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(constant_border_value));
50 }
Class describing the value of a pixel for any image format.
Definition: PixelValue.h:34
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:789
Borders are left undefined.
#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)
Definition: Error.h:328

References arm_compute::AREA, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::border_mode, arm_compute::F32, arm_compute::test::validation::policy, arm_compute::U8, and arm_compute::UNDEFINED.


The documentation for this class was generated from the following files: