Compute Library
 21.02
NEWarpAffine Class Reference

Basic function to run NEWarpAffineKernel. More...

#include <NEWarpAffine.h>

Collaboration diagram for NEWarpAffine:
[legend]

Public Member Functions

void configure (ITensor *input, ITensor *output, const std::array< float, 9 > &matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value=0)
 Initialize the function's source, destination, interpolation policy and border_mode. More...
 
- Public Member Functions inherited from INESimpleFunction
 INESimpleFunction ()
 Constructor. More...
 
 INESimpleFunction (const INESimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INESimpleFunction (INESimpleFunction &&)=default
 Default move constructor. More...
 
INESimpleFunctionoperator= (const INESimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INESimpleFunctionoperator= (INESimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~INESimpleFunction ()
 Default destructor. 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 run NEWarpAffineKernel.

Deprecated:
This function is deprecated and will be removed in release 21.05

Definition at line 41 of file NEWarpAffine.h.

Member Function Documentation

◆ configure()

void configure ( ITensor input,
ITensor output,
const std::array< float, 9 > &  matrix,
InterpolationPolicy  policy,
BorderMode  border_mode,
uint8_t  constant_border_value = 0 
)

Initialize the function's source, destination, interpolation policy and border_mode.

Parameters
[in,out]inputSource tensor. Data type supported: U8. (Written to only for border_mode != UNDEFINED)
[out]outputDestination tensor. Data type supported: U8
[in]matrixThe perspective matrix. Must be 2x3 of type float. The matrix argument requires 9 values, the last 3 values are ignored.
[in]policyThe interpolation type.
[in]border_modeStrategy to use for borders.
[in]constant_border_value(Optional) Constant value to use for borders if border_mode is set to CONSTANT.

Definition at line 35 of file NEWarpAffine.cpp.

References arm_compute::AREA, ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, arm_compute::test::validation::b, arm_compute::BILINEAR, arm_compute::NEAREST_NEIGHBOR, and arm_compute::U8.

36 {
39 
40  switch(policy)
41  {
43  {
44  auto k = std::make_unique<NEWarpAffineKernel<InterpolationPolicy::NEAREST_NEIGHBOR>>();
45  k->configure(input, output, matrix, border_mode, constant_border_value);
46  _kernel = std::move(k);
47  break;
48  }
50  {
51  auto k = std::make_unique<NEWarpAffineKernel<InterpolationPolicy::BILINEAR>>();
52  k->configure(input, output, matrix, border_mode, constant_border_value);
53  _kernel = std::move(k);
54  break;
55  }
57  default:
58  ARM_COMPUTE_ERROR("Interpolation type not supported");
59  }
60 
61  auto b = std::make_unique<NEFillBorderKernel>();
62  b->configure(input, _kernel->border_size(), border_mode, constant_border_value);
63  _border_handler = std::move(b);
64 }
SimpleTensor< float > b
Definition: DFT.cpp:157
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
1 channel, 1 U8 per channel
Output values are defined by bilinear interpolation between the pixels.
Output values are defined to match the source pixel whose center is nearest to the sample position...
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:790

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