libragephoto Version: 0.6.0
Loading...
Searching...
No Matches
RagePhoto.h
Go to the documentation of this file.
1/*****************************************************************************
2* libragephoto RAGE Photo Parser
3* Copyright (C) 2021-2024 Syping
4*
5* Redistribution and use in source and binary forms, with or without modification,
6* are permitted provided that the following conditions are met:
7*
8* 1. Redistributions of source code must retain the above copyright notice,
9* this list of conditions and the following disclaimer.
10*
11* 2. Redistributions in binary form must reproduce the above copyright notice,
12* this list of conditions and the following disclaimer in the documentation
13* and/or other materials provided with the distribution.
14*
15* This software is provided as-is, no warranties are given to you, we are not
16* responsible for anything with use of the software, you are self responsible.
17*****************************************************************************/
18
23#ifndef RAGEPHOTO_H
24#define RAGEPHOTO_H
25
26#include "RagePhotoLibrary.h"
27#include "RagePhotoTypedefs.h"
28#include <stddef.h>
29#include <stdint.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif // __cplusplus
34
38typedef void* ragephoto_t;
39
43LIBRAGEPHOTO_C_PUBLIC ragephoto_t ragephoto_open();
44
50LIBRAGEPHOTO_C_PUBLIC void ragephoto_addparser(ragephoto_t instance, RagePhotoFormatParser *rp_parser);
51
56LIBRAGEPHOTO_C_PUBLIC void ragephoto_clear(ragephoto_t instance);
57
62LIBRAGEPHOTO_C_PUBLIC void ragephotodata_clear(RagePhotoData *rp_data);
63
70LIBRAGEPHOTO_C_PUBLIC bool ragephoto_load(ragephoto_t instance, const char *data, size_t size);
71
79LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_load(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, const char *data, size_t size);
80
86LIBRAGEPHOTO_C_PUBLIC bool ragephoto_loadfile(ragephoto_t instance, const char *filename);
87
92LIBRAGEPHOTO_C_PUBLIC int32_t ragephoto_error(ragephoto_t instance);
93
97LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_defpbuf_gta5();
98
102LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_defpbuf_rdr2();
103
107LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_format_gta5();
108
112LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_format_rdr2();
113
118LIBRAGEPHOTO_C_PUBLIC RagePhotoData* ragephoto_getphotodata(ragephoto_t instance);
119
124LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotodesc(ragephoto_t instance);
125
130LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_getphotoformat(ragephoto_t instance);
131
136LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotojpeg(ragephoto_t instance);
137
142LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotojson(ragephoto_t instance);
143
148LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotoheader(ragephoto_t instance);
149
154LIBRAGEPHOTO_C_PUBLIC uint64_t ragephoto_getphotosign(ragephoto_t instance);
155
161LIBRAGEPHOTO_C_PUBLIC uint64_t ragephoto_getphotosignf(ragephoto_t instance, uint32_t photoFormat);
162
169LIBRAGEPHOTO_C_PUBLIC void ragephoto_getphotosigns(ragephoto_t instance, char *data, size_t size);
170
178LIBRAGEPHOTO_C_PUBLIC void ragephoto_getphotosignsf(ragephoto_t instance, char *data, size_t size, uint32_t photoFormat);
179
184LIBRAGEPHOTO_C_PUBLIC uint64_t ragephotodata_getphotosign(RagePhotoData *rp_data);
185
191LIBRAGEPHOTO_C_PUBLIC uint64_t ragephotodata_getphotosignf(RagePhotoData *rp_data, uint32_t photoFormat);
192
197LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_getphotosize(ragephoto_t instance);
198
203LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphototitle(ragephoto_t instance);
204
209LIBRAGEPHOTO_C_PUBLIC size_t ragephoto_getsavesize(ragephoto_t instance);
210
216LIBRAGEPHOTO_C_PUBLIC size_t ragephotodata_getsavesize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser);
217
223LIBRAGEPHOTO_C_PUBLIC size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat);
224
231LIBRAGEPHOTO_C_PUBLIC size_t ragephotodata_getsavesizef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat);
232
238LIBRAGEPHOTO_C_PUBLIC bool ragephoto_save(ragephoto_t instance, char *data);
239
246LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_save(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data);
247
254LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat);
255
263LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_savef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data, uint32_t photoFormat);
264
270LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savefile(ragephoto_t instance, const char *filename);
271
278LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat);
279
284LIBRAGEPHOTO_C_PUBLIC void ragephoto_setbufferdefault(ragephoto_t instance);
285
290LIBRAGEPHOTO_C_PUBLIC void ragephotodata_setbufferdefault(RagePhotoData *rp_data);
291
296LIBRAGEPHOTO_C_PUBLIC void ragephoto_setbufferoffsets(ragephoto_t instance);
297
302LIBRAGEPHOTO_C_PUBLIC void ragephotodata_setbufferoffsets(RagePhotoData *rp_data);
303
309LIBRAGEPHOTO_C_PUBLIC void ragephoto_setlibraryflag(RagePhotoLibraryFlag flag, bool state);
310
316LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *rp_data);
317
323LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *rp_data);
324
333LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize);
334
340LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat);
341
351LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize);
352
361LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize);
362
366LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum);
367
371LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoheader2(ragephoto_t instance, const char *header, uint32_t headerSum, uint32_t headerSum2);
372
381LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize);
382
387LIBRAGEPHOTO_C_PUBLIC void ragephoto_close(ragephoto_t instance);
388
392LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_version();
393
394#ifdef __cplusplus
395}
396#endif // __cplusplus
397
398#endif // RAGEPHOTO_H
size_t ragephotodata_getsavesizef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat)
Definition RagePhoto.c:1035
uint64_t ragephotodata_getphotosignf(RagePhotoData *rp_data, uint32_t photoFormat)
Definition RagePhoto.c:681
uint32_t ragephoto_format_rdr2()
Definition RagePhoto.c:1313
void ragephotodata_setbufferdefault(RagePhotoData *rp_data)
Definition RagePhoto.c:1070
uint32_t ragephoto_defpbuf_rdr2()
Definition RagePhoto.c:1303
bool ragephotodata_savef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data, uint32_t photoFormat)
Definition RagePhoto.c:764
bool ragephotodata_load(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, const char *data, size_t length)
Definition RagePhoto.c:250
uint32_t ragephoto_format_gta5()
Definition RagePhoto.c:1308
uint32_t ragephoto_defpbuf_gta5()
Definition RagePhoto.c:1298
Definition RagePhotoTypedefs.h:31
Definition RagePhotoTypedefs.h:65
const char * ragephoto_getphotojson(ragephoto_t instance)
int32_t ragephoto_error(ragephoto_t instance)
void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize)
bool ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *rp_data)
bool ragephoto_savefile(ragephoto_t instance, const char *filename)
void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize)
bool ragephoto_load(ragephoto_t instance, const char *data, size_t size)
void ragephoto_clear(ragephoto_t instance)
void * ragephoto_t
Definition RagePhoto.h:38
RagePhotoData * ragephoto_getphotodata(ragephoto_t instance)
size_t ragephoto_getsavesize(ragephoto_t instance)
void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat)
void ragephoto_setbufferdefault(ragephoto_t instance)
const char * ragephoto_getphototitle(ragephoto_t instance)
void ragephoto_getphotosigns(ragephoto_t instance, char *data, size_t size)
bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize)
bool ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat)
void ragephoto_close(ragephoto_t instance)
size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat)
void ragephoto_setphotoheader2(ragephoto_t instance, const char *header, uint32_t headerSum, uint32_t headerSum2)
void ragephoto_addparser(ragephoto_t instance, RagePhotoFormatParser *rp_parser)
uint64_t ragephoto_getphotosign(ragephoto_t instance)
void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize)
bool ragephoto_loadfile(ragephoto_t instance, const char *filename)
void ragephoto_setbufferoffsets(ragephoto_t instance)
uint64_t ragephoto_getphotosignf(ragephoto_t instance, uint32_t photoFormat)
const char * ragephoto_getphotoheader(ragephoto_t instance)
bool ragephoto_save(ragephoto_t instance, char *data)
bool ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat)
uint32_t ragephoto_getphotoformat(ragephoto_t instance)
void ragephoto_getphotosignsf(ragephoto_t instance, char *data, size_t size, uint32_t photoFormat)
uint32_t ragephoto_getphotosize(ragephoto_t instance)
bool ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *rp_data)
void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum)
const char * ragephoto_getphotodesc(ragephoto_t instance)
const char * ragephoto_getphotojpeg(ragephoto_t instance)