libragephoto Version: 0.5.0
Loading...
Searching...
No Matches
RagePhoto.h
Go to the documentation of this file.
1/*****************************************************************************
2* libragephoto RAGE Photo Parser
3* Copyright (C) 2021-2023 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
19#ifndef RAGEPHOTO_H
20#define RAGEPHOTO_H
21
22#include "RagePhotoLibrary.h"
23#include "RagePhotoTypedefs.h"
24#include <stddef.h>
25#include <stdint.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif // __cplusplus
30
36typedef void* ragephoto_t;
37
39LIBRAGEPHOTO_C_PUBLIC ragephoto_t ragephoto_open();
40
45LIBRAGEPHOTO_C_PUBLIC void ragephoto_addparser(ragephoto_t instance, RagePhotoFormatParser *rp_parser);
46
50LIBRAGEPHOTO_C_PUBLIC void ragephoto_clear(ragephoto_t instance);
51
55LIBRAGEPHOTO_C_PUBLIC void ragephotodata_clear(RagePhotoData *rp_data);
56
62LIBRAGEPHOTO_C_PUBLIC bool ragephoto_load(ragephoto_t instance, const char *data, size_t size);
63
70LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_load(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, const char *data, size_t size);
71
76LIBRAGEPHOTO_C_PUBLIC bool ragephoto_loadfile(ragephoto_t instance, const char *filename);
77
81LIBRAGEPHOTO_C_PUBLIC int32_t ragephoto_error(ragephoto_t instance);
82
84LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_defpbuf_gta5();
85
87LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_defpbuf_rdr2();
88
90LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_format_gta5();
91
93LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_format_rdr2();
94
98LIBRAGEPHOTO_C_PUBLIC RagePhotoData* ragephoto_getphotodata(ragephoto_t instance);
99
103LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotodesc(ragephoto_t instance);
104
108LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_getphotoformat(ragephoto_t instance);
109
113LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotojpeg(ragephoto_t instance);
114
118LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotojson(ragephoto_t instance);
119
123LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphotoheader(ragephoto_t instance);
124
128LIBRAGEPHOTO_C_PUBLIC uint64_t ragephoto_getphotosign(ragephoto_t instance);
129
134LIBRAGEPHOTO_C_PUBLIC uint64_t ragephoto_getphotosignf(ragephoto_t instance, uint32_t photoFormat);
135
139LIBRAGEPHOTO_C_PUBLIC uint64_t ragephotodata_getphotosign(RagePhotoData *rp_data);
140
145LIBRAGEPHOTO_C_PUBLIC uint64_t ragephotodata_getphotosignf(RagePhotoData *rp_data, uint32_t photoFormat);
146
150LIBRAGEPHOTO_C_PUBLIC uint32_t ragephoto_getphotosize(ragephoto_t instance);
151
155LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_getphototitle(ragephoto_t instance);
156
160LIBRAGEPHOTO_C_PUBLIC size_t ragephoto_getsavesize(ragephoto_t instance);
161
166LIBRAGEPHOTO_C_PUBLIC size_t ragephotodata_getsavesize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser);
167
172LIBRAGEPHOTO_C_PUBLIC size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat);
173
179LIBRAGEPHOTO_C_PUBLIC size_t ragephotodata_getsavesizef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat);
180
185LIBRAGEPHOTO_C_PUBLIC bool ragephoto_save(ragephoto_t instance, char *data);
186
192LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_save(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data);
193
199LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat);
200
207LIBRAGEPHOTO_C_PUBLIC bool ragephotodata_savef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data, uint32_t photoFormat);
208
213LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savefile(ragephoto_t instance, const char *filename);
214
220LIBRAGEPHOTO_C_PUBLIC bool ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat);
221
225LIBRAGEPHOTO_C_PUBLIC void ragephoto_setbufferdefault(ragephoto_t instance);
226
230LIBRAGEPHOTO_C_PUBLIC void ragephotodata_setbufferdefault(RagePhotoData *rp_data);
231
235LIBRAGEPHOTO_C_PUBLIC void ragephoto_setbufferoffsets(ragephoto_t instance);
236
240LIBRAGEPHOTO_C_PUBLIC void ragephotodata_setbufferoffsets(RagePhotoData *rp_data);
241
246LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *rp_data);
247
252LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *rp_data);
253
261LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize);
262
267LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat);
268
277LIBRAGEPHOTO_C_PUBLIC bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize);
278
286LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize);
287
289LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum);
290
292LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphotoheader2(ragephoto_t instance, const char *header, uint32_t headerSum, uint32_t headerSum2);
293
301LIBRAGEPHOTO_C_PUBLIC void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize);
302
306LIBRAGEPHOTO_C_PUBLIC void ragephoto_close(ragephoto_t instance);
307
309LIBRAGEPHOTO_C_PUBLIC const char* ragephoto_version();
310
311#ifdef __cplusplus
312}
313#endif // __cplusplus
314
315#endif // RAGEPHOTO_H
const char * ragephoto_getphotojson(ragephoto_t instance)
Definition RagePhoto.c:659
void ragephotodata_setbufferoffsets(RagePhotoData *rp_data)
Definition RagePhoto.c:994
int32_t ragephoto_error(ragephoto_t instance)
Definition RagePhoto.c:599
size_t ragephotodata_getsavesizef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat)
Definition RagePhoto.c:945
void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize)
Definition RagePhoto.c:1084
bool ragephoto_setphotodata(ragephoto_t instance, RagePhotoData *rp_data)
Definition RagePhoto.c:1008
bool ragephoto_savefile(ragephoto_t instance, const char *filename)
Definition RagePhoto.c:939
void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize)
Definition RagePhoto.c:1151
bool ragephoto_load(ragephoto_t instance, const char *data, size_t size)
Definition RagePhoto.c:553
void ragephoto_clear(ragephoto_t instance)
Definition RagePhoto.c:187
void * ragephoto_t
Definition RagePhoto.h:36
void ragephotodata_clear(RagePhotoData *rp_data)
Definition RagePhoto.c:176
RagePhotoData * ragephoto_getphotodata(ragephoto_t instance)
Definition RagePhoto.c:193
size_t ragephoto_getsavesize(ragephoto_t instance)
Definition RagePhoto.c:974
void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat)
Definition RagePhoto.c:1098
void ragephoto_setbufferdefault(ragephoto_t instance)
Definition RagePhoto.c:988
const char * ragephoto_getphototitle(ragephoto_t instance)
Definition RagePhoto.c:671
uint64_t ragephotodata_getphotosignf(RagePhotoData *rp_data, uint32_t photoFormat)
Definition RagePhoto.c:617
uint32_t ragephoto_format_rdr2()
Definition RagePhoto.c:1218
uint64_t ragephotodata_getphotosign(RagePhotoData *rp_data)
Definition RagePhoto.c:627
bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize)
Definition RagePhoto.c:1104
void ragephotodata_setbufferdefault(RagePhotoData *rp_data)
Definition RagePhoto.c:980
bool ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat)
Definition RagePhoto.c:912
ragephoto_t ragephoto_open()
Definition RagePhoto.c:127
void ragephoto_close(ragephoto_t instance)
Definition RagePhoto.c:144
size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat)
Definition RagePhoto.c:968
void ragephoto_setphotoheader2(ragephoto_t instance, const char *header, uint32_t headerSum, uint32_t headerSum2)
Definition RagePhoto.c:1177
void ragephoto_addparser(ragephoto_t instance, RagePhotoFormatParser *rp_parser)
Definition RagePhoto.c:157
uint64_t ragephoto_getphotosign(ragephoto_t instance)
Definition RagePhoto.c:638
uint32_t ragephoto_defpbuf_rdr2()
Definition RagePhoto.c:1208
bool ragephotodata_save(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data)
Definition RagePhoto.c:895
void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize)
Definition RagePhoto.c:1189
bool ragephoto_loadfile(ragephoto_t instance, const char *filename)
Definition RagePhoto.c:559
void ragephoto_setbufferoffsets(ragephoto_t instance)
Definition RagePhoto.c:1002
uint64_t ragephoto_getphotosignf(ragephoto_t instance, uint32_t photoFormat)
Definition RagePhoto.c:632
const char * ragephoto_getphotoheader(ragephoto_t instance)
Definition RagePhoto.c:665
bool ragephotodata_savef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, char *data, uint32_t photoFormat)
Definition RagePhoto.c:682
bool ragephoto_save(ragephoto_t instance, char *data)
Definition RagePhoto.c:906
uint32_t ragephoto_format_gta5()
Definition RagePhoto.c:1213
bool ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat)
Definition RagePhoto.c:900
bool ragephotodata_load(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, const char *data, size_t size)
Definition RagePhoto.c:199
uint32_t ragephoto_getphotoformat(ragephoto_t instance)
Definition RagePhoto.c:605
const char * ragephoto_version()
Definition RagePhoto.c:677
uint32_t ragephoto_getphotosize(ragephoto_t instance)
Definition RagePhoto.c:644
size_t ragephotodata_getsavesize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser)
Definition RagePhoto.c:963
uint32_t ragephoto_defpbuf_gta5()
Definition RagePhoto.c:1203
bool ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *rp_data)
Definition RagePhoto.c:1025
void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum)
Definition RagePhoto.c:1165
const char * ragephoto_getphotodesc(ragephoto_t instance)
Definition RagePhoto.c:653
const char * ragephoto_getphotojpeg(ragephoto_t instance)
Definition RagePhoto.c:611
Definition RagePhotoTypedefs.h:31
Definition RagePhotoTypedefs.h:65