2021-11-04 13:21:18 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* libragephoto RAGE Photo Parser
|
2023-01-07 20:43:11 +01:00
|
|
|
* Copyright (C) 2021-2023 Syping
|
2021-11-04 13:21:18 +01:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
* are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* This software is provided as-is, no warranties are given to you, we are not
|
|
|
|
* responsible for anything with use of the software, you are self responsible.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef RAGEPHOTOA_H
|
|
|
|
#define RAGEPHOTOA_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2021-11-13 04:41:01 +01:00
|
|
|
#include "RagePhotoC.h"
|
2021-11-18 17:33:20 +01:00
|
|
|
#include <cstdlib>
|
2021-11-16 06:20:20 +01:00
|
|
|
#include <iostream>
|
2021-11-04 13:21:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief ABI Stable Wrapper for RagePhoto.
|
|
|
|
*
|
|
|
|
* Using RagePhotoA instead of RagePhoto allows your library or application to survive more changes in the RagePhoto class,
|
2023-02-24 23:51:32 +01:00
|
|
|
* disadvantages include that it doesn't always include the newest features, performance is about the same.
|
2021-11-04 13:21:18 +01:00
|
|
|
*/
|
|
|
|
class RagePhotoA
|
|
|
|
{
|
|
|
|
public:
|
2023-01-07 20:43:11 +01:00
|
|
|
/** Default sizes */
|
|
|
|
enum DefaultSize : uint32_t {
|
|
|
|
DEFAULT_GTA5_PHOTOBUFFER = 524288UL, /**< GTA V default Photo Buffer Size */
|
|
|
|
DEFAULT_RDR2_PHOTOBUFFER = 1048576UL, /**< RDR 2 default Photo Buffer Size */
|
|
|
|
DEFAULT_DESCBUFFER = 256UL, /**< Default Description Buffer Size */
|
|
|
|
DEFAULT_JSONBUFFER = 3072UL, /**< Default JSON Buffer Size */
|
|
|
|
DEFAULT_TITLBUFFER = 256UL, /**< Default Title Buffer Size */
|
|
|
|
GTA5_HEADERSIZE = 264UL, /**< GTA V Header Size */
|
|
|
|
RDR2_HEADERSIZE = 272UL, /**< RDR 2 Header Size */
|
|
|
|
};
|
|
|
|
/** Parsing and set errors */
|
2023-02-07 03:06:22 +01:00
|
|
|
enum Error : int32_t {
|
2023-05-14 11:44:59 +02:00
|
|
|
DescBufferTight = 39L, /**< Description Buffer is too tight */
|
|
|
|
DescMallocError = 31L, /**< Description Buffer can't be allocated */
|
|
|
|
DescReadError = 32L, /**< Description can't be read successfully */
|
|
|
|
HeaderBufferTight = 35L, /**< Header Buffer is too tight */
|
|
|
|
HeaderMallocError = 4L, /**< Header Buffer can't be allocated */
|
|
|
|
IncompatibleFormat = 2L, /**< Format is incompatible */
|
|
|
|
IncompleteChecksum = 7L, /**< Header checksum is incomplete */
|
|
|
|
IncompleteDescBuffer = 30L, /**< Description Buffer Size is incomplete */
|
|
|
|
IncompleteDescMarker = 28L, /**< Description Marker is incomplete */
|
|
|
|
IncompleteDescOffset = 11L, /**< Description Offset is incomplete */
|
|
|
|
IncompleteEOF = 8L, /**< End Of File Offset is incomplete */
|
|
|
|
IncompleteHeader = 3L, /**< Header is incomplete */
|
|
|
|
IncompleteJendMarker = 33L, /**< JEND Marker is incomplete */
|
|
|
|
IncompleteJpegMarker = 12L, /**< JPEG Marker is incomplete */
|
|
|
|
IncompleteJsonBuffer = 20L, /**< JSON Buffer Size is incomplete */
|
|
|
|
IncompleteJsonMarker = 18L, /**< JSON Marker incomplete */
|
|
|
|
IncompleteJsonOffset = 9L, /**< JSON Offset incomplete */
|
|
|
|
IncompletePhotoBuffer = 14L, /**< Photo Buffer Size is incomplete */
|
|
|
|
IncompletePhotoSize = 15L, /**< Photo Size is incomplete */
|
|
|
|
IncompleteTitleBuffer = 25L, /**< Title Buffer Size is incomplete */
|
|
|
|
IncompleteTitleMarker = 23L, /**< Title Marker is incomplete */
|
|
|
|
IncompleteTitleOffset = 10L, /**< Title Offset is incomplete */
|
|
|
|
IncorrectDescMarker = 29L, /**< Description Marker is incorrect */
|
|
|
|
IncorrectJendMarker = 34L, /**< JEND Marker is incorrect */
|
|
|
|
IncorrectJpegMarker = 13L, /**< JPEG Marker is incorrect */
|
|
|
|
IncorrectJsonMarker = 19L, /**< JSON Marker is incorrect */
|
|
|
|
IncorrectTitleMarker = 24L, /**< Title Marker is incorrect */
|
|
|
|
JsonBufferTight = 37L, /**< JSON Buffer is too tight */
|
|
|
|
JsonMallocError = 21L, /**< JSON Buffer can't be allocated */
|
|
|
|
JsonReadError = 22L, /**< JSON can't be read successfully */
|
|
|
|
NoError = 255L, /**< Finished without errors */
|
|
|
|
NoFormatIdentifier = 1L, /**< No format detected, empty file */
|
|
|
|
PhotoBufferTight = 36L, /**< Photo Buffer is too tight */
|
|
|
|
PhotoMallocError = 16L, /**< Photo Buffer can't be allocated */
|
|
|
|
PhotoReadError = 17L, /**< Photo can't be read */
|
|
|
|
TitleBufferTight = 38L, /**< Title Buffer is too tight */
|
|
|
|
TitleMallocError = 26L, /**< Title Buffer can't be allocated */
|
|
|
|
TitleReadError = 27L, /**< Title can't be read */
|
|
|
|
UnicodeInitError = 5L, /**< Failed to initialise Unicode decoder */
|
|
|
|
UnicodeHeaderError = 6L, /**< Header can't be encoded/decoded successfully */
|
|
|
|
Uninitialised = 0L, /**< Uninitialised, file access failed */
|
2023-01-07 20:43:11 +01:00
|
|
|
};
|
|
|
|
/** Photo Formats */
|
|
|
|
enum PhotoFormat : uint32_t {
|
|
|
|
GTA5 = 0x01000000UL, /**< GTA V Photo Format */
|
|
|
|
RDR2 = 0x04000000UL, /**< RDR 2 Photo Format */
|
|
|
|
};
|
2023-03-15 08:22:38 +01:00
|
|
|
/** Sign Initials */
|
|
|
|
enum SignInitials : uint32_t {
|
|
|
|
SIGTA5 = 0xE47AB81CUL, /**< GTA V Sign Initial */
|
2023-05-09 23:28:38 +02:00
|
|
|
SIRDR2 = 0x00FEEB1EUL, /**< RDR 2 Sign Initial */
|
2023-03-15 08:22:38 +01:00
|
|
|
};
|
2021-11-04 13:21:18 +01:00
|
|
|
RagePhotoA() {
|
|
|
|
instance = ragephoto_open();
|
|
|
|
}
|
|
|
|
~RagePhotoA() {
|
|
|
|
ragephoto_close(instance);
|
|
|
|
}
|
2023-02-20 14:58:41 +01:00
|
|
|
/** Add a custom defined RagePhotoFormatParser. */
|
|
|
|
void addParser(RagePhotoFormatParser *rp_parser) {
|
|
|
|
ragephoto_addparser(instance, rp_parser);
|
|
|
|
}
|
|
|
|
/** Resets the RagePhotoData object to default values. */
|
|
|
|
static void clear(RagePhotoData *rp_data) {
|
|
|
|
ragephotodata_clear(rp_data);
|
|
|
|
}
|
|
|
|
/** Resets the RagePhotoData object to default values. */
|
2021-11-05 16:20:43 +01:00
|
|
|
void clear() {
|
|
|
|
ragephoto_clear(instance);
|
|
|
|
}
|
2023-01-08 13:57:37 +01:00
|
|
|
/** Returns the internal RagePhotoData object. */
|
|
|
|
RagePhotoData* data() {
|
|
|
|
return ragephoto_getphotodata(instance);
|
|
|
|
}
|
2023-02-20 14:58:41 +01:00
|
|
|
/** Loads a Photo from a const char*. */
|
2023-02-23 09:17:53 +01:00
|
|
|
static bool load(const char *data, size_t size, RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser) {
|
2023-02-20 14:58:41 +01:00
|
|
|
return ragephotodata_load(rp_data, rp_parser, data, size);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Loads a Photo from a const char*.
|
|
|
|
* \param data Photo data
|
|
|
|
* \param size Photo data size
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
bool load(const char *data, size_t size) {
|
|
|
|
return ragephoto_load(instance, data, size);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Loads a Photo from a std::string.
|
|
|
|
* \param data Photo data
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
bool load(const std::string &data) {
|
|
|
|
return ragephoto_load(instance, data.data(), data.size());
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Loads a Photo from a file.
|
|
|
|
* \param filename File to load
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
bool loadFile(const char *filename) {
|
|
|
|
return ragephoto_loadfile(instance, filename);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the last error occurred. */
|
2023-04-02 21:33:48 +02:00
|
|
|
int32_t error() const {
|
2021-11-04 13:21:18 +01:00
|
|
|
return ragephoto_error(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo Format (GTA V or RDR 2). */
|
2021-11-04 13:21:18 +01:00
|
|
|
uint32_t format() const {
|
|
|
|
return ragephoto_getphotoformat(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo JPEG data. */
|
2023-02-23 09:17:53 +01:00
|
|
|
const std::string jpeg() const {
|
2023-03-03 03:26:59 +01:00
|
|
|
const char *jpegData = ragephoto_getphotojpeg(instance);
|
|
|
|
if (jpegData)
|
|
|
|
return std::string(jpegData, ragephoto_getphotosize(instance));
|
|
|
|
else
|
|
|
|
return std::string();
|
2021-11-04 13:21:18 +01:00
|
|
|
}
|
2023-03-03 03:26:59 +01:00
|
|
|
#if (__cplusplus >= 201703L)
|
|
|
|
/** Returns the Photo JPEG data. */
|
|
|
|
const std::string_view jpeg_view() const {
|
|
|
|
const char *jpegData = ragephoto_getphotojpeg(instance);
|
|
|
|
if (jpegData)
|
|
|
|
return std::string_view(jpegData, ragephoto_getphotosize(instance));
|
|
|
|
else
|
|
|
|
return std::string_view();
|
|
|
|
}
|
|
|
|
#endif
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo JPEG data. */
|
2023-02-24 23:51:32 +01:00
|
|
|
const char* jpegData() const {
|
2021-11-04 13:21:18 +01:00
|
|
|
return ragephoto_getphotojpeg(instance);
|
|
|
|
}
|
2023-04-02 21:33:48 +02:00
|
|
|
/** Returns the Photo JPEG sign. */
|
2023-03-15 08:22:38 +01:00
|
|
|
static uint64_t jpegSign(uint32_t photoFormat, RagePhotoData *rp_data) {
|
|
|
|
return ragephotodata_getphotosignf(rp_data, photoFormat);
|
|
|
|
}
|
2023-04-02 21:33:48 +02:00
|
|
|
/** Returns the Photo JPEG sign. */
|
2023-03-15 08:22:38 +01:00
|
|
|
static uint64_t jpegSign(RagePhotoData *rp_data) {
|
|
|
|
return ragephotodata_getphotosign(rp_data);
|
|
|
|
}
|
2023-04-02 21:33:48 +02:00
|
|
|
/** Returns the Photo JPEG sign. */
|
2023-03-15 08:22:38 +01:00
|
|
|
uint64_t jpegSign(uint32_t photoFormat) const {
|
|
|
|
return ragephoto_getphotosignf(instance, photoFormat);
|
|
|
|
}
|
2023-04-02 21:33:48 +02:00
|
|
|
/** Returns the Photo JPEG sign. */
|
2023-03-15 08:22:38 +01:00
|
|
|
uint64_t jpegSign() const {
|
|
|
|
return ragephoto_getphotosign(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo JPEG data size. */
|
2023-02-23 09:17:53 +01:00
|
|
|
uint32_t jpegSize() const {
|
2021-11-04 13:21:18 +01:00
|
|
|
return ragephoto_getphotosize(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo description. */
|
2021-11-04 13:21:18 +01:00
|
|
|
const char* description() const {
|
|
|
|
return ragephoto_getphotodesc(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo JSON data. */
|
2021-11-04 13:21:18 +01:00
|
|
|
const char* json() const {
|
|
|
|
return ragephoto_getphotojson(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo header. */
|
2021-11-04 13:21:18 +01:00
|
|
|
const char* header() const {
|
|
|
|
return ragephoto_getphotoheader(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo title. */
|
2021-11-04 13:21:18 +01:00
|
|
|
const char* title() const {
|
|
|
|
return ragephoto_getphototitle(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the library version. */
|
2021-11-04 13:21:18 +01:00
|
|
|
static const char* version() {
|
|
|
|
return ragephoto_version();
|
|
|
|
}
|
2023-02-23 09:17:53 +01:00
|
|
|
/** Saves a Photo to a char*. */
|
|
|
|
static bool save(char *data, uint32_t photoFormat, RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser) {
|
|
|
|
return ragephotodata_savef(rp_data, rp_parser, data, photoFormat);
|
|
|
|
}
|
|
|
|
/** Saves a Photo to a char*. */
|
|
|
|
static bool save(char *data, RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser) {
|
|
|
|
return ragephotodata_save(rp_data, rp_parser, data);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a char*.
|
|
|
|
* \param data Photo data
|
|
|
|
* \param photoFormat Photo Format (GTA V or RDR 2)
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
bool save(char *data, uint32_t photoFormat) {
|
|
|
|
return ragephoto_savef(instance, data, photoFormat);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a char*.
|
|
|
|
* \param data Photo data
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
bool save(char *data) {
|
|
|
|
return ragephoto_save(instance, data);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a std::string.
|
|
|
|
* \param photoFormat Photo Format (GTA V or RDR 2)
|
|
|
|
* \param ok \p true when saved successfully
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
const std::string save(uint32_t photoFormat, bool *ok = nullptr) {
|
2021-12-02 05:55:50 +01:00
|
|
|
std::string sdata;
|
2021-11-04 13:21:18 +01:00
|
|
|
const size_t size = ragephoto_getsavesizef(instance, photoFormat);
|
|
|
|
if (size == 0) {
|
|
|
|
if (ok)
|
|
|
|
*ok = false;
|
2021-12-02 05:55:50 +01:00
|
|
|
return sdata;
|
2021-11-04 13:21:18 +01:00
|
|
|
}
|
2021-12-02 05:55:50 +01:00
|
|
|
sdata.resize(size);
|
|
|
|
const bool saved = ragephoto_savef(instance, &sdata[0], photoFormat);
|
2021-11-04 13:21:18 +01:00
|
|
|
if (ok)
|
|
|
|
*ok = saved;
|
2021-12-02 05:55:50 +01:00
|
|
|
return sdata;
|
2021-11-04 13:21:18 +01:00
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a std::string.
|
|
|
|
* \param ok \p true when saved successfully
|
|
|
|
*/
|
2021-11-04 13:21:18 +01:00
|
|
|
const std::string save(bool *ok = nullptr) {
|
|
|
|
return save(ragephoto_getphotoformat(instance), ok);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a file. */
|
2021-11-04 13:21:18 +01:00
|
|
|
bool saveFile(const char *filename, uint32_t photoFormat) {
|
|
|
|
return ragephoto_savefilef(instance, filename, photoFormat);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Saves a Photo to a file. */
|
2021-11-04 13:21:18 +01:00
|
|
|
bool saveFile(const char *filename) {
|
|
|
|
return ragephoto_savefile(instance, filename);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo save file size. */
|
2023-02-23 09:17:53 +01:00
|
|
|
static size_t saveSize(uint32_t photoFormat, RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser) {
|
2023-02-20 14:58:41 +01:00
|
|
|
return ragephotodata_getsavesizef(rp_data, rp_parser, photoFormat);
|
|
|
|
}
|
|
|
|
/** Returns the Photo save file size. */
|
|
|
|
static size_t saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser) {
|
|
|
|
return ragephotodata_getsavesize(rp_data, rp_parser);
|
|
|
|
}
|
|
|
|
/** Returns the Photo save file size. */
|
2021-11-04 13:21:18 +01:00
|
|
|
size_t saveSize(uint32_t photoFormat) {
|
|
|
|
return ragephoto_getsavesizef(instance, photoFormat);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Returns the Photo save file size. */
|
2021-11-04 13:21:18 +01:00
|
|
|
size_t saveSize() {
|
|
|
|
return ragephoto_getsavesize(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets all cross-format Buffer to default size. */
|
2023-02-20 14:58:41 +01:00
|
|
|
static void setBufferDefault(RagePhotoData *rp_data) {
|
|
|
|
ragephotodata_setbufferdefault(rp_data);
|
|
|
|
}
|
|
|
|
/** Sets all cross-format Buffer to default size. */
|
2021-11-04 13:21:18 +01:00
|
|
|
void setBufferDefault() {
|
|
|
|
ragephoto_setbufferdefault(instance);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Moves all Buffer offsets to correct position. */
|
2023-02-20 14:58:41 +01:00
|
|
|
static void setBufferOffsets(RagePhotoData *rp_data) {
|
|
|
|
ragephotodata_setbufferoffsets(rp_data);
|
|
|
|
}
|
|
|
|
/** Moves all Buffer offsets to correct position. */
|
2021-11-04 13:21:18 +01:00
|
|
|
void setBufferOffsets() {
|
|
|
|
ragephoto_setbufferoffsets(instance);
|
|
|
|
}
|
2023-01-08 17:45:54 +01:00
|
|
|
/** Sets the internal RagePhotoData object. */
|
2023-02-23 09:17:53 +01:00
|
|
|
bool setData(RagePhotoData *ragePhotoData, bool takeCopy = true) {
|
|
|
|
if (takeCopy)
|
2023-02-08 19:59:56 +01:00
|
|
|
return ragephoto_setphotodatac(instance, ragePhotoData);
|
2023-02-23 09:17:53 +01:00
|
|
|
else
|
2023-05-25 23:30:26 +02:00
|
|
|
return ragephoto_setphotodata(instance, ragePhotoData);
|
2023-01-08 17:45:54 +01:00
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets the Photo description. */
|
2021-11-04 13:21:18 +01:00
|
|
|
void setDescription(const char *description, uint32_t bufferSize = 0) {
|
|
|
|
ragephoto_setphotodesc(instance, description, bufferSize);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets the Photo Format (GTA V or RDR 2). */
|
2021-11-04 13:21:18 +01:00
|
|
|
void setFormat(uint32_t photoFormat) {
|
|
|
|
ragephoto_setphotoformat(instance, photoFormat);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets the Photo JPEG data.
|
|
|
|
* \param data JPEG data
|
|
|
|
* \param size JPEG data size
|
|
|
|
* \param bufferSize JPEG buffer size
|
|
|
|
*/
|
2023-02-23 09:17:53 +01:00
|
|
|
bool setJpeg(const char *data, uint32_t size, uint32_t bufferSize = 0) {
|
2021-11-04 13:21:18 +01:00
|
|
|
return ragephoto_setphotojpeg(instance, data, size, bufferSize);
|
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets the Photo JPEG data.
|
|
|
|
* \param data JPEG data
|
|
|
|
* \param bufferSize JPEG buffer size
|
|
|
|
*/
|
2023-02-23 09:17:53 +01:00
|
|
|
bool setJpeg(const std::string &data, uint32_t bufferSize = 0) {
|
2021-11-04 13:21:18 +01:00
|
|
|
return ragephoto_setphotojpeg(instance, data.data(), static_cast<uint32_t>(data.size()), bufferSize);
|
|
|
|
}
|
2023-02-23 09:17:53 +01:00
|
|
|
/** Sets the Photo JSON data. */
|
|
|
|
void setJson(const char *json, uint32_t bufferSize = 0) {
|
|
|
|
ragephoto_setphotojson(instance, json, bufferSize);
|
|
|
|
}
|
2023-05-14 11:44:59 +02:00
|
|
|
/** Sets the Photo header. */
|
|
|
|
void setHeader(const char *header, uint32_t headerSum, uint32_t headerSum2 = 0) {
|
|
|
|
ragephoto_setphotoheader2(instance, header, headerSum, headerSum2);
|
2023-02-23 09:17:53 +01:00
|
|
|
}
|
2023-01-08 13:35:32 +01:00
|
|
|
/** Sets the Photo title. */
|
2021-11-04 13:21:18 +01:00
|
|
|
void setTitle(const char *title, uint32_t bufferSize = 0) {
|
|
|
|
ragephoto_setphototitle(instance, title, bufferSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
ragephoto_t instance;
|
|
|
|
};
|
2023-03-03 03:26:59 +01:00
|
|
|
#else
|
|
|
|
#include "RagePhotoC.h"
|
2021-11-13 04:41:01 +01:00
|
|
|
#endif // __cplusplus
|
2021-11-04 13:21:18 +01:00
|
|
|
|
|
|
|
#endif // RAGEPHOTOA_H
|