From c8859308244a56f9b2ef5202586dadd10eabfa32 Mon Sep 17 00:00:00 2001 From: David Korth Date: Sun, 24 Nov 2024 17:08:20 -0500 Subject: [PATCH] [librpbase] RpImageLoader: Take IRpFile* and make the IRpFilePtr version a wrapper. Similar to RpJpeg and RpPng, which are both used by RpImageLoader. --- src/librpbase/img/RpImageLoader.cpp | 2 +- src/librpbase/img/RpImageLoader.hpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/librpbase/img/RpImageLoader.cpp b/src/librpbase/img/RpImageLoader.cpp index 80643d30b1..ef57c577ac 100644 --- a/src/librpbase/img/RpImageLoader.cpp +++ b/src/librpbase/img/RpImageLoader.cpp @@ -48,7 +48,7 @@ static constexpr array exif_magic = {{'E','x','i','f'}}; * @param file IRpFile to load from. * @return rp_image*, or nullptr on error. */ -rp_image_ptr load(const IRpFilePtr &file) +rp_image_ptr load(IRpFile *file) { file->rewind(); diff --git a/src/librpbase/img/RpImageLoader.hpp b/src/librpbase/img/RpImageLoader.hpp index 0207ff2f6c..409e1b3f8c 100644 --- a/src/librpbase/img/RpImageLoader.hpp +++ b/src/librpbase/img/RpImageLoader.hpp @@ -22,6 +22,16 @@ namespace LibRpBase { namespace RpImageLoader { * @return rp_image*, or nullptr on error. */ RP_LIBROMDATA_PUBLIC -LibRpTexture::rp_image_ptr load(const LibRpFile::IRpFilePtr &file); +LibRpTexture::rp_image_ptr load(LibRpFile::IRpFile *file); + +/** + * Load an image from an IRpFile. + * @param file IRpFile to load from. + * @return rp_image*, or nullptr on error. + */ +LibRpTexture::rp_image_ptr load(const LibRpFile::IRpFilePtr &file) +{ + return load(file.get()); +} } }