diff --git a/frameworks/innerkitsimpl/utils/include/image_utils.h b/frameworks/innerkitsimpl/utils/include/image_utils.h index 616b837e0a71696d7e05b7e3ef8a70cc8bde792d..ff6112c1526a3353d830e2cb98ddd22842d109da 100644 --- a/frameworks/innerkitsimpl/utils/include/image_utils.h +++ b/frameworks/innerkitsimpl/utils/include/image_utils.h @@ -122,8 +122,6 @@ public: AllocatorType type, uint8_t* ptr, uint64_t count, void* fd); static bool IsSdrPixelMapReuseSuccess(ImagePlugin::DecodeContext& context, int width, int height, const std::shared_ptr &reusePixelmap); - static bool IsReuseYUV(ImagePlugin::DecodeContext& context, const std::shared_ptr &reusePixelmap); - static bool IsReuseRGB(ImagePlugin::DecodeContext& context, const std::shared_ptr &reusePixelmap); static bool IsYuvFormat(PixelFormat format); static bool IsRGBX(PixelFormat format); static bool PixelMapCreateCheckFormat(PixelFormat format); diff --git a/frameworks/innerkitsimpl/utils/src/image_utils.cpp b/frameworks/innerkitsimpl/utils/src/image_utils.cpp index c34e389f0ed4d2ad7a6c552afe2166b1a6dfcb98..ba67e2ffebaf915510fe6cfaef03a422aa0a07f9 100644 --- a/frameworks/innerkitsimpl/utils/src/image_utils.cpp +++ b/frameworks/innerkitsimpl/utils/src/image_utils.cpp @@ -1516,8 +1516,7 @@ bool ImageUtils::CanReusePixelMapHdr(ImagePlugin::DecodeContext& context, int wi hdrPixelFormat = GRAPHIC_PIXEL_FMT_YCBCR_P010; } SetContextHdr(context, hdrPixelFormat); - bool cond = ((reusePixelmap->GetPixelFormat() != PixelFormat::RGBA_1010102) || - (context.info.pixelFormat != PixelFormat::RGBA_1010102)); + bool cond = (reusePixelmap->GetPixelFormat() != context.info.pixelFormat); CHECK_ERROR_RETURN_RET_LOG(cond, false, "PixelFormat of Hdrimage is not equal to reusePixelmap"); return true; #else @@ -1525,28 +1524,6 @@ bool ImageUtils::CanReusePixelMapHdr(ImagePlugin::DecodeContext& context, int wi #endif } -bool IsReuseYUVFormat(PixelFormat format) -{ - return format == PixelFormat::NV12 || format == PixelFormat::NV21; -} - -// Determine whether the reusePixelmap and decoding image are both YUV format. -bool ImageUtils::IsReuseYUV(ImagePlugin::DecodeContext& context, const std::shared_ptr &reusePixelmap) -{ - return IsReuseYUVFormat(reusePixelmap->GetPixelFormat()) && IsReuseYUVFormat(context.info.pixelFormat); -} - -bool IsReuseRGBFormat(PixelFormat format) -{ - return format == PixelFormat::RGBA_8888 || format == PixelFormat::BGRA_8888; -} - -// Determine whether the reusePixelmap and decoding image are both RGB format. -bool ImageUtils::IsReuseRGB(ImagePlugin::DecodeContext& context, const std::shared_ptr &reusePixelmap) -{ - return IsReuseRGBFormat(reusePixelmap->GetPixelFormat()) && IsReuseRGBFormat(context.info.pixelFormat); -} - bool ImageUtils::CanReusePixelMapSdr(ImagePlugin::DecodeContext& context, int width, int height, const std::shared_ptr &reusePixelmap) { @@ -1556,7 +1533,7 @@ bool ImageUtils::CanReusePixelMapSdr(ImagePlugin::DecodeContext& context, int wi bool cond = ((reusePixelmap->GetPixelFormat() == PixelFormat::RGBA_1010102) || (context.info.pixelFormat == PixelFormat::RGBA_1010102)); CHECK_ERROR_RETURN_RET_LOG(cond, false, "Sdr image is not RGBA 10bit"); - cond = (!IsReuseYUV(context, reusePixelmap) && !IsReuseRGB(context, reusePixelmap)); + cond = (reusePixelmap->GetPixelFormat() != context.info.pixelFormat); CHECK_ERROR_RETURN_RET_LOG(cond, false, "PixelFormat of Sdrimage is not equal to reusePixelmap"); return true; }