AURobotServers
4
|
#include <uimagelog.h>
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 | |
UCamPool * | camPool |
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 |
Function to save and maintain an imagelogfile. The file is to be used for simulated replay of MMRD including cameraserver.
UImageLog::~UImageLog | ( | ) |
Destructor
References ULogFile::closeLog(), ULock::lock(), and ULock::unlock().
UImageLog::UImageLog | ( | ) |
Constructor
UImageLog::~UImageLog | ( | ) |
Destructor
void UImageLog::closeLogging | ( | ) |
Close logfie - and stop logging
References ULogFile::closeLog(), ULogFile::getLogFileName(), ULogFile::isOpen(), ULock::tryLock(), ULock::unlock(), and Wait().
Referenced by UCamPool::closeImageLogging(), logImage(), openLog(), UFuncKinect::~UFuncKinect(), and UFuncPiCam::~UFuncPiCam().
void UImageLog::closeLogging | ( | ) |
Close logfie - and stop logging
|
inline |
Is logging to save the image too?
References saveImg.
|
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().
|
inline |
|
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 | ||
) |
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.
img | is the image to be saved |
cam | is the camera device - with camera pose. |
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(), toLog(), ULock::unlock(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by UCamMounted::logImage(), UFuncPiCam::logImageToFile(), UFuncPTgrey::logImageToFile(), UFuncKinect::logImageToFile(), UFuncTOF::logImageToFile(), and logImgPoolImage().
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.
img | is the image to be saved |
cam | is the camera device - with camera pose. |
poolImg | is optional pool image - when logged from image pool (-1 is default, i.e. not from image pool) |
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
img | is the image to be saved |
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.
doOpen | if true opens a fresh logfile, if false closes the logfile (if open) |
returns | true 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.
doOpen | if true opens a fresh logfile, if false closes the logfile (if open) |
returns | true 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
|
inline |
Set the image format to PNG (else BMP)
References inPNG.
|
inline |
Set the image format to PNG (else BMP)
References inPNG.
Referenced by UFuncPiCam::handleNormal(), UFuncPiCam::init(), UFuncPTgrey::runSetting(), UCamPool::setLogPng(), and UImagePool::UImagePoolInit().
|
inline |
Set the save image too flag
References saveImg.
|
inline |
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().
UCamPool* UImageLog::camPool |
pointer to camera pool
Referenced by logImgPoolImage(), and UImagePool::setLogImg().
|
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().
|
staticprivate |
Filename length
|
private |
Save image in addition to logging and making filename
Referenced by isLogSaveImg(), logImage(), setSaveImg(), and UImageLog().