Definition at line 43 of file mainUtil.cpp. References Impala::Core::Database::RawDataSet::AddFile(), Impala::Core::Array::ArrayListDelete(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::FileNameExt(), Impala::FileNameTail(), Impala::CmdOptions::GetArg(), Impala::Persistency::RepositoryInFileSystem::GetFile(), Impala::Persistency::RepositoryInFileSystem::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), Impala::Persistency::File::GetReadBuffer(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::Array::LimitCompressedImageSize(), Impala::Util::IOBuffer::Read(), Impala::Persistency::File::ReadStrings(), Impala::Util::IOBuffer::Size(), and Impala::Persistency::File::Valid(). Referenced by mainUtil(). 00044 { 00045 typedef Core::ImageSet::ImageSet ImageSet; 00046 typedef Core::Array::Array2dScalarUInt8 Array2dScalarUInt8; 00047 typedef Core::Array::Array2dVec3UInt8 Array2dVec3UInt8; 00048 00049 ILOG_VAR(Impala.Application.Util.DoCreateImageSet); 00050 CmdOptions& options = CmdOptions::GetInstance(); 00051 if (options.GetNrArg() < 3) 00052 { 00053 ILOG_ERROR("Need more parameters"); 00054 return; 00055 } 00056 00057 String setName = options.GetArg(1); 00058 ImageSet imSet(setName); 00059 std::vector<Array2dScalarUInt8*> imList; 00060 00061 String container("."); // Kill directory structure for now 00062 int a = 2; 00063 RepositoryInFileSystem& repFS = RepositoryInFileSystem::GetInstance(); 00064 std::vector<String> input; 00065 String fName = options.GetArg(a); 00066 if (FileNameExt(fName) == "txt") 00067 { 00068 String fName = options.GetArg(a); 00069 FileLocator loc(fName); 00070 Persistency::File file = repFS.GetFile(loc, false, false); 00071 file.ReadStrings(input); 00072 } 00073 else 00074 { 00075 while (a < options.GetNrArg()) 00076 { 00077 String fName = options.GetArg(a++); 00078 input.push_back(fName); 00079 } 00080 } 00081 ILOG_INFO("Input contains " << input.size() << " files"); 00082 for (int i=0 ; i<input.size() ; i++) 00083 { 00084 String fName = input[i]; 00085 String tail = FileNameTail(fName); 00086 //String container = FileNamePath2(fName); 00087 imSet.AddFile(tail, container); 00088 FileLocator loc(fName); 00089 Persistency::File file = repFS.GetFile(loc, false, false); 00090 if (!file.Valid()) 00091 return; 00092 Impala::Util::IOBuffer* ioBuf = file.GetReadBuffer(); 00093 Int64 bufSize = ioBuf->Size(); 00094 Array2dScalarUInt8* bufIm = 00095 Core::Array::ArrayCreate<Array2dScalarUInt8>(bufSize, 1); 00096 Int64 nrRead = ioBuf->Read(bufIm->CPB(), ioBuf->Size()); 00097 00098 Core::Array::LimitCompressedImageSize(bufIm, 720); 00099 imList.push_back(bufIm); 00100 } 00101 ImageSetLocator setLoc(setName, options); 00102 ImageSetRepository().Add(setLoc, &imSet); 00103 00104 ImageArchiveLocator arLoc(setLoc, false, container, "images.raw", 0); 00105 Core::Array::ImageArchiveMemory wrapper(&imList); 00106 ImageArchiveRepository().Add(arLoc, &wrapper); 00107 Core::Array::ArrayListDelete(&imList); 00108 }
Here is the call graph for this function: ![]()
|