Skip to content

Commit

Permalink
[librpbase] RpImageLoader: Take IRpFile* and make the IRpFilePtr vers…
Browse files Browse the repository at this point in the history
…ion a wrapper.

Similar to RpJpeg and RpPng, which are both used by RpImageLoader.
  • Loading branch information
GerbilSoft committed Nov 24, 2024
1 parent 0ec0b76 commit c885930
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librpbase/img/RpImageLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static constexpr array<uint8_t, 4> 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();

Expand Down
12 changes: 11 additions & 1 deletion src/librpbase/img/RpImageLoader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

} }

0 comments on commit c885930

Please sign in to comment.