libragephoto: add new ragephotodata functions and improvements

RagePhoto: changed photo(), photoData(), photoSize() and setPhoto() to
jpeg(), jpegData(), jpegSize() and setJpeg()
RagePhoto: setData() now takes takeCopy instead of takeOwnership
RagePhoto: changed static member argument order for easier coding
RagePhotoA: changed photo(), photoData(), photoSize() and setPhoto() to
jpeg(), jpegData(), jpegSize() and setJpeg()
RagePhotoA: setData() now takes takeCopy instead of takeOwnership
RagePhotoA: changed static member argument order for easier coding
RagePhotoA: add new C API functions
RagePhotoC: add ragephotodata_save() and ragephotodata_savef()
RagePhoto-Extract: update for API changes, stop assuming RDR 2 when GTA
V format not found
ragephoto-gtkviewer: update for API changes
ragephoto-qtviewer: update for API changes
This commit is contained in:
Syping 2023-02-23 09:17:53 +01:00
parent 9807f0d696
commit d75eba2a46
9 changed files with 237 additions and 182 deletions

View file

@ -1,6 +1,6 @@
/*****************************************************************************
* libragephoto RAGE Photo Parser
* Copyright (C) 2021-2022 Syping
* Copyright (C) 2021-2023 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@ -44,8 +44,8 @@ bool readPhotoFile(const QString &filename, QMainWindow *mainWindow, QLabel *pho
return false;
}
}
const QByteArray photoData = QByteArray::fromRawData(ragePhoto.photoData(), ragePhoto.photoSize());
const QImage image = QImage::fromData(photoData, "JPEG");
const QByteArray jpegData = QByteArray::fromRawData(ragePhoto.jpegData(), ragePhoto.jpegSize());
const QImage image = QImage::fromData(jpegData, "JPEG");
photoLabel->setPixmap(QPixmap::fromImage(image));
mainWindow->setWindowTitle(QStringLiteral("RagePhoto Qt Photo Viewer - ") + QString::fromUtf8(ragePhoto.title()));
return true;