eLynx SDK
v3.0.1 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 elxToByte(T); 00027 template<typename T> uint8 elxToUByte(T); 00028 template<typename T> int16 elxToShort(T); 00029 template<typename T> uint16 elxToUShort(T); 00030 template<typename T> int32 elxToInteger(T); 00031 template<typename T> uint32 elxToUInteger(T); 00032 template<typename T> int64 elxToLarge(T); 00033 template<typename T> uint64 elxToULarge(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 elxToByteScaled(T); 00041 template<typename T> uint8 elxToUByteScaled(T); 00042 template<typename T> int16 elxToShortScaled(T); 00043 template<typename T> uint16 elxToUShortScaled(T); 00044 template<typename T> int32 elxToIntegerScaled(T); 00045 template<typename T> uint32 elxToUIntegerScaled(T); 00046 template<typename T> int64 elxToLargeScaled(T); 00047 template<typename T> uint64 elxToULargeScaled(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 00059 // @param iprDst typed destination buffer. 00060 // @param iprSrc typed read-only source buffer. 00061 // @param iSize number of primary type to convert form source. 00062 // @param ibScaled true if conversion conserve max or Normalized, false for simple cast. 00063 template<typename T, typename U> 00064 bool elxConvertBuffer( 00065 T * iprDst, 00066 const U * iprSrc, 00067 size_t iSize, 00068 bool ibScaled = true); 00069 00070 } // namespace eLynx 00071 00072 #include "inl/CoreConversion.inl" 00073 00074 #endif // __CoreConversion_h__