eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // CoreConversion.h Core.Component package 00003 //============================================================================ 00004 // Copyright (C) 2006 by eLynx project 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Library General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2 of the License, or (at your option) any later version. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00014 // See the GNU Library General Public License for more details. 00015 //---------------------------------------------------------------------------- 00016 #ifndef __CoreConversion_h__ 00017 #define __CoreConversion_h__ 00018 00019 #include "CoreTypes.h" 00020 00021 namespace eLynx { 00022 00023 //---------------------------------------------------------------------------- 00024 // simple cast conversion 00025 //---------------------------------------------------------------------------- 00026 template<typename T> int8 elxToINT8(T); 00027 template<typename T> uint8 elxToUINT8(T); 00028 template<typename T> int16 elxToINT16(T); 00029 template<typename T> uint16 elxToUINT16(T); 00030 template<typename T> int32 elxToINT32(T); 00031 template<typename T> uint32 elxToUINT32(T); 00032 template<typename T> int64 elxToINT64(T); 00033 template<typename T> uint64 elxToUINT64(T); 00034 template<typename T> float elxToFloat(T); 00035 template<typename T> double elxToDouble(T); 00036 00037 //---------------------------------------------------------------------------- 00038 // conversion scaled so that max are converse 00039 //---------------------------------------------------------------------------- 00040 template<typename T> int8 elxToINT8Scaled(T); 00041 template<typename T> uint8 elxToUINT8Scaled(T); 00042 template<typename T> int16 elxToINT16Scaled(T); 00043 template<typename T> uint16 elxToUINT16Scaled(T); 00044 template<typename T> int32 elxToINT32Scaled(T); 00045 template<typename T> uint32 elxToUINT32Scaled(T); 00046 template<typename T> int64 elxToINT64Scaled(T); 00047 template<typename T> uint64 elxToUINT64Scaled(T); 00048 template<typename T> float elxToFloatNormalized(T); 00049 template<typename T> double elxToDoubleNormalized(T); 00050 template<typename T> void elxToDoubleNormalized(const T*, uint32 count, double *); 00051 00052 template<typename T> 00053 void elxFromDouble(double iValue, T& oValue); 00054 00055 template<typename T> 00056 void elxFromDoubleNormalized(double iValue, T& oValue); 00057 00064 template<typename T, typename U> 00065 bool elxConvertBuffer( 00066 T * iprDst, 00067 const U * iprSrc, 00068 size_t iSize, 00069 bool ibScaled = true); 00070 00075 template<typename T> 00076 bool elxStringToType(const char * iprString, T& oValue); 00077 00078 } // namespace eLynx 00079 00080 #include "inl/CoreConversion.inl" 00081 00082 #endif // __CoreConversion_h__