revertDifxDrawableImage

Signed-off-by: WyxGitHub <878459285@qq.com>
This commit is contained in:
WyxGitHub 2024-08-18 09:40:11 +08:00
parent 712e95ee90
commit 4eeab930f3
2 changed files with 2 additions and 13 deletions

View File

@ -139,13 +139,12 @@ std::shared_ptr<Media::PixelMap> ImageConverter::BitmapToPixelMap(
auto data = bitMap->GetPixels();
opts.size.width = static_cast<int32_t>(bitMap->GetWidth());
opts.size.height = static_cast<int32_t>(bitMap->GetHeight());
opts.editable = true;
auto pixelMap = Media::PixelMap::Create(opts);
auto pixelMap = Media::PixelMap::Create(reinterpret_cast<uint32_t*>(data),
opts.size.width * opts.size.height, opts);
if (!pixelMap) {
HILOGE("PixelMap is null, bitMap's Size = (%{public}d, %{public}d)", bitMap->GetWidth(), bitMap->GetHeight());
return pixelMap;
}
pixelMap->WritePixels(reinterpret_cast<uint8_t*>(data), opts.size.width * opts.size.height * sizeof(uint32_t));
return pixelMap;
}
#endif

View File

@ -112,16 +112,6 @@ public:
{
return 0;
}
uint32_t WritePixels(const uint8_t *source, const uint64_t &bufferSize)
{
return 0;
}
static std::unique_ptr<PixelMap> Create(const InitializationOptions& opts)
{
return nullptr;
}
static std::unique_ptr<PixelMap> Create(
const uint32_t* colors, uint32_t colorLength, const InitializationOptions& opts)