HarmonyOS鸿蒙Next中getHdrComposedPixelmap的实现与应用
HarmonyOS鸿蒙Next中getHdrComposedPixelmap的实现与应用
const HDRContext = getContext();
const HDRResourceMgr = HDRContext.resourceManager;
const HDRRawFile = await HDRResourceMgr.getRawFileContent("HDR2.jpg");
let exifOps: image.SourceOptions = {
sourceDensity: 98,
}
let HDRImageSource: image.ImageSource = image.createImageSource(HDRRawFile.buffer as ArrayBuffer, exifOps);
let HDRCommodityPixelMap: image.PixelMap = await HDRImageSource.createPixelMap();
let HDRPictureObj: image.Picture = image.createPicture(HDRCommodityPixelMap);
if (HDRPictureObj != null) { //图片包含Hdr图
try {
let hdrComposedPixelmap: image.PixelMap = await HDRPictureObj.getHdrComposedPixelmap();
if (hdrComposedPixelmap != null) {
hdrComposedPixelmap.getImageInfo().then((imageInfo: image.ImageInfo) => {
if (imageInfo != null) {
console.info('GetHdrComposedPixelmap information height:' + imageInfo.size.height +
' width:' + imageInfo.size.width);
}
}).catch((error: BusinessError) => {
console.error(`Failed error.code: ${error.code} ,error.message: ${error.message}`);
});
}
} catch (e) {
e as BusinessError
console.error(`Failed error.code: ${e.code} ,error.message: ${e.message}`);
}
} else {
console.info('hdrPictureObj is null');
}
使用picture的getHdrComposedPixelmap方法报错,提示error.code: 7600201 ,error.message: There is no GAINMAP
使用的是网上找的HDR图片资源
更多关于HarmonyOS鸿蒙Next中getHdrComposedPixelmap的实现与应用的实战教程也可以访问 https://www.itying.com/category-93-b0.html
您好,您的问题需要进一步分析,请您通过在线提单进一步解决:https://developer.huawei.com/consumer/cn/support/feedback/#/,感谢您的反馈和支持。
更多关于HarmonyOS鸿蒙Next中getHdrComposedPixelmap的实现与应用的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS鸿蒙Next中,getHdrComposedPixelmap
是一个用于获取高动态范围(HDR)图像合成后的像素图的方法。它通常用于图像处理模块,特别是在需要处理HDR图像时。通过该方法,开发者可以获取经过HDR合成后的像素数据,以便进行进一步的处理或显示。应用场景包括但不限于图像编辑、视频处理、以及需要高动态范围显示的应用程序。使用该方法时,需确保设备支持HDR功能,并正确配置相关参数以获得最佳效果。