Lines Matching refs:imageFile
108 uint32_t BufferHelper::GetPixelFmtFromFileSuffix(const string& imageFile)
110 if (imageFile.rfind(".rgba") != string::npos) {
113 if (imageFile.rfind(".nv21") != string::npos) {
119 sptr<NativeBuffer> BufferHelper::CreateImgBuffer(const string& imageFile)
121 IF_TRUE_RETURN_VAL(imageFile.length() <= 0, nullptr);
122 ifstream ifs(imageFile, ios::binary);
123 IF_TRUE_RETURN_VAL_WITH_MSG(!ifs.is_open(), nullptr, "cannot open %{public}s", imageFile.c_str());
125 IF_TRUE_RETURN_VAL_WITH_MSG(!ExtractPixelInfoFromFilePath(imageFile, pixelInfo), nullptr,
126 "invalid file path format: %{public}s", imageFile.c_str());
130 pixelInfo.pixFmt = GetPixelFmtFromFileSuffix(imageFile);