libragephoto: add RagePhotoB for best implementation

CMakeLists.txt: add RagePhotoB class, improve settings clarification
doc/build.doc: add RAGEPHOTO_C_LIBRARY flag
doc/index.doc: correct RagePhoto.h header
doc/usage.doc: fix minor documentation issue, clarify class differences
ragephoto-gtkviewer: use RagePhotoB class
ragephoto-qtviewer: use RagePhotoB class
RagePhoto-Extract.cpp: use RagePhotoB class
RagePhoto.cpp: LIBRAGEPHOTO_C_API -> LIBRAGEPHOTO_CXX_C
RagePhotoA.hpp: simplify brief
RagePhotoB.hpp: add best implementation detection
RagePhotoLibrary.h: fix WASM C API inclusion by default
README.md: add RAGEPHOTO_C_LIBRARY flag
This commit is contained in:
Syping 2023-06-11 05:41:32 +02:00
parent d7943e552d
commit 12507be85d
13 changed files with 81 additions and 38 deletions

View file

@ -16,7 +16,7 @@
* responsible for anything with use of the software, you are self responsible.
*****************************************************************************/
#include <RagePhoto>
#include <RagePhotoB>
#include <fstream>
int main(int argc, char *argv[])
@ -27,18 +27,18 @@ int main(int argc, char *argv[])
}
// Initialise RagePhoto
RagePhoto ragePhoto;
RagePhotoB ragePhoto;
// Load Photo
const bool loaded = ragePhoto.loadFile(argv[1]);
if (!loaded) {
const int32_t error = ragePhoto.error();
if (error == RagePhoto::Uninitialised) {
if (error == RagePhotoB::Uninitialised) {
std::cout << "Failed to open file: " << argv[1] << std::endl;
return 1;
}
else if (error <= RagePhoto::PhotoReadError) {
else if (error <= RagePhotoB::PhotoReadError) {
std::cout << "Failed to load photo" << std::endl;
return 1;
}
@ -60,9 +60,9 @@ int main(int argc, char *argv[])
}
const uint32_t photoFormat = ragePhoto.format();
if (photoFormat == RagePhoto::GTA5)
if (photoFormat == RagePhotoB::GTA5)
std::cout << "GTA V Photo successfully exported" << std::endl;
else if (photoFormat == RagePhoto::RDR2)
else if (photoFormat == RagePhotoB::RDR2)
std::cout << "RDR 2 Photo successfully exported" << std::endl;
else
std::cout << "Photo successfully exported" << std::endl;