RagePhoto: update ragephoto_setphotodata function

- RagePhotoTypedefs: add saveSize function
This commit is contained in:
Syping 2023-02-11 22:40:13 +01:00
parent b2e765c2af
commit 659feb0cbf
3 changed files with 8 additions and 3 deletions

View File

@ -1244,9 +1244,9 @@ void ragephoto_setbufferoffsets(ragephoto_t instance)
ragePhoto->setBufferOffsets();
}
ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData)
ragephoto_bool_t ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *ragePhotoData)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(*instance);
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->setData(ragePhotoData, true);
}

View File

@ -32,6 +32,7 @@
extern "C" {
#endif // __cplusplus
/** \file RagePhotoC.h */
/** RagePhoto C++ class typedef for C API. */
typedef void* ragephoto_t;
@ -164,7 +165,7 @@ LIBRAGEPHOTO_C_BINDING void ragephoto_setbufferoffsets(ragephoto_t instance);
* \param instance \p ragephoto_t instance
* \param ragePhotoData RagePhotoData object being set
*/
LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData);
LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *ragePhotoData);
/** Copies RagePhotoData object to internal RagePhotoData object.
* \param instance \p ragephoto_t instance

View File

@ -61,12 +61,16 @@ typedef ragephoto_bool_t (*ragephoto_savefunc_t)(RagePhotoData*, char*, uint32_t
/** RagePhoto save function typedef (char* allocated by function). */
typedef ragephoto_bool_t (*ragephoto_savepfunc_t)(RagePhotoData*, char**, uint32_t);
/** RagePhoto saveSize function typedef. */
typedef size_t (*ragephoto_saveszfunc_t)(RagePhotoData*, uint32_t);
/** RagePhoto format parser struct for registering custom formats. */
typedef struct RagePhotoFormatParser {
uint32_t photoFormat; /**< Photo file format magic */
ragephoto_loadfunc_t funcLoad; /**< Pointer to load function */
ragephoto_savefunc_t funcSave; /**< Pointer to save function */
ragephoto_savepfunc_t funcSavep; /**< Pointer to savep function */
ragephoto_saveszfunc_t funcSaveSz; /**< Pointer to saveSize function */
} RagePhotoFormatParser;
#ifdef __cplusplus