C/C++ API improvements, CMake include dir change

C API: add format functions
C++ API: add ABI stable wrapper RagePhotoA based on C API
This commit is contained in:
Syping 2021-11-04 13:21:18 +01:00
parent d8c99b9067
commit 67ed433f6b
6 changed files with 198 additions and 2 deletions

View file

@ -1001,18 +1001,36 @@ size_t ragephoto_getsavesize(ragephoto_t instance)
return ragePhoto->saveSize();
}
size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->saveSize(photoFormat);
}
int ragephoto_save(ragephoto_t instance, char *data)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->save(data);
}
int ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->save(data, photoFormat);
}
int ragephoto_savefile(ragephoto_t instance, const char *filename)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->saveFile(filename);
}
int ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->saveFile(filename, photoFormat);
}
void ragephoto_setbufferdefault(ragephoto_t instance)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);