int CmFile::GetNamesNE(CStr& rootFolder, CStr &fileW, vecS &names) { int fNum = GetNames(rootFolder, fileW, names); int extS = (int)GetExtention(fileW).size(); for (int i = 0; i < fNum; i++) names[i].resize(names[i].size() - extS); return fNum; }
int CmFile::GetNamesNE(CStr& nameWC, vecS &names, string &dir, string &ext) { int fNum = GetNames(nameWC, names, dir); ext = GetExtention(nameWC); for (int i = 0; i < fNum; i++) names[i] = GetNameNE(names[i]); return fNum; }
// NE for No extension int IMVLFile::GetNamesNE(const string& rootFolder, const string &fileW, vector<string> &names) { int fNum = GetNames(rootFolder, fileW, names); int extS = (int)GetExtention(fileW).size(); for (int i = 0; i < fNum; i++) names[i].resize(names[i].size() - extS); return fNum; }
// NE for No extension int IMVLFile::GetNamesNE(const string& nameWC, vector<string> &names, string &dir, string &ext) { int fNum = GetNames(nameWC, names, dir); ext = GetExtention(nameWC); for (int i = 0; i < fNum; i++) names[i] = GetNameNE(names[i]); return fNum; }
int CmFile::ChangeImgFormat(CStr &imgW, CStr dstW) { vecS names; string inDir, ext = GetExtention(imgW); int iNum = GetNames(imgW, names, inDir); #pragma omp parallel for for (int i = 0; i < iNum; i++) { Mat img = imread(inDir + names[i]); imwrite(format(_S(dstW), _S(GetNameNE(names[i]))), img); } return iNum; }
// 拡張子を判定 bool isExtention(LPCTSTR iPath, LPCTSTR iExtention) { return ( lstrcmpi( GetExtention(iPath), iExtention ) == 0 ); }
LPTSTR GetExtention( LPTSTR szPath ) { return const_cast<LPTSTR>( GetExtention( static_cast<LPCTSTR>(szPath) ) ); }