Definition at line 37 of file mainIm.cpp. References Impala::Core::Array::ARRAY2DSCALARREAL64, Impala::Core::Array::ARRAY2DSCALARUINT8, Impala::Core::Array::ARRAY2DVEC2REAL64, Impala::Core::Array::ARRAY2DVEC3UINT8, Impala::CmdOptions::GetArg(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_VAR, Impala::Core::Array::PrintData(), Impala::Core::Array::ReadRaw(), Impala::Core::Array::ReadRawArrayType(), Impala::Core::Array::Set(), and Impala::Core::Array::WriteRaw(). Referenced by mainIm(). 00038 { 00039 ILOG_VAR(Impala.Application.Im.DoDump); 00040 CmdOptions& options = CmdOptions::GetInstance(); 00041 if (options.GetNrArg() < 2) 00042 { 00043 ILOG_ERROR("Need more arguments"); 00044 return; 00045 } 00046 Util::Database* db = &Util::Database::GetInstance(); 00047 00048 String fileName = options.GetArg(1); 00049 bool doGenesis = false; 00050 if (options.GetNrArg() >= 3) 00051 doGenesis = true; 00052 00053 // todo : -rect arg 00054 00055 ArrayType aType = ReadRawArrayType(fileName, db); 00056 switch (aType) 00057 { 00058 case ARRAY2DSCALARUINT8: { 00059 Array2dScalarUInt8* a = 0; 00060 ReadRaw(a, fileName, db); 00061 PrintData(a, false, 0, 0, 10, 10); 00062 delete a; 00063 break; 00064 } 00065 case ARRAY2DSCALARREAL64: { 00066 Array2dScalarReal64* a = 0; 00067 ReadRaw(a, fileName, db); 00068 PrintData(a, false); 00069 if (doGenesis) 00070 WriteRaw(a, "real64_b.raw", db, true); 00071 // 00072 Array2dScalarInt32* b = 0; 00073 Set(b, a); 00074 PrintData(b, false); 00075 if (doGenesis) 00076 WriteRaw(b, "int32.raw", db, false); 00077 00078 Array2dVec3UInt8* c = 0; 00079 Set(c, b); 00080 PrintData(c, false); 00081 if (doGenesis) 00082 WriteRaw(c, "vec3uint8.raw", db, false); 00083 00084 Array2dComplex64* d = 0; 00085 Set(d, a); 00086 PrintData(d, false); 00087 if (doGenesis) 00088 WriteRaw(d, "complex64.raw", db, false); 00089 // 00090 delete a; 00091 break; 00092 } 00093 case ARRAY2DVEC3UINT8: { 00094 Array2dVec3UInt8* a = 0; 00095 ReadRaw(a, fileName, db); 00096 PrintData(a, false); 00097 if (doGenesis) 00098 WriteRaw(a, "vec3uint8_b.raw", db, true); 00099 delete a; 00100 break; 00101 } 00102 case ARRAY2DVEC2REAL64: { // we assume this to be complex 00103 Array2dComplex64* a = 0; 00104 ReadRaw(a, fileName, db); 00105 PrintData(a, false); 00106 if (doGenesis) 00107 WriteRaw(a, "complex64_b.raw", db, true); 00108 delete a; 00109 break; 00110 } 00111 default: 00112 ILOG_ERROR("Unknown ArrayType"); 00113 } 00114 }
Here is the call graph for this function:
|