Compute Library
ImageLoaderFactory Class Referencefinal

Factory for generating appropriate image loader. More...

#include <ImageLoader.h>

Static Public Member Functions

static std::unique_ptr< IImageLoadercreate (const std::string &filename)
 Create an image loader depending on the image type. More...

Detailed Description

Factory for generating appropriate image loader.

Definition at line 500 of file ImageLoader.h.

Member Function Documentation

◆ create()

static std::unique_ptr<IImageLoader> create ( const std::string &  filename)

Create an image loader depending on the image type.

[in]filenameFile than needs to be loaded
Image loader

Definition at line 509 of file ImageLoader.h.

510  {
512  switch(type)
513  {
514  case ImageType::PPM:
515  return std::make_unique<PPMLoader>();
516  case ImageType::JPEG:
517  return std::make_unique<JPEGLoader>();
518  case ImageType::UNKNOWN:
519  default:
520  return nullptr;
521  }
522  }
decltype(strategy::transforms) typedef type
Supported image types.
Definition: Utils.h:63
ImageType get_image_type_from_file(const std::string &filename)
Gets image type given a file.
Definition: Utils.cpp:167

References arm_compute::utils::get_image_type_from_file(), arm_compute::utils::JPEG, arm_compute::utils::PPM, type, and arm_compute::utils::UNKNOWN.

Referenced by ImageAccessor::access_tensor().

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