aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util')
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/CMakeLists.txt4
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/.prev_CMakeLists.txt55
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/CMakeLists.txt55
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.cpp579
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.h164
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.cpp270
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.h134
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKDynamicTimeWarping.h566
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.cpp209
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.h60
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKHierarchicalClustering.h1592
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.cpp1306
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.h431
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.cpp676
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.h135
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.cpp235
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.h111
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.cpp410
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.h132
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.cpp378
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.h108
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.cpp349
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.h135
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKOSUtilFactory.cpp75
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.cpp401
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.h133
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.cpp327
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.h110
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.cpp245
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.h104
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.cpp469
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.h114
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.cpp582
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.h110
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/lib.pro39
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/.prev_CMakeLists.txt41
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/CMakeLists.txt42
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/LTKLogger.cpp399
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.cpp240
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.def10
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.h92
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.pro19
-rw-r--r--src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/util.pro7
43 files changed, 0 insertions, 11653 deletions
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/CMakeLists.txt b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/CMakeLists.txt
deleted file mode 100644
index 668f09f1..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Generated from util.pro.
-
-add_subdirectory(lib)
-add_subdirectory(logger)
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/.prev_CMakeLists.txt b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/.prev_CMakeLists.txt
deleted file mode 100644
index 51ddf0c6..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated from lib.pro.
-
-#####################################################################
-## ltkutil Generic Library:
-#####################################################################
-
-qt_add_cmake_library(ltkutil
- STATIC
- EXCEPTIONS
- OUTPUT_DIRECTORY "${QT_BUILD_DIR}/lib"
- SOURCES
- LTKCheckSumGenerate.cpp LTKCheckSumGenerate.h
- LTKConfigFileReader.cpp LTKConfigFileReader.h
- LTKDynamicTimeWarping.h
- LTKErrors.cpp LTKErrors.h
- LTKHierarchicalClustering.h
- LTKImageWriter.cpp LTKImageWriter.h
- LTKInkFileReader.cpp LTKInkFileReader.h
- LTKInkFileWriter.cpp LTKInkFileWriter.h
- LTKInkUtils.cpp LTKInkUtils.h
- LTKLinuxUtil.h
- LTKLoggerUtil.cpp LTKLoggerUtil.h
- LTKOSUtilFactory.cpp
- LTKStrEncoding.cpp LTKStrEncoding.h
- LTKStringUtil.cpp LTKStringUtil.h
- LTKVersionCompatibilityCheck.cpp LTKVersionCompatibilityCheck.h
- LTKWinCEUtil.h
- LTKWindowsUtil.h
- INCLUDE_DIRECTORIES
- ../../include
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
-)
-qt_disable_warnings(ltkutil)
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(ltkutil CONDITION WIN32
- SOURCES
- LTKWindowsUtil.cpp
- DEFINES
- -UNICODE
-)
-
-qt_extend_target(ltkutil CONDITION UNIX
- SOURCES
- LTKLinuxUtil.cpp
-)
-
-qt_extend_target(ltkutil CONDITION NOT LIPILIBS_ISEMPTY
- PUBLIC_LIBRARIES
- # Remove: L/lib
-)
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/CMakeLists.txt b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/CMakeLists.txt
deleted file mode 100644
index 323c9095..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated from lib.pro.
-
-#####################################################################
-## ltkutil Generic Library:
-#####################################################################
-
-qt_add_cmake_library(ltkutil
- STATIC
- EXCEPTIONS
- OUTPUT_DIRECTORY "${QT_BUILD_DIR}/lib"
- SOURCES
- LTKCheckSumGenerate.cpp LTKCheckSumGenerate.h
- LTKConfigFileReader.cpp LTKConfigFileReader.h
- LTKDynamicTimeWarping.h
- LTKErrors.cpp LTKErrors.h
- LTKHierarchicalClustering.h
- LTKImageWriter.cpp LTKImageWriter.h
- LTKInkFileReader.cpp LTKInkFileReader.h
- LTKInkFileWriter.cpp LTKInkFileWriter.h
- LTKInkUtils.cpp LTKInkUtils.h
- LTKLinuxUtil.h
- LTKLoggerUtil.cpp LTKLoggerUtil.h
- LTKOSUtilFactory.cpp
- LTKStrEncoding.cpp LTKStrEncoding.h
- LTKStringUtil.cpp LTKStringUtil.h
- LTKVersionCompatibilityCheck.cpp LTKVersionCompatibilityCheck.h
- LTKWinCEUtil.h
- LTKWindowsUtil.h
- INCLUDE_DIRECTORIES
- ../../include
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
-)
-qt_disable_warnings(ltkutil)
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(ltkutil CONDITION WIN32
- SOURCES
- LTKWindowsUtil.cpp
- DEFINES
- # -UNICODE # special case remove
-)
-
-qt_extend_target(ltkutil CONDITION UNIX
- SOURCES
- LTKLinuxUtil.cpp
-)
-
-qt_extend_target(ltkutil CONDITION NOT LIPILIBS_ISEMPTY
- PUBLIC_LIBRARIES
- # Remove: L/lib
-)
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.cpp
deleted file mode 100644
index a9041ba6..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.cpp
+++ /dev/null
@@ -1,579 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions of Checksum generate module
- *
- * CONTENTS:
- * LTKCheckSumGenerate
- * initCRC32Table
- * reflect
- * getCRC
- * addHeaderInfo
- * readMDTHeader
- *
- * AUTHOR: Vijayakumara M
- *
- * DATE: Aug 02, 2005
- * CHANGE HISTORY:
- * Author Date Description
- ************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-02-08 16:57:52 +0530 (Tue, 08 Feb 2011) $
- * $Revision: 834 $
- * $Author: mnab $
- *
- ************************************************************************/
-
-#include "LTKCheckSumGenerate.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-#include "LTKConfigFileReader.h"
-#include "LTKException.h"
-
-#include "LTKOSUtil.h"
-
-#include "LTKOSUtilFactory.h"
-
-/*****************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 26 July 2005
-* NAME : LTKCheckSumGenerate
-* DESCRIPTION : Constractor.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-*****************************************************************************/
-LTKCheckSumGenerate::LTKCheckSumGenerate():
-m_OSUtilPtr(LTKOSUtilFactory::getInstance())
-{
- initCRC32Table();
-}
-
-/*****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 26 June 2008
-* NAME : ~LTKCheckSumGenerate
-* DESCRIPTION : Desctructor.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-*****************************************************************************/
-LTKCheckSumGenerate::~LTKCheckSumGenerate()
-{
- delete m_OSUtilPtr;
-}
-
-/****************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 26 July 2005
-* NAME : initCRC32Table
-* DESCRIPTION : Call this function only once to initialize the CRC table.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-****************************************************************************/
-void LTKCheckSumGenerate::initCRC32Table()
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::initCRC32Table()" << endl;
-
- unsigned int ulPolynomial = 0x04c11db7;
-
- // 256 values representing ASCII character codes.
- for(int i = 0; i <= 0xFF; i++)
- {
- m_CRC32Table[i]=reflect(i, 8) << 24;
- for (int j = 0; j < 8; j++)
- m_CRC32Table[i] = (m_CRC32Table[i] << 1) ^ (m_CRC32Table[i] & (1 << 31) ? ulPolynomial : 0);
- m_CRC32Table[i] = reflect(m_CRC32Table[i], 32);
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::initCRC32Table()" << endl;
-}
-
-/**********************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 26 July 2005
-* NAME : reflect
-* DESCRIPTION : reflection is a requirement for the official CRC-32 standard.
-* we can create CRCs without it, but they won't conform to the standard.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-*************************************************************************************/
-unsigned int LTKCheckSumGenerate::reflect(unsigned int ref, char ch)
-{// Used only by initCRC32Table()
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::reflect()" << endl;
-
- unsigned int value(0);
-
- // Swap bit 0 for bit 7
- // bit 1 for bit 6, etc.
- for(int i = 1; i < (ch + 1); i++)
- {
- if(ref & 1)
- value |= 1 << (ch - i);
- ref >>= 1;
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::reflect()" << endl;
- return value;
-}
-
-/**********************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 26 July 2005
-* NAME : getCRC
-* DESCRIPTION : Function to generate checkSum.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-* Balaji MNA 11th Nov, 2008 Changed char* parameter to string&
-*************************************************************************************/
-int LTKCheckSumGenerate::getCRC(string& text)
-{
- // Pass a text string to this function and it will return the CRC.
-
- // Once the lookup table has been filled in by the two functions above,
- // this function creates all CRCs using only the lookup table.
-
- // Be sure to use unsigned variables,
- // because negative values introduce high bits
- // where zero bits are required.
-
- // Start out with all bits set high.
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::getCRC()" << endl;
- unsigned int ulCRC(0xffffffff);
-
- // Get the length.
- int len = text.size();
-
- // Save the text in the buffer.
- unsigned char* buffer = (unsigned char*)text.c_str();
-
- // Perform the algorithm on each character
- // in the string, using the lookup table values.
- while(len--)
- {
- ulCRC = (ulCRC >> 8) ^ m_CRC32Table[(ulCRC & 0xFF) ^ *buffer++];
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::getCRC()" << endl;
-
- // Exclusive OR the result with the beginning value.
- return ulCRC ^ 0xffffffff;
-}
-
-/**********************************************************************************
-* AUTHOR : Srinivasa Vithal
-* DATE : 21 November 2007
-* NAME : addHeaderInfo
-* DESCRIPTION : This function adds the Header information to the Model Data file.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-*************************************************************************************/
-int LTKCheckSumGenerate::addHeaderInfo(const string& modelDataHeaderInfoFilePath,
- const string& mdtFilePath,
- const stringStringMap& headerInfo)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::addHeaderInfo()" << endl;
-
- int nCRC; // Holds checks sum in decimal format
-
- long testEndian = 1;
-
- char *modelFileData = NULL; // Model File header Data.
-
- //unsigned int hdLen[CKSUM_HDR_STR_LEN], offsetLen[CKSUM_HDR_STR_LEN];
- char chSum[CKSUM_HDR_STR_LEN];
-
- long modelFileInfoSize ;
-
- string comment, heder; //Header comment,and the header data
-
- stringVector strTokens;
-
- ostringstream strHeaderContents1;
- ostringstream strHeaderContents2;
-
- string::size_type indx=0;
-
- // Add the mandatory fields to the header Info
- stringStringMap tempHeaderInfo = updateHeaderWithMandatoryFields(headerInfo);
-
- ostringstream headInfo, newHeadInfo;
-
-
- ifstream readFile(mdtFilePath.c_str(), ios::in | ios::binary);
-
- if(!readFile )
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)<<"Error : "<< EMODEL_DATA_FILE_OPEN
- <<": "<< "Error opening mdt file "<< mdtFilePath <<
- " LTKCheckSumGenerate::addHeaderInfo()"<<endl;
-
- LTKReturnError(EMODEL_DATA_FILE_OPEN);
- }
-
- // get fle size
- readFile.seekg(0, ios::beg);
- readFile.seekg(0, ios::end);
- modelFileInfoSize = readFile.tellg();
- readFile.seekg(0, ios::beg);
-
- try
- {
- if(!modelDataHeaderInfoFilePath.empty())
- {
- LTKConfigFileReader inputHeaderFileReader(modelDataHeaderInfoFilePath);
- const stringStringMap& tempCfgFileMap = inputHeaderFileReader.getCfgFileMap();
-
- stringStringMap::const_iterator tempCfgFileIter = tempCfgFileMap.begin();
- stringStringMap::const_iterator tempCfgFileIterEnd = tempCfgFileMap.end();
-
- for(; tempCfgFileIter != tempCfgFileIterEnd ; ++tempCfgFileIter)
- {
- if(tempHeaderInfo.find(tempCfgFileIter->first) == tempHeaderInfo.end())
- {
-
- //inserting user-defined key-value pair
- tempHeaderInfo[tempCfgFileIter->first] = tempCfgFileIter->second;
- }
- }
- }
-
- //Read Model Data File.
- modelFileData = new char[modelFileInfoSize+1];
-
- memset(modelFileData, '\0', modelFileInfoSize+1);
-
- readFile.read(modelFileData, modelFileInfoSize+1);
-
- readFile.close();
-
- string szBuf(modelFileData);
-
- //Caluculate Checksum for the Modiel File Data.
- nCRC = getCRC(szBuf);
-
- //Convert the check sum into Hexadecimal Value.
- sprintf(chSum, "%x", nCRC);
-
- tempHeaderInfo[CKS] = chSum;
-
-
-
-
-
- ofstream writeFile(mdtFilePath.c_str(),ios::out|ios::binary);
-
- stringStringMap::const_iterator tempHeadInfoIter = tempHeaderInfo.begin();
- stringStringMap::const_iterator tempHeadInfoIterEnd = tempHeaderInfo.end();
- for(; tempHeadInfoIter != tempHeadInfoIterEnd ; ++tempHeadInfoIter)
- {
- if((tempHeadInfoIter->first!=CKS) && (tempHeadInfoIter->first!=HEADERLEN)
- && (tempHeadInfoIter->first!=DATAOFFSET))
- {
- strHeaderContents2 <<"<"<<tempHeadInfoIter->first
- <<"="<<tempHeadInfoIter->second<<">";
- }
-
- }
-
- strHeaderContents1<<"<"<<CKS<<"="<<chSum<<">"<<"<"<<HEADERLEN<<"=";
-
-
-
- string initialStrHeader = strHeaderContents1.str() + strHeaderContents2.str();
-
- char strHeaderLength[CKSUM_HDR_STR_LEN], strOffsetLength[CKSUM_HDR_STR_LEN];
-
- //Get the Length of the header.( 15 is for length of ><DATAOFFSET=> ).
- sprintf(strHeaderLength, "%d", initialStrHeader.length()+14);
-
- sprintf(strOffsetLength, "%d", initialStrHeader.length()+15);
-
-
- //Add the length of the pre Header length and 1 for the last ">" char.
- sprintf(strHeaderLength, "%d", initialStrHeader.length()+strlen(strHeaderLength)+strlen(strOffsetLength)+14);
-
- sprintf(strOffsetLength, "%d", initialStrHeader.length()+strlen(strHeaderLength)+strlen(strOffsetLength)+15);
-
- strHeaderContents1<<strHeaderLength<<">";
-
- strHeaderContents1<<"<"<<DATAOFFSET<<"="<<strOffsetLength<<">";
-
- writeFile<<strHeaderContents1.str();
- writeFile<<strHeaderContents2.str();
-
- writeFile.write(modelFileData, modelFileInfoSize);
-
- writeFile.close();
-
- if( modelFileData != NULL)
- {
- delete [] modelFileData;
- modelFileData = NULL;
- }
-
-
- }
- catch (LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)<<"Error : "<<EFILE_OPEN_ERROR<<":"<< e.getExceptionMessage()<<
- "LTKCheckSumGenerate::addHeaderInfo()"<<endl;
- LTKReturnError(EFILE_OPEN_ERROR);
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::addHeaderInfo()" << endl;
-
- return SUCCESS;
-}
-
-stringStringMap LTKCheckSumGenerate::updateHeaderWithMandatoryFields(const stringStringMap& headerInfo)
-{
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::updateHeaderWithMandatoryFields()" << endl;
-
- long testEndian = 1;
- string comment="";
- int commentLen=0;
-
- stringStringMap tempHeaderInfo = headerInfo;
-
- if(tempHeaderInfo.find(COMMENT)!=tempHeaderInfo.end())
- {
-
- commentLen=tempHeaderInfo[COMMENT].length();
- }
-
-
- // Pushing keys to the tempHeaderInfo
- ostringstream tempString;
- string platformInfoString = "";
-
- string timeString ;
- m_OSUtilPtr->getSystemTimeString(timeString);
- tempString << timeString;
-
- tempHeaderInfo["CKS"] = "";
- tempHeaderInfo["HEADERLEN"] = "";
- tempHeaderInfo["DATAOFFSET"] = "";
- tempHeaderInfo["CREATETIME"] = tempString.str();
- tempHeaderInfo["MODTIME"] = tempString.str();
-
- // get Platform Name
- m_OSUtilPtr->getPlatformName(platformInfoString);
- tempHeaderInfo["PLATFORM"] = platformInfoString;
-
- //get processor architechure
- platformInfoString = "";
- m_OSUtilPtr->getProcessorArchitechure(platformInfoString);
- tempHeaderInfo["PROCESSOR_ARCHITEC"] = platformInfoString;
-
- // get OS info
- platformInfoString = "";
- m_OSUtilPtr->getOSInfo(platformInfoString);
- tempHeaderInfo["OSVERSION"] = platformInfoString;
- tempHeaderInfo["HEADERVER"] = HEADERVERSION;
-
- tempString.str("");
- tempString << commentLen;
- tempHeaderInfo["COMMENTLEN"] = tempString.str();
-
- tempString.str("");
- tempString << sizeof(int);
- tempHeaderInfo["SIZEOFINT"] = tempString.str();
-
- tempString.str("");
- tempString << sizeof(unsigned int);
- tempHeaderInfo["SIZEOFUINT"] = tempString.str();
-
- tempString.str("");
- tempString << sizeof(short int);
- tempHeaderInfo["SIZEOFSHORTINT"] = tempString.str();
-
- tempString.str("");
- tempString << sizeof(float);
- tempHeaderInfo["SIZEOFFLOAT"] = tempString.str();
-
- tempString.str("");
- tempString << sizeof(char);
- tempHeaderInfo["SIZEOFCHAR"] = tempString.str();
-
- // checking for indian ness
- if(!(*((char *)(&testEndian))))
- {
- tempHeaderInfo["BYTEORDER"] = "BE";
- }
- else
- {
- tempHeaderInfo["BYTEORDER"] = "LE";
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::updateHeaderWithMandatoryFields()" << endl;
-
- return tempHeaderInfo;
-}
-
-/****************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 26 July 2005
-* NAME : readMDTHeader
-* DESCRIPTION : This function is used to check for checking the file integriry.
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description
-*****************************************************************************/
-int LTKCheckSumGenerate::readMDTHeader(const string &mdtFilePath,
- stringStringMap &headerSequence)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKCheckSumGenerate::readMDTHeader()" << endl;
-
- int headerLen, nCRC;
-
- long dSize, actDataSize;
-
- char chSum[CKSUM_HDR_STR_LEN], *sbuf,*headerData, headerInfo[51];
-
- stringVector strTokens;
-
- ifstream mdtFileHandle(mdtFilePath.c_str(), ios::in | ios::binary);
-
- if(!mdtFileHandle)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EMODEL_DATA_FILE_OPEN <<":"<< getErrorMessage(EMODEL_DATA_FILE_OPEN)
- <<"LTKCheckSumGenerate::readMDTHeader()" <<endl;
-
- LTKReturnError(EMODEL_DATA_FILE_OPEN);
- }
-
-
- mdtFileHandle.read(headerInfo, 50);
-
- char *ptr = strstr(headerInfo, HEADERLEN);
- if(ptr == NULL)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EMODEL_DATA_FILE_FORMAT <<":"<< getErrorMessage(EMODEL_DATA_FILE_FORMAT)
- <<"LTKCheckSumGenerate::readMDTHeader()" <<endl;
-
- LTKReturnError(EMODEL_DATA_FILE_FORMAT);
- }
-
- strtok(ptr, "=");
-
- char *headerLenPtr = strtok( NULL , ">" );
-
- if(headerLenPtr == NULL)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EMODEL_DATA_FILE_FORMAT <<":"<< getErrorMessage(EMODEL_DATA_FILE_FORMAT)
- <<"LTKCheckSumGenerate::readMDTHeader()"<<endl;
-
- LTKReturnError(EMODEL_DATA_FILE_FORMAT);
- }
-
- headerLen = atoi(headerLenPtr);
-
- mdtFileHandle.seekg(0, ios::beg);
-
- headerData = new char [headerLen+1];
-
- memset(headerData, '\0', headerLen+1);
-
- mdtFileHandle.read(headerData, headerLen);
-
- LTKStringUtil::tokenizeString(headerData, TOKENIZE_DELIMITER, strTokens);
-
- int strTokensSize = strTokens.size();
-
- for(int indx=0; indx+1 <strTokensSize ;indx=indx+2)
- {
- headerSequence[strTokens.at(indx)] = strTokens.at(indx+1);
- }
-
- // get the file size in bytes
- mdtFileHandle.seekg(0,ios::beg);
- mdtFileHandle.seekg(0, ios::end);
- dSize = mdtFileHandle.tellg();
-
- //Size fo the actual data excluding Header size.
- actDataSize=dSize-headerLen+1;
-
- string cks = headerSequence[CKS];
-
- //Allocate memory to read the actual data.
- sbuf = new char[actDataSize];
- memset(sbuf, '\0', actDataSize);
-
- //Read the file.
- mdtFileHandle.seekg(headerLen, ios::beg);
- mdtFileHandle.read(sbuf, actDataSize);
-
- //Close the file.
- mdtFileHandle.close();
-
- string szBuf(sbuf);
-
- //Caluculate Checksum for the Model File Data.
- nCRC = getCRC(szBuf);
- sprintf(chSum, "%x", nCRC);
-
- delete [] sbuf;
- delete [] headerData;
-
- if(strcmp(cks.c_str(), chSum) != 0)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINVALID_INPUT_FORMAT <<":"<< getErrorMessage(EINVALID_INPUT_FORMAT)
- <<"LTKCheckSumGenerate::readMDTHeade()r"<<endl;
- LTKReturnError(EINVALID_INPUT_FORMAT);
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKCheckSumGenerate::readMDTHeader()" << endl;
-
- return SUCCESS;
-} \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.h
deleted file mode 100644
index 511bfbaa..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKCheckSumGenerate.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the String Splitter Module
- *
- * CONTENTS:
- *
- * AUTHOR: Vijayakumara M.
- *
- * DATE: July 25, 2005
- * CHANGE HISTORY:
- * Author Date Description
- ************************************************************************/
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-11-19 17:57:12 +0530 (Wed, 19 Nov 2008) $
- * $Revision: 704 $
- * $Author: mnab $
- *
- ************************************************************************/
-#ifndef __LTKCHECSUMGENERATE_H
-#define __LTKCHECSUMGENERATE_H
-
-#include <sstream>
-
-#include "LTKStringUtil.h"
-
-#include "LTKTypes.h"
-
-#include "LTKMacros.h"
-
-#include "LTKErrors.h"
-
-#include "LTKErrorsList.h"
-
-#ifdef _WIN32
-#include <windows.h>
-const int BUFSIZE = 256;
-#else
-#include <stdio.h>
-#include <sys/utsname.h>
-#endif
-
-class LTKOSUtil;
-
-class LTKCheckSumGenerate
-{
-private:
-
- unsigned int m_CRC32Table[256]; // Lookup table array.
-
- LTKOSUtil* m_OSUtilPtr;
-
-public:
-
- // @{
-
- /**
- * Default constractor, calls initCRC32Table function for intialization.
- */
-
- LTKCheckSumGenerate();
-
- /**
- * Destructor
- */
-
- ~LTKCheckSumGenerate();
-
-
- /**
- * This method generates the checksum.
- *
- * @param text, for which the checksum to be calculated.
- *
- * @return checksum for the text.
- */
- int getCRC(string& text);
-
- /**
- * This method reads the header information from the model data header information file and
- * adds it to the data file with additional header information.
- *
- * @param strModelDataHeaderInfoFile, Model data header information file name.
- * @param referenceModelFile, Model data file name.
- * @param verson information.
- * @algoName Name of the alogorithm.
- *
- * @return SUCCESS on successful addition of the header to the data file. of the respective
- * errorCode on the occurence of any errors.
- */
-
- int addHeaderInfo(const string& modelDataHeaderInfoFilePath,
- const string& mdtFilePath,
- const stringStringMap& headerInfo);
-
- /**
- * This method reads the header information from the header information file and
- * adds it to the data file with additional header information.
- *
- * @param headerInfo, Model data header information file name.
- * @param referenceModelFile, Model data file name.
- *
- * @return the new stringStringMap after updation
- */
- stringStringMap updateHeaderWithMandatoryFields(const stringStringMap& headerInfo);
-
-
- /**
- * This method is used to check the file integrity with the checksum.
- *
- * @param mdtFilePath, Model data file Name.
- * @param string - string map variable, which holds the header keys and the values respectively.
- *
- * @return SUCCESS,
- */
-
- int readMDTHeader(const string &mdtFilePath,
- stringStringMap &headerSequence);
-
-private:
-
- /**
- * This method intializes the crc32_table with 256 values representing ASCII character
- * codes.
- */
-
- void initCRC32Table();
-
- /**
- * This method is used only by initCRC32Table() function. reflection is a requirement
- * for the official CRC-32 standard.
- *
- * @param ref value.
- * @param character.
- *
- * @return long integer value which will be used by initCRC32Table functon.
- */
-
- unsigned int reflect(unsigned int ref, char ch);
-
-
- // @}
-};
-
-#endif //__LTKCHECSUMGENERATE_H
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.cpp
deleted file mode 100644
index 30e06f42..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-02-08 14:54:14 +0530 (Tue, 08 Feb 2011) $
- * $Revision: 833 $
- * $Author: dineshm $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Implementation of the Configuration File Reader Module
- *
- * CONTENTS:
- * getMap
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of LTKConfigFileReader
- ************************************************************************/
-
-#include "LTKConfigFileReader.h"
-
-#include "LTKStringUtil.h"
-
-#include "LTKException.h"
-
-#include "LTKErrorsList.h"
-
-#include "LTKMacros.h"
-
-#include "LTKErrors.h"
-
-#include "LTKLoggerUtil.h"
-
-/******************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : LTKConfigFileReader
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of LTKConfigFileReader ctor
-* Nidhi Sharma 08-FEB-2007
-******************************************************************************/
-
-LTKConfigFileReader::LTKConfigFileReader(const string& configFilePath):
-m_configFilePath(configFilePath)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKConfigFileReader::LTKConfigFileReader()" << endl;
-
- // Read the config file into stringStringMap
- int errorCode = getMap();
-
- if (errorCode != SUCCESS )
- {
- // logger message
- LOG( LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKConfigFileReader::LTKConfigFileReader()"<<endl;
- throw LTKException(errorCode);
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKConfigFileReader::LTKConfigFileReader()" << endl;
-}
-
-/***************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : getMap
-* DESCRIPTION : reads string-value pair into an asoociative array
-* ARGUMENTS : cfgFile - the name of the configuration file from which the string-value pairs
-* are to be read from
-* RETURNS : an associative array indexable on the string to the value
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of getMap
-*Nidhi Sharma 08-FEB-2007 Made this function a private member function of the class
-*****************************************************************************/
-
-int LTKConfigFileReader::getMap()
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKConfigFileReader::getMap()" << endl;
-
- string line = ""; // a line read from the config file
-
- vector<string> strTokens; // string list found in the line read
-
- // opening the config file
-
- ifstream cfgFileHandle(m_configFilePath.c_str());
-
- // checking if the file open was successful
-
- if(!cfgFileHandle)
- {
- // logger message
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Unable to Open Config file :"<< m_configFilePath<<endl;
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EFILE_OPEN_ERROR <<": "<<
- getErrorMessage(EFILE_OPEN_ERROR)
- <<"LTKConfigFileReader::getMap() => Config File Not Found" <<endl;
-
- LTKReturnError(EFILE_OPEN_ERROR);
- }
-
- // reading lines of the config file
- while(getline(cfgFileHandle, line, NEW_LINE_DELIMITER))
- {
- // trim the line
- LTKStringUtil::trimString(line);
-
- if(line.empty())
- {
- // skipping over empty line
- continue;
- }
- else if((line[0] == COMMENTCHAR))
- {
- // skipping over commented lines
- continue;
- }
- else
- {
- LTKStringUtil::tokenizeString(line, "=", strTokens);
-
- if(strTokens.size() == 2)
- {
- LTKStringUtil::trimString(strTokens[0]);
- LTKStringUtil::trimString(strTokens[1]);
-
- m_cfgFileMap[strTokens[0]] = strTokens[1];
- }
- else
- {
- // Logger message
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINVALID_CFG_FILE_ENTRY <<": "<<
- getErrorMessage(EINVALID_CFG_FILE_ENTRY)
- <<"LTKConfigFileReader::getMap()" <<endl;
-
- // closing the config file
- cfgFileHandle.close();
-
- LTKReturnError(EINVALID_CFG_FILE_ENTRY);
- }
- }
- // populating the name value pair associative array (map)
- }
-
- // closing the config file
- cfgFileHandle.close();
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKConfigFileReader::getMap()" << endl;
-
- return SUCCESS;
-}
-
-/****************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : ~LTKConfigFileReader
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of ~LTKConfigFileReader
-*****************************************************************************/
-
-LTKConfigFileReader::~LTKConfigFileReader(){}
-
-/**************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 08-FEB-2007
-* NAME : getConfigValue
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of getConfigValue
-****************************************************************************/
-int LTKConfigFileReader::getConfigValue(const string& key, string& outValue)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKConfigFileReader::getConfigValue()" << endl;
-
- stringStringMap::const_iterator cfgItem = m_cfgFileMap.find(key);
- if (cfgItem != m_cfgFileMap.end() )
- {
- outValue = cfgItem->second.c_str();
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKConfigFileReader::getConfigValue()" << endl;
- return SUCCESS;
- }
- // logger mesage
- int errorCode = EKEY_NOT_FOUND;
- LTKReturnError(errorCode);
-}
-
-/****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 08-FEB-2007
-* NAME : isConfigMapEmpty
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of getConfigValue
-****************************************************************************/
-bool LTKConfigFileReader::isConfigMapEmpty()
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKConfigFileReader::isConfigMapEmpty()" << endl;
-
- bool returnBool = false;
-
- if ( m_cfgFileMap.empty() )
- {
- returnBool = true;
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKConfigFileReader::isConfigMapEmpty()" << endl;
-
- return returnBool;
-}
-
-/***************************************************************************
-* AUTHOR : Srinivasa Vithal
-* DATE : 21-NOV-2007
-* NAME : getCfgFileMap
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of getConfigValue
-****************************************************************************/
-const stringStringMap& LTKConfigFileReader::getCfgFileMap()
-{
- return m_cfgFileMap;
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.h
deleted file mode 100644
index 361d70f6..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKConfigFileReader.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-18 15:00:39 +0530 (Fri, 18 Jul 2008) $
- * $Revision: 561 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the Configuration File Reader Module
- *
- * CONTENTS:
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description
- ************************************************************************/
-
-#ifndef __LTKCONFIGFILEREADER_H
-#define __LTKCONFIGFILEREADER_H
-
-#include "LTKTypes.h"
-
-/**
-* @ingroup util
-*/
-
-/** @brief A utility class for reading the key value pairs defined in Lipi Config Files
-* @class LTKConfigFileReader
-*/
-class LTKConfigFileReader
-{
-
-private :
- /** @brief A string string map that holds the key-value pairs defined in the config file
- */
- stringStringMap m_cfgFileMap;
- string m_configFilePath;
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Parameterized Constructor
- *
- * <p>
- * The constructor takes in the path of the confg file to be read as paramater and
- * reads the key-value pairs defined in that class to the data member LTKConfigFileReader::m_cfgFileMap
- * </p>
- */
-
- LTKConfigFileReader(const string& configFilePath);
-
- /**
- * Destructor
- */
-
- ~LTKConfigFileReader();
-
- // @}
-
- /** @name public methods
- */
-
- // @{
-
- /** @brief Returns the value for the key defined in the config file
- * <p>
- * Returns the value for the key if the key is defined in the config file and empty string otherwise.
- * </p>
- * @param key Type : string (constant)
- * @returns Type : string
- */
- int getConfigValue(const string& key, string& outValue);
-
-
- /** @brief Returns true if no key-value pairs were defined in the config file
- *
- * @returns Type : bool, true : if config file has no valid key-value pairs and false otherwise.
- */
- bool isConfigMapEmpty();
- //bool isConfigFileEmpty();
- // @}
- /** @brief Returns the stringStringMap of m_cfgFileMap
- *
- */
- const stringStringMap& getCfgFileMap();
- // @}
-
-private:
-
- /**
- * @name Methods
- */
-
- // @{
-
- /**
- * Reads key-value pairs from a file into a map
- */
-
- int getMap();
-
- //@}
-};
-
-#endif
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKDynamicTimeWarping.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKDynamicTimeWarping.h
deleted file mode 100644
index dced46bc..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKDynamicTimeWarping.h
+++ /dev/null
@@ -1,566 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-01-11 14:11:25 +0530 (Fri, 11 Jan 2008) $
- * $Revision: 359 $
- * $Author: sundarn $
- *
- ************************************************************************/
-#ifndef __DYNAMICTIMEWARPING_H
-#define __DYNAMICTIMEWARPING_H
-
-#include <iostream>
-#include <cstdlib>
-#include <string>
-#include <vector>
-#ifndef _WIN32
-//#include <values.h>
-#endif
-#include <limits>
-#include <algorithm>
-#include <cmath>
-#include <deque>
-
-
-using namespace std;
-
-template <typename TimeSeriesElementType, typename DistanceType>
-//TimeSeriesElementType - pointer of type feature (LTKShapeFeature * etc.)
-//DistanceType - type of distance (float, int etc.)
-
-
-
-/**
- * @class DTWShapeRecognizer
- */
-class DynamicTimeWarping
-{
- private:
-
- vector<vector <DistanceType> > m_cumulativeDistance; // Cumulative distance matrix
-
- vector<vector<int> > m_phi; // phi matrix required for path computation
-
- //function pointer type of the function that defines local distance function
- typedef void (*FN_PTR_DISTANCE)(const TimeSeriesElementType&, const TimeSeriesElementType&, DistanceType&) ;
-
-
- DistanceType m_maxVal;
- // Max val (like FLT_MAX etc),
- // this max value that can be returned
- // local distance
-
-
- /**
- * This function back tracks and calculates the DTW warping path from the DTW distance matrix
- * @param1 lastPointYIndex is the x index of the point from which back tracking has to start
- * @param1 lastPointXIndex is the y index of the point from which back tracking has to start
- */
- void populatePath(int lastPointYIndex, int lastPointXIndex, deque<vector<int> >& warpingPath)
- {
-
- int yIndex = lastPointYIndex;
- int xIndex = lastPointXIndex;
- vector<int > indices(2);
- int tb; // req for warping path
- int k,p; // loop variables
-
- //Path Computation
-
- indices[0] = yIndex;
- indices[1] = xIndex;
- warpingPath.push_front(indices);
-
- while((yIndex > 0) && (xIndex > 0))
- {
- tb = m_phi[yIndex][xIndex];
- if (tb == 2)
- {
- yIndex--;
- xIndex--;
- indices[0] = yIndex;
- indices[1] = xIndex;
- }
- else if(tb == 0)
- {
- yIndex--;
- indices[0] = yIndex;
- indices[1] = xIndex;
- }
- else if (tb == 1)
- {
- xIndex--;
- indices[0] = yIndex;
- indices[1] = xIndex;
- }
-
- warpingPath.push_front(indices);
-
- }
-
- if((yIndex > 0) && (xIndex == 0))
- {
- --yIndex;
- for(k = yIndex; k >= 0; --k)
- {
- indices[0] = (k);
- indices[1] = (0);
- warpingPath.push_front(indices);
- }
- }
- else if(( yIndex == 0) && (xIndex > 0))
- {
- --xIndex;
- for(p = xIndex; p >= 0; --p)
- {
- indices[0] = (0);
- indices[1] = (p);
- warpingPath.push_front(indices);
- }
- }
-
- }
-
- public:
-
-
-
- /** @name Constructors and Destructor */
- //@{
-
- /**
- * This Constructor takes the size of the input train character,
- * size of input test character, Max Value (ie FLT_MAX, INT_MAX etc)
- * Local distance function, reduce by half function, and banding value
- */
-
- DynamicTimeWarping()
- {
-
-
- }
-
-
- /**
- * Destructor
- */
-
- ~DynamicTimeWarping(){};
-
- /**
- * @name Methods
- */
-
- //@{
-
-
- /**
- * This function computes the DTW distance between the two vectors.
- * @param train This is an input parameter and corresponds to the first vector
- * @param test This is an input parameter and corresponds to the second vector
- * @param local This is the function pointer to the local distance function
- * @param distanceDTW This is the output parameter which gives the DTW distance between the two vectors.
- * @param warpingPath This is the output parameter which gives DTW warping path
- * @param banding This is the banding value for the DTW Matrix
- * @param bestSoFar This is an imput parameter as stoping criteria based on Best So Far
- * @param maxVal This is used to pass the maximum possible value for the DTW distance
- */
-/*
- int computeDTW(const vector <TimeSeriesElementType>& train,
- const vector <TimeSeriesElementType>& test,
- FN_PTR_DISTANCE localDistPtr,
- DistanceType& distanceDTW,
- deque<vector<int> >& warpingPath,
- int banding=0, DistanceType bestSoFar=numeric_limits<DistanceType>::infinity(),
- DistanceType maxVal=numeric_limits<DistanceType>::infinity())
- */
- int computeDTW(const vector <TimeSeriesElementType>& train,
- const vector <TimeSeriesElementType>& test,
- FN_PTR_DISTANCE localDistPtr,
- DistanceType& distanceDTW,
- deque<vector<int> >& warpingPath,
- float banding=0, DistanceType bestSoFar=numeric_limits<DistanceType>::infinity(),
- DistanceType maxVal=numeric_limits<DistanceType>::infinity())
-
- {
- m_maxVal = maxVal;
- if(localDistPtr == NULL)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< ENULL_POINTER <<":"<< getErrorMessage(ENULL_POINTER)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
-
- LTKReturnError(ENULL_POINTER);
- }
- int trainSize = train.size(); //Temporary variables to store the size of the train and test vectors.
- if(trainSize == 0)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EEMPTY_VECTOR <<":"<< getErrorMessage(EEMPTY_VECTOR)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
- LTKReturnError(EEMPTY_VECTOR);
- }
- int testSize = test.size(); //Temporary variables to store the size of the train and test vectors.
- if(testSize == 0)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EEMPTY_VECTOR <<":"<< getErrorMessage(EEMPTY_VECTOR)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
- LTKReturnError(EEMPTY_VECTOR);
- }
-
- float testBanding = floor(testSize*(1-banding));
- float trainBanding = floor(trainSize*(1-banding));
- banding = (trainBanding < testBanding)?trainBanding:testBanding;
-
- int banded = 0;
-
- if(banding < 0 || banding >= trainSize || banding >= testSize)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< ENEGATIVE_NUM <<":"<< getErrorMessage(ENEGATIVE_NUM)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
-
- LTKReturnError(ECONFIG_FILE_RANGE);
- }
- else
- {
- banded = banding; // is the variable used for fixing the band in the computation of the distance matrix.
- // this is the number of elements from the matrix
- // boundary for which computation will be skipped
- }
-
- int trunkI = banded; //Temporary variables used to keep track of the band in the distance matrix.
-
- int trunkJ = 0; //Temporary variables used to keep track of the band in the distance matrix.
-
- int i,j,l; //index variables
-
- if(m_cumulativeDistance.size() == 0)
- {
- vector <DistanceType> dVec(testSize,m_maxVal);
- vector <int> phiVec(testSize,0);
-
- for(i = 0; i < trainSize; ++i)
- {
- m_cumulativeDistance.push_back(dVec);
- m_phi.push_back(phiVec);
- }
- }
- else if(trainSize > m_cumulativeDistance.size() || testSize > m_cumulativeDistance[0].size())
- {
- m_cumulativeDistance.clear();
- m_phi.clear();
- vector <DistanceType> dVec(testSize,m_maxVal);
- vector <int> phiVec(testSize,0);
-
- for(i = 0; i < trainSize; ++i)
- {
- m_cumulativeDistance.push_back(dVec);
- m_phi.push_back(phiVec);
- }
-
- }
- else
- {
- for(i=0; i<m_cumulativeDistance.size(); i++)
- {
- for(j=0; j<m_cumulativeDistance[0].size();j++)
- {
- m_cumulativeDistance[i][j] = m_maxVal;
- m_phi[i][j] = 0;
- }
- }
- }
-
- DistanceType rowMin; //Temporary variable which contains the minimum value of the distance of a row.
-
- DistanceType tempDist[2]; //Temporary variable to store the distance
-
- DistanceType tempMinDist; //Temporary variable to store the minimum distance
-
- DistanceType tempVal;
-
- int tempIndex;
-
- typename vector <vector<DistanceType> > ::iterator cumDistIter1; //iterator for cumDist i
- typename vector<DistanceType> ::iterator cumDistIter2; //iterator for cumDist j
- typename vector<DistanceType> ::iterator cumDistIter3; //iterator for cumDist j
-
-
- (localDistPtr)(train[0],test[0],m_cumulativeDistance[0][0]);
-
- m_phi[0][0]=2;
-
- /**
- Computing the first row of the distance matrix.
- */
-
- cumDistIter2 = m_cumulativeDistance[0].begin();
- for(i = 1; i < testSize; ++i)
- {
- DistanceType tempVal;
-
- (localDistPtr)(train[0],test[i],tempVal);
-
- *(cumDistIter2 + i) = *(cumDistIter2 + i-1) + tempVal;
- m_phi[0][i]=1;
- }
- if(trunkI > 0)
- {
- --trunkI;
- }
- /**
- Computing the first column of the distance matrix.
- */
-
- for(j = 1; j < trainSize; ++j)
- {
-
-
- (localDistPtr)(train[j],test[0],tempVal);
-
- m_cumulativeDistance[j][0] = m_cumulativeDistance[j-1][0]+tempVal;
- m_phi[j][0]=0;
- }
-
-
- /**
- Computing the values of the rest of the cells in the distance matrix.
- */
- cumDistIter1 = m_cumulativeDistance.begin();
- for(i = 1; i < trainSize; ++i)
- {
- rowMin = m_maxVal;
- cumDistIter2 = (*(cumDistIter1+i-1)).begin();
- cumDistIter3 = (*(cumDistIter1+i)).begin();
-
- for(j = 1+trunkJ; j < testSize-trunkI; ++j)
- {
- tempDist[0] = *(cumDistIter2+j-1);
- tempIndex = 2;
-
- tempMinDist = tempDist[0];
- tempDist[0] = *(cumDistIter2+j);
- tempDist[1] = *(cumDistIter3+j-1);
-
- for(l = 0; l < 2; ++l)
- {
- if(tempMinDist>=tempDist[l])
- {
- tempMinDist=tempDist[l];
- tempIndex = l;
- }
- }
-
- m_phi[i][j] = tempIndex;
- localDistPtr(train[i],test[j],tempVal);
- tempMinDist= tempMinDist+tempVal;
- m_cumulativeDistance[i][j]=tempMinDist;
-
- if(rowMin > tempMinDist)
- rowMin = tempMinDist;
-
- }
- if(trunkI > 0)
- --trunkI;
- if(i > (trainSize-banded-1))
- ++trunkJ;
-
- if(rowMin > bestSoFar)
- {
- distanceDTW = m_maxVal;
- return SUCCESS;
- }
- }
-
- distanceDTW = tempMinDist;
-
- distanceDTW = distanceDTW/(trainSize + testSize);
-
- populatePath(trainSize-1,testSize-1,warpingPath);
-
- return SUCCESS;
-
- }
-
-
- /**
- * This function computes the DTW distance between the two vectors.
- * @param train This is an input parameter and corresponds to the first vector
- * @param test This is an input parameter and corresponds to the second vector
- * @param local This is the function pointer to the local distance function
- * @param distanceDTW This is the output parameter which gives the DTW distance between the two vectors.
- * @param banding This is the banding value for the DTW Matrix
- * @param bestSoFar This is an imput parameter as stoping criteria based on Best So Far
- * @param maxVal This is used to pass the maximum possible value for the DTW distance
- */
-/*
- int computeDTW(const vector <TimeSeriesElementType>& train,
- const vector <TimeSeriesElementType>& test,
- FN_PTR_DISTANCE localDistPtr, DistanceType& distanceDTW,
- int banding=0, DistanceType bestSoFar=(numeric_limits<DistanceType>::infinity()),
- DistanceType maxVal=(numeric_limits<DistanceType>::infinity()))
- */
- int computeDTW(const vector <TimeSeriesElementType>& train,
- const vector <TimeSeriesElementType>& test,
- FN_PTR_DISTANCE localDistPtr, DistanceType& distanceDTW,
- float banding=0, DistanceType bestSoFar=(numeric_limits<DistanceType>::infinity()),
- DistanceType maxVal=(numeric_limits<DistanceType>::infinity()))
- {
-
- m_maxVal = maxVal;
- if(localDistPtr == NULL)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< ENULL_POINTER <<":"<< getErrorMessage(ENULL_POINTER)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
-
- LTKReturnError(ENULL_POINTER);
- }
- int trainSize = train.size(); //Temporary variables to store the size of the train and test vectors.
- if(trainSize == 0)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EEMPTY_VECTOR <<":"<< getErrorMessage(EEMPTY_VECTOR)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
- LTKReturnError(EEMPTY_VECTOR);
- }
- int testSize = test.size(); //Temporary variables to store the size of the train and test vectors.
- if(testSize == 0)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EEMPTY_VECTOR <<":"<< getErrorMessage(EEMPTY_VECTOR)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
- LTKReturnError(EEMPTY_VECTOR);
- }
-
- float testBanding = floor(testSize*(1-banding));
- float trainBanding = floor(trainSize*(1-banding));
- banding = (trainBanding < testBanding)?trainBanding:testBanding;
-
-
- int banded = 0;
- if(banding < 0 || banding >= trainSize || banding >= testSize)
- {
- /*LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< ENEGATIVE_NUM <<":"<< getErrorMessage(ENEGATIVE_NUM)
- <<" DynamicTimeWarping::computeDTW()" <<endl;*/
- LTKReturnError(ECONFIG_FILE_RANGE);
- }
- else
- {
- banded = banding; // is the variable used for fixing the band in the computation of the distance matrix.
- // this is the number of elements from the matrix
- // boundary for which computation will be skipped
- }
-
- int trunkI = banded; //Temporary variables used to keep track of the band in the distance matrix.
-
- int trunkJ = 0; //Temporary variables used to keep track of the band in the distance matrix.
-
- int i,j,k; //index variables
- vector<DistanceType> currentRow(testSize,m_maxVal);
- vector<DistanceType> previousRow(testSize,m_maxVal);
-
- DistanceType rowMin; //Temporary variable which contains the minimum value of the distance of a row.
-
- DistanceType tempDist[3]; //Temporary variable to store the distance
-
- DistanceType tempMinDist; //Temporary variable to store the minimum distance
-
- DistanceType tempVal;
-
-
- (localDistPtr)(train[0],test[0],previousRow[0]);
-
- /**
- Computing the first row of the distance matrix.
- */
-
- for(i = 1; i < testSize; ++i)
- {
-
- (localDistPtr)(train[0],test[i],tempVal);
- previousRow[i] = previousRow[i-1] + tempVal;
- }
- if(trunkI > 0)
- {
- --trunkI;
- }
-
-
- for(i = 1; i < trainSize; ++i)
- {
- rowMin = m_maxVal;
-
-
- localDistPtr(train[i],test[trunkJ],tempVal);
- currentRow[trunkJ]=tempVal+previousRow[trunkJ];
-
- for(j = 1+trunkJ; j < testSize-trunkI; ++j)
- {
-
- tempDist[0] = currentRow[j-1];
- tempDist[1] = previousRow[j];
- tempDist[2] = previousRow[j-1];
-
- tempMinDist = tempDist[0];
-
- for(k = 0; k < 3; k++)
- {
- if(tempMinDist>=tempDist[k])
- {
- tempMinDist=tempDist[k];
- }
- }
-
- localDistPtr(train[i],test[j],tempVal);
- tempMinDist= tempMinDist+tempVal;
- currentRow[j]=tempMinDist;
- if(rowMin > tempMinDist)
- rowMin = tempMinDist;
-
- }
- if(rowMin > bestSoFar)
- {
- distanceDTW = m_maxVal;
- return SUCCESS;
- }
-
- if(i > (trainSize-banded-1))
- ++trunkJ;
- if(trunkI > 0)
- --trunkI;
- copy(currentRow.begin()+trunkJ, currentRow.end()-trunkI, previousRow.begin()+trunkJ);
- }
-
- distanceDTW = tempMinDist;
- distanceDTW = distanceDTW/(trainSize + testSize);
-
- return SUCCESS;
-
- }
-
-};
-
-#endif
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.cpp
deleted file mode 100644
index 2cf87532..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2009-04-17 11:23:39 +0530 (Fri, 17 Apr 2009) $
- * $Revision: 765 $
- * $Author: mnab $
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Definition of getError function.
- *
- * CONTENTS:
- * getError
- *
- * AUTHOR: VijayaKumara M.
- *
- * DATE:
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#include "LTKErrors.h"
-#include "LTKMacros.h"
-#include "LTKErrorsList.h"
-#include "stdio.h"
-
-int errorCode;
-
-// Error list ( In the same oreder as in LTKErrorList.h file in "include" dir.
-static map<int,string> errors;
-
-static void initErrorCode()
-{
- errors.clear();
- errors[EINK_FILE_OPEN] = "Unable to open ink file"; /* 100 - EINK_FILE_OPEN */
- errors[ECONFIG_FILE_OPEN] = "Unable to open configuration file"; /* 101 - ECONFIG_FILE_OPEN */
- errors[EHEADER_INFO_FILE_OPEN] = "Unable to open model header information file"; /* 102 - EHEADER_INFO_FILE_OPEN_ERR */
- errors[EMODEL_DATA_FILE_OPEN] = "Unable to open model data file"; /* 103 - EMODEL_DATA_FILE_OPEN_ERR */
- errors[ETRAINLIST_FILE_OPEN] = "Unable to open train list file"; /* 104 - ETRAINLIST_FILE_OPEN_ERR */
- errors[EMODEL_DATA_FILE_FORMAT] = "Incompatible model data file. The header is not in the desired format."; /* 105 - EFILE_FORMAT_ERR */
- errors[EINVALID_INPUT_FORMAT] = "Model data file is corrupted"; /* 106 - EFILE_CORRUPT_ERR */
-
- errors[ELOAD_SHAPEREC_DLL] = "Error while loading shape recognition module"; /* 107 - ELOAD_SHAPEREC_DLL_ERR */
- errors[ELOAD_WORDREC_DLL] = "Error while loading word recognition module"; /* 108 - ELOAD_WORDREC_DLL_ERR */
- errors[ELOAD_PREPROC_DLL] = "Error while loading preprocessing module"; /* 109 - ELOAD_PREPROC_DLL_ERR */
- errors[EDLL_FUNC_ADDRESS] = "Exported function not found in module"; /* 110 - EDLL_FUNC_ADDRESS_ERR */
- errors[ECREATE_SHAPEREC] = "Error while creating shape recognizer instance"; /* 111 - ECREATE_SHAPEREC_ERR */
- errors[ECREATE_WORDREC] = "Error while creating word recognizer instance"; /* 112 - ECREATE_WORDREC_ERR */
- errors[ECREATE_PREPROC] = "Error while creating preprocessor instance"; /* 113 - ECREATE_PREPROC_ERR */
-
- errors[ELIPI_ROOT_PATH_NOT_SET] = "Environment variable LIPI_ROOT is not set"; /* 114 - ELIPI_ROOT_PATH_NOT_SET */
- errors[EINVALID_PROJECT_NAME] = "Invalid or no entry for project name"; /* 115 - EINVALID_PROJECT_NAME */
- errors[EINVALID_CONFIG_ENTRY] = "Invalid configuration entry in project.cfg file"; /* 116 - EINVALID_CONFIG_ENTRY */
- errors[ENO_SHAPE_RECOGNIZER] = "No shape recognizer specified in profile.cfg file"; /* 117 - ENO_SHAPE_RECOGNIZER */
- errors[ENO_WORD_RECOGNIZER] = "No word recognizer specified in profile.cfg file"; /* 118 - ENO_WORD_RECOGNIZER */
-
- errors[EINVALID_NUM_OF_TRACES] = "Invalid number of traces processed"; /* 119 - EINVALID_NUMBER_OF_TRACES */
- errors[EINVALID_NUM_OF_SHAPES] = "Invalid value for number of shapes"; /* 120 - EINVALID_VALUE_NUMOFSHAPES */
- errors[EINVALID_TRACE_DIMENTION] = "Invalid value for trace dimension"; /* 121 - EINVALID_TRACE_DIMENTION */
- errors[EINVALID_NUMEIGENVECTOR] = "Invalid value for eigen vector"; /* 122 - EINVALID_VALUE_NUMEIGENVECTOR */
- errors[EINVALID_FLOAT_SIZE] = "Invalid float size entry in model data File"; /* 123 - EINVALID_FLOAT_SIZE */
- errors[EINCOMPATIBLE_VERSION] = "Incompatible algorithm version"; /* 124 - EINCOMPATIBLE_VERSION_ERR */
- errors[EINVALID_PREPROC_SEQUENCE] = "Wrong preprocessor sequence entry in cfg file"; /* 125 - EPREPROC_SEQUENCE_ERR */
-
- errors[ENO_TOKEN_FOUND] = "Invalid or no value specified for project name for recognizer"; /* 126 - ENO_TOKEN_FOUND */
- errors[EINVALID_LOGICAL_NAME] = "Invalid or no value specified for logical name for recognizer"; /* 127 - EINVALID_LOGICAL_NAME */
-
- errors[EINVALID_SEGMENT] = "Invalid segment, boxfield recognizer requires character level segment info"; /* 128 - EINVALID_SEGMENT */
- errors[EINVALID_REC_MODE] = "Unsupported recognizer mode"; /* 129 - EINVALID_REC_MODE */
-
- errors[EUNSUPPORTED_STATISTICS] = "Unsupported or invalid statistics to be computed"; /* 130 - EUNSUPPORTED_STATISTICS */
-
-
- errors[EMAP_NOT_FOUND] = "No function implemented to convert to a unicode string"; /* 131 - EMAP_NOT_FOUND */
- errors[EINVALID_SHAPEID] = "Invalid value for shape id"; /* 132 - EINVALID_VALUE_SHAPEID */
-
- errors[ENOMAPFOUND_LIPIENGINECFG] = "Cannot map the logical name, no entries in lipiengine.cfg";/* 133 - ENOMAPFOUND_LIPIENGINECFG */
- errors[EINVALID_NUM_OF_POINTS] = "Number of points in the tracegroup is not normalized"; /* 134 - EINVALID_NUM_OF_POINTS */
- errors[EEMPTY_TRACE] = "Empty trace"; /* 135 - EEMPTY_TRACE*/
- errors[EEMPTY_TRACE_GROUP] = "Empty Trace Group" , /* 136 -EEMPTY_TRACE_GROUP*/
- errors[ECONFIG_FILE_RANGE] = "The config file variable is not within the correct range"; /* 137 - ECONFIG_FILE_RANGE */
-
-
- errors[EINITSHAPE_NONZERO] = "Recognizer requires the Intial shape id to be zero"; /* 138 - EINITSHAPE_NONZERO */
- errors[EINVALID_LINE_LISTFILE] = "Invalid line in the listfile (train or test )"; /* 139 - EINVALID_LINE_LISTFILE */
- errors[EINVALID_ORDER_LISTFILE] = "Invalid order of shape-ids in the list file ( train )"; /* 140 - EINVALID_ORDER_LISTFILE */
- errors[ENUM_NNS] = "Invalid number of nearest neighbours specified"; /*141 - ENUM_NNS/*/
- errors[EINKFILE_EMPTY] = "Ink file name is empty"; /* 142 - EINKFILE_EMPTY */
- errors[EINKFILE_CORRUPTED] = "Incorrect or corrupted unipen ink file."; /* 143 - EINKFILE_CORRUPTED */
- errors[EDLL_FUNC_ADDRESS_CREATE] = "Could not map the createPreprocessor function from DLL. "; /*144 EDLL_FUNC_ADDRESS_CREATE */
- errors[EDLL_FUNC_ADDRESS_DELETE] = "Could not map the deletePreprocessor function from DLL. "; /*145 EDLL_FUNC_ADDRESS_DELETE */
- errors[ENO_RESAMPLETRACEGROUP] = "No resampleTraceGroup in preProcSequence entry of cfg file. "; /*146 ENO_RESAMPLETRACEGROUP */
-
- errors[EINVALID_SAMPLING_RATE] = "Sampling rate cannot be negative. "; /*147 EINVALID_SAMPLING_RATE */
- errors[EINVALID_X_RESOLUTION] = "m_xDpi values cannot be negative. "; /*148 EINVALID_X_RESOLUTION */
- errors[EINVALID_Y_RESOLUTION] = "m_yDpi values cannot be negative. "; /*149 EINVALID_Y_RESOLUTION */
- errors[EINVALID_LATENCY] = "m_latency cannot be negative. "; /*150 EINVALID_LATENCY */
-
- errors[EPOINT_INDEX_OUT_OF_BOUND] = "Point index greater than number of points available. "; /*151 EPOINT_INDEX_OUT_OF_BOUND */
- errors[ECHANNEL_INDEX_OUT_OF_BOUND] = "Invalid Channel. "; /*152 ECHANNEL_INDEX_OUT_OF_BOUND */
- errors[ECHANNEL_SIZE_MISMATCH] = "New channel data not as long as the old one. "; /*153 ECHANNEL_SIZE_MISMATCH */
- errors[ENUM_CHANNELS_MISMATCH] = "Point to be added does not have the same number of channels as the trace. "; /*154 ENUM_CHANNELS_MISMATCH */
- errors[EDUPLICATE_CHANNEL] = "Channel with the new channel name already present. "; /*155 EDUPLICATE_CHANNEL */
- errors[ECHANNEL_NOT_FOUND] = "Channel not found. "; /*156 ECHANNEL_NOT_FOUND */
- errors[EZERO_CHANNELS] = "Number of channels cannot be zero. "; /*157 EZERO_CHANNELS */
- errors[EINVALID_INPUT_STREAM] = "Input stream does not match with number of channels in the trace. "; /*158 EINVALID_INPUT_STREAM */
- errors[ECOMPUTE_DISTANCE_ERROR] = "Error: Cannot find distance for test sample with more than 1 stroke. "; /*159 ECOMPUTE_DISTANCE_ERROR */
- errors[ECOMPARISON_ERROR] = "Error: Cannot compare with train sample having more than 1 stroke. "; /*160 ECOMPARISON_ERROR */
- errors[ETRAIN_TEST_VECTOR_SIZE_MISMATCH] = "Incompatible: train vector and test vector sizes do not match. "; /*161 ETRAIN_TEST_VECTOR_SIZE_MISMATCH */
- errors[EGRAMMER_FILE_NOT_EXIST] = "Grammar file does not exists. "; /*162 EGRAMMER_FILE_NOT_EXIST */
- errors[EVALUES_NOT_PROVIDED] = "Values for the terminal is not Provided. "; /*163 EVALUES_NOT_PROVIDED */
- errors[ECONFIG_FILE_FORMAT] = "No productions or terminals identified in the CFG. Please check the CFG format. "; /*164 ECONFIG_FILE_FORMAT */
- errors[ECYCLIC_DEPENDENCY] = "Cyclic dependency exists! Unable to find paths. "; /*165 ECYCLIC_DEPENDENCY */
- errors[EFILE_OPEN_ERROR] = "Could Not open file : "; /*166 EFILE_OPEN_ERROR*/
- errors[ELOAD_FEATEXT_DLL] = "Error while loading feature extractor module "; /*167 ELOAD_FEATEXT_DLL*/
- errors[EDLL_FUNC_ADDRESS_CREATE_FEATEXT] = "Could not map the createShapeFeatureExtractor function from DLL "; /*168 EDLL_FUNC_ADDRESS_CREATE_FEATEXT */
- errors[EDLL_FUNC_ADDRESS_DELETE_FEATEXT] = "Could not map the deleteShapeFeatureExtractor function from DLL "; /*169 EDLL_FUNC_ADDRESS_DELETE_FEATEXT */
- errors[EFTR_EXTR_NOT_EXIST] = "Feature extractor does not exist "; /*170 EFTR_EXTR_NOT_EXIST */
- errors[ENO_FTR_EXTR_IN_CFG] = "No Feature Extractor in Config file "; /*171 ENO_FTR_EXTR_IN_CFG*/
- errors[EFTR_RPRCLASS_NOIMPLEMENTATION] = "No implementation provided "; /*172 EFTR_RPRCLASS_NOIMPLEMENTATION */
- errors[EINVALID_ORDER_FEATUREFILE] = "Invalid order of shape-ids in the feature file "; /* 173 - EINVALID_ORDER_FEATUREFILE */
- errors[ENUMSHAPES_NOT_SET] = "NumShapes config variable is not set in the project.cfg file ";/* 174 - ENUMSHAPES_NOT_SET */
- errors[EUNEQUAL_LENGTH_VECTORS] = "Vectors are of different lengths "; /* 175 - EUNEQUAL_LENGTH_VECTORS */
- errors[EINVALID_LOG_LEVEL] = "Invalid log level "; /* 176 - EINVALID_LOG_LEVEL */
- errors[EPROJ_NOT_DYNAMIC] = "Not allowed to ADD/Delete class for a project with fixed number of shapes"; /*177 EPROJ_NOT_DYNAMIC*/
- errors[EMORPH_FVEC_SIZE_MISMATCH] = "Error: Cannot perform MORPH on features vectors of different sizes"; /*178 EMORPH_FVEC_SIZE_MISMATCH*/
- errors[ESHAPE_RECOCLASS_NOIMPLEMENTATION] = "No implementation provided"; /*179 ESHAPE_RECOCLASS_NOIMPLEMENTATION*/
- errors[ENULL_POINTER] = "Null Pointer Error"; /*180 ENULL_POINTER*/
- errors[EINVALID_X_SCALE_FACTOR] = "Invalid X scale factor. Scale factor must be greater than zero"; /*181 EINVALID_X_SCALE_FACTOR*/
- errors[EINVALID_Y_SCALE_FACTOR] = "Invalid Y scale factor. Scale factor must be greater than zero"; /*182 EINVALID_Y_SCALE_FACTOR*/
- errors[ECONFIG_MDT_MISMATCH] = "Parameter values in config file and MDT file do not match, check log file for more details"; /*183 ECONFIG_MDT_MISMATCH*/
- errors[ENEIGHBOR_INFO_VECTOR_EMPTY] = "Neighbor Info Vector is empty"; /*184 ENEIGHBOR_INFO_VECTOR_EMPTY*/
- errors[ERECO_RESULT_EMPTY] = "Recognize result is empty"; /*185 ERECO_RESULT_EMPTY*/
- errors[ESHAPE_SAMPLE_FEATURES_EMPTY] = "Features of input TraceGroup is empty"; /* 186 ESHAPE_SAMPLE_FEATURES_EMPTY*/
- errors[ENO_TOOLKIT_VERSION] = "Toolkit version missing in the control information"; /* 187 ENO_TOOLKIT_VERSION */
- errors[ETRACE_INDEX_OUT_OF_BOUND] = "Trace index greater than number of traces available. "; /*188 ETRACE_INDEX_OUT_OF_BOUND */
- errors[EINVALID_CFG_FILE_ENTRY] = "Invalid key=value pair in the config file"; /**189 EINVALID_CFG_FILE_ENTRY*/
- errors[EKEY_NOT_FOUND] = "Key could not be found in the config file"; /** 190 EKEY_NOT_FOUND */
- errors[EFEATURE_INDEX_OUT_OF_BOUND] = "feature index out of bounds"; /**191 EFEATURE_INDEX_OUT_OF_BOUND*/
- errors[EINVALID_FILE_HANDLE] = "Invalid file handle"; /**192 EINVALID_FILE_HANDLE*/
- errors[EFEATURE_FILE_OPEN] = "Feature file open error"; /**193 EFEATURE_FILE_OPEN*/
- errors[EFTR_DISTANCE_NOT_DEFINED] = "Distance between the features not defined"; /**194 EFTR_DISTANCE_NOT_DEFINED*/
- errors[EINVALID_CLUSTER_ID] = "Invalid Cluster ID"; /**195 EINVALID_CLUSTER_ID */
- errors[EPROTOTYPE_SET_EMPTY] = "Prototype set is empty"; /**196 EPROTOTYPE_SET_EMPTY */
- errors[ELOG_FILE_NOT_EXIST] = "Log file does not exist"; /**197 ELOG_FILE_NOT_EXIST */
- errors[EDATA_HYPERLINK_VEC_SIZE_MISMATCH] = "Size of the data objects vector and their corresponding hyperlinks vector do not match"; /**198 EDATA_HYPERLINK_VEC_SIZE_MISMATCH*/
- errors[EFILE_CREATION_FAILED] = "File creation failed. Invalid path or no permission."; /**199 EFILE_CREATION_FAILED*/
- errors[EINVALID_NUM_CLUSTERS] = "Invalid number of clusters specified. The number must be greater than or equal to 1 and less than number of data objects."; /**200 EINVALID_NUM_CLUSTERS*/
- errors[ENO_DATA_TO_CLUSTER] = "No elements in the input data vector for clustering."; /**201 ENO_DATA_TO_CLUSTER*/
- errors[EINSUFFICIENT_DATA_FOR_LMETHOD] = "Minimum 6 data objects are required to employ LMethod."; /**202 EINSUFFICIENT_DATA_FOR_LMETHOD*/
- errors[EMODULE_NOT_IN_MEMORY] = "Module index not found in module vector"; /**203 EMODULE_NOT_IN_MEMORY */
- errors[EINVALID_LOG_FILENAME] = "Specified Log filename is empty"; /**204 EINVALID_LOG_FILENAME */
- errors[ECREATE_LOGGER] = "Error creating logger"; /**205 ECREATE_LOGGER */
- errors[EINVALID_PROJECT_TYPE] = "Project type in CFG is missing or an invalid value"; /**206 EINVALID_PROJECT_TYPE*/
- errors[EEMPTY_STRING] = "Empty string"; /**207 EEMPTY_STRING*/
- errors[EEMPTY_VECTOR] = "Empty vector"; /**208 EEMPTY_VECTOR*/
- errors[ENON_POSITIVE_NUM] = "Negative or zero value"; /**209 ENON_POSITIVE_NUM*/
- errors[EEMPTY_WORDREC_RESULTS] = "The word recogniton result vector is empty"; /**210 EEMPTY_WORDREC_RESULTS*/
- errors[ENEGATIVE_NUM] = "Negative value";/**211 ENEGATIVE_NUM*/
- errors[EINVALID_CLASS_ID] = "Invalid Class ID"; /**212 EINVALID_CLASS_ID*/
- errors[EINVALID_CONFIDENCE_VALUE] = "Invalid Confidence Value"; /** 213 EINVALID_CONFIDENCE_VALUE*/
- errors[ENO_SHAPE_RECO_PROJECT] = "Shape Recognizer Project name missing in the word recognizer config file."; /**214 ENO_SHAPE_RECO_PROJECT*/
- errors[EINVALID_RECOGNITION_MODE] = "Unsupported recognition mode."; /**215 EINVALID_RECOGNITION_MODE*/
- errors[ELOGGER_LIBRARY_NOT_LOADED] = "Shared library for Logger not loaded";
- errors[ESINGLE_POINT_TRACE] = "Single point trace"; /**217 ESINGLE_POINT_TRACE*/
-
- errors[EADAPTSCHEME_NOT_SUPPORTED] = "AdaptScheme not supported:"; /**229 EADAPTSCHEME_NOT_SUPPORTED **/
-}
-/**********************************************************************************
-* AUTHOR : Vijayakumara M
-* DATE : 01-Sept-2005
-* NAME : getError
-* DESCRIPTION : returns the error descriptions from the errors Table.
-* ARGUMENTS : error code.
-* RETURNS : returns pointer to an error description
-* NOTES :
-* CHANGE HISTORY
-* Author Date Description of change
-*************************************************************************************/
-string getErrorMessage(int errorCode)
-{
- initErrorCode();
- string errorDiscrip = errors[errorCode];
- if(errorDiscrip.empty())
- {
- return "Error code is not set";
- }
-
- return errorDiscrip;
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.h
deleted file mode 100644
index eac0224b..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKErrors.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-02-08 11:00:11 +0530 (Tue, 08 Feb 2011) $
- * $Revision: 832 $
- * $Author: dineshm $
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: getError function declaration.
- *
- * CONTENTS:
- *
- * AUTHOR: Vijayakumara M.
- *
- * DATE: Sept 01, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#ifndef _LTK_ERRORS_H__
-#define _LTK_ERRORS_H__
-
-#include "LTKInc.h"
-
-//extern int errorCode; // Error code, which will set for the error occurence.
-
-
-/**
- * This method returns error description corresponding to the error code.
- *
- * @param error code, the integer value for an error.
- *
- * @return the error description of the error code.
- */
-
-string getErrorMessage(int errorCode);
-
-#endif // #ifndef _LTKERRORS_H__
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKHierarchicalClustering.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKHierarchicalClustering.h
deleted file mode 100644
index 921c6085..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKHierarchicalClustering.h
+++ /dev/null
@@ -1,1592 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Definitions of Agglomerative Hierarchical Clustering module
- *
- * CONTENTS:
- * cluster
- * getProximityMatrix
- * setOutputConfig
- * setHyperlinkMap
- * getClusterResult
- * computeProximityMatrix
- * computeDistances
- * clusterToFindNumClusters
- * getInterObjectDistance
- * findGroup
- * findInterClusterDistance
- * writeClustersAsHTML
- * determineNumOfClusters
- * determineKnee
- * findRMSE
- * computeAvgSil
- *
- *
- * AUTHOR: Bharath A
- *
- * DATE: February 22, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#ifndef __LTKHIERARCHICALCLUSTERING_H
-#define __LTKHIERARCHICALCLUSTERING_H
-
-
-#ifndef _WIN32
-//#include <values.h>
-#endif
-
-#include "LTKInc.h"
-#include "LTKTypes.h"
-#include "LTKLoggerUtil.h"
-#include "LTKException.h"
-#include "LTKErrors.h"
-
-/*Enumerator for stopping criterion to be used*/
-enum ELTKHCStoppingCriterion
-{
- LMETHOD,
- AVG_SIL
-};
-
-/*Enumerator for methods in hierarchical clustering*/
- enum ELTKHCMethod
- {
- SINGLE_LINKAGE,
- COMPLETE_LINKAGE,
- AVERAGE_LINKAGE
- };
-
-#define OUTPUT_HTML_FILE_NAME "output.html"
-#define MIN_CUTOFF 20
-
-/**
- * @class LTKHierarchicalClustering
- * <p> This class does agglomerative hierarchical clustering. The data objects
- which could be LTKTrace or LTKTraceGroup, are supplied as a vector.
- Function that defines the distance between two data objects needs to be
- supplied as a function pointer.One of the 3 methods (Single,Average or
- Complete linkage) needs to be selected to define the way inter-cluster
- has to be determined. In case number of clusters is not supplied,
- it is determined using the L-method (default stopping criterion)<p> */
-
-template <class ClusterObjType,class DistanceClass>
-class LTKHierarchicalClustering
-{
-
- private:
-
- //reference to the vector containing the data objects to be clustered
- const vector<ClusterObjType>& m_data;
-
- //triangular matrix containing the pairwise distances between data
- //objects
- float2DVector m_proximityMatrix;
-
- //data structure that stores current (intermediate) state of the
- //clusters
- int2DVector m_intermediateCG;
-
- //vector mapping the data object id and path to the data (unipen) file
- stringVector m_hyperlinksVec;
-
- //contains the number of clusters required
- int m_numOfClusters;
-
- //output file handle to write the cluster results as html
- //with name of the file as OUTPUT_HTML_FILE_NAME
- ofstream m_output;
-
- //flag to indicate whether the output is required as html
- bool m_writeHTML;
-
- //flag to indicate whether to show all levels of the hierarchy in the
- //html file
- bool m_showAllLevels;
-
- //vector to hold merging distance for each number of clusters
- floatVector m_mergingDist;
-
- //flag for determining number of clusters
- bool m_determineClusters;
-
- //output result directory
- string m_outputDir;
-
- //extension of the image corresponding to each data object in
- //order to write in the html
- string m_imageFileExtn;
-
- //Method for defining inter-cluster distance
- ELTKHCMethod m_method;
-
- //number of clusters determined by Average Silhouette method
- int m_numBySil;
-
- //cached clustering result corresponding minimum average silhouette
- int2DVector m_cachedResult;
-
- //stopping criterion selected - LMethod or Average Silhouette
- ELTKHCStoppingCriterion m_stoppingCriterion;
-
- //pointer to the class that has the definition of distance function
- DistanceClass* m_distClassPtr;
-
- //function pointer type of the function that defines inter-object distance
- typedef int (DistanceClass::*FN_PTR_DISTANCE)(const ClusterObjType&,
- const ClusterObjType&,
- float&) ;
-
- //distance function pointer
- FN_PTR_DISTANCE m_distancePtr;
-
-
- public:
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : LTKHierarchicalClustering
-* DESCRIPTION : Constructor to initialise the required parameters
-* ARGUMENTS : clusterObjects - vector of data objects which could be LKTrace or
-* LTKTraceGroup for HWR
-* noOfClusters - Number of clusters required
-* clusteringMethod - One of the 3 methods:
-* SINGLE_LINKAGE,AVERAGE_LINKAGE
-* or COMPLETE_LINKAGE
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-
-LTKHierarchicalClustering(const vector<ClusterObjType>& clusterObjects,int noOfClusters,
- ELTKHCMethod clusteringMethod=AVERAGE_LINKAGE) :
- m_data(clusterObjects),m_method(clusteringMethod),
- m_numOfClusters(noOfClusters),m_writeHTML(false),
- m_showAllLevels(false),
- m_determineClusters(false)
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,int,ELTKHCMethod)"<<endl;
-
- if(m_numOfClusters < 1 || m_numOfClusters>=clusterObjects.size())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Number of clusters:"<<m_numOfClusters<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINVALID_NUM_CLUSTERS <<":"<< getErrorMessage(EINVALID_NUM_CLUSTERS)
- <<" LTKHierarchicalClustering::"
- <<"LTKHierarchicalClustering(vector<ClusterObjType>,int,ELTKHCMethod)"<<endl;
-
- throw LTKException(EINVALID_NUM_CLUSTERS);
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,int,ELTKHCMethod)"<<endl;
-
-}
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : LTKHierarchicalClustering
-* DESCRIPTION : Constructor to initialise the required parameters.
-* Number of clusters is determined by L-method
-* ARGUMENTS : clusterObjects - vector of data objects which could be LKTrace or
-* LTKTraceGroup for HWR
-* clusteringMethod - One of the 3 methods:
-* SINGLE_LINKAGE,AVERAGE_LINKAGE
-* or COMPLETE_LINKAGE
-* stoppingCriterion - stopping criterion to determine the
-* right set of clusters: LMETHOD or AVG_SIL
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-
-LTKHierarchicalClustering(const vector<ClusterObjType>& clusterObjects,
- ELTKHCMethod clusteringMethod=AVERAGE_LINKAGE,
- ELTKHCStoppingCriterion stoppingCriterion=LMETHOD) :
- m_data(clusterObjects),
- m_method(clusteringMethod),
- m_stoppingCriterion(stoppingCriterion),
- m_writeHTML(false),
- m_showAllLevels(false),
- m_determineClusters(true)
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,ELTKHCMethod,ELTKHCStoppingCriterion)"<<endl;
-
- if(clusterObjects.size()==0)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Number of elements in clusterObjects vector is zero"<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< ENO_DATA_TO_CLUSTER <<":"<< getErrorMessage(ENO_DATA_TO_CLUSTER)
- <<" LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,ELTKHCMethod,ELTKHCStoppingCriterion)"<<endl;
-
-
- throw LTKException(ENO_DATA_TO_CLUSTER);
- }
-
- if(clusterObjects.size() < 6 && stoppingCriterion == LMETHOD)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Number of elements in clusterObjects vector is:"
- <<clusterObjects.size()<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINSUFFICIENT_DATA_FOR_LMETHOD
- <<":"<< getErrorMessage(EINSUFFICIENT_DATA_FOR_LMETHOD)
- <<" LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,ELTKHCMethod,ELTKHCStoppingCriterion)"<<endl;
-
- throw LTKException(EINSUFFICIENT_DATA_FOR_LMETHOD);
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::LTKHierarchicalClustering"
- <<"(vector<ClusterObjType>,ELTKHCMethod,ELTKHCStoppingCriterion)"<<endl;
-
-}
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : cluster
-* DESCRIPTION : Clusters the input data objects. The number of clusters is determined
-* based on the stopping criterion or as specified by the user.
-* ARGUMENTS : distanceClassPtr - pointer to the class that contains the distance
-* function defintion
-* distFuncPtr - distance function pointer
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int cluster(DistanceClass* distanceClassPtr,FN_PTR_DISTANCE distFuncPtr)
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::cluster()"<<endl;
-
-
- m_distancePtr=distFuncPtr;
-
- m_distClassPtr=distanceClassPtr;
-
-
- //To compute inter-object distances
- int errorCode = computeDistances();
-
- if (errorCode != SUCCESS )
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKHierarchicalClustering::cluster()"<<endl;
-
- LTKReturnError(errorCode)
- }
-
- //if the user has specified the number of clusters
- if(!m_determineClusters)
- {
- clusterToFindNumClusters();
- }
- else
- {
- m_numOfClusters=1;
-
- //clustering to determine the number of
- //clusters vs merging distance curve
- clusterToFindNumClusters();
-
- m_determineClusters=false;
-
- if(m_stoppingCriterion==LMETHOD)
- {
- //Number of clusters determined by L-method
- m_numOfClusters=determineNumOfClusters();
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)
- <<"Number of clusters determined using L-Method"
- <<m_numOfClusters<<endl;
-
- }
- else if(m_stoppingCriterion==AVG_SIL)
- {
-
- //Number of clusters determined by silhouette method
- m_numOfClusters=m_numBySil;
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)
- <<"Number of clusters determined using Average Silhouette method"
- <<m_numOfClusters<<endl;
-
- }
-
- //clearing intermediate clusters formed during evaluation
- //of the stopping criterion
- m_intermediateCG.clear();
-
- //clustering to the number of clusters determined
- //by the stopping criterion
- clusterToFindNumClusters();
-
- }
-
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::cluster()"<<endl;
- return SUCCESS;
-
-}
-
-
-
-/**********************************************************************************
-* AUTHOR : Dinesh M
-* DATE : 23-Jan-2006
-* NAME : getProximityMatrix
-* DESCRIPTION : returns the distance matrix
-* ARGUMENTS :
-* RETURNS : proximity matrix (float2DVector)
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-const float2DVector& getProximityMatrix() const
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::getProximityMatrix()"<<endl;
-
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::getProximityMatrix()"<<endl;
-
- return m_proximityMatrix;
-}
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : setOutputConfig
-* DESCRIPTION : This function sets the configuration for the output of clustering.
-* ARGUMENTS : outputDirectory - path to the directory where output html
-* is to be generated
-* displayAllLevels - flag to indicate whether all levels in the
-* clustering need to written to the file
-* imageFileExtension - extension of the image file (ex)"png".
-* If not specified <img> tag in the output html is not created.
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-//int setOutputConfig(const string& outputDirectory,
-// bool displayAllLevels=false,
-// string imageFileExtension="")
-int setOutputConfig(const string& outputDirectory,bool displayAllLevels=false,
- const string& imageFileExtension="")
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::setOutputConfig()"<<endl;
-
- m_writeHTML=true;
-
- m_showAllLevels=displayAllLevels;
-
- string tempOutputFilePath=outputDirectory+"/"+OUTPUT_HTML_FILE_NAME;
-
- m_output.open(tempOutputFilePath.c_str());
-
- if(m_output.fail())
- {
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Unable to create file:"
- <<tempOutputFilePath<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EFILE_CREATION_FAILED <<":"
- <<getErrorMessage(EFILE_CREATION_FAILED)
- <<" LTKHierarchicalClustering::setOutputConfig()" <<endl;
-
- LTKReturnError(EFILE_CREATION_FAILED)
- }
-
- m_outputDir=outputDirectory;
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)
- <<"Clustering results output directory:"
- <<m_outputDir<<endl;
-
- m_output.close();
-
- //If it takes the default value, <img> tag in the output is not generated
- m_imageFileExtn=imageFileExtension;
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)
- <<"Image file extension:"<<m_imageFileExtn<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::setOutputConfig()"<<endl;
-
- return SUCCESS;
-}
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : setHyperlinkMap
-* DESCRIPTION : To set hyperlinks for each data object which refers to actual data file.
-* Assumes one-to-one correspondence with the data vector
-* passed in the constructor.
-* ARGUMENTS : hyperlinksVector - Vector containing paths to physical
-* files of each data object.
-*
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-//int setHyperlinkMap(const vector<string>& hyperlinksVector)
-int setHyperlinkMap(const vector<string>& hyperlinksVector)
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::setHyperlinkMap()"<<endl;
-
- if(m_data.size()!=hyperlinksVector.size())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"cluster objects vector size:"<<m_data.size()
- <<" and hyperlinks vector size:"<<hyperlinksVector.size()<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EDATA_HYPERLINK_VEC_SIZE_MISMATCH
- <<":"<< getErrorMessage(EDATA_HYPERLINK_VEC_SIZE_MISMATCH)
- <<" LTKHierarchicalClustering::setHyperlinkMap()" <<endl;
-
- LTKReturnError(EDATA_HYPERLINK_VEC_SIZE_MISMATCH);
- }
-
- m_hyperlinksVec=hyperlinksVector; //Vector for hyperlinks is set
-
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::setHyperlinkMap()"<<endl;
-
- return SUCCESS;
-
-}
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : getClusterResult
-* DESCRIPTION : Populates the argument (vector of vectors) with data objects indices.
-* Each row (inner vector) corresponds to a cluster.
-* ARGUMENTS : outClusterResult - reference to result vector of vectors.
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-void getClusterResult(vector<vector<int> >& outClusterResult) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::getClusterResult()"<<endl;
-
- for(int v=0;v<m_intermediateCG.size();v++)
- {
-
- outClusterResult.push_back(m_intermediateCG[v]);
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::getClusterResult()"<<endl;
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : computeProximityMatrix
-* DESCRIPTION : Populates the argument (vector of vectors) with data objects indices.
-* Each inner vector corresponds to a cluster.
-* ARGUMENTS : distanceClassPtr - pointer to the class that has the distance definition
-* distFuncPtr - function pointer to the distance function
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-//void computeProximityMatrix(ComputeDistanceFunc computeDistFuncObj)
-int computeProximityMatrix(DistanceClass* distanceClassPtr,
- FN_PTR_DISTANCE distFuncPtr)
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::computeProximityMatrix()"<<endl;
-
- m_distancePtr=distFuncPtr;
- m_distClassPtr=distanceClassPtr;
-
- int errorCode;
-
- if((errorCode=computeDistances())!=SUCCESS)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKHierarchicalClustering::computeProximityMatrix()"<<endl;
-
- LTKReturnError(errorCode);
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::computeProximityMatrix()"<<endl;
-
- return SUCCESS;
-}
-
-
-
-private:
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : computeDistances
-* DESCRIPTION : Computes inter-object distances and puts them in the distance matrix
-* ARGUMENTS :
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int computeDistances()
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::computeDistances()"<<endl;
-
- for(int i=0;i<(m_data.size()-1);++i)
- {
- vector<float> eachRow((m_data.size()-i)-1);//added -1 at the end
-
- int c=0;
-
- for(int j=i+1;j<m_data.size();++j)
- {
- //external distance function called
- int errorCode = (m_distClassPtr->*m_distancePtr)(m_data[i],m_data[j], eachRow[c]);
-
- if (errorCode != SUCCESS )
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error while calling distance function"<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKHierarchicalClustering::computeDistances()"<<endl;
-
- LTKReturnError(errorCode);
- }
-
- ++c;
-
- }
-
- m_proximityMatrix.push_back(eachRow);
-
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::computeDistances()"<<endl;
-
- return SUCCESS;
-
-}
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : clusterToFindNumClusters
-* DESCRIPTION : Clusters the data objects hierarchically (agglomerative)
-* till the desired number of
-* clusters and also evaluates the stopping criterion selected.
-* ARGUMENTS :
-* RETURNS : error code
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int clusterToFindNumClusters()
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::clusterToFindNumClusters()"<<endl;
-
- if(m_stoppingCriterion==LMETHOD)
- {
- //Number of clusters needs to be determined
- if(m_determineClusters)
- {
- //map for number of clusters vs. merging distance
- m_mergingDist.reserve(m_data.size());
- }
- }
- else if(m_stoppingCriterion==AVG_SIL)
- {
- if(m_writeHTML==false && m_cachedResult.size()>0)
- {
- m_intermediateCG=m_cachedResult;
-
- return SUCCESS;
- }
- }
-
- for(int i=0;i<m_data.size();i++)
- {
- vector<int> v;
- v.push_back(i);
-
- //To begin with, each data object is cluster by itself
- m_intermediateCG.push_back(v);
- }
-
- if(m_writeHTML) //If output is needed as html
- {
- string outputFilePath=m_outputDir+"/"+OUTPUT_HTML_FILE_NAME;
-
- m_output.open(outputFilePath.c_str()); //Cluster output file is created
-
- if(m_output.fail())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Unable to create file:"
- <<outputFilePath<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EFILE_CREATION_FAILED
- <<":"<< getErrorMessage(EFILE_CREATION_FAILED)
- <<" LTKHierarchicalClustering::clusterToFindNumClusters()" <<endl;
-
- LTKReturnError(EFILE_CREATION_FAILED);
- }
-
- /*Html tags are written*/
- m_output<<"<html>\n";
- m_output<<"<body>\n";
- m_output<<"<table border='1' bordercolor='black'>\n";
-
-
- m_output<<"<tr>\n";
-
-
- for(int v=0;v<m_intermediateCG.size();v++)
- {
-
- int clusterSize=m_intermediateCG[v].size();
-
- m_output<<"<td colspan=\""<<clusterSize<<"\">";
-
- for(int w=0;w<clusterSize;w++)
- {
- if(m_hyperlinksVec.size()>0)
- {
- m_output<<"<a href='"
- <<m_hyperlinksVec[m_intermediateCG[v][w]]
- <<"'>"<<m_intermediateCG[v][w]<<"</a>&nbsp;";
- }
- else
- {
- m_output<<m_intermediateCG[v][w]<<"&nbsp;";
- }
-
- //if there is an image file corresponding to each data object
- if(!m_imageFileExtn.empty())
- {
- m_output<<"<img src=\""
- <<m_intermediateCG[v][w]<<"."<<m_imageFileExtn
- <<"\" border=\"0\"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
- }
-
-
- }
- }
-
- m_output<<"<td><b>";
- m_output<<"Inter-cluster Dist";
- m_output<<"</b></td>";
-
- m_output<<"</tr>\n";
-
- }
-
- if(m_numOfClusters<m_data.size() || m_determineClusters==true)
- {
-
- int currNumOfClusters = m_data.size();
-
- //this local variable is used only for Average Silhouette method
- float minSil=FLT_MAX;
-
-
- for(int it=0;it<(m_data.size()-m_numOfClusters);++it)
- {
- vector<int> toCluster;
-
- //to find the clusters that need to be merged
- float interClusterDistance=findGroup(toCluster);
-
- currNumOfClusters=m_data.size()-it-1;
-
- if(m_stoppingCriterion==AVG_SIL)
- {
- float silDiff=computeAvgSil(toCluster[0],toCluster[1]);
-
- if(silDiff<minSil)
- {
- minSil=silDiff;
- if(currNumOfClusters > 2)
- {
- m_numBySil=currNumOfClusters+1;
- m_cachedResult=m_intermediateCG;
- }
-
- }
- }
- else if(m_stoppingCriterion==LMETHOD && m_determineClusters==true)
- {
- m_mergingDist[currNumOfClusters]=interClusterDistance;
- }
-
-
- //clusters are merged
- m_intermediateCG[toCluster[0]].insert(m_intermediateCG[toCluster[0]].end(),
- m_intermediateCG[toCluster[1]].begin(),
- m_intermediateCG[toCluster[1]].end());
-
- //old cluster deleted
- m_intermediateCG.erase(m_intermediateCG.begin()+ toCluster[1]);
-
-
-
- if(m_writeHTML)
- {
- if(!m_showAllLevels)
- {
- if(currNumOfClusters==m_numOfClusters)
- {
- writeClustersAsHTML(interClusterDistance);
- }
- }
- else
- {
- writeClustersAsHTML(interClusterDistance);
- }
-
- }
-
-
- }
-
-
- }
-
-
- //closing the html tags
- if(m_writeHTML)
- {
- m_output<<"</table>\n";
- m_output<<"</body>\n";
- m_output<<"</html>";
-
- m_output.close();
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::clusterToFindNumClusters()"<<endl;
-
- return SUCCESS;
-
-}
-
-
-
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : getInterObjectDistance
-* DESCRIPTION : Returns the distance between two data objects from the distance matrix
-* ARGUMENTS : firstObjIndex - index of the first data object
-* secondObjIndex - index of the second data object
-* RETURNS : distance (float)
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-float getInterObjectDistance(int firstObjIndex,int secondObjIndex) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::getInterObjectDistance()"<<endl;
-
- int row = 0;
- int col = 0;
-
- if(firstObjIndex < secondObjIndex)
- {
- row=firstObjIndex;
- col=secondObjIndex;
- }
- else
- {
- row=secondObjIndex;
- col=firstObjIndex;
- } //lesser index is made as row and the other as column
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::getInterObjectDistance()"<<endl;
-
- return m_proximityMatrix[row][col-row-1];
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : findGroup
-* DESCRIPTION : Finds the indices in the m_intermediateCG (clusters) that
-* need to be merged
-* ARGUMENTS : pairToCombine - vector for storing the cluster indices
-* RETURNS : inter cluster distance (float)
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-//double findGroup(vector<int> pairToCombine)
-float findGroup(vector<int>& pairToCombine) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::findGroup()"<<endl;
-
- float minDistance=FLT_MAX;
-
- pairToCombine.clear();
-
- pairToCombine.resize(2);
-
- for(int i=0;i<m_intermediateCG.size();i++)
- {
- for(int j=i+1;j<m_intermediateCG.size();j++)
- {
- float tempDist=findInterClusterDistance(m_intermediateCG[i],
- m_intermediateCG[j]);
-
- if(tempDist<minDistance)
- {
-
- minDistance=tempDist;
- pairToCombine[0]=i;
- pairToCombine[1]=j;
- }
- }
-
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::findGroup()"<<endl;
-
-
- return minDistance;
-
-}
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : findInterClusterDistance
-* DESCRIPTION : Finds the inter-cluster distance.
-* The contents of each cluster are in the vectors.
-* ARGUMENTS : v1 cluster one
-* v2 cluster two
-* RETURNS : inter cluster distance
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-//double findInterClusterDistance(const vector<int>& v1,const vector<int>& v2)
-float findInterClusterDistance(const vector<int>& cluster1, const vector<int>& cluster2) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::findInterClusterDistance()"<<endl;
-
- float groupDistance=0.0;
-
- /*For single-linkage algorithm*/
- if(m_method==SINGLE_LINKAGE)
- {
- groupDistance= FLT_MAX;
-
- for(int i=0;i<cluster1.size();i++)
- {
- for(int j=0;j<cluster2.size();j++)
- {
- float temp=getInterObjectDistance(cluster1[i],cluster2[j]);
-
- if(temp < groupDistance)
- {
- groupDistance=temp;
- }
- }
- }
- }
-
-
- /*For average-linkage algorithm*/
- if(m_method==AVERAGE_LINKAGE)
- {
- groupDistance=0.0;
-
- for(int i=0;i<cluster1.size();i++)
- {
- for(int j=0;j<cluster2.size();j++)
- {
-
- groupDistance+=getInterObjectDistance(cluster1[i],cluster2[j]);
- }
- }
-
- groupDistance/=((float)(cluster1.size()*cluster2.size()));
- }
-
-
- /*For complete-linkage algorithm*/
- if(m_method==COMPLETE_LINKAGE)
- {
- groupDistance=0.0;
-
- for(int i=0;i<cluster1.size();i++)
- {
- for(int j=0;j<cluster2.size();j++)
- {
- float temp=getInterObjectDistance(cluster1[i],cluster2[j]);
-
- if(temp > groupDistance)
- {
- groupDistance=temp;
- }
- }
- }
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::findInterClusterDistance()"<<endl;
-
-
- return groupDistance;
-
-
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : writeClustersAsHTML
-* DESCRIPTION : Writes the cluster results as html with data objects' and clusters' ids.
-* If hyperlinks vector is set, provides links to actual files.
-* ARGUMENTS : interClustDist - merging distance of the new cluster formed
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-void writeClustersAsHTML(float interClustDist)
-{
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::writeClustersAsHTML()"<<endl;
-
- m_output<<"<tr>\n";
-
- for(int v=0;v<m_intermediateCG.size();v++)
- {
- int clusterSize=m_intermediateCG[v].size();
-
- m_output<<"<td colspan=\""<<clusterSize<<"\">";
-
- m_output<<"("<<v<<")<br>";
-
- for(int w=0;w<clusterSize;w++)
- {
- if(m_hyperlinksVec.size()>0)
- {
- m_output<<"<a href='"<<m_hyperlinksVec[m_intermediateCG[v][w]]
- <<"'>"<<m_intermediateCG[v][w]<<"</a>&nbsp;";
- }
- else
- {
- m_output<<m_intermediateCG[v][w]<<"&nbsp;";
- }
- if(!m_imageFileExtn.empty())
- {
- m_output<<"<img src=\""<<m_intermediateCG[v][w]<<"."
- <<m_imageFileExtn
- <<"\" border=\"0\"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
- }
-
- }
- }
-
- m_output<<"<td>";
-
- m_output<<"("<<m_intermediateCG.size()
- <<")&nbsp;&nbsp;&nbsp;<b>"<<interClustDist<<"</b>";
-
- m_output<<"</td>";
-
- m_output<<"</tr>\n";
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::writeClustersAsHTML()"<<endl;
-
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : determineNumOfClusters
-* DESCRIPTION : Determines the number of clusters to be formed using
-* iterative refinement of L-method.
-* REFERENCE:S. Salvador and P. Chan. Determining the number of clusters/
-* segments in hierarchical clustering/segmentation algorithms.
-* Proceedings of 16th IEEE International Conference
-* on Tools with Artificial Intelligence, 3:1852-1857, 2004.
-* ARGUMENTS :
-* RETURNS : number of clusters
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int determineNumOfClusters() const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::determineNumOfClusters()"<<endl;
-
- int cutOff=(int)m_mergingDist.capacity()-1;
-
- int lastKnee=0;
- int currentKnee=0;
-
- lastKnee=cutOff;
-
- currentKnee=lastKnee;
-
- bool trueCutOff=false;
-
- /*Iterative refinement of the L-method result*/
-
- while(true)
- {
-
- lastKnee=currentKnee;
-
- currentKnee=determineKnee(cutOff);
-
- if(trueCutOff)
- {
-
- if(currentKnee >= lastKnee)
- {
-
- break;
- }
- }
-
- int temp=currentKnee*2;
-
- if(temp>cutOff)
- {
- --cutOff;
-
- trueCutOff=false;
- }
- else
- {
- cutOff=temp;
-
- trueCutOff=true;
- }
-
-
- if(cutOff < MIN_CUTOFF)
- {
-
- break;
- }
-
-
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)
- <<"Number of clusters determined by iterative refinement:"
- <<currentKnee<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::determineNumOfClusters()"<<endl;
-
- return currentKnee;
-}
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : determineKnee
-* DESCRIPTION : Determines the knee of the given number of clusters vs. merging distance curve
-* ARGUMENTS : maxNumClusters - maximum number of clusters
-* RETURNS : knee point of the curve
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int determineKnee(int maxNumClusters) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::determineKnee()"<<endl;
-
- int result=0;
-
- float minRMSE = FLT_MAX;
-
- //atleast two points are required to fit lines, hence c ranges
- //from 3 to maxNumClusters-2
- for(int c=3;c<maxNumClusters-2;c++)
- {
-
- float lRMSE=0,rRMSE=0;
-
- findRMSE(c,maxNumClusters,lRMSE,rRMSE);
-
- float cRMSE=(((float)(c-1)/(float)(maxNumClusters-1))*lRMSE)
- +(((float)(maxNumClusters-c)/(float)(maxNumClusters-1))*rRMSE);
-
- if(cRMSE<minRMSE)
- {
-
- minRMSE=cRMSE;
-
- result=c;
- }
- }
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::determineKnee()"<<endl;
-
- return result+1;
-}
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : determineKnee
-* DESCRIPTION : Determines left and right RMSE values of the given point
-* on the no. of clusters vs. merging distance curve.
-* It fits two regression lines on either side of the point to find RMSEs
-* ARGUMENTS : candidateKnee - candidata knee point
-* maxNumClusters - upper bound on number of clusters
-* lRMSE - output RMSE on the left of c
-* rRMSE - output RMSE on the right of c
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-void findRMSE(int candidateKnee,int maxNumClusters,float& outLRMSE,float& outRRMSE) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::findRMSE()"<<endl;
-
- float avgXLeft = 0;
- float avgYLeft = 0;
- float avgXRight = 0;
- float avgYRight = 0;
-
- /*Regression line coefficients*/
- float beta0Left = 0;
- float beta1Left = 0;
- float beta0Right = 0;
- float beta1Right = 0;
-
- int i = 0;
- int j = 0;
-
- for(i=2;i<=candidateKnee;i++)
- {
- avgYLeft+=m_mergingDist[i];
-
- avgXLeft+=i;
- }
-
-
- avgYLeft /= (candidateKnee-1);
- avgXLeft /= (candidateKnee-1);
-
-
- for(j=candidateKnee+1;j<=maxNumClusters;j++)
- {
-
- avgYRight += m_mergingDist[j];
- avgXRight += j;
- }
-
- avgYRight /= (maxNumClusters-candidateKnee);
- avgXRight /= (maxNumClusters-candidateKnee);
-
- float numer=0;
- float denom=0;
-
- for(i=2;i<=candidateKnee;i++)
- {
-
- numer += ((i-avgXLeft)*(m_mergingDist[i]-avgYLeft));
- denom += ((i-avgXLeft)*(i-avgXLeft));
- }
-
- beta1Left = numer/denom;
- beta0Left = avgYLeft-(beta1Left*avgXLeft);
-
- numer=0;denom=0;
-
- for(j=candidateKnee+1;j<=maxNumClusters;j++)
- {
- numer += ((j-avgXRight)*(m_mergingDist[j]-avgYRight));
- denom += ((j-avgXRight)*(j-avgXRight));
- }
-
- if(denom > EPS)
- {
- beta1Right = numer / denom;
- }
- else
- {
- beta1Right = 0;
- }
-
- beta0Right = avgYRight-(beta1Right*avgXRight);
-
- float errorSOS=0;
-
- for(i=2;i<=candidateKnee;i++)
- {
-
- float yCap = (beta0Left+(beta1Left*i));
-
- errorSOS += ((m_mergingDist[i]-yCap)*(m_mergingDist[i]-yCap));
-
- }
-
- outLRMSE=sqrt(errorSOS/(candidateKnee-2));
-
- errorSOS=0;
-
- for(j=candidateKnee+1;j<=maxNumClusters;j++)
- {
-
- float yCap = beta0Right + (beta1Right*j);
-
- errorSOS += (m_mergingDist[j]-yCap)*(m_mergingDist[j]-yCap);
-
- }
-
- outRRMSE=sqrt(errorSOS/(maxNumClusters-candidateKnee-1));
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::findRMSE()"<<endl;
-
-}
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : computeAvgSil
-* DESCRIPTION : Funtion that determines the change in the ratio of
-* intra and inter cluster similarity before and after merging
-* ARGUMENTS : clust1Index - index of cluster one
-* clust2Index - index of cluster two
-* RETURNS : average silhouette computed
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-float computeAvgSil(int clust1Index,int clust2Index) const
-{
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Entering: "
- <<"LTKHierarchicalClustering::computeAvgSil()"<<endl;
-
- const vector<int>& clust1=m_intermediateCG[clust1Index];
-
- const vector<int>& clust2=m_intermediateCG[clust2Index];
-
- vector<int> combinedClust;
-
- combinedClust.insert(combinedClust.end(),clust1.begin(),clust1.end());
-
- combinedClust.insert(combinedClust.end(),clust2.begin(),clust2.end());
-
- float clust1TotalSils=0.0f,clust2TotalSils=0.0f,combinedClustTotalSils=0.0f;
-
- for(int i=0;i<clust1.size();i++)
- {
- int dataObj=clust1[i];
-
- float avgIntraDist=0.0;
-
- if(clust1.size()>1)
- {
- for(int j=0;j<clust1.size();j++)
- {
- if(clust1[j]!=dataObj)
- {
- avgIntraDist+=getInterObjectDistance(dataObj,clust1[j]);
-
- }
- }
-
- avgIntraDist/=((float)(clust1.size()-1));
- }
-
- float minInterDist= FLT_MAX;
-
- for(int r=0;r<m_intermediateCG.size();r++)
- {
- float avgInterDist=0.0;
-
- if(r!=clust1Index)
- {
- for(int c=0;c<m_intermediateCG[r].size();c++)
- {
- avgInterDist+=getInterObjectDistance(dataObj,m_intermediateCG[r][c]);
- }
-
- avgInterDist/=((float)m_intermediateCG[r].size());
-
- if(avgInterDist<minInterDist)
- {
- minInterDist=avgInterDist;
- }
- }
-
- }
-
- float dataObjSil=0.0;
-
- if(minInterDist > avgIntraDist && minInterDist > EPS)
- {
-
- dataObjSil=(minInterDist-avgIntraDist)/minInterDist;
-
- }
- else if(avgIntraDist > EPS)
- {
-
- dataObjSil=(minInterDist-avgIntraDist)/avgIntraDist;
-
- }
-
- clust1TotalSils+=dataObjSil;
- }
-
- for(int ii=0;ii<clust2.size();ii++)
- {
- int dataObj=clust2[ii];
-
- float avgIntraDist=0.0;
-
- if(clust2.size()>1)
- {
- for(int j=0;j<clust2.size();j++)
- {
- if(clust2[j]!=dataObj)
- {
-
- avgIntraDist+=getInterObjectDistance(dataObj,clust2[j]);
-
- }
- }
-
- avgIntraDist/=((float)(clust2.size()-1));
- }
-
- float minInterDist= FLT_MAX;
-
- for(int r=0;r<m_intermediateCG.size();r++)
- {
- float avgInterDist=0.0;
-
- if(r!=clust2Index)
- {
- for(int c=0;c<m_intermediateCG[r].size();c++)
- {
- avgInterDist+=getInterObjectDistance(dataObj,
- m_intermediateCG[r][c]);
- }
-
- avgInterDist/=((float)m_intermediateCG[r].size());
-
- if(avgInterDist < minInterDist)
- {
- minInterDist=avgInterDist;
- }
- }
-
- }
- float dataObjSil=0.0;
-
- if(minInterDist > avgIntraDist && minInterDist > EPS)
- {
- dataObjSil=(minInterDist-avgIntraDist)/minInterDist;
- }
- else if(avgIntraDist > EPS)
- {
- dataObjSil=(minInterDist-avgIntraDist)/avgIntraDist;
- }
-
- clust2TotalSils+=dataObjSil;
- }
-
-
- for(int iii=0;iii<combinedClust.size();iii++)
- {
- int dataObj=combinedClust[iii];
-
- float avgIntraDist=0.0;
-
- if(combinedClust.size()>1)
- {
- for(int j=0;j<combinedClust.size();j++)
- {
- if(combinedClust[j]!=dataObj)
- {
- avgIntraDist+=getInterObjectDistance(dataObj,combinedClust[j]);
-
- }
- }
- avgIntraDist/=((float)(combinedClust.size()-1));
- }
-
- float minInterDist=FLT_MAX;
-
- for(int r=0;r<m_intermediateCG.size();r++)
- {
-
- if(r!=clust1Index && r!=clust2Index)
- {
- float avgInterDist=0.0f;
-
- for(int c=0;c<m_intermediateCG[r].size();c++)
- {
- avgInterDist+=getInterObjectDistance(dataObj,m_intermediateCG[r][c]);
- }
-
- avgInterDist = (float)avgInterDist/ ((float)m_intermediateCG[r].size());
-
- if(avgInterDist<minInterDist)
- {
- minInterDist=avgInterDist;
-
- }
- }
-
- }
-
- float dataObjSil=0.0;
-
- if(minInterDist>avgIntraDist && minInterDist > EPS)
- {
-
- dataObjSil=(minInterDist-avgIntraDist)/minInterDist;
-
- }
- else if(avgIntraDist > EPS)
- {
-
- dataObjSil=(minInterDist-avgIntraDist)/avgIntraDist;
-
- }
-
- combinedClustTotalSils+=dataObjSil;
- }
-
-
- LOG(LTKLogger::LTK_LOGLEVEL_DEBUG)<<"Exiting: "
- <<"LTKHierarchicalClustering::computeAvgSil()"<<endl;
-
-
- return (combinedClustTotalSils-clust1TotalSils-clust2TotalSils);
-
-}
-
-
-
-};
-#endif
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.cpp
deleted file mode 100644
index 9067ca98..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.cpp
+++ /dev/null
@@ -1,1306 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2007-10-08 22:10:54 +0530 (Mon, 08 Oct 2007) $
- * $Revision: 252 $
- * $Author: bharatha $
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Definitions of Image Writer module
- *
- * CONTENTS:
- * drawLTKTraceGroupToImage
- * drawRawInkFileToImage
- * drawUnipenFileToImage
- * drawUnipenFileToImageWithBB
- * showStartingPoint
- * setColor
- * setAlternateColor
- * setOffstet
- * normalizeSize
- * getBoundingBox
- * findMinXOfTrace
- * findMaxXOfTrace
- * drawPoint
- * drawLine
- * drawRectangle
- * fillRectangle
- * createTraceOrderInTraceGroup
- *
- * AUTHOR: Bharath A
- *
- * DATE: February 22, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKImageWriter.h"
-#include "LTKChannel.h"
-#include "LTKTraceFormat.h"
-#include "LTKTrace.h"
-#include "LTKTraceGroup.h"
-#include "LTKInkFileReader.h"
-#include "LTKCaptureDevice.h"
-#include "LTKPreprocessorInterface.h"
-#include "LTKErrors.h"
-#include "LTKErrorsList.h"
-#include "LTKScreenContext.h"
-#include "LTKLoggerUtil.h"
-
-#include "LTKException.h"
-
-
-using namespace std;
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : LTKImageWriter
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKImageWriter::LTKImageWriter():
-m_width(0),
-m_height(0),
-m_pixels(NULL),
-m_showBB(false),
-m_showSP(false),
-m_red(255),
-m_green(0),
-m_blue(0),
-m_altRed(0),
-m_altGreen(0),
-m_altBlue(255),
-m_offset(0)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- "Entering: LTKImageWriter::LTKImageWriter()" <<endl;
-
- xChannelstr = "X";
- yChannelstr = "Y";
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- "Exiting: LTKImageWriter::LTKImageWriter()" <<endl;
-}
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : ~LTKImageWriter
-* DESCRIPTION : Destructor deletes the pixels array
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- LTKImageWriter::~LTKImageWriter()
- {
- if(m_pixels!=NULL){
- delete [] m_pixels;
- }
-
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawLTKTraceGroupToImage
-* DESCRIPTION : The function draws LTKTraceGroup to image file with specified width,height,color and offset.
- If offset not equal to zero, the image would be in the trace order.
-* ARGUMENTS :
-* traceGroup the trace group that is to be drawn
-* imgFileName name of the file that is to be created to draw the image
-* imgWidth width of the image
-* imgHeight height of the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup,
- const string imgFileName,int imgWidth,int imgHeight)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawLTKTraceGroupToImage()" << endl;
-
- m_width=imgWidth+5;
- m_height=imgHeight+5;
- delete [] m_pixels;
- m_pixels=new unsigned char[3*m_width*m_height];
-
- for(int c=0;c<(3*m_width*m_height);c++)
- {
- m_pixels[c]=0xff;
- }
-
- LTKTraceGroup normTraceGroup;
-
- if(m_offset)
- {
- createTraceOrderInTraceGroup(traceGroup,normTraceGroup);
-
- }
- else
- {
- normTraceGroup=traceGroup;
- }
-
- normTraceGroup.getBoundingBox(m_xMin,m_yMin,m_xMax,m_yMax);
- float newXScaleFactor = (float) imgWidth/((float)(m_xMax-m_xMin)/normTraceGroup.getXScaleFactor());
-
- float newYScaleFactor = (float)imgHeight / (float) ((m_yMax-m_yMin)/normTraceGroup.getYScaleFactor());
-
- float origin = 0;
-
- normTraceGroup.affineTransform(newXScaleFactor,newYScaleFactor,origin,origin,XMIN_YMIN);
-
- int numOfTracesToDraw=normTraceGroup.getNumTraces();
-
- if(m_showBB)
- {
- numOfTracesToDraw = normTraceGroup.getNumTraces() - 1;
-
- LTKTrace trace ;
- normTraceGroup.getTraceAt(numOfTracesToDraw, trace);
-
- for(int j=1; j< trace.getNumberOfPoints(); j++)
- {
- floatVector fromPoint, toPoint;
-
- trace.getPointAt(j-1, fromPoint);
-
- trace.getPointAt(j, toPoint);
-
- drawLine((int)fromPoint[0]+2, (int)fromPoint[1]+2,
- (int)toPoint[0]+2, (int)toPoint[1]+2, 255, 255, 0);
- }
- }
-
-
- for(int i=0;i<numOfTracesToDraw;i++)
- {
- LTKTrace trace;
-
- normTraceGroup.getTraceAt(i, trace);
-
- for(int j=1 ; j < trace.getNumberOfPoints() ; j++)
- {
- floatVector fromPoint, toPoint;
-
- trace.getPointAt(j-1, fromPoint);
-
- trace.getPointAt(j, toPoint);
-
- if((i%2)==0)
- {
- if(j == 1)
- {
- if(m_showSP)
- {
- drawRectangle((int)fromPoint[0]+2-2,(int)fromPoint[1]+2+2,(int)fromPoint[0]+2+2,(int)fromPoint[1]+2-2,0,0,0);
-
- }
-
- }
- drawLine((int)fromPoint[0]+2,(int)fromPoint[1]+2,(int)toPoint[0]+2,(int)toPoint[1]+2,m_red,m_green,m_blue);
- }
- else
- {
- if(j==1)
- {
- if(m_showSP)
- {
- drawRectangle((int)fromPoint[0]+2-2,(int)fromPoint[1]+2+2,(int)fromPoint[0]+2+2,(int)fromPoint[1]+2-2,0,0,0);
-
- }
-
- }
- drawLine((int)fromPoint[0]+2,(int)fromPoint[1]+2,(int)toPoint[0]+2,(int)toPoint[1]+2,m_altRed,m_altGreen,m_altBlue);
-
- }
-
- }
-
- }
-
- drawBMPImage(imgFileName,m_pixels,m_width,m_height);
- delete [] m_pixels;
-
- m_pixels=NULL;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawLTKTraceGroupToImage()" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawLTKTraceGroupToImage
-* DESCRIPTION : The function draws LTKTraceGroup to image file with specified color and offset. The width and height would be determined from the trace group. If offset not equal to zero, the image would be in the trace order.
-* ARGUMENTS :
-* traceGroup the trace group that is to be drawn
-* imgFileName name of the file that is to be created to draw the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup,const string imgFileName)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup&,const string)" << endl;
-
-
- traceGroup.getBoundingBox(m_xMin,m_yMin,m_xMax,m_yMax);
-
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName,(int)(m_xMax-m_xMin),(int)(m_yMax-m_yMin));
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup&,const string)" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawLTKTraceGroupToImage
-* DESCRIPTION : The function draws LTKTraceGroup to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
-* ARGUMENTS :
-* traceGroup the trace group that is to be drawn
-* imgFileName name of the file that is to be created to draw the image
-* size bound on larger dimension
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup,
- const string imgFileName, int size)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup&,const string,size)" << endl;
-
- LTKTraceGroup normTraceGroup = traceGroup;
-
- normTraceGroup.getBoundingBox(m_xMin,m_yMin,m_xMax,m_yMax);
-
- float xScale = ((float)fabs(m_xMax - m_xMin))/normTraceGroup.getXScaleFactor();
-
- float yScale = ((float)fabs(m_yMax - m_yMin))/normTraceGroup.getYScaleFactor();
-
-
- if(yScale > xScale)
- {
- xScale = yScale;
- }
- else
- {
- yScale = xScale;
- }
-
- float xScaleFactor = size / xScale ;
-
- float yScaleFactor = size / yScale;
-
- float origin = 0.0;
-
- normTraceGroup.affineTransform(xScaleFactor,yScaleFactor,origin,origin,XMIN_YMIN);
-
- drawLTKTraceGroupToImage(normTraceGroup,imgFileName);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawLTKTraceGroupToImage(const LTKTraceGroup&,const string,size)" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawLTKTraceGroupToImage
-* DESCRIPTION : The function draws LTKTraceGroup to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.The bounding box of the image is also drawn to show relative position.
-* ARGUMENTS :
-* traceGroup the trace group that is to be drawn
-* screenContext screenContext the reference to screen Context for determining the bounding box
-* imgFileName name of the file that is to be created to draw the image
-* size bound on larger dimension
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawLTKTraceGroupToImageWithBB(const LTKTraceGroup& traceGroup,const LTKScreenContext& screenContext,
- const string imgFileName,int size)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawLTKTraceGroupToImageWithBB()" << endl;
-
- LTKTraceGroup newTG;
- newTG=traceGroup;
- float x1=screenContext.getBboxLeft();
- float y1=screenContext.getBboxBottom();
- float x2=screenContext.getBboxRight();
- float y2=screenContext.getBboxTop();
-
- vector<LTKChannel> channels;
-
- LTKChannel xChannel("X", DT_FLOAT, true);
- LTKChannel yChannel("Y", DT_FLOAT, true);
-
- channels.push_back(xChannel);
- channels.push_back(yChannel);
-
- LTKTraceFormat traceFormat(channels);
-
- LTKTrace trace(traceFormat);
-
- vector<float> point1;
- point1.push_back(x1);
- point1.push_back(y1);
- trace.addPoint(point1);
-
- vector<float> point2;
- point2.push_back(x2);
- point2.push_back(y1);
- trace.addPoint(point2);
-
- vector<float> point3;
- point3.push_back(x2);
- point3.push_back(y2);
- trace.addPoint(point3);
-
- vector<float> point4;
- point4.push_back(x1);
- point4.push_back(y2);
- trace.addPoint(point4);
-
- vector<float> point5;
- point5.push_back(x1);
- point5.push_back(y1);
- trace.addPoint(point5);
-
- newTG.addTrace(trace);
-
- m_showBB=true;
-
- drawLTKTraceGroupToImage(newTG,imgFileName,size);
- m_showBB=false;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawLTKTraceGroupToImageWithBB()" << endl;
- }
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawRawInkFileToImage
-* DESCRIPTION : The function creates LTKTraceGroup from the specified data file and draws it to image file with specified width,height,color and offset. If offset not equal to zero, the image would be in the trace order.
-* ARGUMENTS :
-* fileName path to the datafile
-* imgFileName name of the file that is to be created to draw the image
-* imgWidth width of the image
-* imgHeight height of the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawRawInkFileToImage(const string fileName, const string imgFileName,
- int imgWidth,int imgHeight)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawRawInkFileToImage(const string, const string,int,int)" << endl;
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(fileName);
- try
- {
- LTKInkFileReader::readRawInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawRawInkFileToImage(const string, const string,int,int)" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName,imgWidth,imgHeight);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawRawInkFileToImage(const string, const string,int,int)" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawRawInkFileToImage
-* DESCRIPTION : The function creates LTKTraceGroup from the specified data file and draws it to image file with specified color and offset. The width and height would be determined from the trace group.
-* ARGUMENTS :
-* fileName path to the datafile
-* imgFileName name of the file that is to be created to draw the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawRawInkFileToImage(const string fileName, const string imgFileName)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawRawInkFileToImage(const string, const string)" << endl;
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(fileName);
-
- try
- {
- LTKInkFileReader::readRawInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawRawInkFileToImage(const string, const string)" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawRawInkFileToImage(const string, const string)" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawRawInkFileToImage
-* DESCRIPTION : The function draws LTKTraceGroup to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
-* ARGUMENTS :
-* fileName path to the data file
-* imgFileName name of the file that is to be created to draw the image
-* size bound on larger dimension
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawRawInkFileToImage(const string fileName,const string imgFileName,int size)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawRawInkFileToImage(const string,const string,int)" << endl;
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(fileName);
- try
- {
- LTKInkFileReader::readRawInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawRawInkFileToImage(const string,const string,int)" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName,size);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawRawInkFileToImage(const string,const string,int)" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawUnipenFileToImage
-* DESCRIPTION : The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified width,height,color and offset. If offset not equal to zero, the image would be in the trace order.
-* ARGUMENTS :
-* unipenFileName path to the datafile
-* imgFileName name of the file that is to be created to draw the image
-* imgWidth width of the image
-* imgHeight height of the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawUnipenFileToImage(const string unipenFileName,const string imgFileName,int imgWidth,int imgHeight)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawUnipenFileToImage(const string,const string,int,int)" << endl;
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(unipenFileName);
- try
- {
- LTKInkFileReader::readUnipenInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawUnipenFileToImage(const string,const string,int,int)" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
- drawLTKTraceGroupToImage(traceGroup,imgFileName,imgWidth,imgHeight);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawUnipenFileToImage(const string,const string,int,int)" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawUnipenFileToImage
-* DESCRIPTION : The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified color and offset. The width and height would be determined from the trace group.
-* ARGUMENTS :
-* unipenFileName path to the datafile
-* imgFileName name of the file that is to be created to draw the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawUnipenFileToImage(const string& unipenFileName,const string& imgFileName)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawUnipenFileToImage(const string&,const string&)" << endl;
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(unipenFileName);
- try
- {
- LTKInkFileReader::readUnipenInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawUnipenFileToImage(const string&,const string&)" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawUnipenFileToImage(const string&,const string&)" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawUnipenFileToImage
-* DESCRIPTION : The function creates LTKTraceGroup from the unipen data file specified and draws it to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
-* ARGUMENTS :
-* unipenFileName path to the unipen data file
-* imgFileName name of the file that is to be created to draw the image
-* size bound on larger dimension
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawUnipenFileToImage(const string& unipenFileName,const string& imgFileName,int size)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawUnipenFileToImage(const string&,const string&,int)" << endl;
-
-
- LTKTraceGroup traceGroup;
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- string strFileName(unipenFileName);
- try
- {
- LTKInkFileReader::readUnipenInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawUnipenFileToImage(const string&,const string&,int)" <<endl;
-
-
- errorCode = EINK_FILE_OPEN;
- }
-
- drawLTKTraceGroupToImage(traceGroup,imgFileName,size);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawUnipenFileToImage(const string&,const string&,int)" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawUnipenFileToImageWithBB
-* DESCRIPTION : The function creates LTKTraceGroup from the unipen data file specified and draws it to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.The bounding box of the image is also drawn to show relative position.
-* ARGUMENTS :
-* unipenFileName path to the unipen data file
-* imgFileName name of the file that is to be created to draw the image
-* size bound on larger dimension
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawUnipenFileToImageWithBB(const string& unipenFileName,const string& imgFileName,int size)
- {
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawUnipenFileToImageWithBB()" << endl;
-
- LTKTraceGroup traceGroup;
- string strFileName(unipenFileName);
- LTKCaptureDevice captureDevice;
- LTKScreenContext screenContext;
- try
- {
- LTKInkFileReader::readUnipenInkFile(strFileName,traceGroup,captureDevice,screenContext);
- }
- catch(LTKException e)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKImageWriter::drawUnipenFileToImageWithBB()" <<endl;
-
- errorCode = EINK_FILE_OPEN;
- }
- drawLTKTraceGroupToImageWithBB(traceGroup,screenContext,imgFileName,size);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawUnipenFileToImageWithBB()" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : showStartingPoint
-* DESCRIPTION : The set function for showing the starting point of each stroke
-* ARGUMENTS :
-* toShow flag to show the starting point
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::showStartingPoint(bool toShow)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::showStartingPoint()" << endl;
-
- m_showSP=toShow;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::showStartingPoint()" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : findMinXOfTrace
-* DESCRIPTION : The function finds the minimum x value of the given trace.
-* ARGUMENTS :
-* trace input trace
-*
-* RETURNS : minimum value of x
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
- int LTKImageWriter::findMinXOfTrace(const LTKTrace& trace,float& minX)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::findMinXOfTrace(const LTKTrace&,float&)" << endl;
-
- minX=numeric_limits<float>::infinity();
- for(int i=0;i<trace.getNumberOfPoints();i++){
- vector<float> point;
-
- trace.getPointAt(i, point);
- if(point[0]<minX){
- minX=point[0];
- }
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::findMinXOfTrace(const LTKTrace&,float&)" << endl;
-
- return SUCCESS;
-
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : findMaxXOfTrace
-* DESCRIPTION : The function finds the maximum x value of the given trace.
-* ARGUMENTS :
-* trace input trace
-*
-* RETURNS : maximum value of x
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- int LTKImageWriter::findMaxXOfTrace(const LTKTrace& trace,float& maxX)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::findMaxXOfTrace(const LTKTrace&,float&)" << endl;
-
- maxX = -FLT_MAX;
-
- for(int i=0;i<trace.getNumberOfPoints();i++){
-
- vector<float> point;
-
- trace.getPointAt(i, point);
- if(point[0]>maxX){
-
- maxX=point[0];
- }
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::findMaxXOfTrace(const LTKTrace&,float&)" << endl;
-
- return SUCCESS;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawPoint
-* DESCRIPTION : The function makes entries in the pixels array for the specified x,y and color.
-* ARGUMENTS :
-* x,y coordinates of the point to be drawn
-* red,green,blue RGB values of the color of the point
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawPoint(int x,int y,unsigned char red,unsigned char green,unsigned char blue){
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawPoint()" << endl;
-
-
- m_pixels[(3*((x)+y*m_width))]=red;
- m_pixels[(3*((x)+y*m_width))+1]=green;
- m_pixels[(3*((x)+y*m_width))+2]=blue;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawPoint()" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawLine
-* DESCRIPTION : The function draws line between the specified end points.
-* ARGUMENTS :
-* x1,y1,x2,y2 coordinates of the end points of the line to be drawn
-* red,green,blue RGB values of the color of the line
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawLine(int x1, int y1, int x2, int y2,unsigned char red,unsigned char green,unsigned char blue)
- {
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawLine()" << endl;
-
- int x, y;
- double k, s;
-
- if (y1==y2) {
- if (x1>x2)
- swap(x1,x2);
- for (x=x1; x<=x2; x++)
- drawPoint(x, y1,red,green,blue);
- } else {
- k = (double)(y2-y1)/(x2-x1);
- if (-1<=k && k<=1) {
- if (x1>x2) {
- swap(x1, x2);
- swap(y1, y2);
- }
- for (x=x1, s=y1; x<=x2; x++, s+=k)
- drawPoint(x, (int)(s+.5),red,green,blue);
- } else {
- if (y1>y2) {
- swap(x1, x2);
- swap(y1, y2);
- }
- k = 1/k;
- for (s=x1, y=y1; y<=y2; s+=k, y++)
- drawPoint((int)(s+.5), y,red,green,blue);
- }
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting:LTKImageWriter::drawLine()" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawRectangle
-* DESCRIPTION : The function draws hollow rectange with specified color and diagonal end points.
-* ARGUMENTS :
-* x1,y1,x2,y2 coordinates of the end points of the diagonal of the rectangle
-* red,green,blue RGB values of the color of the lines
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::drawRectangle(int x1,int y1,int x2,int y2,unsigned char red,unsigned char green,unsigned char blue)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawRectangle()" << endl;
-
-
- int xmin,ymin,xmax,ymax;
-
- if(x1<x2){
-
- xmin=x1;xmax=x2;
- }
- else{
- xmin=x2;xmax=x1;
- }
-
- if(y1<y2){
-
- ymin=y1;ymax=y2;
- }
- else{
- ymin=y2;ymax=y1;
- }
-
- drawLine(xmin,ymin,xmin,ymax,red,green,blue);
- drawLine(xmin,ymin,xmax,ymin,red,green,blue);
- drawLine(xmin,ymax,xmax,ymax,red,green,blue);
- drawLine(xmax,ymin,xmax,ymax,red,green,blue);
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawRectangle()" << endl;
- }
-
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : drawRectangle
-* DESCRIPTION : The function draws a rectange with specified diagonal end points and fills it with the specified color.
-* ARGUMENTS :
-* x1,y1,x2,y2 coordinates of the end points of the diagonal of the rectangle
-* red,green,blue RGB values of the color of the lines
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
- void LTKImageWriter::fillRectangle(int x1,int y1,int x2,int y2,unsigned char red,unsigned char green,unsigned char blue)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::fillRectangle()" << endl;
-
- int xmin,ymin,xmax,ymax;
-
- if(x1<x2){
-
- xmin=x1;xmax=x2;
- }
- else{
- xmin=x2;xmax=x1;
- }
-
- if(y1<y2){
-
- ymin=y1;ymax=y2;
- }
- else{
- ymin=y2;ymax=y1;
- }
-
-
- for(int i=xmin;i<=xmax;i++)
- {
- drawLine(i,ymin,i,ymax,red,green,blue);
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::fillRectangle()" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : createTraceOrderInTraceGroup
-* DESCRIPTION : The function offsets the input trace group by specified offset value and in the original trace order.
-* ARGUMENTS :
-* traceGroup input trace group
-* offsetTraceGroup trace group with offset
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::createTraceOrderInTraceGroup(const LTKTraceGroup& traceGroup,LTKTraceGroup& offsetTraceGroup)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::createTraceOrderInTraceGroup()" << endl;
-
-
- float maxOfX=0.0;
- LTKTrace tempTrace;
- traceGroup.getTraceAt(0, tempTrace);
-
- findMaxXOfTrace(tempTrace,maxOfX);
-
- maxOfX += m_offset;
-
-
- offsetTraceGroup.addTrace(tempTrace);
-
- for(int i = 1 ; i < traceGroup.getNumTraces(); i++)
- {
- LTKTrace trace;
- traceGroup.getTraceAt(i, trace);
-
- float minOfTrace =0;
-
- findMinXOfTrace(trace,minOfTrace);
-
- LTKTrace offsetTrace=trace;
- int pointToShift=0;
- vector<float> newXChannel;
- for(int j=0;j<trace.getNumberOfPoints();j++){
- vector<float> point;
-
- trace.getPointAt(j, point);
- point[0]+=fabs(maxOfX-minOfTrace);
- newXChannel.push_back(point[0]);
- }
-
- offsetTrace.reassignChannelValues(xChannelstr,newXChannel);
- offsetTraceGroup.addTrace(offsetTrace);
-
- findMaxXOfTrace(offsetTrace,maxOfX);
- maxOfX += m_offset;
-
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::createTraceOrderInTraceGroup()" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : setColor
-* DESCRIPTION : Setter method for color of the starting stroke and subsequent alternate strokes
-* ARGUMENTS :
-* red value of Red in RGB combination
-* green value of Green in RGB combination
-* blue value of Blue in RGB combination
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::setColor(unsigned char red,unsigned char green,unsigned char blue)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::setColor()" << endl;
-
- m_red=red;
- m_green=green;
- m_blue=blue;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::setColor()" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : setAlternateColor
-* DESCRIPTION : Setter method for color of alternate strokes
-* ARGUMENTS :
-* altRed value of Red in RGB combination
-* altGreen value of Green in RGB combination
-* altBlue value of Blue in RGB combination
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
- void LTKImageWriter::setAlternateColor(unsigned char altRed,unsigned char altGreen,unsigned char altBlue)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::setAlternateColor()" << endl;
-
- m_altRed=altRed;
- m_altGreen=altGreen;
- m_altBlue=altBlue;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::setAlternateColor()" << endl;
- }
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 22-FEB-2005
-* NAME : setOffstet
-* DESCRIPTION : Setter method for offset value between strokes
-* ARGUMENTS :
-* offset value of offset
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
- void LTKImageWriter::setOffset(int offset)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::setOffset()" << endl;
-
- if(offset < 0)
- {
- m_offset=0;
- }
- else
- {
- m_offset=offset;
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::setOffset()" << endl;
- }
-
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A
-* DATE : 19-MAY-2005
-* NAME : drawBMPImage
-* DESCRIPTION : The function writes the given pixel array to the specified BMP file
-* ARGUMENTS :
-* fileName name of output bmp file name with extension as 'bmp'
-* pixelArray pixel array
-* width width of the image
-* height height of the image
-*
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
- void LTKImageWriter::drawBMPImage(string fileName,unsigned char* pixelArray,int width,int height)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKImageWriter::drawBMPImage()" << endl;
-
- short type;
- int size;
- short reserved1;
- short reserved2;
- int offset;
- int i,j;
- int biSize,biWidth,biHeight;
- short biPlanes, biBitCount;
- int biCompression,biSizeImage,biXPelsPerMeter,biYPelsPerMeter,biClrUsed,biClrImportant;
- FILE *bmp = fopen(fileName.c_str(),"wb");
-
- offset = 54;
- biSize = 40;
-
- biWidth=width;
- biHeight=height;
- biPlanes = 1;
- biBitCount = 24;
- biCompression = 0;
- biSizeImage =0;
- biXPelsPerMeter = 0;
- biYPelsPerMeter = 0;
- biClrUsed = 0;
- biClrImportant = 0;
- type = 19778;
-
- int padding = ( 4 - ( ( 3 * width ) % 4 ) ) % 4;
-
- size = 54 + ( ( 3 * width ) + padding ) * height;
- reserved1 = 0;
- reserved2 = 0;
- fwrite(&type,sizeof(short),1,bmp);
- fwrite(&size,sizeof(int),1,bmp);
- fwrite(&reserved1,sizeof(short),1,bmp);
- fwrite(&reserved1,sizeof(short),1,bmp);
- fwrite(&offset,sizeof(int),1,bmp);
- fwrite(&biSize,sizeof(int),1,bmp);
- fwrite(&biWidth,sizeof(int),1,bmp);
- fwrite(&biHeight,sizeof(int),1,bmp);
- fwrite(&biPlanes,sizeof(short),1,bmp);
- fwrite(&biBitCount,sizeof(short),1,bmp);
- fwrite(&biCompression,sizeof(int),1,bmp);
- fwrite(&biSizeImage,sizeof(int),1,bmp);
- fwrite(&biXPelsPerMeter,sizeof(int),1,bmp);
- fwrite(&biYPelsPerMeter,sizeof(int),1,bmp);
- fwrite(&biClrUsed,sizeof(int),1,bmp);
- fwrite(&biClrImportant,sizeof(int),1,bmp);
-
- unsigned char zeroValue=0x00;
- //if(height%4 ==0) ++height;
- for ( i = height-1; i >=0 ; --i )
- {
- for ( j = 0; j < width ; ++j )
- {
-
- fwrite(&m_pixels[(3*((i*m_width)+j))+2],sizeof(char),1,bmp);
- fwrite(&m_pixels[(3*((i*m_width)+j))+1],sizeof(char),1,bmp);
- fwrite(&m_pixels[(3*((i*m_width)+j))],sizeof(char),1,bmp);
-
- }
-
-
- for ( int k = 0; k < padding; k++ )
- {
-
- fwrite(&zeroValue,sizeof(char),1,bmp);
- }
- }
-
- fclose(bmp);
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKImageWriter::drawBMPImage()" << endl;
- }
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.h
deleted file mode 100644
index c1e387e6..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKImageWriter.h
+++ /dev/null
@@ -1,431 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2007-10-08 22:10:54 +0530 (Mon, 08 Oct 2007) $
- * $Revision: 252 $
- * $Author: bharatha $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Declarations of Image Writer module
- *
- * CONTENTS:
- *
- * AUTHOR: Bharath A
- *
- * DATE: February 22, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#ifndef __LTKImageWriter_H
-#define __LTKImageWriter_H
-
-#include <limits>
-#include <math.h>
-#include "LTKInc.h"
-#include "LTKMacros.h"
-#include "LTKTypes.h"
-#include "LTKLoggerUtil.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-#define SUPPORTED_MIN_VERSION "4.0.0"
-
-//class LTKPreprocessorInterface;
-class LTKTraceGroup;
-class LTKScreenContext;
-class LTKTrace;
-
-//typedef LTKPreprocessorInterface* (*FN_PTR_CREATELTKLIPIPREPROCESSOR)(LTKControlInfo);
-
-/**
-* @class LTKImageWriter
-* <p>This class converts LTKTraceGroup or LTKTrace to images. Inputs could be objects of LTKTraceGroup,LTKTrace or path to the file containing the LTKTraceGroup.</p>
-* <p>The output images could also display the trace order if the offset is not equal to zero.</p>
-*/
-
-class LTKImageWriter{
-
-private:
-
-
- unsigned char *m_pixels; //pointer to the array of pixels
-
- int m_width; //width of the image
-
- int m_height; //height of the image
-
- float m_xMin,m_yMin,m_xMax,m_yMax; //Min and Max of tracegroups
-
- bool m_showBB; //flag to show bounding box
-
- bool m_showSP; //flag to show starting point of each stroke
-
- unsigned char m_red; //Red value of starting color
- unsigned char m_green; //Green value of starting color
- unsigned char m_blue; //Blue value of starting color
-
- unsigned char m_altRed; //Red value of alternate color
- unsigned char m_altGreen; //Green value of alternate color
- unsigned char m_altBlue; //Blue value of alternate color
-
- int m_offset; //offset value between strokes
-
- string xChannelstr, yChannelstr;
-
-public:
- /**
- * @name Constructors and Destructor
- */
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKImageWriter();
-
- /**
- * Destructor
- */
- ~LTKImageWriter();
-
- /**
- * @name Image writing functions
- */
- // @{
-
- /**
- * The function draws LTKTraceGroup to image file with specified width,height,color and offset. If offset not equal to zero, the image would be in the trace order.
- *
- * @param traceGroup the trace group that is to be drawn
- * @param imgFileName name of the file that is to be created to draw the image
- * @param imgWidth width of the image
- * @param imgHeight height of the image
- *
- * @return void
- */
- void drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup,
- const string imgFileName,int imgWidth,int imgHeight);
-
-
-
- /**
- * The function draws LTKTraceGroup to image file with specified color and offset. The width and height would be determined from the trace group. If offset not equal to zero, the image would be in the trace order.
- *
- * @param traceGroup the trace group that is to be drawn
- * @param imgFileName name of the file that is to be created to draw the image
- *
- * @return void
- */
- void drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup, const string imgFileName);
-
-
-
- /**
- * The function draws LTKTraceGroup to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
- *
- * @param traceGroup the trace group that is to be drawn
- * @param imgFileName name of the file that is to be created to draw the image
- * @param size bound on larger dimension
- *
- * @return void
- */
- void drawLTKTraceGroupToImage(const LTKTraceGroup& traceGroup,const string imgFileName,int size);
-
-
-
- /**
- * The function draws LTKTraceGroup to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
- * The bounding box of the image is also drawn to show relative position.
- *
- * @param traceGroup the trace group that is to be drawn
- * @param screenContext the reference to screen Context for determining the bounding box.
- * @param imgFileName name of the file that is to be created to draw the image
- * @param size bound on larger dimension
- * @return void
- */
- void drawLTKTraceGroupToImageWithBB(const LTKTraceGroup& traceGroup,const LTKScreenContext& screenContext,
- const string imgFileName,int size);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified data file and draws it to image file with specified width,height,color and offset. If offset not equal to zero, the image would be in the trace order.
- *
- * @param fileName path to the data file
- * @param imgFileName name of the file that is to be created to draw the image
- * @param imgWidth width of the image
- * @param imgHeight height of the image
- *
- * @return void
- */
- void drawRawInkFileToImage(const string fileName,const string imgFileName,
- int imgWidth,int imgHeight);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified data file and draws it to image file with specified color and offset. The width and height would be determined from the trace group.
- *
- * @param fileName path to the data file
- * @param imgFileName name of the file that is to be created to draw the image
- *
- * @return void
- */
- void drawRawInkFileToImage(const string fileName,const string imgFileName);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified data file and draws it to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
- *
- * @param fileName path to the data file
- * @param imgFileName name of the file that is to be created to draw the image
- * @param size bound on larger dimension
- *
- * @return void
- */
- void drawRawInkFileToImage(const string fileName,const string imgFileName,int size);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified color and offset. The width and height would be determined from the trace group.
- *
- * @param unipenFileName path to the unipen data file
- * @param imgFileName name of the file that is to be created to draw the image
- * @param imgWidth width of the image
- * @param imgHeight height of the image
- *
- * @return void
-
- */
-
- void drawUnipenFileToImage(const string unipenFileName,const string imgFileName,int imgWidth,int imgHeight);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified color and offset. The width and height would be determined from the trace group.
- *
- * @param unipenFileName path to the unipen data file
- * @param imgFileName name of the file that is to be created to draw the image
- *
- * @return void
- */
- void drawUnipenFileToImage(const string& unipenFileName,const string& imgFileName);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
- *
- * @param unipenFileName path to the unipen data file
- * @param imgFileName name of the file that is to be created to draw the image
- * @param size bound on larger dimension
- *
- * @return void
- */
- void drawUnipenFileToImage(const string& unipenFileName,const string& imgFileName,int size);
-
-
-
- /**
- * The function creates LTKTraceGroup from the specified unipen data file and draws it to image file with specified color and offset. The size specified is the bound on larger dimension and the trace group is normalized to maintain the aspect ratio.
- * The bounding box of the image is also drawn to show relative position.
- *
- * @param unipenFileName path to the unipen data file
- * @param imgFileName name of the file that is to be created to draw the image
- * @param size bound on larger dimension
- *
- * @return void
- */
-
-
- void drawUnipenFileToImageWithBB(const string& unipenFileName,const string& imgFileName,int size);
-
-
- /**
- * Setter method for showing the starting point of each stroke
- *
- * @param toShow flag to show the starting point
- *
- * @return
- */
-
- void showStartingPoint(bool toShow);
-
- /**
- * Setter method for color of the starting stroke and subsequent alternate strokes
- *
- * @param red value of Red in RGB combination
- * @param green value of Green in RGB combination
- * @param blue value of Blue in RGB combination
- *
- * @return void
- */
-
- void setColor(unsigned char red,unsigned char green,unsigned char blue);
-
- /**
- * Setter method for color of alternate strokes
- *
- * @param altRed value of Red in RGB combination
- * @param altGreen value of Green in RGB combination
- * @param altBlue value of Blue in RGB combination
- *
- * @return void
- */
-
- void setAlternateColor(unsigned char altRed,unsigned char altGreen,unsigned char altBlue);
-
-
- /**
- * Setter method for offset value between strokes
- *
- * @param offset value of offset
- *
- * @return void
- */
-
- void setOffset(int offset);
-
-
-private:
-
- /**
- * @name Preprocessing, trace group ordering, and point,line and rectangle drawing functions.
- */
-
-
-
- /**
- * The function finds the minimum x value of the given trace.
- *
- * @param trace input trace
- *
- * @return minimum value of x
- */
-
- int findMinXOfTrace(const LTKTrace& trace,float& minX);
-
-
-
- /**
- * The function finds the maximum x value of the given trace.
- *
- * @param trace input trace
- *
- * @return maximum value of x
- */
-
- int findMaxXOfTrace(const LTKTrace& trace,float& maxX);
-
-
-
- /**
- * The function makes entries in the pixels array for the specified x,y and color.
- *
- * @param x,y coordinates of the point to be drawn
- * @param red,green,blue RGB values of the color of the point
- *
- * @return
- */
-
- void drawPoint(int x,int y,unsigned char red,unsigned char green,unsigned char blue);
-
-
-
- /**
- * The function draws line between the specified end points.
- *
- * @param x1,y1,x2,y2 coordinates of the end points of the line to be drawn
- * @param red,green,blue RGB values of the color of the line
- *
- * @return
- */
-
- void drawLine(int x1, int y1, int x2, int y2,unsigned char red,unsigned char green,unsigned char blue);
-
-
-
- /**
- * The function draws hollow rectange with specified color and diagonal end points.
- *
- * @param x1,y1,x2,y2 coordinates of the end points of the diagonal of the rectangle
- * @param red,green,blue RGB values of the color of the lines
- *
- * @return
- */
-
- void drawRectangle(int x1,int y1,int x2,int y2,unsigned char red,unsigned char green,unsigned char blue);
-
-
-
- /**
- * The function draws a rectange with specified diagonal end points and fills it with the specified color.
- *
- * @param x1,y1,x2,y2 coordinates of the end points of the diagonal of the rectangle
- * @param red,green,blue RGB values of the color of the lines
- *
- * @return
- */
-
- void fillRectangle(int x1,int y1,int x2,int y2,unsigned char red,unsigned char green,unsigned char blue);
-
-
-
- /**
- * The function offsets the input trace group by specified offset value and in the original trace order.
- *
- * @param traceGroup input trace group
- * @param offsetTraceGroup trace group with offset
- *
- * @return
- */
-
- void createTraceOrderInTraceGroup(const LTKTraceGroup& traceGroup,LTKTraceGroup& offsetTraceGroup);
-
- /**
- * The function writes the given pixel array to the specified BMP file
- *
- * @param fileName name of output bmp file name with extension as 'bmp'
- * @param pixelArray pixel array
- * @param width width of the image
- * @param height height of the image
- *
- * @return
- */
-
- void drawBMPImage(string fileName,unsigned char* pixelArray,int width,int height);
-
-
-};
-#endif
-
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.cpp
deleted file mode 100644
index da5e89b7..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.cpp
+++ /dev/null
@@ -1,676 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-04-05 13:49:39 +0530 (Tue, 05 Apr 2011) $
- * $Revision: 844 $
- * $Author: mnab $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Implementation of the Ink File Reader Module
- *
- * CONTENTS:
- * readInkFile
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- * Deepu V. 14 Sept 2005 Added unipen file reading function
- * that reads annotation.
-************************************************************************/
-#include "LTKChannel.h"
-
-#include "LTKTraceFormat.h"
-
-#include "LTKTrace.h"
-
-#include "LTKTraceGroup.h"
-
-#include "LTKCaptureDevice.h"
-
-#include "LTKScreenContext.h"
-
-#include "LTKStringUtil.h"
-
-#include "LTKInc.h"
-
-#include "LTKException.h"
-
-#include "LTKMacros.h"
-
-#include "LTKErrors.h"
-
-#include "LTKErrorsList.h"
-
-#include "LTKLoggerUtil.h"
-#include "LTKInkFileReader.h"
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : LTKInkFileReader
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKInkFileReader::LTKInkFileReader(){}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : readRawInkFile
-* DESCRIPTION : reads contents of a file containing raw ink stored in a specified format into
-* a trace group object. Also the device information stored in the ink file is read
-* into a capture device object.
-* ARGUMENTS : inkFile - name of the file containing the ink
-* traceGroup - trace group into which the ink has to be read into
-* captureDevice - capture device object into which device info is to be read into
-* screenContext - writing area information
-* RETURNS : SUCCESS on successfully reading the ink file into
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKInkFileReader::readRawInkFile(const string& inkFile, LTKTraceGroup& traceGroup, LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext)
-{
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkFileReader::readRawInkFile()" << endl;
-
- string dataLine;
-
- vector<string> dataVector;
-
- vector<float> point; // a point of a trace
-
- int pointIndex;
-
- if(inkFile.empty())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_EMPTY <<":"<< getErrorMessage(EINKFILE_EMPTY)
- <<"LTKInkFileReader::readRawInkFile()" <<endl;
-
- LTKReturnError(EINKFILE_EMPTY);
- }
-
- // opening the ink file
-
- ifstream infile(inkFile.c_str());
-
- // checking if the file open was successful
-
- if(!infile)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKInkFileReader::readRawInkFile()"<<endl;
-
- LTKReturnError(EINK_FILE_OPEN);
- }
-
- vector<LTKChannel> channels; // channels of a trace
-
- LTKChannel xChannel("X", DT_FLOAT, true); // x-coordinate channel of the trace
-
- LTKChannel yChannel("Y", DT_FLOAT, true); // y-coordinate channel of the trace
-
- LTKChannel tChannel("T", DT_FLOAT, true); // time channel of the trace
-
- // initializing the channels of the trace
-
- channels.push_back(xChannel);
-
- channels.push_back(yChannel);
-
- channels.push_back(tChannel);
-
- // composing the trace format object
-
- LTKTraceFormat traceFormat(channels);
-
- // reading the ink file
-
- while(infile)
- {
- LTKTrace trace(traceFormat);
-
- while(infile)
- {
- getline(infile, dataLine);
-
- LTKStringUtil::tokenizeString(dataLine, " \t", dataVector);
-
- if(fabs( LTKStringUtil::convertStringToFloat(dataVector[0]) + 1 ) < EPS)
- {
- traceGroup.addTrace(trace);
-
- break;
- }
- else if(fabs( LTKStringUtil::convertStringToFloat(dataVector[0]) + 2 ) < EPS)
- {
- return SUCCESS;
- }
- else if(fabs( LTKStringUtil::convertStringToFloat(dataVector[0]) + 6 ) < EPS)
- {
- captureDevice.setXDPI(LTKStringUtil::convertStringToFloat(dataVector[1]));
-
- captureDevice.setYDPI(LTKStringUtil::convertStringToFloat(dataVector[2]));
- }
- else if(LTKStringUtil::convertStringToFloat(dataVector[0]) < 0)
- {
- // unknown tag. skipping line
-
- continue;
- }
- else
- {
-
- for(pointIndex = 0; pointIndex < dataVector.size(); ++pointIndex)
- {
- point.push_back(LTKStringUtil::convertStringToFloat(dataVector[pointIndex]));
- }
-
- if(dataVector.size() == 2)
- {
- point.push_back(0.0);
- }
-
- trace.addPoint(point);
-
- point.clear();
- }
- }
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileReader::readRawInkFile()" << endl;
-
- return FAILURE;
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : readUnipenInkFile
-* DESCRIPTION : reads contents of a file containing unipen ink stored in a specified format into
-* a trace group object. Also the device information stored in the ink file is read
-* into a capture device object.
-* ARGUMENTS : inkFile - name of the file containing the ink
-* traceGroup - trace group into which the ink has to be read into
-* captureDevice - capture device object into which device info is to be read into
-* screenContext - writing area information
-* RETURNS : SUCCESS on successfully reading the ink file into
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKInkFileReader::readUnipenInkFile(const string& inkFile, LTKTraceGroup& traceGroup, LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkFileReader::readUnipenInkFile()" << endl;
-
- map<string,string> traceIndicesCommentsMap;
-
- string hierarchyLevel;
- string quality("ALL");
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileReader::readUnipenInkFile()" << endl;
-
- return (readUnipenInkFileWithAnnotation(inkFile,hierarchyLevel,quality,traceGroup,traceIndicesCommentsMap,captureDevice,screenContext));
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 14-SEP-2004
-* NAME : readUnipenInkFileWithAnnotation
-* DESCRIPTION : reads contents of a unipen file containing ink stored in a specified format into
-* a trace group object. Also the device information stored in the ink file is read
-* into a capture device object.The screen information is captured in screen context object.
-* ARGUMENTS : inkFile - name of the file containing the ink
-* hierarchyLevel - level at which the ink is required, ex. WORD or CHARACTER that follows .SEGMENT
-* quality - quality of the ink that is required. Can be GOOD,BAD,OK or ALL. Example, if ink of quality
-* GOOD and BAD are required, then quality="GOOD,BAD" (NOTE:comma(,) is the delimiter) else if all ink
-* are required, quality="ALL"
-* traceGroup - trace group into which the ink has to be read into
-* traceIndicesCommentsMap - Map containing list of strokes separated by commas as key and the comments
-* to that trace group unit as value (ex. key-"2,4,5" value-"delayed stroke"
-* captureDevice - capture device object into which device info is to be read into
-* screenContext - writing area information
-* RETURNS : SUCCESS on successfully reading the ink file into
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-
-
-int LTKInkFileReader::readUnipenInkFileWithAnnotation(const string& inkFile,const string& hierarchyLevel,const string& quality, LTKTraceGroup& traceGroup,map<string,string>& traceIndicesCommentsMap,LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkFileReader::readUnipenInkFileWithAnnotation()" << endl;
-
- vector<float> point; // a point of a trace
-
- float xDpi; // device resolution in the x direction
-
- float yDpi; // device resolution in the y direction
-
- float bboxLeft; // leftmost x-coord of the writing area
-
- float bboxBottom; // bottommost y-coord of the writing area
-
- float bboxRight; // rightmost x-coord of the writing area
-
- float bboxTop; // topmost y-coord of the writing area
-
- float floatChannelValue; // channel value of type float
-
- long longChannelValue; // channel value of type long
-
- string channelNames; // string containing all the channel names
-
- vector<string> channelNamesVector; // vector of channel names
-
- int channelIndex; // index to loop over all channels in the channel list
-
- vector<string> qualityLevels; // list of quality levels required
-
- vector<string> coordVals; // list of coordinate values present
-
- string remainingLine; //remaining of the line that does not contain the required hierarchy level
-
- bool verFlag = false, hlevelFlag = false, coordFlag = false;// bool level that denote whether version Info, Hierarchy level and coordinate info are set
-
- bool pendownFlag = false;
-
- LTKStringUtil::tokenizeString(quality,",", qualityLevels);
-
- // opening the ink file
-
- if(inkFile.empty())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_EMPTY <<":"<< getErrorMessage(EINKFILE_EMPTY)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_EMPTY);
- }
-
- ifstream infile(inkFile.c_str()); //
-
- // checking if the file open was successful
-
- if(!infile)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINK_FILE_OPEN <<":"<< getErrorMessage(EINK_FILE_OPEN)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINK_FILE_OPEN);
- }
-
- LTKTrace *trace = NULL; // initializing trace to NULL
-
- vector<LTKChannel> channels; // channels of a trace
-
- LTKTraceFormat traceFormat; // format of the trace
-
- // reading the ink file
-
- string keyWord; // a key word of the unipen format
-
- while(infile)
- {
- keyWord = "";
- infile >> keyWord;
-
- if(keyWord == ".COORD")
- {
- coordFlag = true;
-
- getline(infile, channelNames);
-
- LTKStringUtil::tokenizeString(channelNames, " \t", channelNamesVector);
-
- for(channelIndex = 0; channelIndex < channelNamesVector.size(); ++channelIndex)
- {
- if(channelNamesVector[channelIndex] == "T")
- {
- LTKChannel channel(channelNamesVector[channelIndex], DT_LONG, true);
- channels.push_back(channel);
- }
- else
- {
- LTKChannel channel(channelNamesVector[channelIndex], DT_FLOAT, true);
- channels.push_back(channel);
- }
- }
-
- traceFormat.setChannelFormat(channels);
-
- }
- else if(keyWord == ".X_POINTS_PER_INCH")
- {
- infile >> xDpi;
- captureDevice.setXDPI(xDpi);
-
- }
- else if(keyWord == ".Y_POINTS_PER_INCH")
- {
- infile >> yDpi;
- captureDevice.setYDPI(yDpi);
- }
- else if(keyWord == ".H_LINE")
- {
- infile >> bboxBottom >> bboxTop;
- screenContext.setBboxBottom(bboxBottom);
- screenContext.setBboxTop(bboxTop);
- }
- else if(keyWord == ".V_LINE")
- {
- infile >> bboxLeft >> bboxRight;
-
- screenContext.setBboxLeft(bboxLeft);
-
- screenContext.setBboxRight(bboxRight);
- }
- else if(keyWord==".SEGMENT")
- {
- string strHierarchyLevel; //stores the hierarchy level (ex. CHARACTER or WORD)
- string strStrokeIndices; //comma separated stroke indices
- string strQuality; //annotated quality of the trace/trace group
- string strComments; //comments about the ink
-
- infile >> strHierarchyLevel;
-
- if(strHierarchyLevel==hierarchyLevel) //if the encountered hierarchy level is the required
- {
-
- string checkString;
- getline(infile,checkString,'\n');
-
- if(checkString.empty())
- {
-
- LOG( LTKLogger::LTK_LOGLEVEL_ERR) <<
- "Annotation not found at the specified hierarchy level:" <<
- hierarchyLevel << " in "+inkFile << endl;
- //return FAILURE;
- continue;
-
- }
-
- vector<string> tokens;
-
- LTKStringUtil::tokenizeString(checkString," ", tokens);
-
- if(tokens.size()>=3)
- {
-
- strStrokeIndices=tokens[0];
- strQuality=tokens[1];
- for(int i=2;i<tokens.size();++i)
- {
- strComments=strComments+tokens[i]+" ";
- }
-
- strComments=strComments.substr(0,strComments.length()-1); //removing the last space added
- }
- else
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- "Invalid annotation format at the specified hierarchy level:" <<
- hierarchyLevel << " in " << inkFile << endl;
- //return FAILURE;
- continue;
- }
-
-
- strComments=strComments.substr(1,strComments.length()-2); //to remove the leading space and double quoutes
-
- bool isRequiredQuality=false;
- if(quality=="ALL") //if no condition on quality
- {
- isRequiredQuality=true;
- }
- else
- {
- for(vector<string>::iterator iter=qualityLevels.begin();iter!=qualityLevels.end();++iter)
- {
-
- if((*iter)==strQuality)
- {
- isRequiredQuality=true;
- break;
- }
-
- }
-
- }
-
- if(isRequiredQuality)
- {
- //if the trace/trace group is of required quality stores the stroke
- //indices and comments in the output map
- traceIndicesCommentsMap.insert(make_pair(strStrokeIndices,strComments));
-
- }
- }
- else //if not the required hierarchy level, just get the remaining line
- {
- if(keyWord == ".VERSION")
- verFlag = true;
- else if ((keyWord == ".HIERARCHY"))
- hlevelFlag = true;
-
- getline(infile,remainingLine);
-
- }
-
- }
- else if(keyWord == ".PEN_DOWN")
- {
- if (pendownFlag)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_CORRUPTED <<":"<< getErrorMessage(EINKFILE_CORRUPTED)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_CORRUPTED);
- }
-
- pendownFlag = true;
-
- LTKTrace trace(traceFormat);
-
-
- while(infile)
- {
- infile >> keyWord;
-
- if(keyWord == ".PEN_UP")
- {
- if (!pendownFlag)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_CORRUPTED <<":"<< getErrorMessage(EINKFILE_CORRUPTED)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_CORRUPTED);
- }
-
- pendownFlag = false;
-
- if(trace.getNumberOfPoints() == 0)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKInkFileReader::readUnipenInkFileWithAnnotation()"<<endl;
-
- LTKReturnError(EEMPTY_TRACE);
- }
-
- traceGroup.addTrace(trace);
-
- break;
- }
- else
- {
- // BUGFIX : if no attributes in input ink file, throw error and stop
- if(channelNamesVector.empty())
- {
- //if(!verFlag)
- //{
- //}
- // cout<<" keyword = "<<keyWord<<endl;
-
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_CORRUPTED <<":"<< getErrorMessage(EINKFILE_CORRUPTED)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_CORRUPTED);
- }
-
- if(channelNamesVector[0] == "T")
- {
- longChannelValue = atol(keyWord.c_str());
-
- point.push_back(longChannelValue);
- }
- else
- {
- floatChannelValue = LTKStringUtil::convertStringToFloat(keyWord);
-
- point.push_back(floatChannelValue);
- }
-
- getline(infile,remainingLine);
-
- coordVals.clear();
-
- LTKStringUtil::tokenizeString(remainingLine,string(" "), coordVals);
-
- if (coordVals.size() != (channelNamesVector.size() -1))
- {
- int index;
- for (index = 0 ; index < channelNamesVector.size(); ++index)
- {
- cout << "coord name at index "<<channelNamesVector.at(index) <<endl;
- }
- cout<<"first coord val "<<keyWord;
- for (index = 0 ; index < coordVals.size(); ++index)
- {
- cout << "coord val at index "<<coordVals.at(index) <<endl;
- }
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_CORRUPTED <<":"<< getErrorMessage(EINKFILE_CORRUPTED)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_CORRUPTED);
- }
-
- for(channelIndex = 1; channelIndex < channelNamesVector.size(); ++channelIndex)
- {
- if(channelNamesVector[channelIndex] == "T")
- {
- longChannelValue = atol((coordVals.at(channelIndex -1 )).c_str());
-
- point.push_back(longChannelValue);
- }
- else
- {
- floatChannelValue = LTKStringUtil::convertStringToFloat(coordVals.at(channelIndex -1 ));
-
- point.push_back(floatChannelValue);
- }
-
- }
-
- trace.addPoint(point);
-
- point.clear();
-
- }
- }
- }
- else if(keyWord == ".PEN_UP")
- {
- if (!pendownFlag)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINKFILE_CORRUPTED <<":"<< getErrorMessage(EINKFILE_CORRUPTED)
- <<"LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EINKFILE_CORRUPTED);
- }
- }
- else
- {
- if(keyWord == ".VERSION")
- verFlag = true;
- else if ((keyWord == ".HIERARCHY"))
- hlevelFlag = true;
-
- getline(infile, keyWord);
- }
- }
-
- int numberOfTraces = traceGroup.getNumTraces();
-
- if(numberOfTraces == 0)
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : LTKInkFileReader::readUnipenInkFileWithAnnotation()" <<endl;
-
- LTKReturnError(EEMPTY_TRACE_GROUP);
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileReader::readUnipenInkFileWithAnnotation()" << endl;
-
- return SUCCESS;
-}
-
-
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : ~LTKInkFileReader
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKInkFileReader::~LTKInkFileReader(){}
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.h
deleted file mode 100644
index 16704688..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileReader.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-10 15:23:21 +0530 (Thu, 10 Jul 2008) $
- * $Revision: 556 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the Ink File Reader Module
- *
- * CONTENTS:
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- * Deepu V. 14 Sept 2005 Added unipen file reading function
- * that reads annotation.
- ************************************************************************/
-
-#ifndef __LTKINKFILEREADER_H
-#define __LTKINKFILEREADER_H
-
-#include "LTKTypes.h"
-
-
-class LTKTraceGroup;
-class LTKCaptureDevice;
-class LTKScreenContext;
-
-/**
-* @ingroup util
-*/
-
-/** @brief Exposes the APIs for reading ink files
-@class LTKInkFileReader
-*/
-class LTKInkFileReader
-{
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKInkFileReader();
-
- /**
- * Destructor
- */
-
- ~LTKInkFileReader();
-
- // @}
-
- /**
- * @name Methods
- */
-
- // @{
-
- /**
- * This is a static method which reads a raw ink file and loads it into a trace group object
- * Also reads the device information from the unipen ink file into a capture device object
- * @param inkFile Name of the ink file to be read
- * @param traceGroup trace group into which the ink file has to be read into
- * @param captureDevice object into which the device specific information is to be read into
- * @return SUCCESS on successful read operation
- */
-
- static int readRawInkFile(const string& inkFile, LTKTraceGroup& traceGroup, LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext);
-
- /**
- * This is a static method which reads a unipen ink file and loads it into a trace group object
- * Also reads the device information from the unipen ink file into a capture device object
- * @param inkFile Name of the ink file to be read
- * @param traceGroup trace group into which the ink file has to be read into
- * @param captureDevice object into which the device specific information is to be read into
- * @return SUCCESS on successful read operation
- */
-
- static int readUnipenInkFile(const string& inkFile, LTKTraceGroup& traceGroup, LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext);
-
- /**
- * This is a static method which reads the contents of a unipen file containing ink stored in a specified format into
- * a trace group object. Also the device information stored in the ink file is read
- * into a capture device object.The writing area information is captured in screen context object.
- * @param inkFile name of the file containing the ink
- * @param hierarchyLevel level at which the ink is required, ex. WORD or CHARACTER that follows .SEGMENT
- * @param quality quality of the ink that is required. Can be GOOD,BAD,OK or ALL. Example, if ink of quality
- * GOOD and BAD are required, then quality="GOOD,BAD" (NOTE:comma(,) is the delimiter) else if all ink
- * are required, quality="ALL"
- * @param traceGroup trace group into which the ink has to be read into
- * @param traceIndicesCommentsMap Map containing list of strokes separated by commas as key and the comments
- * to that trace group unit as value (ex. key-"2,4,5" value-"delayed stroke"
- * @param captureDevice capture device object into which device info is to be read into
- * @param screenContext writing area information
- * @return SUCCESS on successful read operation
- */
-
- static int readUnipenInkFileWithAnnotation(const string& inkFile,const string& hierarchyLevel,const string& quality, LTKTraceGroup& traceGroup,map<string,string>& traceIndicesCommentsMap,LTKCaptureDevice& captureDevice, LTKScreenContext& screenContext);
-
-
- // @}
-};
-
-#endif //#ifndef __LTKINKFILEREADER_H
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.cpp
deleted file mode 100644
index ae7fdd3f..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-01-11 13:48:17 +0530 (Tue, 11 Jan 2011) $
- * $Revision: 827 $
- * $Author: mnab $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Implementation of the Ink File Writer Module
- *
- * CONTENTS:
- *
- * AUTHOR: Bharath A.
- *
- * DATE: March 22, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#include "LTKInkFileWriter.h"
-#include "LTKMacros.h"
-#include "LTKTrace.h"
-#include "LTKTraceGroup.h"
-#include "LTKLoggerUtil.h"
-
-using namespace std;
-
-
-/**********************************************************************************
-* AUTHOR : Bharath A.
-* DATE : 22-MAR-2005
-* NAME : LTKInkFileWriter
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKInkFileWriter::LTKInkFileWriter()
-{
-
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A.
-* DATE : 22-MAR-2005
-* NAME : ~LTKInkFileWriter
-* DESCRIPTION : Destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-LTKInkFileWriter::~LTKInkFileWriter()
-{
-
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A.
-* DATE : 22-MAR-2005
-* NAME : writeRawInkFile
-* DESCRIPTION : This is a static method which writes the trace group supplied to the file name specified with X and Y DPI info.
-* ARGUMENTS traceGroup trace group to be written onto the file
-* fileName name of the file
-* xDPI x-coordinate dots per inch
-* yDPI y-coordinate dots per inch
-* :
-* RETURNS : SUCCESS on successful write operation
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKInkFileWriter::writeRawInkFile(const LTKTraceGroup& traceGroup,const string& fileName,int xDPI,int yDPI)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkFileWriter::writeRawInkFile()" << endl;
-
- if(traceGroup.getNumTraces()>=1)
- {
- LTKTrace tempTrace;
- traceGroup.getTraceAt(0, tempTrace);
-
- int numOfChannels = tempTrace.getTraceFormat().getNumChannels();
-
- std::ofstream output(fileName.c_str());
- output<<"-6 "<<xDPI<<" "<<yDPI<<endl;
- for(int i=0;i<traceGroup.getNumTraces();i++)
- {
- LTKTrace trace;
-
- traceGroup.getTraceAt(i, trace);
-
- for(int j=0;j<trace.getNumberOfPoints();j++)
- {
- floatVector pointVec;
- trace.getPointAt(j, pointVec);
-
- for(int k=0;k<pointVec.size();k++){
- if(k==pointVec.size()-1){
- output<<pointVec[k]<<endl;
- }
- else{
- output<<pointVec[k]<<" ";
- }
- }
- }
-
- for(int d=0;d<numOfChannels;d++){
- if(d==numOfChannels-1){
- output<<"-1"<<endl;
- }
- else{
- output<<"-1 ";
- }
- }
-
- }
-
- for(int e=0;e<numOfChannels;e++){
- if(e==numOfChannels-1){
- output<<"-2"<<endl;
- }
- else{
- output<<"-2 ";
- }
- }
- output.close();
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileWriter::writeRawInkFile()" << endl;
-
- return SUCCESS;
- }
- else
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileWriter::writeRawInkFile()" << endl;
- return FAILURE;
- }
-}
-
-/**********************************************************************************
-* AUTHOR : Bharath A.
-* DATE : 22-MAR-2005
-* NAME : writeUnipenInkFile
-* DESCRIPTION : This is a static method which writes the trace group supplied to the file name specified with X and Y DPI info, in unipen format
-* ARGUMENTS traceGroup trace group to be written onto the file
-* fileName name of the file
-* xDPI x-coordinate dots per inch
-* yDPI y-coordinate dots per inch
-* :
-* RETURNS : SUCCESS on successful write operation
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKInkFileWriter::writeUnipenInkFile(const LTKTraceGroup& traceGroup,const string& fileName,int xDPI,int yDPI)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkFileWriter::writeUnipenInkFile()" << endl;
-
- if(traceGroup.getNumTraces()>=1)
- {
- LTKTrace tempTrace;
- traceGroup.getTraceAt(0, tempTrace);
-
- vector<string> channelNames = tempTrace.getTraceFormat().getAllChannelNames();
- std::ofstream output(fileName.c_str());
- output<<".VERSION 1.0"<<endl;
- output<<".COORD";
- for(int c=0;c<channelNames.size();c++)
- {
- output<<" "<<channelNames[c];
-
- }
- output<<endl;
- output<<".X_POINTS_PER_INCH "<<xDPI<<endl;
- output<<".Y_POINTS_PER_INCH "<<yDPI<<endl;
- for(int i=0;i<traceGroup.getNumTraces();i++)
- {
- output<<".PEN_DOWN"<<endl;
-
- LTKTrace trace;
- traceGroup.getTraceAt(i, trace);
-
- for(int j=0;j<trace.getNumberOfPoints();j++){
-
- floatVector pointVec;
- trace.getPointAt(j, pointVec);
-
- for(int k=0;k<pointVec.size();k++){
- if(k==pointVec.size()-1){
- output<<pointVec[k]<<endl;
- }
- else{
- output<<pointVec[k]<<" ";
- }
- }
- }
- output<<".PEN_UP"<<endl;
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileWriter::writeUnipenInkFile()" << endl;
- return SUCCESS;
- }
- else
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkFileWriter::writeUnipenInkFile()" << endl;
- return FAILURE;
- }
-} \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.h
deleted file mode 100644
index ee41ac4c..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkFileWriter.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-10 15:23:21 +0530 (Thu, 10 Jul 2008) $
- * $Revision: 556 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the Ink File Writer Module
- *
- * CONTENTS:
- *
- * AUTHOR: Bharath A.
- *
- * DATE: March 22, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#ifndef __LTKINKFILEWRITER_H
-#define __LTKINKFILEWRITER_H
-
-#include "LTKInc.h"
-
-class LTKTraceGroup;
-
-/**
-* @ingroup util
-*/
-
-/** @brief Utility class for writing ink files
-* @class LTKInkFileWriter
-*/
-class LTKInkFileWriter
-{
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKInkFileWriter();
-
- /**
- * Destructor
- */
-
- ~LTKInkFileWriter();
-
- // @}
-
- /**
- * @name Methods
- */
-
- // @{
-
- /**
- * This is a static method which writes the trace group supplied to the file name specified with X and Y DPI info
- * @param traceGroup trace group to be written onto the file
- * @param fileName name of the file
- * @param xDPI x-coordinate dots per inch
- * @param yDPI y-coordinate dots per inch
- * @return SUCCESS on successful write operation
- */
-
- static int writeRawInkFile(const LTKTraceGroup& traceGroup,const string& fileName,int xDPI,int yDPI);
-
- /**
- * This is a static method which writes the trace group supplied to the file name specified with X and Y DPI info, in unipen format
- * @param traceGroup trace group to be written onto the file
- * @param fileName name of the file
- * @param xDPI x-coordinate dots per inch
- * @param yDPI y-coordinate dots per inch
- * @return SUCCESS on successful write operation
- */
-
- static int writeUnipenInkFile(const LTKTraceGroup& traceGroup,const string& fileName,int xDPI,int yDPI);
-
- // @}
-};
-
-
-#endif
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.cpp
deleted file mode 100644
index 53a34c13..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-02-08 11:00:11 +0530 (Tue, 08 Feb 2011) $
- * $Revision: 832 $
- * $Author: dineshm $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Implementation of LTKInkUtils that computes the statistics
- * of a trace group
- *
- * CONTENTS:
- * computeTraceGroupStatistics
- * computeChannelMaximum
- * computeChannelMinimum
- * computeChannelMaxMin
- *
- * AUTHOR: Deepu V.
- *
- * DATE: March 9, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKInkUtils.h"
-#include "LTKMacros.h"
-#include "LTKErrors.h"
-#include "LTKLoggerUtil.h"
-#include "LTKErrorsList.h"
-#include "LTKTrace.h"
-#include "LTKTraceGroup.h"
-
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : LTKInkUtils
-* DESCRIPTION : Initialization constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKInkUtils::LTKInkUtils()
-{
-
-}
-
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : computeChannelStatistics
-* DESCRIPTION : This is a generic function that computes the statistics of channels of
-* an LTKTraceGroup object passed to it.
-* ARGUMENTS : traceGroup - The TraceGroup whose statistics need to be computed channelNames - Names of channels in the traceGroup for which
-* channelNames - channels for which statistics have to be comptued
-* properties - The names of the statistics to be computed
-* channelStatistics - output vector containing results
-* channelStatistics[i][j] the statistics properties[j] for channelname
-* channelNames[i]
-*
-* RETURNS : SUCCESS/FAILURE
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKInkUtils::computeChannelStatistics(const LTKTraceGroup& traceGroup,
- const vector<string>& channelNames, const vector<ELTKTraceGroupStatistics>& properties,
- vector<vector<float> >& channelStatistics)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkUtils::computeChannelStatistics()" << endl;
-
- vector<float> tempVec; //temporary vector
-
- int numChannels = channelNames.size(); //num of channels for which statistics need to be computed
-
- int numFeatures = properties.size(); //number of properties to be calculated
-
- int numTraces = traceGroup.getNumTraces(); //number of traces in each tracegroup
-
- int numPoints; //number of points in a stroke
-
-
- int totalNumPoints=0; //each channel is of equal length
-
- float currVal; //value of current point in the channel
-
- int traceIndex, channelIndex, pointIndex, featureIndex;
-
- // Clear the output vector
- channelStatistics.clear();
-
- //Make an initial vector
- tempVec.clear();
- for (featureIndex= 0 ; featureIndex <numFeatures; ++featureIndex)
- {
- switch(properties[featureIndex])
- {
- //initializing max
- case TG_MAX:tempVec.push_back(-FLT_MAX);
- break;
- //initializing min
- case TG_MIN:tempVec.push_back(FLT_MAX);
- break;
- //initializing avg
- case TG_AVG:tempVec.push_back(0);
- break;
-
- default: LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKInkUtils::computeChannelStatistics()"<<endl;
-
- LTKReturnError(EUNSUPPORTED_STATISTICS);
- }
- }
-
- //Initialization Every channel has the same value
- for(channelIndex =0; channelIndex<numChannels; ++channelIndex)
- {
- channelStatistics.push_back(tempVec);
-
- //initialize total number of points for each channel to zero
- }
-
-
- //Iterating through all the strokes
- for (traceIndex = 0; traceIndex <numTraces; ++traceIndex)
- {
- LTKTrace trace;
- traceGroup.getTraceAt(traceIndex, trace);
-
- //Iterating through all the channels in a stroke
- for (channelIndex =0; channelIndex<numChannels; ++channelIndex)
- {
- //get the current channel values
- floatVector currChannel;
- trace.getChannelValues(channelNames[channelIndex], currChannel);
-
- //get the current output vector to be updated
- floatVector& currStats = channelStatistics.at(channelIndex);
-
- //number of points in this channel
- numPoints = currChannel.size();
-
- if(channelIndex==0)
- {
- totalNumPoints += numPoints;
- }
-
- //iterate through all points in the channel
- for(pointIndex = 0; pointIndex <numPoints; ++pointIndex)
- {
- currVal = currChannel[pointIndex];
-
- //updating all features as we iterate through each point;
- for (featureIndex =0; featureIndex<numFeatures; featureIndex++)
- {
- switch(properties[featureIndex])
- {
-
- //updating the maximum
- case TG_MAX:
- if(currVal > currStats[featureIndex])
- currStats[featureIndex] = currVal;
- break;
-
- //updating the minimum
- case TG_MIN:
- if(currVal < currStats[featureIndex])
- currStats[featureIndex] = currVal;
- break;
-
- //accumulating the sum
- case TG_AVG:
- currStats[featureIndex] += currVal;
- break;
-
- default: LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error: LTKInkUtils::computeChannelStatistics()"<<endl;
-
- LTKReturnError(EUNSUPPORTED_STATISTICS);
-
- }
-
- }
-
- }
-
- }
-
- }
-
- //Finalization Step
- for (channelIndex= 0 ; channelIndex<numChannels; ++channelIndex)
- {
-
- floatVector& currStats = channelStatistics.at(channelIndex);
-
- //total number of points in this channel
- numPoints = totalNumPoints;
-
- for(featureIndex = 0; featureIndex<numFeatures; ++featureIndex)
- {
- switch(properties[featureIndex])
- {
- //finding the average
- case TG_AVG:
- currStats[featureIndex] /= numPoints;
- break;
- }
- }
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkUtils::computeChannelStatistics()" << endl;
-
- return SUCCESS;
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : computeChannelMaximum
-* DESCRIPTION : Function that computes the minimums of channels of an
-* LTKTraceGroup object passed to it.
-* ARGUMENTS : traceGroup - The TraceGroup whose minimums need to be computed
-* channelNames - channels for which minimum vals have to be comptued
-* minValues - output vector containing results
-* minValues[i] the minimum for channelname[i]
-*
-* RETURNS : SUCCESS/FAILURE
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKInkUtils::computeChannelMaximum(const LTKTraceGroup& traceGroup, const vector<string>& channelNames,
- vector<float>& maxValues)
-{
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkUtils::computeChannelMaximum()" << endl;
-
- vector<vector<float> >results; //results from computeChannelStatistics;
-
- vector<ELTKTraceGroupStatistics> properties (1,TG_MAX); //Initializing the properties to MIN
-
-
- maxValues.clear(); //clear the minValues
-
- //call generic function
- if(errorCode = computeChannelStatistics(traceGroup,channelNames,properties,results))
- {
- return errorCode;
- }
-
- //populate the results
- for (int resultIndex=0; resultIndex<results.size(); ++resultIndex)
- {
- maxValues.push_back( (results.at(resultIndex)).at(0) );
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkUtils::computeChannelMaximum()" << endl;
-
- return SUCCESS;
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : computeChannelMinimum
-* DESCRIPTION : Function that computes the minimums of channels of an
-* LTKTraceGroup object passed to it.
-* ARGUMENTS : traceGroup - The TraceGroup whose minimums need to be computed
-* channelNames - channels for which minimum vals have to be comptued
-* minValues - output vector containing results
-* minValues[i] the minimum for channelname[i]
-*
-* RETURNS : SUCCESS/FAILURE
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKInkUtils::computeChannelMinimum(const LTKTraceGroup& traceGroup,const vector<string>& channelNames,
- vector<float>& minValues)
-{
-
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkUtils::computeChannelMinimum()" << endl;
-
-
- vector<vector<float> >results; //results from computeChannelStatistics;
-
- vector<ELTKTraceGroupStatistics> properties (1,TG_MIN); //Initializing the properties to MIN
-
-
- minValues.clear(); //clear the minValues
-
- //call generic function
- if(errorCode = computeChannelStatistics(traceGroup,channelNames,properties,results))
- {
- return errorCode;
- }
-
- //populate the results
- for (int resultIndex =0; resultIndex<results.size(); ++resultIndex)
- {
- minValues.push_back( (results.at(resultIndex)).at(0) );
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkUtils::computeChannelMinimum()" << endl;
-
- return SUCCESS;
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : computeChannelMaxMin
-* DESCRIPTION : Function that computes the minimum and maximum of channels of an
-* LTKTraceGroup object passed to it.
-* ARGUMENTS : traceGroup - The TraceGroup whose parameters need to be computed
-* channelNames - channels for which parameters have to be comptued
-* minValues - output vector containing min values
-* maxValues - output vector containing max values
-*
-* RETURNS : SUCCESS/FAILURE
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKInkUtils::computeChannelMaxMin(const LTKTraceGroup& traceGroup, const vector<string>& channelNames,
- vector<float>& maxValues, vector<float>& minValues)
-{
- int errorCode;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKInkUtils::computeChannelMaxMin()" << endl;
-
- vector<vector<float> >results; //results from computeChannelStatistics;
-
- vector<ELTKTraceGroupStatistics> properties (2); //Initializing the properties to MIN
-
- //pushing the operations to be performed
- properties[0] = TG_MIN;
- properties[1] = TG_MAX;
-
- minValues.clear(); //clear the minValues
- maxValues.clear(); //clear the maxvalues
-
- //call generic function
- if(errorCode = computeChannelStatistics(traceGroup,channelNames,properties,results))
- {
- return errorCode;
- }
-
- //populate the results
- for (int resultIndex =0; resultIndex<results.size(); ++resultIndex)
- {
- minValues.push_back( (results.at(resultIndex)).at(0) );
- maxValues.push_back( (results.at(resultIndex)).at(1) );
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKInkUtils::computeChannelMaxMin()" << endl;
-
- return SUCCESS;
-}
-
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 09-MAR-2005
-* NAME : ~LTKInkUtils
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-LTKInkUtils::~LTKInkUtils()
-{
-
-}
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.h
deleted file mode 100644
index a6ca369e..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKInkUtils.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-10 15:23:21 +0530 (Thu, 10 Jul 2008) $
- * $Revision: 556 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the Ink utilities module
- *
- * CONTENTS:
- *
- * AUTHOR: Deepu V.
- *
- * DATE: March 07 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKINKUTILS_H
-#define __LTKINKUTILS_H
-
-#include <cfloat>
-
-#include "LTKInc.h"
-
-#include "LTKTypes.h"
-
-class LTKTraceGroup;
-
-/**
-* @ingroup util
-*/
-
-/** @brief This class contains the methods for computing statistics of a channel
-* @class LTKInkUtils
-*/
-
-class LTKInkUtils
-{
-public:
- /**
- * @name Constructors and Destructor
- */
- // @{
-
- /**
- * Default Constructor
- */
- LTKInkUtils();
-
- /**
- * Destructor
- */
- virtual ~LTKInkUtils();
-
- // @}
-
- /**
- * @name Functions that computes the statistics
- */
- // @{
-
- /**
- * Generic function that computes the statistics of channels of an LTKTraceGroup object
- *
- * @param traceGroup The TraceGroup whose statistics need to be computed
- * @param channelNames Names of channels in the traceGroup for which statistics have to be comptued
- * @param properties The names of the statistics to be computed
- * @param channelStatistics output vector containing results
- */
- static int computeChannelStatistics(const LTKTraceGroup& traceGroup,const vector<string>& channelNames,
- const vector<ELTKTraceGroupStatistics>& properties, vector<vector<float> >& channelStatistics);
-
-
- /**
- * This function computes the minimum of channels of an LTKTraceGroup object
- *
- * @param traceGroup The TraceGroup whose maximum need to be computed
- * @param channelNames Names of channels in the traceGroup for which maximum need to be computed
- * @param maxValues output vector containing maxValues for each channel
- */
- static int computeChannelMaximum(const LTKTraceGroup& traceGroup, const vector<string>& channelNames,
- vector<float>& maxValues);
-
- /**
- * This function computes the minimum of channels of an LTKTraceGroup object
- *
- * @param traceGroup The TraceGroup whose minimum need to be computed
- * @param channelNames Names of channels in the traceGroup for which minimum need to be computed
- * @param minValues output vector containing minValues for each channel
- */
- static int computeChannelMinimum(const LTKTraceGroup& traceGroup, const vector<string>& channelNames,
- vector<float>& minValues);
-
- /**
- * This function computes the minimum and maximum of channels of an LTKTraceGroup object
- *
- * @param traceGroup The TraceGroup whose parameters need to be computed
- * @param channelNames Names of channels for which parameters need to be computed
- * @param minValues output vector containing minValues for each channel
- * @param maxValues output vector containing maxValues for each channel
- */
- static int computeChannelMaxMin(const LTKTraceGroup& traceGroup, const vector<string>& channelNames,
- vector<float>& maxValues, vector<float>& minValues);
-
-
- // @}
-
-};
-
-#endif //#ifndef __LTKINKUTILS_H
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.cpp
deleted file mode 100644
index f7f85702..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-******************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2009-02-25 13:55:23 +0530 (Wed, 25 Feb 2009) $
- * $Revision: 741 $
- * $Author: mnab $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-#include "LTKLinuxUtil.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <sys/utsname.h>
-
-
-/************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : LTKWindowsUtil
- * DESCRIPTION : Default constructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- *****************************************************************************/
-LTKLinuxUtil::LTKLinuxUtil()
-{
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : ~LTKWindowsUtil
- * DESCRIPTION : Desstructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-LTKLinuxUtil::~LTKLinuxUtil()
-{
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::loadSharedLib(const string & lipiLibPath,
- const string & sharedLibName,
- void * * libHandle)
-{
-
-
- string sharedLibraryPath = "";
-
- // construct the path for the recogniser DLL
- sharedLibraryPath = lipiLibPath + "/" + "lib" + sharedLibName + ".so";
-
- // Load the DLL
- *libHandle = dlopen(sharedLibraryPath.c_str(), RTLD_LAZY);
-
- if(*libHandle == NULL)
- {
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::unloadSharedLib(void * libHandle)
-{
- if (libHandle != NULL)
- {
- int returnVal = dlclose(libHandle);
-
- if (returnVal != 0 )
- {
- return FAILURE;
- }
- }
- else
- {
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : getFunctionAddress
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle)
-{
- // validate parameters
- if (libHandle == NULL )
- {
- return FAILURE;
- }
-
- if (functionName.empty())
- {
- return FAILURE;
- }
-
- *functionHandle = dlsym(libHandle, functionName.c_str());
-
- if ( *functionHandle == NULL )
- {
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getPlatformName
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::getPlatformName(string& outStr)
-{
- outStr = "Linux";
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getProcessorArchitechure
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::getProcessorArchitechure(string& outStr)
-{
-
- struct utsname name;
-
- uname(&name);
-
- outStr = name.machine;
-
- return SUCCESS;
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getOSInfo
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::getOSInfo(string& outStr)
-{
-
- struct utsname name;
- uname(&name);
- string sysName(name.sysname);
- string sysRelease(name.release);
-
- outStr = sysName + " " + sysRelease;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : recordStartTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::recordStartTime()
-{
- time(&m_startTime);
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : recordEndTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::recordEndTime()
-{
- time(&m_endTime);
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : diffTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::diffTime(string& outStr)
-{
- char temp[10];
- sprintf(temp, "%.1f", difftime(m_endTime, m_startTime));
- string tempStr(temp) ;
- outStr = tempStr;
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getSystemTimeString
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKLinuxUtil::getSystemTimeString(string& outStr)
-{
- time_t rawtime;
-
- time(&rawtime);
-
- string timeStr = ctime(&rawtime);
-
- outStr = timeStr.substr(0, 24);
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 17-07-2008
- * NAME : getLibraryHandle
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-
-void* LTKLinuxUtil::getLibraryHandle(const string& libName)
-{
- string lipiRoot= getEnvVariable(LIPIROOT_ENV_STRING) ;
- string libNameLinux = lipiRoot + "/" + "lib" + "/" + "lib" + libName + ".so";
-
- void* libHandle = NULL;
- libHandle = dlopen(libNameLinux.c_str(), RTLD_LAZY);
-
- if(libHandle == NULL)
- cout << "Error opening " << libNameLinux.c_str() << " : " << dlerror() << endl;
-
- return libHandle;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 17-07-2008
- * NAME : getEnvVariable
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-
-string LTKLinuxUtil::getEnvVariable(const string& envVariableName)
-{
- return getenv(envVariableName.c_str());
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.h
deleted file mode 100644
index d8eef6f2..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLinuxUtil.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-******************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-08-12 11:34:07 +0530 (Tue, 12 Aug 2008) $
- * $Revision: 604 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR:
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKLINUXUTIL_H
-#define __LTKLINUXUTIL_H
-
-#include "LTKOSUtil.h"
-
-class LTKLinuxUtil: public LTKOSUtil
-{
-private:
- time_t m_startTime;
-
- time_t m_endTime;
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKLinuxUtil();
-
- /**
- * Destructor
- */
-
- ~LTKLinuxUtil();
-
- // @}
- int loadSharedLib(const string& lipiLibPath,
- const string& sharedLibName,
- void** libHandle);
-
- int unloadSharedLib(void* libHandle);
-
- int getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle);
-
- int getPlatformName(string& outStr);
-
- int getProcessorArchitechure(string& outStr);
-
- int getOSInfo(string& outStr);
-
- int recordStartTime();
-
- int recordEndTime();
-
- int diffTime(string& outStr);
-
- int getSystemTimeString(string& outStr);
-
- void* getLibraryHandle(const string& libName);
-
- string getEnvVariable(const string& envVariableName);
-
-};
-
-#endif
-
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.cpp
deleted file mode 100644
index 1971a69d..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-04 11:43:39 +0530 (Fri, 04 Jul 2008) $
- * $Revision: 544 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Implementation of the String Splitter Module
- *
- * CONTENTS:
- * tokenizeString
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKLoggerUtil.h"
-#include "LTKOSUtil.h"
-#include "LTKOSUtilFactory.h"
-#include "LTKLogger.h"
-#include "LTKMacros.h"
-#include "LTKErrors.h"
-#include "LTKErrorsList.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#include <memory>
-
-void* LTKLoggerUtil::m_libHandleLogger = NULL;
-FN_PTR_LOGMESSAGE LTKLoggerUtil::module_logMessage = NULL;
-FN_PTR_STARTLOG LTKLoggerUtil::module_startLogger = NULL;
-FN_PTR_GETINSTANCE LTKLoggerUtil::module_getInstanceLogger = NULL;
-FN_PTR_DESTROYINSTANCE LTKLoggerUtil::module_destroyLogger = NULL;
-#ifdef _WIN32
-ofstream LTKLoggerUtil::m_emptyStream;
-#else
-ofstream LTKLoggerUtil::m_emptyStream("/dev/null");
-#endif
-
-/****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 09-Jul-2007
-* NAME : LTKLoggerUtil
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-****************************************************************************/
-
-LTKLoggerUtil::LTKLoggerUtil(){}
-
-
-
-/****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 09-Jul-2007
-* NAME : createLogger
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-****************************************************************************/
-
-int LTKLoggerUtil::createLogger(const string& lipiLibPath)
-{
- void* functionHandle = NULL;
- auto_ptr<LTKOSUtil> a_ptrOSUtil(LTKOSUtilFactory::getInstance());
-
- int iErrorCode = a_ptrOSUtil->loadSharedLib(lipiLibPath,
- LOGGER_MODULE_STR,
- &m_libHandleLogger);
-
-
- if(iErrorCode != SUCCESS)
- {
- return iErrorCode;
- }
-
- // Create logger instance
- if (module_getInstanceLogger == NULL)
- {
- iErrorCode = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "getLoggerInstance",
- &functionHandle);
- if(iErrorCode != SUCCESS)
- {
- return iErrorCode;
- }
-
- module_getInstanceLogger = (FN_PTR_GETINSTANCE)functionHandle;
-
- functionHandle = NULL;
- }
-
- module_getInstanceLogger();
-
- // map destoylogger function
- if (module_destroyLogger == NULL)
- {
- iErrorCode = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "destroyLogger",
- &functionHandle);
- if(iErrorCode != SUCCESS)
- {
- return iErrorCode;
- }
-
- module_destroyLogger = (FN_PTR_DESTROYINSTANCE)functionHandle;
-
- functionHandle = NULL;
- }
-
- return iErrorCode;
-
-}
-
-/*****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE :
-* NAME : destroyLogger
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-int LTKLoggerUtil::destroyLogger()
-{
- auto_ptr<LTKOSUtil> a_ptrOSUtil(LTKOSUtilFactory::getInstance());
-
- if (module_destroyLogger != NULL )
- {
- module_destroyLogger();
- }
-
- int returnVal = a_ptrOSUtil->unloadSharedLib(m_libHandleLogger);
-
- return returnVal;
-}
-
-
-/*****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE :
-* NAME : getAddressLoggerFunctions
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-int LTKLoggerUtil::configureLogger(const string& logFile, LTKLogger::EDebugLevel logLevel)
-{
- void* functionHandle = NULL;
- int returnVal = SUCCESS;
-
- FN_PTR_SETLOGFILENAME module_setLogFileName = NULL;
- FN_PTR_SETLOGLEVEL module_setLogLevel = NULL;
-
- if (m_libHandleLogger == NULL )
- {
- LTKReturnError(ELOGGER_LIBRARY_NOT_LOADED);
- }
-
- auto_ptr<LTKOSUtil> a_ptrOSUtil(LTKOSUtilFactory::getInstance());
-
- if ( logFile.length() != 0 )
- {
- returnVal = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "setLoggerFileName",
- &functionHandle);
-
- if(returnVal != SUCCESS)
- {
- return returnVal;
- }
-
- module_setLogFileName = (FN_PTR_SETLOGFILENAME)functionHandle;
-
- functionHandle = NULL;
-
- module_setLogFileName(logFile);
-
- }
- else
- {
- LTKReturnError(EINVALID_LOG_FILENAME);
- }
-
- returnVal = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "setLoggerLevel",
- &functionHandle);
-
- if(returnVal != SUCCESS)
- {
- LTKReturnError(returnVal);
- }
-
- module_setLogLevel = (FN_PTR_SETLOGLEVEL)functionHandle;
-
- functionHandle = NULL;
-
- module_setLogLevel(logLevel);
-
- return SUCCESS;
-
-}
-
-
-/*****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE :
-* NAME : getAddressLoggerFunctions
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-int LTKLoggerUtil::getAddressLoggerFunctions()
-{
- void* functionHandle = NULL;
- int returnVal = SUCCESS;
-
- auto_ptr<LTKOSUtil> a_ptrOSUtil;
-
- //start log
-
- if (module_startLogger == NULL )
- {
- if(!a_ptrOSUtil.get())
- a_ptrOSUtil.reset(LTKOSUtilFactory::getInstance());
- returnVal = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "startLogger",
- &functionHandle);
-
- if(returnVal != SUCCESS)
- {
- LTKReturnError(returnVal);
- }
-
- module_startLogger = (FN_PTR_STARTLOG)functionHandle;
-
- functionHandle = NULL;
- }
-
- module_startLogger();
-
- // map Log message
- if (module_logMessage == NULL)
- {
- if(!a_ptrOSUtil.get())
- a_ptrOSUtil.reset(LTKOSUtilFactory::getInstance());
- returnVal = a_ptrOSUtil->getFunctionAddress(m_libHandleLogger,
- "logMessage",
- &functionHandle);
-
- if(returnVal != SUCCESS)
- {
- LTKReturnError(returnVal);
- }
-
- module_logMessage = (FN_PTR_LOGMESSAGE)functionHandle;
-
- functionHandle = NULL;
-
- }
-
-
- return SUCCESS;
-
-}
-
-/*****************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 15-Jul-2008
-* NAME : nidhi
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-
-
-ostream& LTKLoggerUtil::logMessage(LTKLogger::EDebugLevel logLevel, string inStr, int lineNumber)
-{
- if (m_libHandleLogger == NULL)
- {
- auto_ptr<LTKOSUtil> a_ptrOSUtil(LTKOSUtilFactory::getInstance());
- m_libHandleLogger = a_ptrOSUtil->getLibraryHandle(LOGGER_MODULE_STR);
-
- if (m_libHandleLogger == NULL)
- {
- return m_emptyStream;
- }
- }
-
-
- // get function addresses
- if ( module_startLogger == NULL ||
- module_logMessage == NULL )
- {
- int returnVal = getAddressLoggerFunctions();
-
- if(returnVal != SUCCESS)
- {
- return m_emptyStream;
- }
- }
-
- return module_logMessage(logLevel, inStr, lineNumber);
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.h
deleted file mode 100644
index 2f09831b..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKLoggerUtil.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-*
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate:$
- * $Revision: $
- * $Author: $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the String Splitter Module
- *
- * CONTENTS:
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKLOGGERUTIL_H
-#define __LTKLOGGERUTIL_H
-
-#include "LTKInc.h"
-#include "LTKLogger.h"
-class LTKOSUtil;
-
-typedef LTKLoggerInterface* (*FN_PTR_GETINSTANCE)();
-typedef void (*FN_PTR_DESTROYINSTANCE)();
-typedef void (*FN_PTR_STARTLOG)();
-typedef void (*FN_PTR_SETLOGFILENAME)(const string&);
-typedef void (*FN_PTR_SETLOGLEVEL)(LTKLogger::EDebugLevel);
-typedef ostream& (*FN_PTR_LOGMESSAGE)(int, const string& , int );
-
-// Set to 1 to disable the logging functionality
-#define DISABLE_LOG 1
-
-#define LOG(EDebugLevel) if(!DISABLE_LOG) LTKLoggerUtil::logMessage(EDebugLevel, __FILE__, __LINE__)
-
-/**
-* @ingroup util
-*/
-
-/** @brief Utility class to tokenize a string on any given delimiter
-@class LTKStringUtil
-*/
-
-class LTKLoggerUtil
-{
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKLoggerUtil();
-
-
- // @}
-
- /**
- * @name Methods
- */
-
- // @{
-
- /**
- * This is a static method which splits a string at the specified delimiters
- * @param str String to be split
- * @param tokens The split sub-strings
- * @param delimiters The symbols at which the string is to be split at
- * @return SUCCESS on successful split operation
- */
-
- static int createLogger(const string& lipiLibPath);
-
- static int destroyLogger();
-
- static int configureLogger(const string& logFile, LTKLogger::EDebugLevel logLevel);
-
- static int getAddressLoggerFunctions();
-
- static ostream& logMessage(LTKLogger::EDebugLevel logLevel, string, int);
-
- static ofstream m_emptyStream;
-
-
- // @}
-
- private:
- static void* m_libHandleLogger;
-
- static FN_PTR_LOGMESSAGE module_logMessage;
-
- static FN_PTR_STARTLOG module_startLogger;
-
- static FN_PTR_GETINSTANCE module_getInstanceLogger;
-
- static FN_PTR_DESTROYINSTANCE module_destroyLogger;
-
-
-
-
-};
-
-#endif //#ifndef __LTKSTRINGTOKENIZER_H
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKOSUtilFactory.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKOSUtilFactory.cpp
deleted file mode 100644
index 87e14a64..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKOSUtilFactory.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-********************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-08-12 13:24:43 +0530 (Tue, 12 Aug 2008) $
- * $Revision: 610 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKOSUtil.h"
-#include "LTKOSUtilFactory.h"
-#include "LTKMacros.h"
-
-#ifdef WINCE
- #include "LTKWinCEUtil.h"
-#elif defined WIN32
- #include "LTKWindowsUtil.h"
-#else
- #include "LTKLinuxUtil.h"
-#endif
-
-
-/*************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 29-May-2008
-* NAME : getInstance
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-**************************************************************************/
-LTKOSUtil* LTKOSUtilFactory::getInstance()
-{
- #ifdef WINCE
- return new LTKWinCEUtil();
- #elif defined WIN32
- return new LTKWindowsUtil();
- #else
- return new LTKLinuxUtil();
- #endif
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.cpp
deleted file mode 100644
index 3d27249e..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-02-08 11:00:11 +0530 (Tue, 08 Feb 2011) $
- * $Revision: 832 $
- * $Author: dineshm $
- *
- ************************************************************************/
-
-#include "LTKStrEncoding.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-
-/************************************************************************
- * FILE DESCR: Implementation of LTKInkUtils that computes the statistics
- * of a trace group
- *
- * CONTENTS:
- * shapeStrToUnicode
- * tamilShapeStrToUnicode
- *
- * AUTHOR: Deepu V.
- *
- * DATE: September 8, 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 08-SEP-2005
-* NAME : LTKStrEncoding
-* DESCRIPTION : Initialization constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKStrEncoding::LTKStrEncoding()
-{
-
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 08-SEP-2005
-* NAME : shapeStrToUnicode
-* DESCRIPTION : Do the mapping from shaperecognition ID to Unicode string
-* ARGUMENTS : shapeRecProjectName - Shape Recognition Project name
-* : shapeIDs - The shape recognizer output IDs
-* : unicodeString - output unicode string
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-int LTKStrEncoding::shapeStrToUnicode(const string shapeRecProjectName, const vector<unsigned short>&shapeIDs, vector<unsigned short>& unicodeString)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStrEncoding::shapeStrToUnicode()" << endl;
-
-
- /*if(shapeRecProjectName.empty())
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EMAP_NOT_FOUND <<":"<< getErrorMessage(EMAP_NOT_FOUND)
- <<"LTKStrEncoding::shapeStrToUnicode()" <<endl;
-
- LTKReturnError(EMAP_NOT_FOUND);
- }*/
-
- if(shapeRecProjectName == "tamil_iso_char")
- {
- return (tamilShapeStrToUnicode(shapeIDs,unicodeString));
- }
- else
- {
- return (numShapeStrToUnicode(shapeIDs,unicodeString));
- }
-
- //uncomment following if you need to implement mappings for
- //additional shape rec projects
- //else if (shapeRecProjectName == <YOUR PROJECT NAME>)
- //{
- // //Implement the logic here
- //}
-
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStrEncoding::shapeStrToUnicode()" << endl;
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 08-SEP-2005
-* NAME : numShapeStrToUnicode
-* DESCRIPTION : Do the mapping from shaperecognition ID
-* : to Unicode string for numerals project
-* ARGUMENTS : shapeIDs - The shape recognizer output IDs
-* : unicodeString - output unicode string
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKStrEncoding::numShapeStrToUnicode(const vector<unsigned short>& shapeIDs, vector<unsigned short>& unicodeString)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStrEncoding::numShapeStrToUnicode()" << endl;
-
- vector<unsigned short>::const_iterator shapeIDsIter, shapeIDsEnd;
-
- //iterating through the shape IDs
- shapeIDsEnd = shapeIDs.end();
- for(shapeIDsIter = shapeIDs.begin();shapeIDsIter != shapeIDsEnd;++shapeIDsIter)
- {
- if(*shapeIDsIter == SHRT_MAX )
- unicodeString.push_back(L' ');
- else
- unicodeString.push_back((L'0')+ (*shapeIDsIter) );
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStrEncoding::numShapeStrToUnicode()" << endl;
-
- return SUCCESS;
-}
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 08-SEP-2005
-* NAME : tamilShapeStrToUnicode
-* DESCRIPTION : Do the mapping from shaperecognition ID
-* : to Unicode string for tamil_iso_char project
-* ARGUMENTS : shapeIDs - The shape recognizer output IDs
-* : unicodeString - output unicode string
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKStrEncoding::tamilShapeStrToUnicode(const vector<unsigned short>& shapeIDs, vector<unsigned short>& unicodeString)
-{
- int errorCode;
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStrEncoding::tamilShapeStrToUnicode()" << endl;
-
- vector<unsigned short>::const_iterator shapeIDsIter, shapeIDsEnd;
- int charIndex; //index variable for unicode string
- unsigned short currentChar; //unicode representation of the character
- bool matraFlag; //indicates whether a matra is following the current character
-
- //iterating through the shape IDs
- shapeIDsEnd = shapeIDs.end();
- for(shapeIDsIter = shapeIDs.begin();shapeIDsIter != shapeIDsEnd;++shapeIDsIter)
- {
- if(*shapeIDsIter == SHRT_MAX )
- unicodeString.push_back(L' ');
- else if(*shapeIDsIter < 35)
- {
- if((errorCode = tamilCharToUnicode(*shapeIDsIter,unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- }
- else if (*shapeIDsIter < 58 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-23),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bbf); //i mAtra
- }
- else if (*shapeIDsIter < 81 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-46),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bc0); //ii mAtra
- }
- else if (*shapeIDsIter < 99 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-69),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bc1); //u mAtra
- }
- else if (*shapeIDsIter < 117 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-87),unicodeString)) != SUCCESS)
- unicodeString.push_back(0x0bc2); //uu mAtra
- }
- else if (*shapeIDsIter < 118 )
- {
- unicodeString.push_back(0x0bbe); //aa mAtra
- }
- else if (*shapeIDsIter < 119 )
- {
- unicodeString.push_back(0x0bc6); //e mAtra
- }
- else if (*shapeIDsIter < 120 )
- {
- unicodeString.push_back(0x0bc7); //E mAtra
- }
- else if (*shapeIDsIter < 121 )
- {
- unicodeString.push_back(0x0bc8); //ai mAtra
- }
- else if(*shapeIDsIter < 122 )
- {
- //letter shri
- unicodeString.push_back(0x0bb8);//ss
- unicodeString.push_back(0x0bcd);//halant
- unicodeString.push_back(0x0bb0);//r
- unicodeString.push_back(0x0bc0);//ii
- }
- else if(*shapeIDsIter < 127 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-92),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bc1); //u mAtra
- }
- else if(*shapeIDsIter < 132 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-97),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bc2); //u mAtra
- }
- else if(*shapeIDsIter < 155 )
- {
- if((errorCode = tamilCharToUnicode((*shapeIDsIter-120),unicodeString)) != SUCCESS)
- {
- return errorCode;
- }
- unicodeString.push_back(0x0bcd); //halant
- }
- else if (*shapeIDsIter < 156 )
- {
- unicodeString.push_back(0x0b94);
- }
- else
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINVALID_SHAPEID <<":"<< getErrorMessage(EINVALID_SHAPEID)
- <<"LTKStrEncoding::tamilShapeStrToUnicode()" <<endl;
-
- LTKReturnError(EINVALID_SHAPEID);
- }
- }
-
- //Applying rules for e, E , ai, o, O, and au matras
- charIndex = 0;
- while( charIndex < unicodeString.size() )
- {
- currentChar = unicodeString[charIndex];
- switch(currentChar)
- {
- case 0x0bc6://e
- case 0x0bc7://E
- case 0x0bc8://ai
- if( (charIndex +1) < unicodeString.size() )
- {
- unicodeString[charIndex] = unicodeString[charIndex+1];
- unicodeString[charIndex+1] = currentChar;
- charIndex += 2;
- }
- else
- {
- ++charIndex;
- }
- break;
- case 0x0bbe: //check for `o' or `O'
- if(charIndex>0)//within string bounds
- {
- if(unicodeString[charIndex-1] == 0x0bc6 )
- {
- unicodeString[charIndex-1] = 0x0bca;
- unicodeString.erase(unicodeString.begin()+charIndex);
- }
- else if(unicodeString[charIndex-1] == 0x0bc7 )
- {
- unicodeString[charIndex-1] = 0x0bcb;
- unicodeString.erase(unicodeString.begin()+charIndex);
- }
- else
- {
- ++charIndex;
- }
- }
- else
- {
- ++charIndex;
- }
- break;
- case 0x0bb3: //check for au
- matraFlag = (charIndex+1<unicodeString.size() && (unicodeString[charIndex+1] > 0x0bbd && unicodeString[charIndex+1] < 0x0bc3 ) );
-
- //if la is not follwed by a matra and is preceded by an e matra it is an au matra
- if((charIndex >0)&&(unicodeString[charIndex-1] == 0x0bc6) && (!matraFlag))
- {
- unicodeString[charIndex-1] = 0x0bcc;
- unicodeString.erase(unicodeString.begin()+charIndex);
- }
- else
- {
- ++charIndex;
- }
- break;
- default:
- ++charIndex;
-
- }
-
- }
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStrEncoding::tamilShapeStrToUnicode()" << endl;
-
- return SUCCESS;
-}
-
-int LTKStrEncoding::tamilCharToUnicode(const unsigned short& shapeID, vector<unsigned short>& unicodeString)
-{
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStrEncoding::tamilCharToUnicode()" << endl;
-
-
- if(shapeID < 35)
- {
- if(shapeID == 34)
- {
- unicodeString.push_back(0x0b95);
- unicodeString.push_back(0x0bcd);
- unicodeString.push_back(0x0bb7);
- }
- else
- {
- unicodeString.push_back(tamilIsoCharMap[shapeID]);
- }
- }
- else
- {
- LOG(LTKLogger::LTK_LOGLEVEL_ERR)
- <<"Error : "<< EINVALID_SHAPEID <<":"<< getErrorMessage(EINVALID_SHAPEID)
- <<"LTKStrEncoding::tamilCharToUnicode()" <<endl;
-
- LTKReturnError(EINVALID_SHAPEID);
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStrEncoding::tamilCharToUnicode()" << endl;
-
- return SUCCESS;
-}
-
-
-/**********************************************************************************
-* AUTHOR : Deepu V.
-* DATE : 08-SEP-2005
-* NAME : ~LTKStrEncoding
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-LTKStrEncoding::~LTKStrEncoding()
-{
-
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.h
deleted file mode 100644
index a61517fb..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStrEncoding.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-10 15:23:21 +0530 (Thu, 10 Jul 2008) $
- * $Revision: 556 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the Shape ID to Unicode mapping functions
- *
- * CONTENTS:
- *
- * AUTHOR: Deepu V.
- *
- * DATE: September 08 2005
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKSTRENCODING_H
-#define __LTKSTRENCODING_H
-
-#include <string>
-
-#include "LTKInc.h"
-#include "LTKTypes.h"
-#include "LTKErrorsList.h"
-#include "LTKErrors.h"
-
-//mapping for Tamil basic characters
-static unsigned short tamilIsoCharMap[] = {
-//class ID Unicode value
-/*000*/ 0x0b85, //a
-/*001*/ 0x0b86, //aa
-/*002*/ 0x0b87, //i
-/*003*/ 0x0b88, //ii
-/*004*/ 0x0b89, //u
-/*005*/ 0x0b8a, //uu
-/*006*/ 0x0b8e, //e
-/*007*/ 0x0b8f, //E
-/*008*/ 0x0b90, //ai
-/*009*/ 0x0b92, //o
-/*010*/ 0x0b93, //O
-/*011*/ 0x0b83, //aytham
-/*012*/ 0x0b95, //ka
-/*013*/ 0x0b99, //nga
-/*014*/ 0x0b9a, //cha
-/*015*/ 0x0b9e, //nja
-/*016*/ 0x0b9f, //Ta
-/*017*/ 0x0ba3, //Na
-/*018*/ 0x0ba4, //ta
-/*019*/ 0x0ba8, //na
-/*020*/ 0x0baa, //pa
-/*021*/ 0x0bae, //ma
-/*022*/ 0x0baf, //ya
-/*023*/ 0x0bb0, //ra
-/*024*/ 0x0bb2, //la
-/*025*/ 0x0bb5, //va
-/*026*/ 0x0bb4, //zha
-/*027*/ 0x0bb3, //La
-/*028*/ 0x0bb1, //Ra
-/*029*/ 0x0ba9, //n2a
-/*030*/ 0x0bb8, //sa
-/*031*/ 0x0bb7, //sha
-/*032*/ 0x0b9c, //ja
-/*033*/ 0x0bb9 //ha
- };
-
-/**
-* @class LTKStrEncoding
-* <p> This class contains the methods
-* for mapping shape ID to Unicode </p>
-*/
-
-class LTKStrEncoding
-{
-
-public:
- /**
- * @name Constructors and Destructor
- */
- // @{
-
- /**
- * Default Constructor
- */
- LTKStrEncoding();
-
- /**
- * Destructor
- */
- virtual ~LTKStrEncoding();
-
- // @}
-
- /**
- * This function maps the vector of shape recognizer strings to the
- *
- * @param shapeRecProjectName The shape recognition project name
- * @param shapeIDs the vector of shape ids from the shape recognizer
- * @param unicodeString the unicode string output
- */
- static int shapeStrToUnicode(const string shapeRecProjectName, const vector<unsigned short>& shapeIDs, vector<unsigned short>& unicodeString);
-
-private:
-
- static int numShapeStrToUnicode(const vector<unsigned short>& shapeIDs, vector<unsigned short>& unicodeString);
- static int tamilShapeStrToUnicode(const vector<unsigned short>& shapeIDs, vector<unsigned short>& unicodeString);
- static int tamilCharToUnicode(const unsigned short& shapeID, vector<unsigned short>& unicodeString);
-
-
-};
-#endif //#ifndef __LTKSTRENCODING_H \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.cpp
deleted file mode 100644
index 7f56a66d..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2011-01-11 13:48:17 +0530 (Tue, 11 Jan 2011) $
- * $Revision: 827 $
- * $Author: mnab $
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Implementation of the String Splitter Module
- *
- * CONTENTS:
- * tokenizeString
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKStringUtil.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-#include <sstream>
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : LTKStringUtil
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKStringUtil::LTKStringUtil(){}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : tokenizeString
-* DESCRIPTION : splits the given string at the specified delimiters
-* ARGUMENTS : str - string to be split
-* outTokens - the vector containing the split parts of the string
-* delimiters - the symbols at which the string is to be split
-* RETURNS : SUCCESS on successfully splitting of the string
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-* Saravanan. R 29-3-07 dynamic allocation for strString
-*************************************************************************************/
-
-int LTKStringUtil::tokenizeString(const string& inputString,
- const string& delimiters,
- vector<string>& outTokens)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStringUtil::tokenizeString()" << endl;
-
- // clearing the token list
- int inputStrLength = inputString.length();
- int delimLength = delimiters.length();
-
-
- char *strToken;
- char *strString = new char[inputStrLength + 1];
-
- outTokens.clear();
-
- strcpy(strString, inputString.c_str());
-
- strToken = strtok(strString, delimiters.c_str());
-
- while( strToken != NULL )
- {
- outTokens.push_back(strToken);
-
- // Get next token:
- strToken = strtok(NULL, delimiters.c_str());
- }
- delete[] strString;
-
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStringUtil::tokenizeString()" << endl;
-
- return SUCCESS;
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : ~LTKStringUtil
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKStringUtil::~LTKStringUtil(){}
-
-
-/*****************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : ~LTKStringUtil
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-void LTKStringUtil::trimString(string& str)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKStringUtil::trimString()" << endl;
-
- string::size_type pos = str.find_last_not_of(' ');
-
- if(pos != string::npos)
- {
- // we found a non space char
- str.erase(pos + 1);
- pos = str.find_first_not_of(' ');
-
- if(pos != string::npos)
- {
- str.erase(0, pos);
- }
- }
- else
- {
- // string has nothing else but spaces
- str.erase(str.begin(), str.end());
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKStringUtil::trimString()" << endl;
-}
-
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 29-Jan-2008
-* NAME : convertIntegerToString
-* DESCRIPTION : Converts an integer variable to string
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void LTKStringUtil::convertIntegerToString(int intVariable, string& outStr)
-{
- ostringstream tempString;
-
- tempString << intVariable;
-
- outStr = tempString.str();
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 29-Jan-2008
-* NAME : convertIntegerToString
-* DESCRIPTION : Converts an integer variable to string
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void LTKStringUtil::convertFloatToString(float floatVariable, string& outStr)
-{
- ostringstream tempString;
-
- tempString << floatVariable;
-
- outStr = tempString.str();
-}
-
-/***************************************************************************
-* AUTHOR :
-* DATE : 18-Mar-2015
-* NAME : convertStringToFloat
-* DESCRIPTION : Converts string to float
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-float LTKStringUtil::convertStringToFloat(const string& str)
-{
- float rval;
- stringstream ss(str);
- ss.imbue(locale("C"));
- ss >> rval;
- return rval;
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 29-Jan-2008
-* NAME : isNumeric
-* DESCRIPTION : Retruns true if the input string is numeric
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*******************************************************************************/
-bool LTKStringUtil::isFloat(const string& inputStr)
-{
- string remainingStr = "";
-
- // check if prefixed with a sign
- if (inputStr.find_first_of('-') == 0 || inputStr.find_first_of('+') == 0)
- {
- remainingStr = inputStr.substr(1);
- }
- else
- {
- remainingStr = inputStr;
- }
-
- // check if two decimals are there like 9.8.8
- string::size_type pos = remainingStr.find_first_of('.');
-
- if (pos != string::npos)
- {
- string tempString = remainingStr.substr(pos+1);
-
- string::size_type pos2 = tempString.find_first_of('.');
-
- if (pos2 != string::npos)
- {
- return false;
- }
- }
-
-
- const char* ptr = remainingStr.c_str();
-
- for ( ; *ptr; ptr++)
- {
- if (*ptr < '0' || *ptr > '9' )
- {
- if ( *ptr != '.' )
- {
- return false;
- }
- }
- }
-
- return true;
-}
-
-/***************************************************************************
-* AUTHOR : Srinivasa Vithal
-* DATE : 18-Feb-2008
-* NAME : isFloat
-* DESCRIPTION : Retruns true if the input string is integer
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*******************************************************************************/
-bool LTKStringUtil::isInteger(const string& inputStr)
-{
- string remainingStr = "";
-
- // check if prefixed with a sign
- if (inputStr.find_first_of('-') == 0 || inputStr.find_first_of('+') == 0)
- {
- remainingStr = inputStr.substr(1);
- }
- else
- {
- remainingStr = inputStr;
- }
-
- // check if a decimal is present
- string::size_type pos = remainingStr.find_first_of('.');
-
- if (pos != string::npos)
- {
- return false;
- }
-
- const char* ptr = remainingStr.c_str();
-
- for ( ; *ptr; ptr++)
- {
- if (*ptr < '0' || *ptr > '9' )
- {
- return false;
- }
- }
-
- return true;
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.h
deleted file mode 100644
index 4a2c9442..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKStringUtil.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-10 15:23:21 +0530 (Thu, 10 Jul 2008) $
- * $Revision: 556 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Definitions for the String Splitter Module
- *
- * CONTENTS:
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKSTRINGTOKENIZER_H
-#define __LTKSTRINGTOKENIZER_H
-
-#include "LTKInc.h"
-
-/**
-* @ingroup util
-*/
-
-/** @brief Utility class to tokenize a string on any given delimiter
-@class LTKStringUtil
-*/
-
-class LTKStringUtil
-{
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKStringUtil();
-
- /**
- * Destructor
- */
-
- ~LTKStringUtil();
-
- // @}
-
- /**
- * @name Methods
- */
-
- // @{
-
- /**
- * This is a static method which splits a string at the specified delimiters
- * @param str String to be split
- * @param tokens The split sub-strings
- * @param delimiters The symbols at which the string is to be split at
- * @return SUCCESS on successful split operation
- */
-
- static int tokenizeString(const string& str, const string& delimiters, vector<string>& outTokens);
-
- static void convertIntegerToString(int intVariable, string& outStr);
-
- static void convertFloatToString(float floatVariable, string& outStr);
-
- static float convertStringToFloat(const string& str);
-
- static void trimString(string& str);
-
- static bool isFloat(const string& inputStr);
-
- static bool isInteger(const string& inputStr);
-
- // @}
-
-};
-
-#endif //#ifndef __LTKSTRINGTOKENIZER_H
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.cpp
deleted file mode 100644
index 1b48e8d4..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-18 15:33:34 +0530 (Fri, 18 Jul 2008) $
- * $Revision: 564 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Defines the function to check the version compatibility
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 25, 2007
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKVersionCompatibilityCheck.h"
-#include "LTKStringUtil.h"
-#include "LTKTypes.h"
-#include "LTKLoggerUtil.h"
-
-/**********************************************************************************
-* AUTHOR : Nidhi sharma
-* DATE : 25-May-2007
-* NAME : LTKVersionCompatibilityCheck
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-LTKVersionCompatibilityCheck::LTKVersionCompatibilityCheck():m_delimiter(".")
-{
-}
-
-/**********************************************************************************
-* AUTHOR : Nidhi sharma
-* DATE : 25-May-2007
-* NAME : ~LTKVersionCompatibilityCheck
-* DESCRIPTION : Default Destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-LTKVersionCompatibilityCheck::~LTKVersionCompatibilityCheck()
-{
-}
-
-/**********************************************************************************
-* AUTHOR : Nidhi sharma
-* DATE : 25-May-2007
-* NAME : checkCompatibility
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-bool LTKVersionCompatibilityCheck::checkCompatibility(const string& supportedMinVersion,
- const string& currentVersion,
- const string& versionRead)
- {
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKVersionCompatibilityCheck::checkCompatibility()" << endl;
-
- bool returnStatus = false;
-
-
- if (versionRead == currentVersion )
- {
- return true;
- }
-
- if (isFirstVersionHigher(versionRead, supportedMinVersion) == true &&
- isFirstVersionHigher(currentVersion, versionRead) == true)
- {
- returnStatus = true;
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKVersionCompatibilityCheck::checkCompatibility()" << endl;
-
- return returnStatus;
-}
-
-bool LTKVersionCompatibilityCheck::isFirstVersionHigher(const string& firstVersion,
- const string& secondVersion)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKVersionCompatibilityCheck::isFirstVersionHigher()" << endl;
-
- if ( firstVersion == secondVersion )
- {
- return true;
- }
-
- bool returnVal = false;
- bool equalityObtained = false;
-
- stringVector firstVerTok;
- stringVector secondVerTok;
-
- LTKStringUtil::tokenizeString(firstVersion, m_delimiter, firstVerTok);
- LTKStringUtil::tokenizeString(secondVersion, m_delimiter, secondVerTok);
-
- int versionTokSize = firstVerTok.size();
-
- if ( versionTokSize != secondVerTok.size())
- {
- return false;
- }
-
- // compare first tokens
- int cmpResults = compareTokens(atoi((firstVerTok[0]).c_str()), atoi((secondVerTok[0]).c_str()));
-
- switch (cmpResults)
- {
- case GREATER :
- returnVal = true;
- break;
-
- case LESSER :
- returnVal = false;
- break;
-
- case EQUAL :
- equalityObtained = true;
- break;
- }
-
- if (equalityObtained == false)
- {
- return returnVal;
- }
- else
- {
- equalityObtained = false;
- returnVal = false;
-
- // Compare the second tokens
- int cmpResults2 = compareTokens(atoi((firstVerTok[1]).c_str()), atoi((secondVerTok[1]).c_str()));
-
- switch (cmpResults2)
- {
- case GREATER :
- returnVal = true;
- break;
-
- case LESSER :
- returnVal = false;
- break;
-
- case EQUAL :
- equalityObtained = true;
- break;
- }
- }
-
- if (equalityObtained == false)
- {
- return returnVal;
- }
- else
- {
- equalityObtained = false;
- returnVal = false;
-
- // Compare the second tokens
- int cmpResults3 = compareTokens(atoi((firstVerTok[2]).c_str()), atoi((secondVerTok[2]).c_str()));
-
- switch (cmpResults3)
- {
- case GREATER :
- returnVal = true;
- break;
-
- case LESSER :
- returnVal = false;
- break;
-
- case EQUAL :
- returnVal = true;
- break;
- }
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKVersionCompatibilityCheck::isFirstVersionHigher()" << endl;
- return returnVal;
-
-}
-
-ELTKVersionComparison LTKVersionCompatibilityCheck::compareTokens(int firstTokenIntegerValue,
- int secondTokenIntegerValue)
-{
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Entering: LTKVersionCompatibilityCheck::compareTokens()" << endl;
-
- ELTKVersionComparison returnVal;
-
- //int firstTokenIntegerValue =atoi((firstToken).c_str());
- //int secondTokenIntegerValue =atoi((secondToken).c_str());
-
- if (firstTokenIntegerValue > secondTokenIntegerValue )
- {
- returnVal = GREATER;
- }
- else if (firstTokenIntegerValue < secondTokenIntegerValue )
- {
- returnVal = LESSER;
- }
- else
- {
- returnVal = EQUAL;
- }
- LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) <<
- " Exiting: LTKVersionCompatibilityCheck::compareTokens()" << endl;
-
- return returnVal;
-} \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.h
deleted file mode 100644
index 476aae72..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKVersionCompatibilityCheck.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-08-01 09:48:58 +0530 (Fri, 01 Aug 2008) $
- * $Revision: 583 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Defines the function to check the version compatibility
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 25, 2007
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef LTKVERSIONCOMPATIBILITYCHECK_H
-#define LTKVERSIONCOMPATIBILITYCHECK_H
-
-#include "LTKInc.h"
-
-/**
-* @ingroup util
-*/
-
-enum ELTKVersionComparison
-{
- GREATER,
- LESSER,
- EQUAL
-};
-
-class LTKVersionCompatibilityCheck
-{
-private:
- string m_delimiter;
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
- LTKVersionCompatibilityCheck();
-
-
- /**
- * Destructor
- */
-
- ~LTKVersionCompatibilityCheck();
-
- // @}
-
- /**
- * @name Methods
- */
-
- // @{
-
- bool checkCompatibility(const string& supportedMinVersion,const string& currentVersion, const string& versionRead);
-
- bool isFirstVersionHigher(const string& firstVersion, const string& secondVersion);
-
-private:
-
-
- ELTKVersionComparison compareTokens(int firstTokenIntegerValue,
- int secondTokenIntegerValue);
-
- // @}
-};
-
-#endif
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.cpp
deleted file mode 100644
index 1462fedf..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.cpp
+++ /dev/null
@@ -1,469 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-******************************************************************************/
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-18 15:00:39 +0530 (Fri, 18 Jul 2008) $
- * $Revision: 561 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKWinCEUtil.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-#include "LTKStringUtil.h"
-
-/************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : LTKWinCEUtil
- * DESCRIPTION : Default constructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- *****************************************************************************/
-LTKWinCEUtil::LTKWinCEUtil()
-{
-
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : ~LTKWinCEUtil
- * DESCRIPTION : Desstructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-LTKWinCEUtil::~LTKWinCEUtil()
-{
-
-}
-
-/***************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
-* NAME : LoadLibraryUnicode
-* DESCRIPTION : Loads the library which takes as character string input
-* ARGUMENTS :
-* RETURNS : Handle to the library loaded.
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*******************************************************************************/
-HANDLE LTKWinCEUtil::LoadLibraryUnicode(const char* pszDllName)
-{
- if (pszDllName == NULL)
- return NULL ;
-
- HANDLE hDll = NULL ;
- TCHAR *pszwDll = convertCharToTChar(pszDllName);
- if (pszwDll)
- {
- hDll = ::LoadLibrary(pszwDll) ;
- delete(pszwDll) ;
- }
- return hDll ;
-}
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::loadSharedLib(const string & lipiRoot,
- const string & sharedLibName,
- void * * libHandle)
-{
- string sharedLibraryPath = "";
-
- // construct the path for the recogniser DLL
- sharedLibraryPath = lipiRoot + "\\" + "lib" + "\\" + sharedLibName + ".dll";
-
- // Load the DLL
- *libHandle = (void*)LoadLibraryUnicode(sharedLibraryPath.c_str());
-
- if(*libHandle == NULL)
- {
- cout << GetLastError() << endl;
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::unloadSharedLib(void * libHandle)
-{
-
- if (libHandle != NULL)
- {
- int returnVal = FreeLibrary((HINSTANCE)(libHandle));
-
- // For FreeLibrary, If the function fails, the return value is zero
- if (returnVal == 0 )
- {
- return FAILURE;
- }
- }
- else
- {
-
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getFunctionAddress
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle)
-{
-
- // validate parameters
- if (libHandle == NULL )
- {
- return FAILURE;
- }
-
- if (functionName.empty())
- {
- return FAILURE;
- }
- TCHAR *pszwName = convertCharToTChar(functionName.c_str());
- *functionHandle = GetProcAddress((HMODULE)libHandle, pszwName);
- delete pszwName;
-
- if ( *functionHandle == NULL )
- {
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getPlatformName
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::getPlatformName(string& outStr)
-{
- outStr = "Windows";
- return SUCCESS;
-
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getProcessorArchitechure
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::getProcessorArchitechure(string& outStr)
-{
- SYSTEM_INFO architechure;
-
- GetSystemInfo(&architechure);
-
- int arc = architechure.wProcessorArchitecture;
-
- switch (arc)
- {
- case 0 : outStr = "INTEL";
- break;
-
- case 1 : outStr = "MIPS";
- break;
-
- case 2 : outStr = "ALPHA";
- break;
-
- case 3 : outStr = "PPC";
- break;
-
- case 4 : outStr = "SHX";
- break;
-
- case 5 : outStr = "ARM";
- break;
-
- case 6 : outStr = "IA64";
- break;
-
- case 7 : outStr = "ALPHA64";
- break;
-
- default : outStr = "UNKNOWN";
- break;
- }
-
- return SUCCESS;
-
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getOSInfo
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::getOSInfo(string& outStr)
-{
- outStr = "";
- outStr += "Microsoft WinCE" ;
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : recordStartTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::recordStartTime()
-{
- GetLocalTime(&m_startTime);
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : recordEndTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::recordEndTime()
-{
- GetLocalTime(&m_endTime);
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : diffTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::diffTime(string& outStr)
-{
- //Convert the SYSTEMTIME to FILETIME
- FILETIME ftimeStart, ftimeEnd ;
- SystemTimeToFileTime(&m_startTime, &ftimeStart) ;
- SystemTimeToFileTime(&m_endTime, &ftimeEnd) ;
-
- //Convert the FILETIME to ULARGE_INTEGER
- ULARGE_INTEGER uIntStart, uIntEnd ;
- uIntStart.HighPart = ftimeStart.dwHighDateTime ;
- uIntStart.LowPart = ftimeStart.dwLowDateTime;
-
- uIntEnd.HighPart = ftimeEnd.dwHighDateTime;
- uIntEnd.LowPart = ftimeEnd.dwLowDateTime;
-
- ULONGLONG ulDiff = uIntEnd.QuadPart - uIntStart.QuadPart ;
-
- char temp[10];
- sprintf(temp, "%.1f", ulDiff/10000000);
-
- string tempStr(temp) ;
- outStr = tempStr;
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getSystemTimeString
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWinCEUtil::getSystemTimeString(string& outStr)
-{
- SYSTEMTIME st;
- GetLocalTime(&st);
- char szTime[100] ;
- sprintf(szTime, "%02u:%02u:%02u", st.wHour, st.wMinute, st.wSecond);
- outStr = szTime ;
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Sarbeswar Meher
- * DATE : 11-08-2008
- * NAME : getLibraryHandle
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-
-void* LTKWinCEUtil::getLibraryHandle(const string& libName)
-{
- string libNameWindows = libName + ".dll";
-
- void* libHandle = NULL;
-
- TCHAR *pszwLib = convertCharToTChar(libNameWindows.c_str()) ;
- libHandle = GetModuleHandle(pszwLib);
- delete pszwLib ;
-
- return libHandle;
-}
-/***************************************************************************
-* AUTHOR : Sarbeswar Meher
-* DATE : 14-Apr-2008
-* NAME : ConvertCharToTChar
-* DESCRIPTION : Converts char to TCHAR
-* ARGUMENTS :
-* RETURNS : TCHAR*
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*******************************************************************************/
-TCHAR* LTKWinCEUtil::convertCharToTChar(const char* pszData)
-{
- if (pszData == NULL)
- return NULL ;
-
- int nLen = strlen(pszData)+1 ;
- TCHAR *pszwData = new TCHAR[nLen] ;
- if (pszwData)
- {
- //Converts the char to TCHAR value
- MultiByteToWideChar(CP_ACP, 0, pszData, nLen, pszwData, nLen) ;
- return pszwData ;
- }
- return NULL ;
-}
-
-/***************************************************************************
-* AUTHOR : Sarbeswar Meher
-* DATE : 14-Apr-2008
-* NAME : getEnvVariable
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*******************************************************************************/
-string LTKWinCEUtil::getEnvVariable(const string& envVariableName)
-{
- return NULL;
-} \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.h
deleted file mode 100644
index 649a2700..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWinCEUtil.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-********************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-07-18 15:00:39 +0530 (Fri, 18 Jul 2008) $
- * $Revision: 561 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR:
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKWINCEUTIL_H
-#define __LTKWINCEUTIL_H
-
-#define BUFSIZE 256
-
-#include "LTKOSUtil.h"
-#include <windows.h>
-
-class LTKWinCEUtil: public LTKOSUtil
-{
-private:
- SYSTEMTIME m_startTime;
- SYSTEMTIME m_endTime;
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKWinCEUtil();
-
- /**
- * Destructor
- */
-
- ~LTKWinCEUtil();
-
- // @}
- int loadSharedLib(const string& lipiLibPath,
- const string& sharedLibName,
- void** libHandle);
-
- int unloadSharedLib(void* libHandle);
-
- int getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle);
-
- int getPlatformName(string& outStr);
-
- int getProcessorArchitechure(string& outStr);
-
- int getOSInfo(string& outStr);
-
- int recordStartTime();
-
- int recordEndTime();
-
- int diffTime(string& outStr);
-
- int getSystemTimeString(string& outStr);
-
- void* getLibraryHandle(const string& libName);
-
- HANDLE LoadLibraryUnicode(const char* pszDllName) ;
-
- TCHAR* convertCharToTChar(const char* pszData) ;
-
- string getEnvVariable(const string& envVariableName);
-
-};
-
-
-#endif /*__LTKWINCEUTIL_H*/
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.cpp
deleted file mode 100644
index 825ee84c..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.cpp
+++ /dev/null
@@ -1,582 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-******************************************************************************/
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-08-12 11:34:07 +0530 (Tue, 12 Aug 2008) $
- * $Revision: 604 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKWindowsUtil.h"
-#include "LTKMacros.h"
-#include "LTKLoggerUtil.h"
-
-#include <windows.h>
-
-/************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : LTKWindowsUtil
- * DESCRIPTION : Default constructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- *****************************************************************************/
-LTKWindowsUtil::LTKWindowsUtil()
-{
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : ~LTKWindowsUtil
- * DESCRIPTION : Desstructor
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-LTKWindowsUtil::~LTKWindowsUtil()
-{
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::loadSharedLib(const string & lipiLibPath,
- const string & sharedLibName,
- void * * libHandle)
-{
- string sharedLibraryPath = "";
-
- // construct the path for the recogniser DLL
- sharedLibraryPath = lipiLibPath + "\\" + sharedLibName +
-#ifndef NDEBUG
- "d"
-#endif
- ".dll";
- // Load the DLL
- *libHandle = (void*)LoadLibrary(sharedLibraryPath.c_str());
-
- if(*libHandle == NULL)
- {
- cout << GetLastError() << endl;
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : loadSharedLib
- * DESCRIPTION : Loads dynamic library
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::unloadSharedLib(void * libHandle)
-{
-
- if (libHandle != NULL)
- {
- int returnVal = FreeLibrary((HINSTANCE)(libHandle));
-
- // For FreeLibrary, If the function fails, the return value is zero
- if (returnVal == 0 )
- {
- return FAILURE;
- }
- }
- else
- {
-
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 29-05-2008
- * NAME : getFunctionAddress
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle)
-{
-
- // validate parameters
- if (libHandle == NULL )
- {
- return FAILURE;
- }
-
- if (functionName.empty())
- {
- return FAILURE;
- }
-
- *functionHandle = GetProcAddress((HMODULE)libHandle, functionName.c_str());
-
- if ( *functionHandle == NULL )
- {
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getPlatformName
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::getPlatformName(string& outStr)
-{
- outStr = "Windows";
- return SUCCESS;
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getProcessorArchitechure
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::getProcessorArchitechure(string& outStr)
-{
- SYSTEM_INFO architechure;
-
- GetSystemInfo(&architechure);
-
- int arc = architechure.wProcessorArchitecture;
-
- switch (arc)
- {
- case 0 : outStr = "INTEL";
- break;
-
- case 1 : outStr = "MIPS";
- break;
-
- case 2 : outStr = "ALPHA";
- break;
-
- case 3 : outStr = "PPC";
- break;
-
- case 4 : outStr = "SHX";
- break;
-
- case 5 : outStr = "ARM";
- break;
-
- case 6 : outStr = "IA64";
- break;
-
- case 7 : outStr = "ALPHA64";
- break;
-
- default : outStr = "UNKNOWN";
- break;
- }
-
- return SUCCESS;
-
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getOSInfo
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::getOSInfo(string& outStr)
-{
- outStr = "";
-
- OSVERSIONINFOEX osvi;
- BOOL bOsVersionInfoEx;
-
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
-
- if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
- {
- osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
- if (! GetVersionEx ((OSVERSIONINFO *) &osvi))
- return SUCCESS;
- }
-
- switch (osvi.dwPlatformId)
- {
- // Test for the Windows NT product family.
- case VER_PLATFORM_WIN32_NT:
-
- // Test for the specific product family.
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
- {
- outStr = "Microsoft Windows Server&nbsp;2003 family, ";
- }
-
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
- {
- outStr = "Microsoft Windows XP ";
- }
-
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
- {
- outStr = "Microsoft Windows 2000 ";
- }
-
- if ( osvi.dwMajorVersion <= 4 )
- {
- outStr = "Microsoft Windows NT ";
- }
-
- // Test for specific product on Windows NT 4.0 SP6 and later.
- if( bOsVersionInfoEx )
- {
- // Test for the workstation type.
- if( osvi.dwMajorVersion == 4 )
- {
- outStr += "Workstation 4.0 ";
- }
- }
- else // Test for specific product on Windows NT 4.0 SP5 and earlier
- {
- HKEY hKey;
-
- char szProductType[BUFSIZE];
- DWORD dwBufLen=BUFSIZE;
- LONG lRet;
-
- lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
- 0, KEY_QUERY_VALUE, &hKey );
- if( lRet != ERROR_SUCCESS )
- return SUCCESS;
-
- lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL,
- (LPBYTE) szProductType, &dwBufLen);
- if( (lRet != ERROR_SUCCESS) )
- return SUCCESS;
-
- RegCloseKey( hKey );
-
- if ( lstrcmpi( "WINNT", szProductType) == 0 )
- {
- outStr += "Workstation ";
- }
-
- if ( lstrcmpi( "LANMANNT", szProductType) == 0 )
- {
- outStr += "Server ";
- }
-
- if ( lstrcmpi( "SERVERNT", szProductType) == 0 )
- {
- outStr += "Advanced Server ";
- }
-
- printf( "%d.%d ", osvi.dwMajorVersion, osvi.dwMinorVersion );
- }
-
- // Display service pack (if any) and build number.
-
- if( osvi.dwMajorVersion == 4 &&
- lstrcmpi( osvi.szCSDVersion, "Service Pack 6" ) == 0 )
- {
- HKEY hKey;
- LONG lRet;
-
- // Test for SP6 versus SP6a.
- lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009",
- 0, KEY_QUERY_VALUE, &hKey );
-
- if( lRet == ERROR_SUCCESS )
- {
- char tempStr[50];
- sprintf(tempStr,"%d", osvi.dwBuildNumber & 0xFFFF);
- string str1 = string(tempStr);
- string temp = "Service Pack 6a (Build " + str1 + ")";
-
- outStr += temp;
- }
- else // Windows NT 4.0 prior to SP6a
- {
- char tempStr[100];
-
- sprintf (tempStr, "%s (Build %d)",
- osvi.szCSDVersion,
- osvi.dwBuildNumber & 0xFFFF);
- string str1 = string(tempStr);
-
- outStr += str1;
- }
-
- RegCloseKey( hKey );
- }
- else // Windows NT 3.51 and earlier or Windows 2000 and later
- {
- char tempStr[100];
-
- sprintf (tempStr, "%s (Build %d)",
- osvi.szCSDVersion,
- osvi.dwBuildNumber & 0xFFFF);
-
- string str1 = string(tempStr);
-
- outStr += str1;
-
- }
-
-
- break;
-
- // Test for the Windows 95 product family.
- case VER_PLATFORM_WIN32_WINDOWS:
-
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
- {
- outStr += "Microsoft Windows 95 ";
-
- if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' )
- {
- outStr += "OSR2 ";
- }
- }
-
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
- {
- outStr += "Microsoft Windows 98 ";
-
- if ( osvi.szCSDVersion[1] == 'A' )
- {
- outStr += "SE " ;
- }
- }
-
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
- {
- outStr += "Microsoft Windows Millennium Edition";
- }
- break;
-
- case VER_PLATFORM_WIN32s:
- outStr += "Microsoft Win32s";
-
- break;
- }
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : recordStartTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::recordStartTime()
-{
- time(&m_startTime);
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : recordEndTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::recordEndTime()
-{
- time(&m_endTime);
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : diffTime
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::diffTime(string& outStr)
-{
- char temp[10];
- sprintf(temp, "%.1f", difftime(m_endTime, m_startTime));
- string tempStr(temp) ;
- outStr = tempStr;
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 26-06-2008
- * NAME : getSystemTimeString
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-int LTKWindowsUtil::getSystemTimeString(string& outStr)
-{
- time_t rawtime;
-
- time(&rawtime);
-
- string timeStr = ctime(&rawtime);
-
- outStr = timeStr.substr(0, 24);
-
- return SUCCESS;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 17-07-2008
- * NAME : getLibraryHandle
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-
-void* LTKWindowsUtil::getLibraryHandle(const string& libName)
-{
- string libNameWindows = libName +
-#ifndef NDEBUG
- "d"
-#endif
- ".dll";
-
- void* libHandle = NULL;
-
- libHandle = GetModuleHandle(libNameWindows.c_str());
-
- return libHandle;
-}
-
-/**************************************************************************
- * AUTHOR : Nidhi Sharma
- * DATE : 17-07-2008
- * NAME : getEnvVariable
- * DESCRIPTION :
- * ARGUMENTS :
- *
- * RETURNS :
- * NOTES :
- * CHANGE HISTROY
- * Author Date Description
- ***************************************************************************/
-
-string LTKWindowsUtil::getEnvVariable(const string& envVariableName)
-{
- return getenv(envVariableName.c_str());
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.h
deleted file mode 100644
index d62350d9..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/LTKWindowsUtil.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or
-* substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-********************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-08-12 11:34:07 +0530 (Tue, 12 Aug 2008) $
- * $Revision: 604 $
- * $Author: sharmnid $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR:
- *
- * CONTENTS:
- *
- * AUTHOR:
- *
- * DATE: May 29, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#ifndef __LTKWINDOWSUTIL_H
-#define __LTKWINDOWSUTIL_H
-
-#define BUFSIZE 256
-
-#include "LTKOSUtil.h"
-
-class LTKWindowsUtil: public LTKOSUtil
-{
-private:
- time_t m_startTime;
-
- time_t m_endTime;
-
-public:
-
- /**
- * @name Constructors and Destructor
- */
-
- // @{
-
- /**
- * Default Constructor
- */
-
- LTKWindowsUtil();
-
- /**
- * Destructor
- */
-
- ~LTKWindowsUtil();
-
- // @}
- int loadSharedLib(const string& lipiLibPath,
- const string& sharedLibName,
- void** libHandle);
-
- int unloadSharedLib(void* libHandle);
-
- int getFunctionAddress(void * libHandle,
- const string& functionName,
- void** functionHandle);
-
- int getPlatformName(string& outStr);
-
- int getProcessorArchitechure(string& outStr);
-
- int getOSInfo(string& outStr);
-
- int recordStartTime();
-
- int recordEndTime();
-
- int diffTime(string& outStr);
-
- int getSystemTimeString(string& outStr);
-
- void* getLibraryHandle(const string& libName);
-
- string getEnvVariable(const string& envVariableName);
-
-};
-
-
-#endif
-
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/lib.pro b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/lib.pro
deleted file mode 100644
index f5ed0149..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/lib/lib.pro
+++ /dev/null
@@ -1,39 +0,0 @@
-BASE_TARGET_NAME = ltkutil
-include(../../lipilib.pri)
-
-win32: DEFINES -= UNICODE
-
-HEADERS += \
- LTKCheckSumGenerate.h \
- LTKConfigFileReader.h \
- LTKDynamicTimeWarping.h \
- LTKErrors.h \
- LTKHierarchicalClustering.h \
- LTKImageWriter.h \
- LTKInkFileReader.h \
- LTKInkFileWriter.h \
- LTKInkUtils.h \
- LTKLinuxUtil.h \
- LTKLoggerUtil.h \
- LTKStrEncoding.h \
- LTKStringUtil.h \
- LTKVersionCompatibilityCheck.h \
- LTKWinCEUtil.h \
- LTKWindowsUtil.h
-
-SOURCES += \
- LTKCheckSumGenerate.cpp \
- LTKConfigFileReader.cpp \
- LTKInkFileReader.cpp \
- LTKInkFileWriter.cpp \
- LTKLoggerUtil.cpp \
- LTKInkUtils.cpp \
- LTKStrEncoding.cpp \
- LTKErrors.cpp \
- LTKStringUtil.cpp \
- LTKVersionCompatibilityCheck.cpp \
- LTKOSUtilFactory.cpp \
- LTKImageWriter.cpp
-
-win32: SOURCES += LTKWindowsUtil.cpp
-else: SOURCES += LTKLinuxUtil.cpp
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/.prev_CMakeLists.txt b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/.prev_CMakeLists.txt
deleted file mode 100644
index 809dce7b..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-# Generated from logger.pro.
-
-#####################################################################
-## logger Generic Library:
-#####################################################################
-
-qt_add_cmake_library(logger
- MODULE
- INSTALL_DIRECTORY "$$[QT_INSTALL_PLUGINS]/lipi_toolkit"
- OUTPUT_DIRECTORY "${QT_BUILD_DIR}/plugins/lipi_toolkit"
- SOURCES
- LTKLogger.cpp
- logger.cpp logger.h
- INCLUDE_DIRECTORIES
- ../../include
- ../lib
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
-)
-qt_disable_warnings(logger)
-
-#### Keys ignored in scope 1:.:.:logger.pro:<TRUE>:
-# LIPILIBS = "ltkutil"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(logger CONDITION WIN32
- DEFINES
- LOGGER_EXPORTS
- PUBLIC_LIBRARIES
- Advapi32.lib
-)
-
-qt_extend_target(logger CONDITION NOT LIPILIBS_ISEMPTY
- PUBLIC_LIBRARIES
- # Remove: L/lib
-)
-
-qt_autogen_tools_initial_setup(logger)
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/CMakeLists.txt b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/CMakeLists.txt
deleted file mode 100644
index dc494bd8..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# Generated from logger.pro.
-
-#####################################################################
-## logger Generic Library:
-#####################################################################
-
-qt_add_cmake_library(logger
- MODULE
- INSTALL_DIRECTORY "${INSTALL_PLUGINSDIR}/lipi_toolkit" # special case
- OUTPUT_DIRECTORY "${QT_BUILD_DIR}/plugins/lipi_toolkit"
- SOURCES
- LTKLogger.cpp
- logger.cpp logger.h
- INCLUDE_DIRECTORIES
- ../../include
- ../lib
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
-)
-qt_disable_warnings(logger)
-
-#### Keys ignored in scope 1:.:.:logger.pro:<TRUE>:
-# LIPILIBS = "ltkutil"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(logger CONDITION WIN32
- DEFINES
- LOGGER_EXPORTS
- PUBLIC_LIBRARIES
- Advapi32.lib
-)
-
-qt_extend_target(logger CONDITION NOT LIPILIBS_ISEMPTY
- PUBLIC_LIBRARIES
- # Remove: L/lib
- lkutil # special case
-)
-
-qt_autogen_tools_initial_setup(logger)
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/LTKLogger.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/LTKLogger.cpp
deleted file mode 100644
index 75ad218e..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/LTKLogger.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2007 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-*
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate: 2008-01-10 14:36:54 +0530 (Thu, 10 Jan 2008) $
- * $Revision: 353 $
- * $Author: charakan $
- *
- ************************************************************************/
-/************************************************************************
- * FILE DESCR: Implementation of the Debug Logging Module
- *
- * CONTENTS:
- *
- * AUTHOR: Balaji R.
- *
- * DATE: December 23, 2004
- * CHANGE HISTORY:
- * Author Date Description of change
- ************************************************************************/
-
-#include "LTKLogger.h"
-#include "LTKMacros.h"
-#include "LTKErrorsList.h"
-#include "LTKOSUtil.h"
-#include "LTKOSUtilFactory.h"
-
-LTKLoggerInterface* LTKLogger::loggerInstance = NULL;
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : LTKLogger
-* DESCRIPTION : Default Constructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKLogger::LTKLogger():
-m_debugLevel(LTKLogger::LTK_LOGLEVEL_ERR),
-m_logFileName(DEFAULT_LOG_FILE),
-m_logStatus(INACTIVE),
-m_isTimeStamped(true)
-{
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : LTKLogger
-* DESCRIPTION : destructor
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKLogger::~LTKLogger()
-{
- stopLog();
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : operator()
-* DESCRIPTION : overloaded function call operator
-* ARGUMENTS : msgDebugLevel - log level of the messages to be logged
-* RETURNS : reference to an output stream object
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-ostream& LTKLogger::operator()(const EDebugLevel& msgDebugLevel,
- const string& fileName,
- int lineNumber)
-{
- if ( m_debugLevel <= msgDebugLevel )
- {
- writeAuxInfo(fileName, lineNumber);
-
- switch ( msgDebugLevel )
- {
-
- case LTKLogger::LTK_LOGLEVEL_ALL:
- m_logFile << "[All] ";
- break;
-
- case LTKLogger::LTK_LOGLEVEL_VERBOSE:
- m_logFile << "[Verbose] ";
- break;
- case LTKLogger::LTK_LOGLEVEL_DEBUG:
- m_logFile << "[Debug] ";
- break;
-
- case LTKLogger::LTK_LOGLEVEL_INFO:
- m_logFile << "[Info] ";
- break;
-
- case LTKLogger::LTK_LOGLEVEL_ERR:
- m_logFile << "[Error] ";
- break;
- }
-
- m_logFile.flush();
-
- return m_logFile;
- }
-
- // if m_debugLevel is higher than the message importance,
- // then don't attempt to process it's input
- return m_ofstream;
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : writeAuxInfo
-* DESCRIPTION : writes the data, time, file, line no. information into the log file
-* ARGUMENTS : fileName - name of file containing the log message
-* lineNumber - line number of the log message
-* RETURNS : SUCCESS on successful writing of the auxiliary information
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-int LTKLogger::writeAuxInfo(const string& fileName, int lineNumber)
-{
-
- #ifdef LOGGEROFF
- return FAILURE;
- #endif
-
- if(m_isTimeStamped)
- {
- LTKOSUtil *pOSUtil = LTKOSUtilFactory::getInstance() ;
-
- string formattedTimeStr ;
- pOSUtil->getSystemTimeString(formattedTimeStr) ;
- m_logFile << formattedTimeStr << ' ';
- delete pOSUtil ;
-
- /*
- time_t rawtime;
-
- time(&rawtime);
-
- string timeStr = ctime(&rawtime);
-
- string formattedTimeStr = timeStr.substr(0, 24);
-
- m_logFile << formattedTimeStr << ' ';
- */
- }
-
- m_logFile << fileName.substr(fileName.find_last_of(SEPARATOR) + 1, fileName.size());
-
- if(lineNumber != 0)
- {
- m_logFile << '(' << lineNumber << "): ";
- }
-
- return SUCCESS;
-}
-
-
-/***************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : setLogLevel
-* DESCRIPTION : sets the level of the messages to be logged
-* ARGUMENTS : debugLevel - level of the messages to be logged
-* RETURNS : SUCCESS on successful set operation
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-****************************************************************************/
-
-int LTKLogger::setLogLevel(const EDebugLevel& debugLevel)
-{
- #ifdef LOGGEROFF
- return FAILURE;
- #endif
-
- m_debugLevel = debugLevel;
-
- return SUCCESS;
-}
-
-/****************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : setLogFileName
-* DESCRIPTION : sets the name of the file to be used for logging
-* ARGUMENTS : logFileName - name of the file to be used for logging
-* RETURNS : Nothing
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-* Balaji MNA 07-Apr-2009 To fix bug: LIPTKT-600
-*****************************************************************************/
-
-void LTKLogger::setLogFileName(const string& logFileName)
-{
-
- #ifdef LOGGEROFF
- return;
- #endif
-
- m_logStatus = INACTIVE;
- m_logFileName = logFileName;
-}
-
-/**********************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : getLogLevel
-* DESCRIPTION : returns the log of messages to be logged
-* ARGUMENTS :
-* RETURNS : log of messages to be logged
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*************************************************************************************/
-
-LTKLogger::EDebugLevel LTKLogger::getLogLevel()
-{
- #ifdef LOGGEROFF
- return string("Logger is off");
- #endif
- return m_debugLevel;
-}
-
-/*****************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : getLogFileName
-* DESCRIPTION : returns the name of the log file
-* ARGUMENTS :
-* RETURNS : name of the log file
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-******************************************************************************/
-
-const string& LTKLogger::getLogFileName()
-{
- return m_logFileName;
-}
-
-/****************************************************************************
-* AUTHOR : Balaji R.
-* DATE : 23-DEC-2004
-* NAME : startLog
-* DESCRIPTION : starts the logging operation
-* ARGUMENTS :
-* RETURNS : SUCCESS on successful start of logging
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-****************************************************************************/
-
-int LTKLogger::startLog(bool isTimeStamped)
-{
-
- if (m_debugLevel == LTK_LOGLEVEL_OFF )
- return FAILURE;
-
- if(m_logStatus == INACTIVE)
- {
- m_isTimeStamped = isTimeStamped;
-
- if(m_logFileName != "")
- {
- m_logFile.close();
-
- m_logFile.clear();
-
- m_logFile.open(m_logFileName.c_str(), ios::app);
- }
-
- if(m_logFileName == "" || !m_logFile)
- {
- // log the non-existance of m_logFileName file path is unable to open m_logFileName
-
- return (ELOG_FILE_NOT_EXIST);
-
- m_logFile.close();
-
- m_logFile.clear();
-
- m_logFile.open(m_logFileName.c_str(), ios::app);
- }
-
- m_logStatus = ACTIVE;
- }
-
- return SUCCESS;
-}
-
-/****************************************************************************
-* AUTHOR : Nidhi sharma
-* DATE : 12-SEPT-2005
-* NAME : getInstance
-* DESCRIPTION : This file will return the address of the Logger instance.
-* ARGUMENTS :
-* RETURNS : Address of the Logger instance.
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-* Thanigai 28-NOV-05 returning the address of global Logger object
-* is giving runtime error, because the vfptr is not
-* getting initialized(vtable). So implementing the
-* workaround by allocating a new Logger object runtime.
-*****************************************************************************/
-
-LTKLoggerInterface* LTKLogger::getInstance()
-{
- if(loggerInstance == NULL)
- {
- loggerInstance = new LTKLogger();
- }
-
- return loggerInstance;
-
-}
-
-/****************************************************************************
-* AUTHOR : Nidhi sharma
-* DATE : 12-SEPT-2005
-* NAME : destroyLoggerInstance
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-void LTKLogger::destroyLoggerInstance()
-{
- if (loggerInstance != NULL)
- {
- delete loggerInstance;
- loggerInstance = NULL;
- }
-}
-
-/****************************************************************************
-* AUTHOR : Thanigai
-* DATE : 12-SEPT-2005
-* NAME : stopLog
-* DESCRIPTION : stops the logging operation
-* ARGUMENTS :
-* RETURNS : SUCCESS on successful stop of logging
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-*****************************************************************************/
-
-int LTKLogger::stopLog()
-{
- if (m_debugLevel == LTK_LOGLEVEL_OFF )
- return FAILURE;
-
- if(m_logFileName != "")
- {
- m_logFile.close();
- m_logStatus = INACTIVE;
- return 0;
- }
- return FAILURE;
-}
-
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.cpp b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.cpp
deleted file mode 100644
index 2fa735bb..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy
-* of this software and associated documentation files (the "Software"), to deal
-* in the Software without restriction, including without limitation the rights
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-* copies of the Software, and to permit persons to whom the Software is
-* furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE
-********************************************************************************/
-
-/******************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate$
- * $Revision$
- * $Author$
- *
- ************************************************************************/
-/***************************************************************************
- * FILE DESCR: DLL Implementation file for logger module
- *
- * CONTENTS:
- * DllMain
- *
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: April 01, 2008
- *
- * CHANGE HISTORY:
- *
- * Author Date Description of change
- ************************************************************************/
-#include "logger.h"
-#include "LTKLoggerUtil.h"
-#include "LTKLoggerInterface.h"
-#include "LTKLogger.h"
-#include "LTKMacros.h"
-#include "LTKErrorsList.h"
-
-
-
-LTKLoggerInterface* ptrLog = LTKLogger::getInstance();
-
-/************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : DllMain
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-************************************************************************/
-#ifdef _WIN32
-BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,
- LPVOID lpReserved)
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
-
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-#endif // #ifdef _WIN32
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : getLoggerInstance
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-LTKLoggerInterface* getLoggerInstance()
-{
- return ptrLog;
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : destroyLogger
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void destroyLogger()
-{
- ptrLog = NULL;
- LTKLogger::destroyLoggerInstance();
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : setLogFileName
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void setLoggerFileName(const string& logFileName)
-{
- if (!ptrLog) return;
- ptrLog->setLogFileName(logFileName);
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : setLogLevel
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-int setLoggerLevel(LTKLogger::EDebugLevel logLevel)
-{
- if (!ptrLog) return FAILURE;
- return ptrLog->setLogLevel(logLevel);
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 01-APR-2008
-* NAME : getLogFileName
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-const string& getLoggerFileName()
-{
- static string emptyStr;
- if (!ptrLog) return emptyStr;
- return ptrLog->getLogFileName();
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 03-APR-2008
-* NAME : getLogLevel
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-LTKLogger::EDebugLevel getLoggerLevel()
-{
- if (!ptrLog) return LTKLogger::LTK_LOGLEVEL_OFF;
- return ptrLog->getLogLevel();
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 02-APR-2008
-* NAME : startLog
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void startLogger()
-{
- if (!ptrLog) return;
- ptrLog->startLog();
-}
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 02-APR-2008
-* NAME : startLog
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-void stopLogger()
-{
- if (!ptrLog) return;
- ptrLog->stopLog();
-}
-
-
-/***************************************************************************
-* AUTHOR : Nidhi Sharma
-* DATE : 08-APR-2008
-* NAME : logMessage
-* DESCRIPTION :
-* ARGUMENTS :
-* RETURNS :
-* NOTES :
-* CHANGE HISTROY
-* Author Date Description of change
-***************************************************************************/
-ostream& logMessage(LTKLogger::EDebugLevel logLevel, const string& fileName,
- int lineNumber)
-{
- if (!ptrLog) return LTKLoggerUtil::m_emptyStream;
- return (*ptrLog)(logLevel, fileName, lineNumber);
-} \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.def b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.def
deleted file mode 100644
index 5a47ec22..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.def
+++ /dev/null
@@ -1,10 +0,0 @@
-EXPORTS
- getLoggerInstance @1
- setLoggerFileName @2
- setLoggerLevel @3
- getLoggerFileName @4
- getLoggerLevel @5
- startLogger @6
- stopLogger @7
- logMessage @9
- destroyLogger @10 \ No newline at end of file
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.h b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.h
deleted file mode 100644
index dfcbde30..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*****************************************************************************************
-* Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
-* Permission is hereby granted, free of charge, to any person obtaining a copy of
-* this software and associated documentation files (the "Software"), to deal in
-* the Software without restriction, including without limitation the rights to use,
-* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-* Software, and to permit persons to whom the Software is furnished to do so,
-* subject to the following conditions:
-*
-*
-* The above copyright notice and this permission notice shall be included in all
-* copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*****************************************************************************************/
-
-/************************************************************************
- * SVN MACROS
- *
- * $LastChangedDate$
- * $Revision$
- * $Author$
- *
- ************************************************************************/
-
-/************************************************************************
- * FILE DESCR: Definitions for Logger dll exporting functions.
- *
- * CONTENTS:
- *
- * AUTHOR: Nidhi Sharma
- *
- * DATE: 01-April-2008
- *
- * CHANGE HISTORY:
- *
- * Author Date Description
- ************************************************************************/
-#ifndef __LOGGERDLL_H__
-#define __LOGGERDLL_H__
-
-#ifndef _WIN32
-#include <dlfcn.h>
-#else
-#include <windows.h>
-#endif
-
-
-#ifdef _WIN32
-#ifdef LOGGER_EXPORTS
-#define LOGGER_API __declspec(dllexport)
-#else
-#define LOGGER_API __declspec(dllimport)
-#endif //#ifdef LOGGER_EXPORTS
-#else
-#define LOGGER_API
-#endif //#ifdef _WIN32
-
-class LTKLoggerInterface;
-#include "LTKLogger.h"
-#include "LTKTypes.h"
-
-
-extern "C" LOGGER_API LTKLoggerInterface* getLoggerInstance();
-
-extern "C" LOGGER_API void destroyLogger();
-
-extern "C" LOGGER_API void setLoggerFileName(const string& logFileName);
-
-extern "C" LOGGER_API int setLoggerLevel(LTKLogger::EDebugLevel logLevel);
-
-extern "C" LOGGER_API const string& getLoggerFileName();
-
-extern "C" LOGGER_API LTKLogger::EDebugLevel getLoggerLevel();
-
-extern "C" LOGGER_API void startLogger();
-
-extern "C" LOGGER_API void stopLogger();
-
-extern "C" LOGGER_API ostream& logMessage(LTKLogger::EDebugLevel,
- const string& fileName,
- int lineNumber);
-
-
-
-
-#endif //#ifndef __LOGGERDLL_H__
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.pro b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.pro
deleted file mode 100644
index 5f1cc5ac..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/logger/logger.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-LIPILIBS = ltkutil
-include(../../lipiplugin.pri)
-CONFIG -= exceptions
-
-HEADERS += \
- logger.h \
-
-SOURCES += \
- logger.cpp \
- LTKLogger.cpp \
-
-INCLUDEPATH += \
- ../lib \
-
-win32 {
- DEFINES += LOGGER_EXPORTS
- LIBS += Advapi32.lib
- #DEF_FILE = logger.def
-}
diff --git a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/util.pro b/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/util.pro
deleted file mode 100644
index 79cfc027..00000000
--- a/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/util/util.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- lib \
- logger
-
-logger.depends = lib