AURobotServers  4
Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
UImageLog Class Reference

#include <uimagelog.h>

Inheritance diagram for UImageLog:
Inheritance graph

Public Member Functions

void closeLogging ()
 
void closeLogging ()
 
bool isLogSaveImg ()
 
bool isLogSaveImg ()
 
bool isPng ()
 
bool isPng ()
 
bool logImage (UImage *img, UCamMounted *cam)
 
bool logImage (UImage *img, UCamMounted *cam, int poolimg=-1)
 
bool logImgPoolImage (UImgPush *img)
 
bool openLog (bool doOpen)
 
bool openLog (bool doOpen)
 
bool openLogging (const char *name)
 
bool openLogging (const char *name)
 
void setPng (bool value)
 
void setPng (bool value)
 
void setSaveImg (bool value)
 
void setSaveImg (bool value)
 
void toLog (const char *txt)
 
void toLog (const char *txt)
 
 UImageLog ()
 
 UImageLog ()
 
 ~UImageLog ()
 
 ~UImageLog ()
 
- Public Member Functions inherited from ULogFile
void closeLog ()
 
void doFlush ()
 
FILE * getF ()
 
const char * getLogFileName ()
 
const char * getLogName ()
 
bool isLogOpen ()
 
bool isOpen ()
 
void logLock ()
 
bool logRename (const char *name)
 
void logUnlock ()
 
bool openLog ()
 
bool openLog (bool doOpen)
 
bool openLog (const char *resName)
 
void setLogFlush (bool doFlush)
 
void setLogName (const char *resName, const char *ext="log")
 
void setLogNameNumber (int number)
 add a number to the logfile name, That is if the logName is 'svs' and number is 2 (and logPath is '/rhome/demo'), then logfilename is set to '/rhome/demo/svs_2.log'. The purpose is to have an alternative, if the file renaming fails (if the file system is locked or something). More...
 
void setLogTime (UTime timestamp)
 
void toLog (const char *logString)
 
void toLog (const char *s1, const char *s2)
 
void toLog (const int num, const char *s1, const char *s2)
 
void toLog (const char *s1, const int num, const char *s2)
 
void toLog (const char *s1, const int n1, const int n2, const char *s2)
 
void toLog (const char *s1, const int num, const char *s2, const char *s3)
 
void toLog (const char *s1, const int n1, const int n2, const char *s2, const char *s3)
 
 ULogFile ()
 
void useLogTime (bool value)
 
 ~ULogFile ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 

Public Attributes

UCamPoolcamPool
 

Private Attributes

bool inPNG
 
bool saveImg
 

Static Private Attributes

static const int MFNL = MAX_FILENAME_LENGTH
 

Additional Inherited Members

- Protected Attributes inherited from ULogFile
int failCnt
 
FILE * logFile
 
ULock logFileLock
 
char logFileName [MAX_FILENAME_SIZE]
 
bool logFlush
 
char logName [MAX_FILENAME_SIZE]
 
UTime logTime
 
bool logTimeUse
 

Detailed Description

Function to save and maintain an imagelogfile. The file is to be used for simulated replay of MMRD including cameraserver.

Author
Christian Andersen

Constructor & Destructor Documentation

UImageLog::UImageLog ( )

Constructor

References inPNG, and saveImg.

UImageLog::~UImageLog ( )

Destructor

References ULogFile::closeLog(), ULock::lock(), and ULock::unlock().

UImageLog::UImageLog ( )

Constructor

UImageLog::~UImageLog ( )

Destructor

Member Function Documentation

void UImageLog::closeLogging ( )
void UImageLog::closeLogging ( )

Close logfie - and stop logging

bool UImageLog::isLogSaveImg ( )
inline

Is logging to save the image too?

References saveImg.

bool UImageLog::isLogSaveImg ( )
inline

Is logging open Get log filename Get log filename set log filename Is logging to save the image too?

References saveImg.

Referenced by UCamPool::isLogSaveImg().

bool UImageLog::isPng ( )
inline

Set the image format to PNG (else BMP)

References inPNG, and toLog().

bool UImageLog::isPng ( )
inline

Set the image format to PNG (else BMP)

References inPNG, and toLog().

Referenced by UCamPool::isLogPng(), and UFuncPTgrey::runSetting().

bool UImageLog::logImage ( UImage img,
UCamMounted cam 
)
bool UImageLog::logImage ( UImage img,
UCamMounted cam,
int  poolimg = -1 
)

Log this image - if logfile is defined and open. Image itself is not saved is 'saveImg'==false. else image is saved in '.bmp' or '.png' format, as available.

Parameters
imgis the image to be saved
camis the camera device - with camera pose.
poolImgis optional pool image - when logged from image pool (-1 is default, i.e. not from image pool)
Returns
true if image is saved (if requested) and image log entry is created.

References UImage::camDevice, closeLogging(), UCamRad::getCamPar(), UImage::getColorTypeString(), UCamBase::getDev(), UCamDevBase::getDeviceNumber(), ULogFile::getF(), UCamPar::getFocalLength(), UTime::getForFilename(), UImage::getHeight(), UTime::getMicrosec(), UCamMounted::getPos(), UCamMounted::getRot(), UTime::getSec(), UImage::getWidth(), UImage::imageNumber, imagePath, UImage::imgTime, inPNG, ULogFile::isLogOpen(), URotation::Kappa, ULock::lock(), MAX_FILENAME_LENGTH, MAX_IMG_NAME_SIZE, URotation::Omega, URotation::Phi, UImage::saveBMP(), saveImg, UImage::savePNG(), UImage::setName(), ULogFile::toLog(), toLog(), ULock::unlock(), UPosition::x, UPosition::y, and UPosition::z.

bool UImageLog::logImgPoolImage ( UImgPush img)

Log this image - if logfile is defined and open. Will get camera from camDevice number in image

Parameters
imgis the image to be saved
Returns
true if image is saved (if requested) and image log entry is created.

References UImage::camDevice, camPool, UCamPool::getCam(), UImgPush::imgPoolNumber, and logImage().

Referenced by UImgPush::imgUpdated().

bool UImageLog::openLog ( bool  doOpen)

Open (or close) logfile. An open will start a fresh empty file.

Parameters
doOpenif true opens a fresh logfile, if false closes the logfile (if open)
returnstrue if logfile logfile operation is successful.

References closeLogging(), ULogFile::isOpen(), ULock::lock(), ULogFile::openLog(), and ULock::unlock().

Referenced by UFuncPTgrey::handlePTgrey(), UFuncPiCam::logFileTest(), UFuncKinect::logFileTest(), UFuncPTgrey::runSetting(), UImagePool::setLogImg(), and startUFuncTOFThreadData().

bool UImageLog::openLog ( bool  doOpen)

Open (or close) logfile. An open will start a fresh empty file.

Parameters
doOpenif true opens a fresh logfile, if false closes the logfile (if open)
returnstrue if logfile logfile operation is successful.
bool UImageLog::openLogging ( const char *  name)

Open logfile - and start logging

References ULogFile::getLogFileName(), and ULogFile::openLog().

Referenced by UCamPool::openImageLogging().

bool UImageLog::openLogging ( const char *  name)

Open logfile - and start logging

void UImageLog::setPng ( bool  value)
inline

Set the image format to PNG (else BMP)

References inPNG.

void UImageLog::setPng ( bool  value)
inline
void UImageLog::setSaveImg ( bool  value)
inline

Set the save image too flag

References saveImg.

void UImageLog::setSaveImg ( bool  value)
inline

Set the save image too flag

References saveImg.

Referenced by UCamPool::setLogSaveImg().

void UImageLog::toLog ( const char *  txt)

Save info tekst to log

void UImageLog::toLog ( const char *  txt)

Save info tekst to log

References ULock::lock(), ULogFile::toLog(), and ULock::unlock().

Referenced by isPng(), logImage(), and UFuncKinect::run().

Member Data Documentation

UCamPool* UImageLog::camPool

pointer to camera pool

Referenced by logImgPoolImage(), and UImagePool::setLogImg().

bool UImageLog::inPNG
private

Logfile for continued logging of images Buffer image for RGB conversion Save images in PNG format (if supported)

Referenced by isPng(), logImage(), setPng(), and UImageLog().

static const int UImageLog::MFNL = MAX_FILENAME_LENGTH
staticprivate

Filename length

bool UImageLog::saveImg
private

Save image in addition to logging and making filename

Referenced by isLogSaveImg(), logImage(), setSaveImg(), and UImageLog().


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