Image Component Library (ICL)
Classes | Typedefs | Functions
icl::utils Namespace Reference

Classes

struct  Any
 Simple generic data type implementation that uses a string based data representation. More...
 
class  Array2D
 Simple 2D-Array class that provides shallow copy per default. More...
 
struct  ArrayDelOp
 Array delete operation class for the SmartPtr class. More...
 
class  CLBuffer
 Wrapper for an OpenCL Buffer. More...
 
class  CLBufferException
 Class for an OpenCL Exception associated with buffers. More...
 
class  CLBuildException
 Class for an OpenCL Exception during kernel compiling. More...
 
class  CLDeviceContext
 The CLDeviceContext class allows preparation of the device used for CLPrograms. More...
 
class  CLException
 Base class for an OpenCL Exception. More...
 
class  CLImage2D
 Wrapper for an OpenCL Image2D. More...
 
class  CLInitException
 Class for an OpenCL Exception during initialization. More...
 
class  CLKernel
 Wrapper for an OpenCL Kernel. More...
 
class  CLKernelException
 Class for an OpenCL Exception associated with kernels. More...
 
class  CLMemory
 The CLMemory class is a base class for CLBuffer and CLImage2D. More...
 
class  CLMemoryAssistant
 The CLMemoryAssistant class is a helper class to maintain buffers and images for opencl-program pipelines. More...
 
class  CLProgram
 Main class for OpenCL based accelleration. More...
 
class  ConfigFile
 Utility class for creating and reading XML-based hierarchical configuration files. More...
 
class  Configurable
 Interface for classes that can be configured from configuration-files and GUI-Components. More...
 
class  ConfigurableProxy
 This class provides the getter and setter methods of an internally set Configurable. More...
 
struct  ConstFunctorFunctionImpl
 FunctionImpl implementation for functors of const objects. More...
 
struct  ConstMemberFunctionImpl
 FunctionImpl implementation for const member functions. More...
 
class  DelOpBase
 Pure Interface class for DelOps. More...
 
class  FastMedianList
 Utility class for fast calculation of a median (calculating a median in O(N)) More...
 
class  File
 Utility class for file handling (reading files is buffered) More...
 
class  FileNotFoundException
 Exception thrown if a file could not be found. More...
 
class  FileOpenException
 Exception thrown if a file could not be opend. More...
 
struct  FixedArray
 Fixed C++-array wrapper class for data handling. More...
 
struct  FixedArray< T, 1u >
 Specialization for 1D-vectors providing a value x. More...
 
struct  FixedArray< T, 2u >
 Specialization for 2D-matrics providing direct access to values x, y. More...
 
struct  FixedArray< T, 3u >
 Specialization for 3D-matrics providing direct access to values x, y, z. More...
 
struct  FixedArray< T, 4u >
 Specialization for 4D-matrics providing direct access to values x, y, z and h. More...
 
class  FPSEstimator
 Utility clas for online FPS estimation. More...
 
class  FPSLimiter
 An fps limiter can be used to limit online applications FPS. More...
 
struct  FreeDelOp
 C-Style delete operation class for the SmartPtr class. More...
 
struct  Function
 The General Function Template. More...
 
struct  FunctionImpl
 General Implementation for binary functions. More...
 
struct  FunctionImpl< R, A, B, NO_ARG >
 Special Implementation for unary functions. More...
 
struct  FunctionImpl< R, A, NO_ARG >
 Special Implementation for unary functions. More...
 
struct  FunctionImpl< R, NO_ARG >
 Special Implementation for void functions. More...
 
struct  FunctorFunctionImpl
 FunctionImpl implementation for Functors. More...
 
struct  GlobalFunctionImpl
 FunctionImpl implementation for global functions. More...
 
class  GRand
 lightweight Random generator class for gaussian distributed numbers More...
 
class  GRandClip
 lightweight Random generator class for gaussian distributed numbers clipped to a given range More...
 
class  ICLDynamicFunctionLoadException
 
class  ICLDynamicLibLoadException
 
class  ICLException
 Base class for Exception handling in the ICL. More...
 
class  InvalidDepthException
 Exception thrown if a function should process an unsupported image depth. More...
 
class  InvalidFileException
 Exception thrown if a file could not be read properly. More...
 
class  InvalidFileFormatException
 Exception for invalid file formats. More...
 
class  InvalidFormatException
 Exception thrown if a function should process an unsupported image format. More...
 
class  InvalidImgParamException
 Exception called if an image gets invalid params. More...
 
class  InvalidNumChannelException
 Exception thrown if a function should process an unsupported image depth. More...
 
class  InvalidRegularExpressionException
 Thrown by iclStringUtils::match if regular Expression is not valid. More...
 
class  InvalidSizeException
 Exception thrown if a function should process an unsupported sizes (e.g. with negative dim..) More...
 
class  IppInterface
 
class  Lockable
 Interface for objects, that can be locked using an internal mutex. More...
 
struct  MatchResult
 Utility structure for matching results. More...
 
struct  MemberFunctionImpl
 FunctionImpl implementation for member functions. More...
 
class  MultiThreader
 Utility class for parallelizing algorithms. More...
 
class  MultiTypeMap
 Abstract and associative Data Container for Data of different types. More...
 
class  Mutex
 Mutex class of the ICL. More...
 
struct  ParamList
 Utility structure that utilizes an std::map as parameter list. More...
 
class  ParseException
 Exception thrown if a string is parsed into a specific type (or something) More...
 
class  PluginRegister
 Utility class for plugin registration. More...
 
class  Point
 Point class of the ICL used e.g. for the Images ROI offset. More...
 
class  Point32f
 Single precission 3D Vectors Point class of the ICL. More...
 
struct  PointerDelOp
 Pointer delete operation class for the SmartPtr class. More...
 
class  ProcessMonitor
 The ProcessMonitor class grants access to processes memory and CPU usage. More...
 
class  ProgArg
 Programm argument utility class. More...
 
struct  ProgArgException
 Programm argument environment exception type . More...
 
struct  RandomSeeder
 Object based random seed caller. More...
 
struct  Range
 class representing a range defined by min and max value More...
 
class  Rect
 Rectangle class of the ICL used e.g. for the Images ROI-rect. More...
 
class  Rect32f
 Floating point precision implementation of the Rect class. More...
 
struct  SelectFunctor
 Empty utility template that can be used to select a special functor. More...
 
class  Semaphore
 Simple Semaphore implementation wrapping the standard linux "sem_t"-struct. More...
 
class  ShallowCopyable
 Interface class for cheap copyable classes using a smart ptr. More...
 
class  SignalHandler
 C++ Signal-Handler interface class. More...
 
class  Size
 Size class of the ICL. More...
 
class  Size32f
 Size32f class of the ICL (float valued) More...
 
struct  SmartArray
 Specialization of the SmartPtrBase class for Arrays. More...
 
struct  SmartPtr
 Specialization of the SmartPtrBase class for Pointers. More...
 
class  SmartPtrBase
 Base class for reference counting smart-pointers. More...
 
class  StackTimer
 Tool for benchmarking method calls. More...
 
struct  SteppingRange
 class representing a range with defined stepping More...
 
class  StrTok
 String Tokenizer Utility class. More...
 
class  TextTable
 Utility class for pretty console output. More...
 
class  Thread
 Simple object oriented thread class wrapping the pthread library. More...
 
class  Time
 ICL Time class (taken from the Ice lib) More...
 
class  Timer
 
class  UncopiedInstance
 Utility class for class instances that are created brand new on copy. More...
 
class  Uncopyable
 Class interface for un-copyable classes. More...
 
class  URand
 lightweight Random generator class for uniform random distributions More...
 
class  URandI
 lightweight Random generator class for uniform random distributions in positive integer domain More...
 
class  VisualizationDescription
 Abstract class for visualization tasks. More...
 

Typedefs

typedef pugi::xml_node_type XMLNodeType
 Node type. More...
 
typedef pugi::xml_encoding XMLEncoding
 XML encoding type. More...
 
typedef pugi::xml_writer XMLWriter
 XML writer interface. More...
 
typedef pugi::xml_writer_stream XMLStreamWriter
 XML writer implementation for streams. More...
 
typedef pugi::xml_writer_file XMLFileWriter
 XML writer implementation for files. More...
 
typedef pugi::xml_attribute XMLAttribute
 XML Attribute class. More...
 
typedef pugi::xml_node XMLNode
 XML Node class. More...
 
typedef pugi::xml_node_iterator XMLNodeIterator
 Iterator for XMLNodes. More...
 
typedef pugi::xml_attribute_iterator XMLAttributeIterator
 Iterator for XMLAttributes. More...
 
typedef pugi::xml_tree_walker XMLTreeWalker
 XML-Treewalker class. More...
 
typedef pugi::xml_parse_status XMLParseStatus
 Parsing status enumeration. More...
 
typedef pugi::xml_parse_result XMLParseResult
 Parsing status class. More...
 
typedef pugi::xml_document XMLDocument
 Main XML Document class. More...
 
typedef pugi::xpath_value_type XPathValueType
 Type enumeration for xpath values. More...
 
typedef pugi::xpath_parse_result XPathParseResult
 Parse Result class for XPath expressions. More...
 
typedef pugi::xpath_variable XPathVariable
 Variable Type for XPath expressions. More...
 
typedef pugi::xpath_variable_set XPathVariableSet
 Set of XPathVariables. More...
 
typedef pugi::xpath_query XPathQuery
 Precompiled XPath expression. More...
 
typedef pugi::xpath_exception XPathException
 Exception type for xpath expressions. More...
 
typedef pugi::xpath_node XPathNode
 Special node type for XPath query results. More...
 
typedef pugi::xpath_node_set XPathNodeSet
 Set of XPath nodes. More...
 

Functions

template<class T >
clip (T tX, T tMin, T tMax)
 clips a value into the range [tMin,tMax] More...
 
template<class T >
bool is_float_type ()
 
template<class S , class D >
clipped_cast (S src)
 utility cast function wrapping the standard lib's numerical_limits template More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const ConfigFile &cf)
 Default ostream operator to put a ConfigFile into a stream. More...
 
ICLUtils_API void progress_init (const std::string &text="Creating LUT")
 static utility function for displaying some progress information in console More...
 
ICLUtils_API void progress_finish ()
 static utility function for displaying some progress information in console More...
 
ICLUtils_API void progress (int curr, int max, const std::string &extraText="")
 static utility function for displaying some progress information in console More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (Object &obj, R(Object::*method)(A, B, C))
 Create Function instances from member functions. More...
 
template<class Object , class R , class A , class B >
Function< R, A, B > function (Object &obj, R(Object::*method)(A, B))
 Create Function instances from member functions. More...
 
template<class Object , class R , class A >
Function< R, A > function (Object &obj, R(Object::*method)(A))
 create Function instances from member function More...
 
template<class Object , class R >
Function< R > function (Object &obj, R(Object::*method)())
 create Function instances from member function More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (const Object &obj, R(Object::*method)(A a, B b, C c) const)
 create Function instances from const member function More...
 
template<class Object , class R , class A , class B >
Function< R, A, B > function (const Object &obj, R(Object::*method)(A a, B b) const)
 create Function instances from const member function More...
 
template<class Object , class R , class A >
Function< R, A > function (const Object &obj, R(Object::*method)(A a) const)
 create Function instances from const member function More...
 
template<class Object , class R >
Function< R > function (const Object &obj, R(Object::*method)() const)
 create Function instances from const member function More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (Object *obj, R(Object::*method)(A, B, C))
 Create Function instances from member functions. More...
 
template<class Object , class R , class A , class B >
Function< R, A, B > function (Object *obj, R(Object::*method)(A, B))
 Create Function instances from member functions. More...
 
template<class Object , class R , class A >
Function< R, A > function (Object *obj, R(Object::*method)(A))
 create Function instances from member function More...
 
template<class Object , class R >
Function< R > function (Object *obj, R(Object::*method)())
 create Function instances from member function More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (const Object *obj, R(Object::*method)(A, B, C) const)
 Create Function instances from const member functions. More...
 
template<class Object , class R , class A , class B >
Function< R, A, B > function (const Object *obj, R(Object::*method)(A, B) const)
 Create Function instances from const member functions. More...
 
template<class Object , class R , class A >
Function< R, A > function (const Object *obj, R(Object::*method)(A) const)
 create Function instances from const member function More...
 
template<class Object , class R >
Function< R > function (const Object *obj, R(Object::*method)() const)
 create Function instances from const member function More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (Object &obj, SelectFunctor< R, A, B, C >)
 create Function instances from given object-functor More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B > function (const Object &obj, SelectFunctor< R, A, B, C >)
 create Function instances from given object-functor (const version) More...
 
template<class Object >
Function function (Object &obj)
 shortcut create Function to wrap an objects parameter-less function operator More...
 
template<class Object >
Function function (const Object &obj)
 shortcut create Function to wrap a const objects parameter-less function operator More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (Object *obj, SelectFunctor< R, A, B, C > selector)
 create Function instances from given object-functor More...
 
template<class Object , class R , class A , class B , class C >
Function< R, A, B, C > function (const Object *obj, SelectFunctor< R, A, B, C > selector)
 create Function instances from given object-functor (const version) More...
 
template<class R , class A , class B , class C >
Function< R, A, B, C > function (R(*global_function)(A a, B b, C c))
 Function creator function from given binary global function. More...
 
template<class R , class A , class B >
Function< R, A, B > function (R(*global_function)(A a, B b))
 Function creator function from given binary global function. More...
 
template<class R , class A >
Function< R, A > function (R(*global_function)(A a))
 Function creator function from given unary global function. More...
 
template<class R >
Function< R > function (R(*global_function)())
 Function creator function from given parameter less global function. More...
 
template<class T >
static T sqr (const T &x)
 square template (faster than pow(x,2) More...
 
template<class T , unsigned int N>
static T power (const T &x)
 power template More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const Point &p)
 ostream operator (x,y) More...
 
ICLUtils_API std::istream & operator>> (std::istream &s, Point &p)
 istream operator More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const Point32f &p)
 ostream operator (x,y) More...
 
ICLUtils_API std::istream & operator>> (std::istream &s, Point32f &p)
 istream operator More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const ProcessMonitor::Info &info)
 overloaded ostream operator for the ProcessMonitor's Info data type More...
 
std::ostream & operator<< (std::ostream &s, const ProgArg &pa)
 just puts the referenced argument value as string into the lvalue-stream More...
 
bool operator && (const ProgArg &a, const ProgArg &b)
 this allows to check if two progargs are defined More...
 
bool operator && (const ProgArg &a, bool b)
 allows to check more than two ProgArg instances at once More...
 
bool operator && (bool &b, const ProgArg &a)
 allows to check more than two ProgArg instances at once More...
 
bool operator|| (const ProgArg &a, const ProgArg &b)
 this allows to check if either of two progargs are defined More...
 
bool operator|| (const ProgArg &a, bool b)
 allows to check if either of more than two ProgArg instances is defined More...
 
bool operator|| (bool &b, const ProgArg &a)
 allows to check if either of more than two ProgArg instances is defined More...
 
const ProgArg pa (const std::string &id, unsigned int subargidx=0)
 returns given program argument More...
 
const ProgArg pa (unsigned int idx, bool danglingOnly=true)
 returns given program argument at given index More...
 
template<class T >
const T pa_def (const std::string &id, unsigned int subargidx, const T &def)
 utility function that allows to use a default value, if given argument was not defined More...
 
template<class T >
const T pa_def (const std::string &id, const T &def)
 utility function that allows to use a default value, if given argument was not defined More...
 
ICLUtils_API unsigned int pa_get_count (bool danglingOnly=true)
 returns number of actually given args given More...
 
ICLUtils_API const std::string & pa_get_progname (bool fullpath=false)
 returns application name (full command line) More...
 
ICLUtils_API void pa_show_usage (const std::string &msg="")
 shows current available programm arguments More...
 
PAEX pa_explain (const std::string &pa, const std::string &ex)
 This function can be used to provide additional information for certain program arguments. More...
 
ICLUtils_API void pa_init (int n, char **ppc, const std::string &init, bool allowDanglingArgs=false)
 initialization function for ICL's program argument evaluation framework More...
 
ICLUtils_API void pa_show ()
 shows all given program arguments More...
 
ICLUtils_API void pa_set_license (const std::string &newLicenseText)
 Sets a license text, that is used when applications are run with –version or -v. More...
 
ICLUtils_API void pa_set_help_text (const std::string &newHelpText)
 Sets a applications help text that is used when applications are run with –help or with unknown arguments. More...
 
ICLUtils_API std::string pa_get_license ()
 returns the current license text More...
 
ICLUtils_API std::string pa_get_help_text ()
 returns the current help text (which is empty, if it was not set) More...
 
void randomSeed (long int seedval)
 Initilaize the random number generator. More...
 
void randomSeed ()
 Initilaize the random number generator (with Time::now().toMicroSeconds()). More...
 
double random (double max=1)
 Generates random numbers in range [0,1]. More...
 
double random (double min, double max)
 Generate a random number in range [min,max]. More...
 
template<class T >
double random (const Range< T > &r)
 equivalent to random (r.minVal,r.maxVal) More...
 
unsigned int random (unsigned int max)
 Creates a non-negative random number in range [0,max]. More...
 
ICLUtils_API double gaussRandom (double mean, double var)
 Generate a gaussian random number with given mean and variance. More...
 
double gaussRandom (double mean, double var, const Range< double > &range)
 Generate a gaussian random number with given mean and variance and clips the result to a range. More...
 
std::vector< int > get_random_index_subset (int containerSize, int subsetSize)
 
template<class T >
std::vector< T > get_random_subset (const std::vector< T > &s, int subsetSize)
 
template<class T >
void get_random_subset (const std::vector< T > &s, int subsetSize, std::vector< T > &subset)
 
template<class T >
void get_random_subset (const std::vector< T > &s, int subsetSize, std::vector< T > &subset, std::vector< int > &indices)
 
template<class T >
ICL_INSTANTIATE_ALL_DEPTHS ICLUtils_API std::ostream & operator<< (std::ostream &s, const Range< T > &range)
 puts a string representation [min,max] of given range into the given stream More...
 
template<class T >
ICLUtils_API std::istream & operator>> (std::istream &s, Range< T > &range)
 parses a range argument into a std::string More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const Rect &r)
 ostream operator (x,y)wxy More...
 
ICLUtils_API std::istream & operator>> (std::istream &s, Rect &r)
 istream operator More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &s, const Rect32f &r)
 ostream operator (x,y)wxy More...
 
ICLUtils_API std::istream & operator>> (std::istream &s, Rect32f &r)
 istream operator More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &os, const Size &s)
 ostream operator WIDTHxHEIGHT More...
 
ICLUtils_API std::istream & operator>> (std::istream &is, Size &s)
 istream operator parses a size from a string More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &os, const Size32f &s)
 ostream operator WIDTHxHEIGHT More...
 
ICLUtils_API std::istream & operator>> (std::istream &is, Size32f &s)
 istream operator More...
 
template<class T >
ICLUtils_API std::ostream & operator<< (std::ostream &s, const SteppingRange< T > &range)
 puts a string representation [min,max]:step of given range into the given stream More...
 
template<class T >
ICLUtils_API std::istream & operator>> (std::istream &s, SteppingRange< T > &range)
 parses a range argument into a std::string More...
 
template<class T >
std::ostream & icl_to_stream (std::ostream &s, T t)
 compatibility function that writes a datatype instance into a stream More...
 
template<class T >
std::istream & icl_from_stream (std::istream &s, T &t)
 compability function that reads a datatype instance from a stream More...
 
ICLUtils_API std::string & toLowerI (std::string &s)
 inplace lower case conversion More...
 
ICLUtils_API std::string & toUpperI (std::string &s)
 inplace upper case conversion More...
 
ICLUtils_API std::string toLower (const std::string &s)
 lower case conversion More...
 
ICLUtils_API std::string toUpper (const std::string &s)
 upper case conversion More...
 
ICLUtils_API std::vector< std::string > tok (const std::string &s, const std::string &delims=" ", bool singleCharDelims=true, char escapeChar='\0')
 tokenizes a string with given delimiters (internally using a temporary StrTok instance) More...
 
ICLUtils_API std::vector< std::string > & tok (const std::string &s, const std::string &delim, std::vector< std::string > &dst, bool singleCharDelims=true, char escapeChar='\0')
 tokenize a string with given delimiters into a result vector (optimized) More...
 
ICLUtils_API std::string cat (const std::vector< std::string > &v)
 concatinates at string-vector to a single string More...
 
ICLUtils_API std::string toStr (int i, const char *format, char *buf=0)
 creates a string from a given integer More...
 
ICLUtils_API std::string toStr (double d, const char *format, char *buf=0)
 creates a string from a given double/float More...
 
ICLUtils_API std::string toStr (int i, char *buf=0)
 create a string from given integer using format string "%d" More...
 
ICLUtils_API std::string toStr (double d, char *buf=0)
 create a string from given float using format string "%f" More...
 
template<class T >
std::string str (const T &t)
 convert a data type into a string using an std::ostringstream instance More...
 
template<>
std::string str (const icl8u &t)
 specialized for icl8u More...
 
template<>
std::string str (const bool &b)
 specialized for bool More...
 
template<>
std::string str (const std::string &s)
 specialized for std::string input (this is quiet silly) More...
 
template<>
std::string str (char *const &pc)
 specialized for char const pointers More...
 
template<>
std::string str (const char *const &pc)
 specialized for const char const pointers More...
 
template<class T >
std::string cat (const std::vector< T > &v, const std::string &delim=",")
 creates a delim-separated string of str'ed values of given vector More...
 
template<class T >
parse (const std::string &s)
 parses a string into template parameter (defined for iclXX and std::string) More...
 
template<>
const char * parse (const std::string &s)
 
ICLUtils_API icl8u to8u (const std::string &s)
 cast a string to an icl8u (parse) More...
 
ICLUtils_API icl16s to16s (const std::string &s)
 cast a string to an icl16s (parse) More...
 
ICLUtils_API icl32s to32s (const std::string &s)
 cast a string to an icl32ss (parse) More...
 
ICLUtils_API icl32f to32f (const std::string &s)
 cast a string to an icl32f (parse) More...
 
ICLUtils_API icl64f to64f (const std::string &s)
 cast a string to an icl64f (parse) More...
 
template<class T >
std::vector< T > parseVec (const std::vector< std::string > &v)
 parse a vector of strings into a vector of T's More...
 
template<class T >
std::vector< T > parseVecStr (const std::string &vecStr, const std::string &delims=",")
 parse a delims seperated string into a vector of T's More...
 
template<class T >
std::vector< std::string > strVec (const std::vector< T > &v)
 convert a vector of T's into a vector of strings More...
 
ICLUtils_API MatchResult match (const std::string &text, const std::string &regex, int numSubMatches=0)
 Applies a regular expression match on given text and regex pattern (internally using regex.h) More...
 
ICLUtils_API std::string time2str (Time::value_type x)
 converts a Time::value_type (long int) into a string More...
 
ICLUtils_API std::string skipWhitespaces (const std::string &s)
 crops trailing whitespaces of a string More...
 
ICLUtils_API bool endsWith (const std::string &s, const std::string &suffix)
 returns whether a given string ends with a given suffix More...
 
ICLUtils_API bool startsWith (const std::string &s, const std::string &prefix)
 returns whether a given string begins with a given prefix More...
 
ICLUtils_API void analyseHashes (const std::string &sFileName, unsigned int &nHashes, std::string::size_type &iPostfixPos)
 analyses a file pattern with hash-characters More...
 
std::ostream & operator<< (std::ostream &stream, const TextTable &t)
 overloaded ostream-operator that uses the TextTable's toString method for serialization More...
 
template<class T >
static void saveDelete (T *&pointer)
 static utility function which deletes a pointer and sets it to NULL More...
 
template<class T , void(T::*)() func>
static void saveCall (T *obj)
 static utility function which ensures Thread-safety for object functions More...
 
ICLUtils_API std::ostream & operator<< (std::ostream &, const Time &)
 writes Time instances value type into the stream More...
 
ICLUtils_API std::istream & operator>> (std::istream &, Time &)
 reads Time instances value type from the stream More...
 
std::ostream & operator<< (std::ostream &stream, const VisualizationDescription::Text &t)
 
std::istream & operator>> (std::istream &stream, VisualizationDescription::Text &t)
 
std::ostream & operator<< (std::ostream &stream, const VisualizationDescription::Color &c)
 overloaded ostream operator for VisualizationDescription::Color More...
 
std::istream & operator>> (std::istream &stream, VisualizationDescription::Color &c)
 overloaded istream operator for VisualizationDescription::Color More...
 

Typedef Documentation

◆ XMLAttribute

typedef pugi::xml_attribute icl::utils::XMLAttribute

XML Attribute class.

◆ XMLAttributeIterator

typedef pugi::xml_attribute_iterator icl::utils::XMLAttributeIterator

Iterator for XMLAttributes.

◆ XMLDocument

typedef pugi::xml_document icl::utils::XMLDocument

Main XML Document class.

◆ XMLEncoding

typedef pugi::xml_encoding icl::utils::XMLEncoding

XML encoding type.

◆ XMLFileWriter

typedef pugi::xml_writer_file icl::utils::XMLFileWriter

XML writer implementation for files.

◆ XMLNode

typedef pugi::xml_node icl::utils::XMLNode

XML Node class.

◆ XMLNodeIterator

typedef pugi::xml_node_iterator icl::utils::XMLNodeIterator

Iterator for XMLNodes.

◆ XMLNodeType

typedef pugi::xml_node_type icl::utils::XMLNodeType

Node type.

◆ XMLParseResult

typedef pugi::xml_parse_result icl::utils::XMLParseResult

Parsing status class.

◆ XMLParseStatus

typedef pugi::xml_parse_status icl::utils::XMLParseStatus

Parsing status enumeration.

◆ XMLStreamWriter

typedef pugi::xml_writer_stream icl::utils::XMLStreamWriter

XML writer implementation for streams.

◆ XMLTreeWalker

typedef pugi::xml_tree_walker icl::utils::XMLTreeWalker

XML-Treewalker class.

◆ XMLWriter

typedef pugi::xml_writer icl::utils::XMLWriter

XML writer interface.

◆ XPathException

typedef pugi::xpath_exception icl::utils::XPathException

Exception type for xpath expressions.

◆ XPathNode

typedef pugi::xpath_node icl::utils::XPathNode

Special node type for XPath query results.

◆ XPathNodeSet

typedef pugi::xpath_node_set icl::utils::XPathNodeSet

Set of XPath nodes.

◆ XPathParseResult

typedef pugi::xpath_parse_result icl::utils::XPathParseResult

Parse Result class for XPath expressions.

◆ XPathQuery

typedef pugi::xpath_query icl::utils::XPathQuery

Precompiled XPath expression.

◆ XPathValueType

typedef pugi::xpath_value_type icl::utils::XPathValueType

Type enumeration for xpath values.

◆ XPathVariable

typedef pugi::xpath_variable icl::utils::XPathVariable

Variable Type for XPath expressions.

◆ XPathVariableSet

typedef pugi::xpath_variable_set icl::utils::XPathVariableSet

Set of XPathVariables.

Function Documentation

◆ analyseHashes()

ICLUtils_API void icl::utils::analyseHashes ( const std::string &  sFileName,
unsigned int &  nHashes,
std::string::size_type &  iPostfixPos 
)

analyses a file pattern with hash-characters

This function is e.g. used by the FilennameGenerator to extract a patterns hash count e.g. the pattern "image_###.ppm" shall be used to generate filenames like "image_000.ppm", "image_001.ppm" and so on. This function returns the count of found hashes and the position in the string where the suffix begins. E.g. if the pattern is "image_##.ppm.gz", the hash-count is 2 and the suffix-pos becomes 8.

◆ cat() [1/2]

ICLUtils_API std::string icl::utils::cat ( const std::vector< std::string > &  v)

concatinates at string-vector to a single string

◆ cat() [2/2]

template<class T >
std::string icl::utils::cat ( const std::vector< T > &  v,
const std::string &  delim = "," 
)

creates a delim-separated string of str'ed values of given vector

e.g. if v is {1,2,3} and delim is '-' the resulting string will be "1-2-3"

◆ clipped_cast()

template<class S , class D >
D icl::utils::clipped_cast ( src)
inline

utility cast function wrapping the standard lib's numerical_limits template

◆ endsWith()

ICLUtils_API bool icl::utils::endsWith ( const std::string &  s,
const std::string &  suffix 
)

returns whether a given string ends with a given suffix

◆ function() [1/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( Object &  obj,
R(Object::*)(A, B, C)  method 
)

Create Function instances from member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [2/26]

template<class Object , class R , class A , class B >
Function<R, A, B> icl::utils::function ( Object &  obj,
R(Object::*)(A, B)  method 
)

Create Function instances from member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [3/26]

template<class Object , class R , class A >
Function<R, A> icl::utils::function ( Object &  obj,
R(Object::*)(A)  method 
)

create Function instances from member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [4/26]

template<class Object , class R >
Function<R> icl::utils::function ( Object &  obj,
R(Object::*)()  method 
)

create Function instances from member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given parameter-less member function

See also
FUNCTION_SECTION

◆ function() [5/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( const Object &  obj,
R(Object::*)(A a, B b, C c) const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [6/26]

template<class Object , class R , class A , class B >
Function<R, A, B> icl::utils::function ( const Object &  obj,
R(Object::*)(A a, B b) const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [7/26]

template<class Object , class R , class A >
Function<R, A> icl::utils::function ( const Object &  obj,
R(Object::*)(A a) const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [8/26]

template<class Object , class R >
Function<R> icl::utils::function ( const Object &  obj,
R(Object::*)() const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given parameter-less member function

See also
FUNCTION_SECTION

◆ function() [9/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( Object *  obj,
R(Object::*)(A, B, C)  method 
)

Create Function instances from member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [10/26]

template<class Object , class R , class A , class B >
Function<R, A, B> icl::utils::function ( Object *  obj,
R(Object::*)(A, B)  method 
)

Create Function instances from member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [11/26]

template<class Object , class R , class A >
Function<R, A> icl::utils::function ( Object *  obj,
R(Object::*)(A)  method 
)

create Function instances from member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [12/26]

template<class Object , class R >
Function<R> icl::utils::function ( Object *  obj,
R(Object::*)()  method 
)

create Function instances from member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given parameter-less member function

See also
FUNCTION_SECTION

◆ function() [13/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( const Object *  obj,
R(Object::*)(A, B, C) const  method 
)

Create Function instances from const member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [14/26]

template<class Object , class R , class A , class B >
Function<R, A, B> icl::utils::function ( const Object *  obj,
R(Object::*)(A, B) const  method 
)

Create Function instances from const member functions.

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given binary member function

See also
FUNCTION_SECTION

◆ function() [15/26]

template<class Object , class R , class A >
Function<R, A> icl::utils::function ( const Object *  obj,
R(Object::*)(A) const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given unary member function

See also
FUNCTION_SECTION

◆ function() [16/26]

template<class Object , class R >
Function<R> icl::utils::function ( const Object *  obj,
R(Object::*)() const  method 
)

create Function instances from const member function

This version of function allows to create a Function instance from a given object instance (passed by reference) and a given parameter-less member function

See also
FUNCTION_SECTION

◆ function() [17/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( Object &  obj,
SelectFunctor< R, A, B, C >   
)

create Function instances from given object-functor

In constrast to functions, a pointer to an objects overloaded functor can only be defined hardly. Therefore this version of the icl::utils::function-template allows to pick a functor from a given object

See also
FUNCTION_SECTION

◆ function() [18/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B> icl::utils::function ( const Object &  obj,
SelectFunctor< R, A, B, C >   
)

create Function instances from given object-functor (const version)

In constrast to functions, a pointer to an objects overloaded functor can only be defined hardly. Therefore this version of the icl::utils::function-template allows to pick a functor from a given object

See also
FUNCTION_SECTION

◆ function() [19/26]

template<class Object >
Function icl::utils::function ( Object &  obj)

shortcut create Function to wrap an objects parameter-less function operator

See also
FUNCTION_SECTION

◆ function() [20/26]

template<class Object >
Function icl::utils::function ( const Object &  obj)

shortcut create Function to wrap a const objects parameter-less function operator

See also
FUNCTION_SECTION

◆ function() [21/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( Object *  obj,
SelectFunctor< R, A, B, C >  selector 
)

create Function instances from given object-functor

In constrast to functions, a pointer to an objects overloaded functor can only be defined hardly. Therefore this version of the icl::utils::function-template allows to pick a functor from a given object

See also
FUNCTION_SECTION

◆ function() [22/26]

template<class Object , class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( const Object *  obj,
SelectFunctor< R, A, B, C >  selector 
)

create Function instances from given object-functor (const version)

In constrast to functions, a pointer to an objects overloaded functor can only be defined hardly. Therefore this version of the icl::utils::function-template allows to pick a functor from a given object

See also
FUNCTION_SECTION

◆ function() [23/26]

template<class R , class A , class B , class C >
Function<R, A, B, C> icl::utils::function ( R(*)(A a, B b, C c)  global_function)

Function creator function from given binary global function.

In contrast to the constructor, this method can automatically detect the parameter types (like std::make_pair)

See also
FUNCTION_SECTION

◆ function() [24/26]

template<class R , class A , class B >
Function<R, A, B> icl::utils::function ( R(*)(A a, B b)  global_function)

Function creator function from given binary global function.

In contrast to the constructor, this method can automatically detect the parameter types (like std::make_pair)

See also
FUNCTION_SECTION

◆ function() [25/26]

template<class R , class A >
Function<R, A> icl::utils::function ( R(*)(A a)  global_function)

Function creator function from given unary global function.

In contrast to the constructor, this method can automatically detect the parameter types (like std::make_pair)

See also
FUNCTION_SECTION

◆ function() [26/26]

template<class R >
Function<R> icl::utils::function ( R(*)()  global_function)

Function creator function from given parameter less global function.

In contrast to the constructor, this method can automatically detect the parameter types (like std::make_pair)

See also
FUNCTION_SECTION

◆ gaussRandom() [1/2]

ICLUtils_API double icl::utils::gaussRandom ( double  mean,
double  var 
)

Generate a gaussian random number with given mean and variance.

Parameters
meanmode of the gaussian
varvariance of the gaussian
Returns
gaussian distributed variable
See also
double(double,double,const Range<double>&),

◆ gaussRandom() [2/2]

double icl::utils::gaussRandom ( double  mean,
double  var,
const Range< double > &  range 
)
inline

Generate a gaussian random number with given mean and variance and clips the result to a range.

Parameters
meanmode of the gaussian
varvariance of the gaussian
rangeclipping range for the returned value
Returns
gaussian distributed variable clipped to range range
See also
double(double,double,const Range<double>&),

◆ get_random_index_subset()

std::vector<int> icl::utils::get_random_index_subset ( int  containerSize,
int  subsetSize 
)
inline

◆ get_random_subset() [1/3]

template<class T >
std::vector<T> icl::utils::get_random_subset ( const std::vector< T > &  s,
int  subsetSize 
)
inline

◆ get_random_subset() [2/3]

template<class T >
void icl::utils::get_random_subset ( const std::vector< T > &  s,
int  subsetSize,
std::vector< T > &  subset 
)
inline

◆ get_random_subset() [3/3]

template<class T >
void icl::utils::get_random_subset ( const std::vector< T > &  s,
int  subsetSize,
std::vector< T > &  subset,
std::vector< int > &  indices 
)
inline

◆ icl_from_stream()

template<class T >
std::istream& icl::utils::icl_from_stream ( std::istream &  s,
T &  t 
)
inline

compability function that reads a datatype instance from a stream

This must be used, to ensure, icl8u data is read as (int) rather as char

◆ icl_to_stream()

template<class T >
std::ostream& icl::utils::icl_to_stream ( std::ostream &  s,
t 
)
inline

compatibility function that writes a datatype instance into a stream

This must be used, to ensure, icl8u data is shown as (int) rather as char

◆ is_float_type()

template<class T >
bool icl::utils::is_float_type ( )
inline

◆ match()

ICLUtils_API MatchResult icl::utils::match ( const std::string &  text,
const std::string &  regex,
int  numSubMatches = 0 
)

Applies a regular expression match on given text and regex pattern (internally using regex.h)

Parameters
textsource string
regexregular expression to search in text
numSubMatchesIf 0 (which is default, result contains only an information whether the match was successful or not. Sub matches can be recorded optionally using a numSubMatches value > 0. Please note, that the whole pattern match is submatches[0] in the resulting MatchResult if numSubMatches is at least 1

◆ operator &&() [1/3]

bool icl::utils::operator && ( const ProgArg a,
const ProgArg b 
)
inline

this allows to check if two progargs are defined

this allows you to write:

if(pa("-size") && pa("-scale")){
...
}

◆ operator &&() [2/3]

bool icl::utils::operator && ( const ProgArg a,
bool  b 
)
inline

allows to check more than two ProgArg instances at once

Example:

if(pa("-size") && pa("-scale") && pa("-format")){ ... }

◆ operator &&() [3/3]

bool icl::utils::operator && ( bool &  b,
const ProgArg a 
)
inline

allows to check more than two ProgArg instances at once

Example:

if(pa("-size") && pa("-scale") && pa("-format")){ ... }

◆ operator<<() [1/15]

template<class T >
ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const SteppingRange< T > &  range 
)

puts a string representation [min,max]:step of given range into the given stream

Available for all icl-Types (icl8u,icl16s, icl32s, icl32f and icl64f and for unsigned int

◆ operator<<() [2/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  os,
const Size32f s 
)

ostream operator WIDTHxHEIGHT

◆ operator<<() [3/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const ProcessMonitor::Info info 
)

overloaded ostream operator for the ProcessMonitor's Info data type

◆ operator<<() [4/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const Point p 
)

ostream operator (x,y)

◆ operator<<() [5/15]

template<class T >
ICL_INSTANTIATE_ALL_DEPTHS ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const Range< T > &  range 
)

puts a string representation [min,max] of given range into the given stream

Available for all icl-Types (icl8u,icl16s, icl32s, icl32f and icl64f and for unsigned int

◆ operator<<() [6/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const Point32f p 
)

ostream operator (x,y)

◆ operator<<() [7/15]

std::ostream& icl::utils::operator<< ( std::ostream &  s,
const ProgArg pa 
)
inline

just puts the referenced argument value as string into the lvalue-stream

◆ operator<<() [8/15]

std::ostream& icl::utils::operator<< ( std::ostream &  stream,
const TextTable t 
)
inline

overloaded ostream-operator that uses the TextTable's toString method for serialization

◆ operator<<() [9/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  os,
const Size s 
)

ostream operator WIDTHxHEIGHT

◆ operator<<() [10/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const Rect32f r 
)

ostream operator (x,y)wxy

◆ operator<<() [11/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  ,
const Time  
)

writes Time instances value type into the stream

◆ operator<<() [12/15]

std::ostream& icl::utils::operator<< ( std::ostream &  stream,
const VisualizationDescription::Text t 
)
inline

overloaded ostream operator for VisualizationDescription::Text syntax: (x,y)text

◆ operator<<() [13/15]

std::ostream& icl::utils::operator<< ( std::ostream &  stream,
const VisualizationDescription::Color c 
)
inline

overloaded ostream operator for VisualizationDescription::Color

◆ operator<<() [14/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const Rect r 
)

ostream operator (x,y)wxy

◆ operator<<() [15/15]

ICLUtils_API std::ostream& icl::utils::operator<< ( std::ostream &  s,
const ConfigFile cf 
)

Default ostream operator to put a ConfigFile into a stream.

ostream operator is allowed to access privat members

◆ operator>>() [1/11]

template<class T >
ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
SteppingRange< T > &  range 
)

parses a range argument into a std::string

◆ operator>>() [2/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  is,
Size32f s 
)

istream operator

◆ operator>>() [3/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
Point p 
)

istream operator

◆ operator>>() [4/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
Point32f p 
)

istream operator

◆ operator>>() [5/11]

template<class T >
ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
Range< T > &  range 
)

parses a range argument into a std::string

◆ operator>>() [6/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  is,
Size s 
)

istream operator parses a size from a string

also called in Size::Size(const std::string&)

◆ operator>>() [7/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
Rect32f r 
)

istream operator

◆ operator>>() [8/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  ,
Time  
)

reads Time instances value type from the stream

◆ operator>>() [9/11]

std::istream& icl::utils::operator>> ( std::istream &  stream,
VisualizationDescription::Text t 
)
inline

overloaded istream operator for VisualizationDescription::Text syntax: (x,y)text (text must be single lined)

◆ operator>>() [10/11]

std::istream& icl::utils::operator>> ( std::istream &  stream,
VisualizationDescription::Color c 
)
inline

overloaded istream operator for VisualizationDescription::Color

◆ operator>>() [11/11]

ICLUtils_API std::istream& icl::utils::operator>> ( std::istream &  s,
Rect r 
)

istream operator

◆ operator||() [1/3]

bool icl::utils::operator|| ( const ProgArg a,
const ProgArg b 
)
inline

this allows to check if either of two progargs are defined

this allows you to write:

if(pa("-size") || pa("-scale")){
...
}

◆ operator||() [2/3]

bool icl::utils::operator|| ( const ProgArg a,
bool  b 
)
inline

allows to check if either of more than two ProgArg instances is defined

Example:

if(pa("-size") || pa("-scale") || pa("-format")){ ... }

◆ operator||() [3/3]

bool icl::utils::operator|| ( bool &  b,
const ProgArg a 
)
inline

allows to check if either of more than two ProgArg instances is defined

Example:

if(pa("-size") || pa("-scale") || pa("-format")){ ... }

◆ pa() [1/2]

const ProgArg icl::utils::pa ( const std::string &  id,
unsigned int  subargidx = 0 
)
inline

returns given program argument

The pa-function is the main interface for extracting information about given program arguments and/or their default values at run-time.

The returned icl::utils::ProgArg instance is always automatically parsed from its internal string representation into the expressions lvalue-type (this can easily be implemented with a templated version of the implicit cast operator of a class). Here are some examples:

pa_init(n,ppc,"-size|-s(Size=VGA) -index(int) -files(...)");
// extract the first sub-argument of argument
// '-index' and convert it into an int value
int i = pa("-index");
// extract the first sub-argument of argument '-size'
// if '-s' is the shortcut for '-size'
Size s = pa("-s");
// extract the 2nd sub-argument of argument '-input'
int = pa("-input",1);
// check if argument -size was actually given
if(pa("-size")){ ... }
// read a list of files from the arbitrary sub-argument
// arg '-files'. Note: it is not recommended to use
// pa("-files") within a loop, as internally the argument hash-
// map must always be searched
int nFiles = pa("-files").n();
for(int i=0;i<nFiles;++i){
std::cout << "file " << i << " " << pa("-files",i) << std::endl;
}
// alternatively, the "-files" prog-arg can be extracted
ProgArg f = pa("-files");
for(int i=0;i<f.n();++i){
std::cout << "file " << i << " " << f[i] << std::endl;
}
// list all given arguments and subarguments
std::cout << "all arguments " << std::endl;
for(unsigned int i=0;i<pa_get_count(false);++i){
std::cout << pa(i,false) << std::endl;
}
// in case of having dangling arguments allowed in
// painit-call: list all dangling arguments
std::cout << "all dangling arguments " << std::endl;
for(unsigned int i=0;i<pa_get_count();++i){
std::cout << pa(i) << std::endl;
}
// using ProgArg instances as std::strings is sometimes
// a bit complicated as conversion to std::string is
// sometimes ambiguous
struct Test{
Test(int i){...}
Test(const std::string &s){ .. }
};
...
Test t(pa("-x")); // ambiguous -> int | std::string
Test t((std::string)pa("-x")); // also ambiguous
// due to different available std::string constructors
Test t(pa("-x").as<std::string>()); // works, but long
Test t(*pa("-x")); // much shorter, but only for using
// a program argument as std::string
See also
icl::utils::pa_init(int,char**,const std::string&,bool)

◆ pa() [2/2]

const ProgArg icl::utils::pa ( unsigned int  idx,
bool  danglingOnly = true 
)
inline

returns given program argument at given index

See also
icl::utils::pa(const std::string&,unsigned int)

◆ pa_def() [1/2]

template<class T >
const T icl::utils::pa_def ( const std::string &  id,
unsigned int  subargidx,
const T &  def 
)
inline

utility function that allows to use a default value, if given argument was not defined

◆ pa_def() [2/2]

template<class T >
const T icl::utils::pa_def ( const std::string &  id,
const T &  def 
)
inline

utility function that allows to use a default value, if given argument was not defined

◆ pa_explain()

PAEX icl::utils::pa_explain ( const std::string &  pa,
const std::string &  ex 
)
inline

This function can be used to provide additional information for certain program arguments.

Due to the use of a special but hidden utility structure called icl::PAEX, this function can be called in a 'stacked' manner. This mean, that the function can be called several times without repeating the function name. Example:

paex("-size","defines the input image size")
("-input","defines input device id and parameters")
("-format","define input image format");
See also
icl::utils::pa(const std::string&,unsigned int)

◆ pa_get_count()

ICLUtils_API unsigned int icl::utils::pa_get_count ( bool  danglingOnly = true)

returns number of actually given args given

See also
icl::utils::pa(const std::string&,unsigned int)

◆ pa_get_help_text()

ICLUtils_API std::string icl::utils::pa_get_help_text ( )

returns the current help text (which is empty, if it was not set)

◆ pa_get_license()

ICLUtils_API std::string icl::utils::pa_get_license ( )

returns the current license text

◆ pa_get_progname()

ICLUtils_API const std::string& icl::utils::pa_get_progname ( bool  fullpath = false)

returns application name (full command line)

Parameters
fullpathif this is set to true, the complete first argument of main is returned, which may be something like /usr/bin/icl-create. If fullpath is false, which is default, just the program name is returned.
See also
icl::utils::pa(const std::string&,unsigned int)

◆ pa_init()

ICLUtils_API void icl::utils::pa_init ( int  n,
char **  ppc,
const std::string &  init,
bool  allowDanglingArgs = false 
)

initialization function for ICL's program argument evaluation framework

painit always receives your program's main-functions arguments as n and ppc. The actual definition of the underlying program argument evaluation framework is given by the init- argument.
The following rules define the syntax for the init-string:

  • The init string consists of space-separated tokens of single program argument definitions. Necessary space-characters within these tokens must be escaped using a back-slash character.
  • Each single argument definition token consists of a pipe-separated list of argument name alternatives (e.g. -size|-s followed by an optional parameter list in round braces.
  • Each argument is allowed to have 0, N or unlimited sub-arguments.
  • If the argument has no sub arguments it is a flag, which implicitly has the value true if it was given and false otherwise. Zero sub- arguments can be forced by using no parameter list, i.e., no round braces, an empty parameter list () or a parameter list with a zero argument count (0).
  • An arbitrary sub-argument count can be reached by using the special parameter list (...).
  • Otherwise, the parameter-list is a comma separated list of type, type=default-value, or argument-count tokens. Examples:
    • (int,int) defines two integer sub-arguments
    • (5) defines 5 sub-arguments with no type information
    • (float,2,int) defines 4 sub-arguments of type float, any, any and int
    • (int=4,Size=VGA) defines two sub-arguments of type int and Size with given default values 4 and VGA Note: if an int-type is used to define several arguments together, no defaults can be given. If you don't want to define the type, but only the default values, the special type string * should be used e.g., (*=foo,*=bar)

Furthermore, it is worth to mention, that the defined types are always just hints for the user. Internally all parameters are treated as strings.

Here are some further complete example calls for painit.

int main(int n, char **ppc){
icl::utils::pa_init(n,ppc,"-size|-s(Size=VGA) -format|-f(format-string)");
}
int main(int n, char **ppc){
icl::utils::pa_init(n,ppc,"-input|-i(device-type=dc,device-params=0)");
}

Arguments

Sometimes, certain arguments shall be used directly without defining arguments and sub-arguments. E.g. if you have a converter application that gets an input and an output file only (e.g., program call: myConvert image.ppm converted-image.ppm rather than something like myConvert -i image.ppm -o converted-image.ppm). Dangling arguments are these arguments that do not match defined arguments or sub-arguments of these. Usually, given arguments that do not match primary arguments or sub-arguments lead to a ProgArgException. You can explicitly allow these dangling arguments by setting allowDanglingArgs to 'true'.
Dangling arguments can then be obtained simply using the functions icl::utils::pa_get_count and icl::utils::pa(unsigned int,bool).

To list all dangling arguments, the followed code can be used:

for(unsigned int i=0;i<icl::utils::pa_get_count();++i){
std::cout << icl::utils::pa(i) << std::endl;
}

and Mandatory Arguments

As default, all arguments are optional. If you want to define an argument to be mandatory, simply prepend a '[m]'-prefix to the argument name alternative list. Example:

// -size and -format are optional; -input or -i is mandatory
icl::utils::pa_init(n,ppc,"-size(Size=VGA) -format(format=RGB) "
"[m]-input|-i(string,string)");

If mandatory arguments are not actually given to the program, a ProgArgException is thrown. As it does not make sense to define default values for mandatory arguments, a ProgArgException is thrown in this case as well. Furthermore, mandatory arguments must have sub-arguments (which is also sensible if you think about it).

◆ pa_set_help_text()

ICLUtils_API void icl::utils::pa_set_help_text ( const std::string &  newHelpText)

Sets a applications help text that is used when applications are run with –help or with unknown arguments.

pasethelp has to be called before painit is called.

◆ pa_set_license()

ICLUtils_API void icl::utils::pa_set_license ( const std::string &  newLicenseText)

Sets a license text, that is used when applications are run with –version or -v.

pasetlic has to be called before painit is called. Otherwise, only the default licese text is shown.

◆ pa_show()

ICLUtils_API void icl::utils::pa_show ( )

shows all given program arguments

◆ pa_show_usage()

ICLUtils_API void icl::utils::pa_show_usage ( const std::string &  msg = "")

shows current available programm arguments

◆ parse() [1/2]

template<class T >
T icl::utils::parse ( const std::string &  s)
inline

parses a string into template parameter (defined for iclXX and std::string)

See also
to8u to16s to32s to32f to64f (

◆ parse() [2/2]

template<>
const char* icl::utils::parse ( const std::string &  s)
inline

◆ parseVec()

template<class T >
std::vector<T> icl::utils::parseVec ( const std::vector< std::string > &  v)
inline

parse a vector of strings into a vector of T's

◆ parseVecStr()

template<class T >
std::vector<T> icl::utils::parseVecStr ( const std::string &  vecStr,
const std::string &  delims = "," 
)
inline

parse a delims seperated string into a vector of T's

◆ power()

template<class T , unsigned int N>
static T icl::utils::power ( const T &  x)
inlinestatic

power template

◆ progress()

ICLUtils_API void icl::utils::progress ( int  curr,
int  max,
const std::string &  extraText = "" 
)

static utility function for displaying some progress information in console

Extra text is show behind the progress bar

◆ progress_finish()

ICLUtils_API void icl::utils::progress_finish ( )

static utility function for displaying some progress information in console

◆ progress_init()

ICLUtils_API void icl::utils::progress_init ( const std::string &  text = "Creating LUT")

static utility function for displaying some progress information in console

◆ random() [1/4]

double icl::utils::random ( double  max = 1)
inline

Generates random numbers in range [0,1].

◆ random() [2/4]

double icl::utils::random ( double  min,
double  max 
)
inline

Generate a random number in range [min,max].

Parameters
mina float argument. The lower intervall bound
maxa float argument. The upper interval bound

◆ random() [3/4]

template<class T >
double icl::utils::random ( const Range< T > &  r)
inline

equivalent to random (r.minVal,r.maxVal)

◆ random() [4/4]

unsigned int icl::utils::random ( unsigned int  max)
inline

Creates a non-negative random number in range [0,max].

Parameters
maxThe upper limit for the returned number

◆ randomSeed() [1/2]

void icl::utils::randomSeed ( long int  seedval)
inline

Initilaize the random number generator.

Parameters
seedvalThe seed value (e.g. time(0) ...)

◆ randomSeed() [2/2]

void icl::utils::randomSeed ( )
inline

Initilaize the random number generator (with Time::now().toMicroSeconds()).

◆ saveCall()

template<class T , void(T::*)() func>
static void icl::utils::saveCall ( T *  obj)
inlinestatic

static utility function which ensures Thread-safety for object functions

Internally this function template will create a specific mutex for the given class T and the given member function. When using the saveCall template to call an objects member-function from different threads, the function will automatically become Thread-save, as it is only executes once at one time.

◆ saveDelete()

template<class T >
static void icl::utils::saveDelete ( T *&  pointer)
inlinestatic

static utility function which deletes a pointer and sets it to NULL

Internally this function template will create a specific mutex for the given class T. All calls to the saveDelete function are protected by the static mutex. So saveDelete(XXX) can be called from different threads [but with the identical pointer reference] without the risk of segmentation violations or double free exceptions.

◆ skipWhitespaces()

ICLUtils_API std::string icl::utils::skipWhitespaces ( const std::string &  s)

crops trailing whitespaces of a string

◆ sqr()

template<class T >
static T icl::utils::sqr ( const T &  x)
inlinestatic

square template (faster than pow(x,2)

◆ startsWith()

ICLUtils_API bool icl::utils::startsWith ( const std::string &  s,
const std::string &  prefix 
)

returns whether a given string begins with a given prefix

◆ str() [1/6]

template<class T >
std::string icl::utils::str ( const T &  t)
inline

convert a data type into a string using an std::ostringstream instance

◆ str() [2/6]

template<>
std::string icl::utils::str ( const icl8u t)
inline

specialized for icl8u

◆ str() [3/6]

template<>
std::string icl::utils::str ( const bool &  b)
inline

specialized for bool

◆ str() [4/6]

template<>
std::string icl::utils::str ( const std::string &  s)
inline

specialized for std::string input (this is quiet silly)

◆ str() [5/6]

template<>
std::string icl::utils::str ( char *const &  pc)
inline

specialized for char const pointers

◆ str() [6/6]

template<>
std::string icl::utils::str ( const char *const &  pc)
inline

specialized for const char const pointers

◆ strVec()

template<class T >
std::vector<std::string> icl::utils::strVec ( const std::vector< T > &  v)
inline

convert a vector of T's into a vector of strings

◆ time2str()

ICLUtils_API std::string icl::utils::time2str ( Time::value_type  x)

converts a Time::value_type (long int) into a string

◆ to16s()

ICLUtils_API icl16s icl::utils::to16s ( const std::string &  s)

cast a string to an icl16s (parse)

◆ to32f()

ICLUtils_API icl32f icl::utils::to32f ( const std::string &  s)

cast a string to an icl32f (parse)

◆ to32s()

ICLUtils_API icl32s icl::utils::to32s ( const std::string &  s)

cast a string to an icl32ss (parse)

◆ to64f()

ICLUtils_API icl64f icl::utils::to64f ( const std::string &  s)

cast a string to an icl64f (parse)

◆ to8u()

ICLUtils_API icl8u icl::utils::to8u ( const std::string &  s)

cast a string to an icl8u (parse)

◆ tok() [1/2]

ICLUtils_API std::vector<std::string> icl::utils::tok ( const std::string &  s,
const std::string &  delims = " ",
bool  singleCharDelims = true,
char  escapeChar = '\0' 
)

tokenizes a string with given delimiters (internally using a temporary StrTok instance)

◆ tok() [2/2]

ICLUtils_API std::vector<std::string>& icl::utils::tok ( const std::string &  s,
const std::string &  delim,
std::vector< std::string > &  dst,
bool  singleCharDelims = true,
char  escapeChar = '\0' 
)

tokenize a string with given delimiters into a result vector (optimized)

◆ toLower()

ICLUtils_API std::string icl::utils::toLower ( const std::string &  s)

lower case conversion

◆ toLowerI()

ICLUtils_API std::string& icl::utils::toLowerI ( std::string &  s)

inplace lower case conversion

◆ toStr() [1/4]

ICLUtils_API std::string icl::utils::toStr ( int  i,
const char *  format,
char *  buf = 0 
)

creates a string from a given integer

Parameters
ito be converted integer value
formatformat string as d or %8d
bufoptinal dest buffer (used if not NULL)

◆ toStr() [2/4]

ICLUtils_API std::string icl::utils::toStr ( double  d,
const char *  format,
char *  buf = 0 
)

creates a string from a given double/float

Parameters
dto be converted double/float value
formatformat string as ff or %3.5f
bufoptinal dest buffer (used if not NULL)

◆ toStr() [3/4]

ICLUtils_API std::string icl::utils::toStr ( int  i,
char *  buf = 0 
)

create a string from given integer using format string "%d"

See also
toStr(int,const char*,char*)

◆ toStr() [4/4]

ICLUtils_API std::string icl::utils::toStr ( double  d,
char *  buf = 0 
)

create a string from given float using format string "%f"

See also
toStr(double,const char*,char*)

◆ toUpper()

ICLUtils_API std::string icl::utils::toUpper ( const std::string &  s)

upper case conversion

◆ toUpperI()

ICLUtils_API std::string& icl::utils::toUpperI ( std::string &  s)

inplace upper case conversion