Lines Matching defs:pixelInfo
48 bool BufferHelper::ExtractPixelInfoFromFilePath(const string& filePath, PixelFileInfo& pixelInfo)
55 &pixelInfo.displayWidth, &pixelInfo.displayHeight,
56 &pixelInfo.alignedWidth, &pixelInfo.alignedHeight,
57 &pixelInfo.pixFmt);
61 pixelInfo.displayWidth, pixelInfo.displayHeight, pixelInfo.alignedWidth, pixelInfo.alignedHeight);
65 bool BufferHelper::CopyYuvData(BufferHandle *handle, ifstream &ifs, PixelFileInfo& pixelInfo)
70 for (uint32_t i = 0; i < pixelInfo.displayHeight; i++) {
71 ifs.read(dst, pixelInfo.alignedWidth * BYTES_PER_PIXEL_YUV);
75 for (uint32_t i = 0; i < (pixelInfo.alignedHeight - pixelInfo.displayHeight); i++) {
76 ifs.read(dst, pixelInfo.alignedWidth * BYTES_PER_PIXEL_YUV);
86 uint64_t uvOffset = (pixelInfo.pixFmt == OHOS::HDI::Display::Composer::V1_2::PIXEL_FMT_YCBCR_420_SP) ?
90 for (uint32_t i = 0; i < pixelInfo.displayHeight / UV_SAMPLE_RATE; i++) {
91 ifs.read(dst, pixelInfo.alignedWidth * BYTES_PER_PIXEL_YUV);
97 bool BufferHelper::CopyRgbaData(BufferHandle *handle, ifstream &ifs, PixelFileInfo& pixelInfo)
101 for (uint32_t i = 0; i < pixelInfo.displayHeight; i++) {
102 ifs.read(dst, pixelInfo.alignedWidth * BYTES_PER_PIXEL_RBGA);
124 PixelFileInfo pixelInfo;
125 IF_TRUE_RETURN_VAL_WITH_MSG(!ExtractPixelInfoFromFilePath(imageFile, pixelInfo), nullptr,
130 pixelInfo.pixFmt = GetPixelFmtFromFileSuffix(imageFile);
131 HDF_LOGI("pixelFmt=0x%{public}x", pixelInfo.pixFmt);
133 .width = pixelInfo.displayWidth,
134 .height = pixelInfo.displayHeight,
136 .format = pixelInfo.pixFmt
143 bool flag = (pixelInfo.pixFmt == OHOS::HDI::Display::Composer::V1_2::PIXEL_FMT_RGBA_8888) ?
144 CopyRgbaData(handle, ifs, pixelInfo) :
145 CopyYuvData(handle, ifs, pixelInfo);