Evo 7.13.0-TM26061101
Evo LPR Engine
Loading...
Searching...
No Matches
Evo::Picture Class Referenceabstract

Picture class More...

#include <Picture.hpp>

Public Member Functions

virtual const EvoImageGetImage (void)=0
virtual int64_t GetTime (EvoTimeUnit unit=EVOTU_MS) const =0
virtual EvoRC SaveInJPEG (const char *path, int quality=95)=0
virtual EvoRC SaveInPNG (const char *path, int compression=1)=0

Detailed Description

This class represents the captured image and several related information.

Member Function Documentation

◆ GetImage()

virtual const EvoImage & Evo::Picture::GetImage ( void )
pure virtual

Get image data of the picture.

Returns
Image data.

◆ GetTime()

virtual int64_t Evo::Picture::GetTime ( EvoTimeUnit unit = EVOTU_MS) const
pure virtual

Get time stamp when captured.

Parameters
[in]unitPrecision of the time stamp.
Returns
Time Stamp
Note
Because the time stamp is represented as Unix's Epoch Time, for local time must be converted as below
time_t timeRaw;
int64_t timeMS;
struct tm *timeInfo = NULL;
int64_t timeUTC = pic->GetTime(EVOTU_MS);

timeMS = timeUTC % 1000;
timeRaw = time_t(timeUTC / 1000);
timeInfo = localtime(&timeRaw);

cout << timeInfo->tm_year + 1900 << '-'
     << timeInfo->tm_mon + 1 << '-'
     << timeInfo->tm_mday << ' '
     << timeInfo->tm_hour << ':'
     << timeInfo->tm_min << ':'
     << timeInfo->tm_sec << '.'
     << timeMS << endl;

◆ SaveInJPEG()

virtual EvoRC Evo::Picture::SaveInJPEG ( const char * path,
int quality = 95 )
pure virtual

Create JPEG file of the picture.

Parameters
[in]pathPath to JPEG file which must have either of the extensions '.jpg' or '.jpeg'.
[in]qualityQuality level of compressed picture, which has the range [1, 100].
Returns
EvoRC code

◆ SaveInPNG()

virtual EvoRC Evo::Picture::SaveInPNG ( const char * path,
int compression = 1 )
pure virtual

Create PNG file of the picture.

Parameters
[in]pathPath to PNG file which must have the extension '.png'.
[in]compressionCompression level, which has the range [0, 9].
Returns
EvoRC code