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->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); return ragePhoto->setData(ragePhotoData, true);
} }

View file

@ -32,6 +32,7 @@
extern "C" { extern "C" {
#endif // __cplusplus #endif // __cplusplus
/** \file RagePhotoC.h */ /** \file RagePhotoC.h */
/** RagePhoto C++ class typedef for C API. */ /** RagePhoto C++ class typedef for C API. */
typedef void* ragephoto_t; typedef void* ragephoto_t;
@ -164,7 +165,7 @@ LIBRAGEPHOTO_C_BINDING void ragephoto_setbufferoffsets(ragephoto_t instance);
* \param instance \p ragephoto_t instance * \param instance \p ragephoto_t instance
* \param ragePhotoData RagePhotoData object being set * \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. /** Copies RagePhotoData object to internal RagePhotoData object.
* \param instance \p ragephoto_t instance * \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). */ /** RagePhoto save function typedef (char* allocated by function). */
typedef ragephoto_bool_t (*ragephoto_savepfunc_t)(RagePhotoData*, char**, uint32_t); 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. */ /** RagePhoto format parser struct for registering custom formats. */
typedef struct RagePhotoFormatParser { typedef struct RagePhotoFormatParser {
uint32_t photoFormat; /**< Photo file format magic */ uint32_t photoFormat; /**< Photo file format magic */
ragephoto_loadfunc_t funcLoad; /**< Pointer to load function */ ragephoto_loadfunc_t funcLoad; /**< Pointer to load function */
ragephoto_savefunc_t funcSave; /**< Pointer to save function */ ragephoto_savefunc_t funcSave; /**< Pointer to save function */
ragephoto_savepfunc_t funcSavep; /**< Pointer to savep function */ ragephoto_savepfunc_t funcSavep; /**< Pointer to savep function */
ragephoto_saveszfunc_t funcSaveSz; /**< Pointer to saveSize function */
} RagePhotoFormatParser; } RagePhotoFormatParser;
#ifdef __cplusplus #ifdef __cplusplus