C API: add ragephoto_clear()

test
Syping 1 year ago
parent 67ed433f6b
commit 4c43596e2a
  1. 6
      src/RagePhoto.cpp
  2. 5
      src/RagePhoto.h
  3. 3
      src/RagePhotoA.h

@ -915,6 +915,12 @@ ragephoto_t ragephoto_open()
return static_cast<ragephoto_t>(new RagePhoto);
}
void ragephoto_clear(ragephoto_t instance)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
ragePhoto->clear();
}
int ragephoto_load(ragephoto_t instance, const char *data, size_t size)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);

@ -193,6 +193,11 @@ typedef void* ragephoto_t;
/** Opens a \p ragephoto_t instance. */
LIBRAGEPHOTO_EXPORT ragephoto_t ragephoto_open();
/** Resets the RagePhoto instance to default values.
* \param instance \p ragephoto_t instance
*/
LIBRAGEPHOTO_EXPORT void ragephoto_clear(ragephoto_t instance);
/** Loads a Photo from a const char*.
* \param instance \p ragephoto_t instance
* \param data Photo data

@ -37,6 +37,9 @@ public:
~RagePhotoA() {
ragephoto_close(instance);
}
void clear() {
ragephoto_clear(instance);
}
bool load(const char *data, size_t size) {
return ragephoto_load(instance, data, size);
}

Loading…
Cancel
Save