improved documentation, setHeader adapted

This commit is contained in:
Syping 2021-09-15 16:17:51 +02:00
parent 3fa0068251
commit af5c571b16
3 changed files with 56 additions and 37 deletions

18
doc/index.doc Normal file
View file

@ -0,0 +1,18 @@
/*! \mainpage
#### Open Source RAGE Photo Parser for GTA V and RDR 2
- Read RAGE Photos error free and correct
- Support for metadata stored in RAGE Photos
- Export RAGE Photos to jpeg with ragephoto-extract
- High Efficient and Simple C++ API
<b>Main Class:</b>
- RagePhoto
<b>Project Pages:</b>
- https://git.syping.de/Syping/libragephoto
- https://gitlab.com/Syping/libragephoto
- https://github.com/Syping/libragephoto
*/

View file

@ -420,9 +420,10 @@ void RagePhoto::setJson(const std::string &json, uint32_t bufferSize)
} }
} }
void RagePhoto::setHeader(const std::string &header) void RagePhoto::setHeader(const std::string &header, uint32_t headerSum)
{ {
p_photoString = header; p_photoString = header;
p_headerSum = headerSum;
} }
bool RagePhoto::setPhotoData(const char *data, uint32_t size, uint32_t bufferSize) bool RagePhoto::setPhotoData(const char *data, uint32_t size, uint32_t bufferSize)

View file

@ -29,41 +29,41 @@ class LIBRAGEPHOTO_EXPORT RagePhoto
public: public:
/** Parsing and set errors */ /** Parsing and set errors */
enum class Error : uint8_t { enum class Error : uint8_t {
DescMallocError = 30, DescMallocError = 30, /**< Description Buffer can't be allocated */
DescReadError = 31, DescReadError = 31, /**< Description can't be read successfully */
IncompatibleFormat = 2, IncompatibleFormat = 2, /**< Format is incompatible */
IncompleteChecksum = 6, IncompleteChecksum = 6, /**< Header checksum is incomplete */
IncompleteDescBuffer = 29, IncompleteDescBuffer = 29, /**< Description Buffer Size is incomplete */
IncompleteDescMarker = 27, IncompleteDescMarker = 27, /**< Description Marker is incomplete */
IncompleteDescOffset = 10, IncompleteDescOffset = 10, /**< Description Offset is incomplete */
IncompleteEOF = 7, IncompleteEOF = 7, /**< End Of File Offset is incomplete */
IncompleteHeader = 3, IncompleteHeader = 3, /**< Header is incomplete */
IncompleteJendMarker = 32, IncompleteJendMarker = 32, /**< JEND Marker is incomplete */
IncompleteJpegMarker = 11, IncompleteJpegMarker = 11, /**< JPEG Marker is incomplete */
IncompleteJsonBuffer = 19, IncompleteJsonBuffer = 19, /**< JSON Buffer Size is incomplete */
IncompleteJsonMarker = 17, IncompleteJsonMarker = 17, /**< JSON Marker incomplete */
IncompleteJsonOffset = 8, IncompleteJsonOffset = 8, /**< JSON Offset incomplete */
IncompletePhotoBuffer = 13, IncompletePhotoBuffer = 13, /**< Photo Buffer Size is incomplete */
IncompletePhotoSize = 14, IncompletePhotoSize = 14, /**< Photo Size is incomplete */
IncompleteTitleBuffer = 24, IncompleteTitleBuffer = 24, /**< Title Buffer Size is incomplete */
IncompleteTitleMarker = 22, IncompleteTitleMarker = 22, /**< Title Marker is incomplete */
IncompleteTitleOffset = 9, IncompleteTitleOffset = 9, /**< Title Offset is incomplete */
IncorrectDescMarker = 28, IncorrectDescMarker = 28, /**< Description Marker is incorrect */
IncorrectJendMarker = 33, IncorrectJendMarker = 33, /**< JEND Marker is incorrect */
IncorrectJpegMarker = 12, IncorrectJpegMarker = 12, /**< JPEG Marker is incorrect */
IncorrectJsonMarker = 18, IncorrectJsonMarker = 18, /**< JSON Marker is incorrect */
IncorrectTitleMarker = 23, IncorrectTitleMarker = 23, /**< Title Marker is incorrect */
JsonMallocError = 20, JsonMallocError = 20, /**< JSON Buffer can't be allocated */
JsonReadError = 21, JsonReadError = 21, /**< JSON can't be read successfully */
NoError = 255, NoError = 255, /**< Finished without errors */
NoFormatIdentifier = 1, NoFormatIdentifier = 1, /**< No format detected, empty file */
PhotoMallocError = 15, PhotoMallocError = 15, /**< Photo Buffer can't be allocated */
PhotoReadError = 16, PhotoReadError = 16, /**< Photo can't be read */
TitleMallocError = 25, TitleMallocError = 25, /**< Title Buffer can't be allocated */
TitleReadError = 26, TitleReadError = 26, /**< Title can't be read */
UnicodeHeaderError = 5, UnicodeHeaderError = 5, /**< Header can't be decoded */
UnicodeInitError = 4, UnicodeInitError = 4, /**< Failed to initialise Unicode decoder */
Uninitialised = 0, Uninitialised = 0, /**< Uninitialised */
}; };
/** Photo Formats */ /** Photo Formats */
enum class PhotoFormat : uint32_t { enum class PhotoFormat : uint32_t {
@ -86,7 +86,7 @@ public:
const std::string title(); /**< Returns the Photo title. */ const std::string title(); /**< Returns the Photo title. */
void setDescription(const std::string &description, uint32_t bufferSize = 0); /**< Sets the Photo description. */ void setDescription(const std::string &description, uint32_t bufferSize = 0); /**< Sets the Photo description. */
void setJson(const std::string &json, uint32_t bufferSize = 0); /**< Sets the Photo JSON data. */ void setJson(const std::string &json, uint32_t bufferSize = 0); /**< Sets the Photo JSON data. */
void setHeader(const std::string &header); /**< Sets the Photo header. (expert only) */ void setHeader(const std::string &header, uint32_t headerSum); /**< Sets the Photo header. (expert only) */
/** Sets the Photo JPEG data. /** Sets the Photo JPEG data.
* @param data JPEG data * @param data JPEG data
* @param size JPEG data size * @param size JPEG data size