Definition at line 31 of file BinHex.h. Referenced by Impala::Persistency::FeatureTableRepositoryInMonet::Get(), Impala::Core::Array::ImageArchiveMapi::GetImageData(), and Impala::Samples::MonetTest::MakeFeatureTableMapi(). 00032 { 00033 UInt8* tmp = new UInt8[data.size()]; 00034 for (int i=0 ; i<data.size() ; i++) 00035 { 00036 UInt8 res; 00037 switch (data[i]) 00038 { 00039 case '0': res = 0; break; 00040 case '1': res = 1; break; 00041 case '2': res = 2; break; 00042 case '3': res = 3; break; 00043 case '4': res = 4; break; 00044 case '5': res = 5; break; 00045 case '6': res = 6; break; 00046 case '7': res = 7; break; 00047 case '8': res = 8; break; 00048 case '9': res = 9; break; 00049 case 'A': res = 10; break; 00050 case 'B': res = 11; break; 00051 case 'C': res = 12; break; 00052 case 'D': res = 13; break; 00053 case 'E': res = 14; break; 00054 case 'F': res = 15; break; 00055 } 00056 tmp[i] = res; 00057 } 00058 resSize = data.size() / 2; 00059 UInt8* res = new UInt8[resSize]; 00060 for (int i=0 ; i<resSize ; i++) 00061 { 00062 res[i] = ((tmp[i*2] << 4) & 0xF0) | tmp[i*2+1]; 00063 } 00064 delete tmp; 00065 return res; 00066 }
|