24.02.1
|
Go to the documentation of this file.
28 #include "utils/Utils.h"
31 using namespace utils;
33 class NEONScaleExample :
public Example
36 bool do_setup(
int argc,
char **argv)
override
43 std::cout <<
"Usage: ./build/neon_scale[input_image.ppm]\n\n";
44 std::cout <<
"No input_image provided, creating a dummy 640x480 image\n";
54 constexpr
int scale_factor = 2;
56 TensorInfo dst_tensor_info(
src.info()->dimension(0) / scale_factor,
src.info()->dimension(1) / scale_factor,
60 dst.allocator()->init(dst_tensor_info);
68 src.allocator()->allocate();
69 dst.allocator()->allocate();
75 output_filename = std::string(argv[1]) +
"_out.ppm";
80 void do_run()
override
85 void do_teardown()
override
88 if (!output_filename.empty())
97 std::string output_filename{};
105 int main(
int argc,
char **argv)
107 return utils::run_example<NEONScaleExample>(argc, argv);
SimpleTensor< float > src
Class describing the value of a pixel for any image format.
@ UNDEFINED
Borders are left undefined.
int main(int argc, char **argv)
Main program for convolution test.
Structure to hold Image information.
Includes all the Arm® Neon™ functions at once.
void configure(ITensor *input, ITensor *output, const ScaleKernelInfo &info)
Initialize the function's source, destination, interpolation type and border_mode.
Basic function to compute Scale.
void save_to_ppm(T &tensor, const std::string &ppm_filename)
Template helper function to save a tensor image to a PPM file.
@ U8
1 channel, 1 U8 per channel
void run() override
Run the kernels contained in the function.
Store the tensor's metadata.
Copyright (c) 2017-2024 Arm Limited.
@ NEAREST_NEIGHBOR
Output values are defined to match the source pixel whose center is nearest to the sample position.
@ CENTER
Samples are taken at pixel center.