24.02.1
|
Image loader interface. More...
#include <ImageLoader.h>
Public Member Functions | |
IImageLoader () | |
Default Constructor. More... | |
virtual | ~IImageLoader ()=default |
Virtual base destructor. More... | |
unsigned int | width () const |
Return the width of the currently open image file. More... | |
unsigned int | height () const |
Return the height of the currently open image file. More... | |
virtual bool | is_open ()=0 |
Return true if the image file is currently open. More... | |
virtual void | open (const std::string &filename)=0 |
Open an image file and reads its metadata (Width, height) More... | |
virtual void | close ()=0 |
Closes an image file. More... | |
template<typename T > | |
void | init_image (T &image, Format format) |
Initialise an image's metadata with the dimensions of the image file currently open. More... | |
template<typename T > | |
void | fill_image (T &image) |
Fill an image with the content of the currently open image file. More... | |
template<typename T > | |
void | fill_planar_tensor (T &tensor, bool bgr=false) |
Fill a tensor with 3 planes (one for each channel) with the content of the currently open image file. More... | |
Image loader interface.
Definition at line 124 of file ImageLoader.h.
|
inline |
Default Constructor.
Definition at line 128 of file ImageLoader.h.
|
virtualdefault |
Virtual base destructor.
|
pure virtual |
Closes an image file.
Implemented in JPEGLoader, and PPMLoader.
|
inline |
Fill an image with the content of the currently open image file.
[in,out] | image | Image to fill (Must be allocated, and of matching dimensions with the opened image file). |
Definition at line 174 of file ImageLoader.h.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN, ARM_COMPUTE_ERROR_VAR, Window::DimX, Window::DimY, arm_compute::execute_window_loop(), caffe_mnist_image_extractor::image, IImageLoader::is_open(), arm_compute::utils::map(), Iterator::ptr(), arm_compute::RGB888, Window::set(), arm_compute::U8, and arm_compute::utils::unmap().
|
inline |
Fill a tensor with 3 planes (one for each channel) with the content of the currently open image file.
[in,out] | tensor | Tensor with 3 planes to fill (Must be allocated, and of matching dimensions with the opened image). Data types supported: U8/F16/F32 |
[in] | bgr | (Optional) Fill the first plane with blue channel (default = false) |
Definition at line 253 of file ImageLoader.h.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_UNUSED, arm_compute::CHANNEL, arm_compute::cpu::data_layout, Window::DimX, Window::DimY, Window::DimZ, arm_compute::execute_window_loop(), arm_compute::F16, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, IImageLoader::is_open(), arm_compute::utils::map(), arm_compute::NCHW, arm_compute::QASYMM8, Window::set(), tensor, arm_compute::U8, arm_compute::utils::unmap(), and arm_compute::WIDTH.
Referenced by ValidationInputAccessor::access_tensor().
|
inline |
Return the height of the currently open image file.
Definition at line 139 of file ImageLoader.h.
Referenced by ValidationInputAccessor::access_tensor().
|
inline |
Initialise an image's metadata with the dimensions of the image file currently open.
[out] | image | Image to initialise |
[in] | format | Format to use for the image (Must be RGB888 or U8) |
Definition at line 158 of file ImageLoader.h.
References ARM_COMPUTE_ERROR_ON, update_supported_ops::format, caffe_mnist_image_extractor::image, IImageLoader::is_open(), arm_compute::RGB888, and arm_compute::U8.
|
pure virtual |
Return true if the image file is currently open.
Implemented in JPEGLoader, and PPMLoader.
Referenced by IImageLoader::fill_image(), IImageLoader::fill_planar_tensor(), and IImageLoader::init_image().
|
pure virtual |
Open an image file and reads its metadata (Width, height)
[in] | filename | File to open |
Implemented in JPEGLoader, and PPMLoader.
|
inline |
Return the width of the currently open image file.
Definition at line 134 of file ImageLoader.h.
Referenced by ValidationInputAccessor::access_tensor().