19#ifndef RAGEPHOTO_CXX_HPP
20#define RAGEPHOTO_CXX_HPP
23#include "RagePhotoLibrary.h"
24#include "RagePhotoTypedefs.h"
36class LIBRAGEPHOTO_CXX_PUBLIC photo
95 JPEG = RAGEPHOTO_FORMAT_JPEG,
96 GTA5 = RAGEPHOTO_FORMAT_GTA5,
97 RDR2 = RAGEPHOTO_FORMAT_RDR2
115 bool load(
const char *data,
size_t size);
119 bool load(
const std::string &data);
123 bool loadFile(
const char *filename);
124 int32_t error()
const;
125 uint32_t format()
const;
126 const std::string jpeg()
const;
127#if (RAGEPHOTO_CXX_STD >= 17) && (__cplusplus >= 201703L)
128 const std::string_view jpeg_view()
const;
130 const char* jpegData()
const;
131 static uint64_t jpegSign(uint32_t photoFormat,
RagePhotoData *rp_data);
133 uint64_t jpegSign(uint32_t photoFormat)
const;
134 uint64_t jpegSign()
const;
135 uint32_t jpegSize()
const;
136 const char* description()
const;
137 const char* header()
const;
138 const char* json()
const;
139 const char* title()
const;
140 static const char* version();
147 bool save(
char *data, uint32_t photoFormat);
151 bool save(
char *data);
156 const std::string save(uint32_t photoFormat,
bool *ok =
nullptr);
160 const std::string save(
bool *ok =
nullptr);
161 bool saveFile(
const char *filename, uint32_t photoFormat);
162 bool saveFile(
const char *filename);
165 size_t saveSize(uint32_t photoFormat);
168 void setBufferDefault();
170 void setBufferOffsets();
172 void setDescription(
const char *description, uint32_t bufferSize = 0);
173 void setFormat(uint32_t photoFormat);
174 void setHeader(
const char *header, uint32_t headerSum, uint32_t headerSum2 = 0);
180 bool setJpeg(
const char *data, uint32_t size, uint32_t bufferSize = 0);
185 bool setJpeg(
const std::string &data, uint32_t bufferSize = 0);
186 void setJson(
const char *json, uint32_t bufferSize = 0);
187 static void setLibraryFlag(RagePhotoLibraryFlag flag,
bool state =
true);
188 void setTitle(
const char *title, uint32_t bufferSize = 0);
GTA V and RDR 2 Photo Parser.
Definition ragephoto_cxx.hpp:37
SignInitials
Definition ragephoto_cxx.hpp:100
@ SIGTA5
Definition ragephoto_cxx.hpp:101
@ SIRDR2
Definition ragephoto_cxx.hpp:102
DefaultSize
Definition ragephoto_cxx.hpp:40
@ GTA5_HEADERSIZE
Definition ragephoto_cxx.hpp:46
@ RDR2_HEADERSIZE
Definition ragephoto_cxx.hpp:47
@ DEFAULT_RDR2_PHOTOBUFFER
Definition ragephoto_cxx.hpp:42
@ DEFAULT_GTA5_PHOTOBUFFER
Definition ragephoto_cxx.hpp:41
@ DEFAULT_DESCBUFFER
Definition ragephoto_cxx.hpp:43
@ DEFAULT_TITLBUFFER
Definition ragephoto_cxx.hpp:45
@ DEFAULT_JSONBUFFER
Definition ragephoto_cxx.hpp:44
Error
Definition ragephoto_cxx.hpp:50
@ DescBufferTight
Definition ragephoto_cxx.hpp:51
@ IncompleteJendMarker
Definition ragephoto_cxx.hpp:63
@ NoFormatIdentifier
Definition ragephoto_cxx.hpp:82
@ HeaderBufferTight
Definition ragephoto_cxx.hpp:54
@ IncorrectJpegMarker
Definition ragephoto_cxx.hpp:75
@ JsonReadError
Definition ragephoto_cxx.hpp:80
@ IncompleteJpegMarker
Definition ragephoto_cxx.hpp:64
@ HeaderMallocError
Definition ragephoto_cxx.hpp:55
@ JsonBufferTight
Definition ragephoto_cxx.hpp:78
@ UnicodeInitError
Definition ragephoto_cxx.hpp:89
@ IncorrectDescMarker
Definition ragephoto_cxx.hpp:73
@ IncompleteDescMarker
Definition ragephoto_cxx.hpp:59
@ TitleBufferTight
Definition ragephoto_cxx.hpp:86
@ DescReadError
Definition ragephoto_cxx.hpp:53
@ IncorrectJendMarker
Definition ragephoto_cxx.hpp:74
@ TitleMallocError
Definition ragephoto_cxx.hpp:87
@ IncompleteTitleMarker
Definition ragephoto_cxx.hpp:71
@ IncompleteEOF
Definition ragephoto_cxx.hpp:61
@ IncorrectTitleMarker
Definition ragephoto_cxx.hpp:77
@ IncompleteDescOffset
Definition ragephoto_cxx.hpp:60
@ IncompleteDescBuffer
Definition ragephoto_cxx.hpp:58
@ Uninitialised
Definition ragephoto_cxx.hpp:91
@ IncompatibleFormat
Definition ragephoto_cxx.hpp:56
@ IncompletePhotoSize
Definition ragephoto_cxx.hpp:69
@ TitleReadError
Definition ragephoto_cxx.hpp:88
@ JsonMallocError
Definition ragephoto_cxx.hpp:79
@ NoError
Definition ragephoto_cxx.hpp:81
@ PhotoReadError
Definition ragephoto_cxx.hpp:85
@ IncompleteJsonMarker
Definition ragephoto_cxx.hpp:66
@ UnicodeHeaderError
Definition ragephoto_cxx.hpp:90
@ DescMallocError
Definition ragephoto_cxx.hpp:52
@ IncompleteTitleBuffer
Definition ragephoto_cxx.hpp:70
@ PhotoBufferTight
Definition ragephoto_cxx.hpp:83
@ PhotoMallocError
Definition ragephoto_cxx.hpp:84
@ IncorrectJsonMarker
Definition ragephoto_cxx.hpp:76
@ IncompleteHeader
Definition ragephoto_cxx.hpp:62
@ IncompleteJsonOffset
Definition ragephoto_cxx.hpp:67
@ IncompletePhotoBuffer
Definition ragephoto_cxx.hpp:68
@ IncompleteJsonBuffer
Definition ragephoto_cxx.hpp:65
@ IncompleteChecksum
Definition ragephoto_cxx.hpp:57
@ IncompleteTitleOffset
Definition ragephoto_cxx.hpp:72
PhotoFormat
Definition ragephoto_cxx.hpp:94
@ GTA5
Definition ragephoto_cxx.hpp:96
@ RDR2
Definition ragephoto_cxx.hpp:97
@ JPEG
Definition ragephoto_cxx.hpp:95
Definition RagePhotoTypedefs.h:31