libragephoto Version: 0.5.0
Loading...
Searching...
No Matches
Typedefs | Functions
RagePhoto.h File Reference
#include "RagePhotoLibrary.h"
#include "RagePhotoTypedefs.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef void * ragephoto_t
 

Functions

ragephoto_t ragephoto_open ()
 
void ragephoto_addparser (ragephoto_t instance, RagePhotoFormatParser *rp_parser)
 
void ragephoto_clear (ragephoto_t instance)
 
void ragephotodata_clear (RagePhotoData *rp_data)
 
bool ragephoto_load (ragephoto_t instance, const char *data, size_t size)
 
bool ragephotodata_load (RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, const char *data, size_t size)
 
bool ragephoto_loadfile (ragephoto_t instance, const char *filename)
 
int32_t ragephoto_error (ragephoto_t instance)
 
uint32_t ragephoto_defpbuf_gta5 ()
 
uint32_t ragephoto_defpbuf_rdr2 ()
 
uint32_t ragephoto_format_gta5 ()
 
uint32_t ragephoto_format_rdr2 ()
 
RagePhotoDataragephoto_getphotodata (ragephoto_t instance)
 
const char * ragephoto_getphotodesc (ragephoto_t instance)
 
uint32_t ragephoto_getphotoformat (ragephoto_t instance)
 
const char * ragephoto_getphotojpeg (ragephoto_t instance)
 
const char * ragephoto_getphotojson (ragephoto_t instance)
 
const char * ragephoto_getphotoheader (ragephoto_t instance)
 
uint64_t ragephoto_getphotosign (ragephoto_t instance)
 
uint64_t ragephoto_getphotosignf (ragephoto_t instance, uint32_t photoFormat)
 
uint64_t ragephotodata_getphotosign (RagePhotoData *rp_data)
 
uint64_t ragephotodata_getphotosignf (RagePhotoData *rp_data, uint32_t photoFormat)
 
uint32_t ragephoto_getphotosize (ragephoto_t instance)
 
const char * ragephoto_getphototitle (ragephoto_t instance)
 
size_t ragephoto_getsavesize (ragephoto_t instance)
 
size_t ragephotodata_getsavesize (RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser)
 
size_t ragephoto_getsavesizef (ragephoto_t instance, uint32_t photoFormat)
 
size_t ragephotodata_getsavesizef (RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat)
 
bool ragephoto_save (ragephoto_t instance, char *data)
 
bool ragephotodata_save (RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data)
 
bool ragephoto_savef (ragephoto_t instance, char *data, uint32_t photoFormat)
 
bool ragephotodata_savef (RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data, uint32_t photoFormat)
 
bool ragephoto_savefile (ragephoto_t instance, const char *filename)
 
bool ragephoto_savefilef (ragephoto_t instance, const char *filename, uint32_t photoFormat)
 
void ragephoto_setbufferdefault (ragephoto_t instance)
 
void ragephotodata_setbufferdefault (RagePhotoData *rp_data)
 
void ragephoto_setbufferoffsets (ragephoto_t instance)
 
void ragephotodata_setbufferoffsets (RagePhotoData *rp_data)
 
bool ragephoto_setphotodata (ragephoto_t instance, RagePhotoData *rp_data)
 
bool ragephoto_setphotodatac (ragephoto_t instance, RagePhotoData *rp_data)
 
void ragephoto_setphotodesc (ragephoto_t instance, const char *description, uint32_t bufferSize)
 
void ragephoto_setphotoformat (ragephoto_t instance, uint32_t photoFormat)
 
bool ragephoto_setphotojpeg (ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize)
 
void ragephoto_setphotojson (ragephoto_t instance, const char *json, uint32_t bufferSize)
 
void ragephoto_setphotoheader (ragephoto_t instance, const char *header, uint32_t headerSum)
 
void ragephoto_setphotoheader2 (ragephoto_t instance, const char *header, uint32_t headerSum, uint32_t headerSum2)
 
void ragephoto_setphototitle (ragephoto_t instance, const char *title, uint32_t bufferSize)
 
void ragephoto_close (ragephoto_t instance)
 
const char * ragephoto_version ()
 

Detailed Description

C API for RagePhoto.

Typedef Documentation

◆ ragephoto_t

typedef void* ragephoto_t

RagePhoto C instance/C++ class typedef.

Function Documentation

◆ ragephoto_addparser()

void ragephoto_addparser ( ragephoto_t  instance,
RagePhotoFormatParser rp_parser 
)

Add a custom defined RagePhotoFormatParser.

Parameters
instanceragephoto_t instance
rp_parserRagePhotoFormatParser parser to add

◆ ragephoto_clear()

void ragephoto_clear ( ragephoto_t  instance)

Resets the RagePhotoData object to default values.

Parameters
instanceragephoto_t instance

◆ ragephoto_close()

void ragephoto_close ( ragephoto_t  instance)

Closes a ragephoto_t instance.

Parameters
instanceragephoto_t instance

◆ ragephoto_defpbuf_gta5()

uint32_t ragephoto_defpbuf_gta5 ( )

Returns the GTA V default Photo Buffer Size.

◆ ragephoto_defpbuf_rdr2()

uint32_t ragephoto_defpbuf_rdr2 ( )

Returns the RDR 2 default Photo Buffer Size.

◆ ragephoto_error()

int32_t ragephoto_error ( ragephoto_t  instance)

Returns the last error occurred.

Parameters
instanceragephoto_t instance

◆ ragephoto_format_gta5()

uint32_t ragephoto_format_gta5 ( )

Returns the GTA V Photo Format.

◆ ragephoto_format_rdr2()

uint32_t ragephoto_format_rdr2 ( )

Returns the RDR 2 Photo Format.

◆ ragephoto_getphotodata()

RagePhotoData * ragephoto_getphotodata ( ragephoto_t  instance)

Returns the internal RagePhotoData object.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotodesc()

const char * ragephoto_getphotodesc ( ragephoto_t  instance)

Returns the Photo description.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotoformat()

uint32_t ragephoto_getphotoformat ( ragephoto_t  instance)

Returns the Photo Format (GTA V or RDR 2).

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotoheader()

const char * ragephoto_getphotoheader ( ragephoto_t  instance)

Returns the Photo header.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotojpeg()

const char * ragephoto_getphotojpeg ( ragephoto_t  instance)

Returns the Photo JPEG data.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotojson()

const char * ragephoto_getphotojson ( ragephoto_t  instance)

Returns the Photo JSON data.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotosign()

uint64_t ragephoto_getphotosign ( ragephoto_t  instance)

Returns the Photo JPEG sign.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphotosignf()

uint64_t ragephoto_getphotosignf ( ragephoto_t  instance,
uint32_t  photoFormat 
)

Returns the Photo JPEG sign.

Parameters
instanceragephoto_t instance
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephoto_getphotosize()

uint32_t ragephoto_getphotosize ( ragephoto_t  instance)

Returns the Photo JPEG data size.

Parameters
instanceragephoto_t instance

◆ ragephoto_getphototitle()

const char * ragephoto_getphototitle ( ragephoto_t  instance)

Returns the Photo title.

Parameters
instanceragephoto_t instance

◆ ragephoto_getsavesize()

size_t ragephoto_getsavesize ( ragephoto_t  instance)

Returns the Photo save file size.

Parameters
instanceragephoto_t instance

◆ ragephoto_getsavesizef()

size_t ragephoto_getsavesizef ( ragephoto_t  instance,
uint32_t  photoFormat 
)

Returns the Photo save file size.

Parameters
instanceragephoto_t instance
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephoto_load()

bool ragephoto_load ( ragephoto_t  instance,
const char *  data,
size_t  size 
)

Loads a Photo from a const char*.

Parameters
instanceragephoto_t instance
dataPhoto data
sizePhoto data size

◆ ragephoto_loadfile()

bool ragephoto_loadfile ( ragephoto_t  instance,
const char *  filename 
)

Loads a Photo from a file.

Parameters
instanceragephoto_t instance
filenameFile to load

◆ ragephoto_open()

ragephoto_t ragephoto_open ( )

Opens a ragephoto_t instance.

◆ ragephoto_save()

bool ragephoto_save ( ragephoto_t  instance,
char *  data 
)

Saves a Photo to a char*.

Parameters
instanceragephoto_t instance
dataPhoto data

◆ ragephoto_savef()

bool ragephoto_savef ( ragephoto_t  instance,
char *  data,
uint32_t  photoFormat 
)

Saves a Photo to a char*.

Parameters
instanceragephoto_t instance
dataPhoto data
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephoto_savefile()

bool ragephoto_savefile ( ragephoto_t  instance,
const char *  filename 
)

Saves a Photo to a file.

Parameters
instanceragephoto_t instance
filenameFile to save

◆ ragephoto_savefilef()

bool ragephoto_savefilef ( ragephoto_t  instance,
const char *  filename,
uint32_t  photoFormat 
)

Saves a Photo to a file.

Parameters
instanceragephoto_t instance
filenameFile to save
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephoto_setbufferdefault()

void ragephoto_setbufferdefault ( ragephoto_t  instance)

Sets all cross-format Buffer to default size.

Parameters
instanceragephoto_t instance

◆ ragephoto_setbufferoffsets()

void ragephoto_setbufferoffsets ( ragephoto_t  instance)

Moves all Buffer offsets to correct position.

Parameters
instanceragephoto_t instance

◆ ragephoto_setphotodata()

bool ragephoto_setphotodata ( ragephoto_t  instance,
RagePhotoData rp_data 
)

Sets the internal RagePhotoData object.

Parameters
instanceragephoto_t instance
rp_dataRagePhotoData object being set

◆ ragephoto_setphotodatac()

bool ragephoto_setphotodatac ( ragephoto_t  instance,
RagePhotoData rp_data 
)

Copies RagePhotoData object to internal RagePhotoData object.

Parameters
instanceragephoto_t instance
rp_dataRagePhotoData object being copied

◆ ragephoto_setphotodesc()

void ragephoto_setphotodesc ( ragephoto_t  instance,
const char *  description,
uint32_t  bufferSize 
)

Sets the Photo description.

Parameters
instanceragephoto_t instance
descriptionDescription
bufferSizeDescription buffer size

Default bufferSize: 256UL

◆ ragephoto_setphotoformat()

void ragephoto_setphotoformat ( ragephoto_t  instance,
uint32_t  photoFormat 
)

Sets the Photo Format (GTA V or RDR 2).

Parameters
instanceragephoto_t instance
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephoto_setphotoheader()

void ragephoto_setphotoheader ( ragephoto_t  instance,
const char *  header,
uint32_t  headerSum 
)

Sets the Photo header.

◆ ragephoto_setphotoheader2()

void ragephoto_setphotoheader2 ( ragephoto_t  instance,
const char *  header,
uint32_t  headerSum,
uint32_t  headerSum2 
)

Sets the Photo header. (RDR 2)

◆ ragephoto_setphotojpeg()

bool ragephoto_setphotojpeg ( ragephoto_t  instance,
const char *  data,
uint32_t  size,
uint32_t  bufferSize 
)

Sets the Photo JPEG data.

Parameters
instanceragephoto_t instance
dataJPEG data
sizeJPEG data size
bufferSizeJPEG buffer size

Default bufferSize: ragephoto_defpbuf_gta5() or ragephoto_defpbuf_rdr2()

◆ ragephoto_setphotojson()

void ragephoto_setphotojson ( ragephoto_t  instance,
const char *  json,
uint32_t  bufferSize 
)

Sets the Photo JSON data.

Parameters
instanceragephoto_t instance
jsonJSON data
bufferSizeJSON data buffer size

Default bufferSize: 3072UL

◆ ragephoto_setphototitle()

void ragephoto_setphototitle ( ragephoto_t  instance,
const char *  title,
uint32_t  bufferSize 
)

Sets the Photo title.

Parameters
instanceragephoto_t instance
titleTitle
bufferSizeTitle buffer size

Default bufferSize: 256UL

◆ ragephoto_version()

const char * ragephoto_version ( )

Returns the library version.

◆ ragephotodata_clear()

void ragephotodata_clear ( RagePhotoData rp_data)

Resets the RagePhotoData object to default values.

Parameters
rp_dataRagePhotoData object

◆ ragephotodata_getphotosign()

uint64_t ragephotodata_getphotosign ( RagePhotoData rp_data)

Returns the Photo JPEG sign.

Parameters
rp_dataRagePhotoData object

◆ ragephotodata_getphotosignf()

uint64_t ragephotodata_getphotosignf ( RagePhotoData rp_data,
uint32_t  photoFormat 
)

Returns the Photo JPEG sign.

Parameters
rp_dataRagePhotoData object
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephotodata_getsavesize()

size_t ragephotodata_getsavesize ( RagePhotoData rp_data,
RagePhotoFormatParser rp_parser 
)

Returns the Photo save file size.

Parameters
rp_dataRagePhotoData object
rp_parserRagePhotoFormatParser parser array

◆ ragephotodata_getsavesizef()

size_t ragephotodata_getsavesizef ( RagePhotoData rp_data,
RagePhotoFormatParser rp_parser,
uint32_t  photoFormat 
)

Returns the Photo save file size.

Parameters
rp_dataRagePhotoData object
rp_parserRagePhotoFormatParser parser array
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephotodata_load()

bool ragephotodata_load ( RagePhotoData rp_data,
RagePhotoFormatParser rp_parser,
const char *  data,
size_t  size 
)

Loads a Photo from a const char*.

Parameters
rp_dataRagePhotoData object
rp_parserRagePhotoFormatParser parser array
dataPhoto data
sizePhoto data size

◆ ragephotodata_save()

bool ragephotodata_save ( RagePhotoData rp_data,
RagePhotoFormatParser rp_parser,
char *  data 
)

Saves a Photo to a char*.

Parameters
rp_dataRagePhotoData object
rp_parserRagePhotoFormatParser parser array
dataPhoto data

◆ ragephotodata_savef()

bool ragephotodata_savef ( RagePhotoData rp_data,
RagePhotoFormatParser rp_parser,
char *  data,
uint32_t  photoFormat 
)

Saves a Photo to a char*.

Parameters
rp_dataRagePhotoData object
rp_parserRagePhotoFormatParser parser array
dataPhoto data
photoFormatPhoto Format (GTA V or RDR 2)

◆ ragephotodata_setbufferdefault()

void ragephotodata_setbufferdefault ( RagePhotoData rp_data)

Sets all cross-format Buffer to default size.

Parameters
rp_dataRagePhotoData object

◆ ragephotodata_setbufferoffsets()

void ragephotodata_setbufferoffsets ( RagePhotoData rp_data)

Moves all Buffer offsets to correct position.

Parameters
rp_dataRagePhotoData object