Compute Library
 21.05
FileImageFeeder Class Reference

File Image feeder concrete implementation. More...

#include <ImageLoader.h>

Collaboration diagram for FileImageFeeder:
[legend]

Public Member Functions

 FileImageFeeder (std::ifstream &fs)
 Default constructor. More...
 
uint8_t get () override
 Gets a character from an image feed. More...
 
void get_row (uint8_t *dst, size_t row_size) override
 Feed a whole row to a destination pointer. More...
 
- Public Member Functions inherited from IImageDataFeeder
virtual ~IImageDataFeeder ()=default
 Virtual base destructor. More...
 

Detailed Description

File Image feeder concrete implementation.

Definition at line 64 of file ImageLoader.h.

Constructor & Destructor Documentation

◆ FileImageFeeder()

FileImageFeeder ( std::ifstream &  fs)
inline

Default constructor.

Parameters
[in]fsImage file stream

Definition at line 71 of file ImageLoader.h.

72  : _fs(fs)
73  {
74  }

Member Function Documentation

◆ get()

uint8_t get ( )
inlineoverridevirtual

Gets a character from an image feed.

Implements IImageDataFeeder.

Definition at line 76 of file ImageLoader.h.

77  {
78  return _fs.get();
79  }

◆ get_row()

void get_row ( uint8_t *  dst,
size_t  row_size 
)
inlineoverridevirtual

Feed a whole row to a destination pointer.

Parameters
[out]dstDestination pointer
[in]row_sizeRow size in terms of bytes

Implements IImageDataFeeder.

Definition at line 80 of file ImageLoader.h.

81  {
82  ARM_COMPUTE_ERROR_ON(dst == nullptr);
83  _fs.read(reinterpret_cast<std::fstream::char_type *>(dst), row_size);
84  }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466

References ARM_COMPUTE_ERROR_ON, and arm_compute::test::validation::dst.


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