mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
exr: added some usefull attributes
This commit is contained in:
parent
3590a43fc5
commit
a497ab789b
@ -297,23 +297,27 @@ static void readMetadata(const Imf::Header &header, QImage &image)
|
|||||||
image.setText(QStringLiteral(META_KEY_XMP_ADOBE), QString::fromStdString(xmp->value()));
|
image.setText(QStringLiteral(META_KEY_XMP_ADOBE), QString::fromStdString(xmp->value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: OpenEXR 3.2 metadata
|
// camera metadata
|
||||||
*
|
if (auto manufacturer = header.findTypedAttribute<Imf::StringAttribute>("cameraMake")) {
|
||||||
* New Optional Standard Attributes:
|
image.setText(QStringLiteral(META_KEY_MANUFACTURER), QString::fromStdString(manufacturer->value()));
|
||||||
* - Support automated editorial workflow:
|
}
|
||||||
* reelName, imageCounter, ascFramingDecisionList
|
if (auto model = header.findTypedAttribute<Imf::StringAttribute>("cameraModel")) {
|
||||||
*
|
image.setText(QStringLiteral(META_KEY_MODEL), QString::fromStdString(model->value()));
|
||||||
* - Support forensics (“which other shots used that camera and lens before the camera firmware was updated?”):
|
}
|
||||||
* cameraMake, cameraModel, cameraSerialNumber, cameraFirmware, cameraUuid, cameraLabel, lensMake, lensModel,
|
if (auto serial = header.findTypedAttribute<Imf::StringAttribute>("cameraSerialNumber")) {
|
||||||
* lensSerialNumber, lensFirmware, cameraColorBalance
|
image.setText(QStringLiteral(META_KEY_SERIALNUMBER), QString::fromStdString(serial->value()));
|
||||||
*
|
}
|
||||||
* -Support pickup shots (reproduce critical camera settings):
|
|
||||||
* shutterAngle, cameraCCTSetting, cameraTintSetting
|
// lens metadata
|
||||||
*
|
if (auto manufacturer = header.findTypedAttribute<Imf::StringAttribute>("lensMake")) {
|
||||||
* - Support metadata-driven match move:
|
image.setText(QStringLiteral(META_KEY_LENS_MANUFACTURER), QString::fromStdString(manufacturer->value()));
|
||||||
* sensorCenterOffset, sensorOverallDimensions, sensorPhotositePitch, sensorAcquisitionRectanglenominalFocalLength,
|
}
|
||||||
* effectiveFocalLength, pinholeFocalLength, entrancePupilOffset, tStop(complementing existing 'aperture')
|
if (auto model = header.findTypedAttribute<Imf::StringAttribute>("lensModel")) {
|
||||||
*/
|
image.setText(QStringLiteral(META_KEY_LENS_MODEL), QString::fromStdString(model->value()));
|
||||||
|
}
|
||||||
|
if (auto serial = header.findTypedAttribute<Imf::StringAttribute>("lensSerialNumber")) {
|
||||||
|
image.setText(QStringLiteral(META_KEY_LENS_SERIALNUMBER), QString::fromStdString(serial->value()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -503,6 +507,26 @@ static void setMetadata(const QImage &image, Imf::Header &header)
|
|||||||
header.insert("xmp", Imf::StringAttribute(text.toStdString()));
|
header.insert("xmp", Imf::StringAttribute(text.toStdString()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_MANUFACTURER), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("cameraMake", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_MODEL), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("cameraModel", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_SERIALNUMBER), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("cameraSerialNumber", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_LENS_MANUFACTURER), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("lensMake", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_LENS_MODEL), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("lensModel", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
|
if (!key.compare(QStringLiteral(META_KEY_LENS_SERIALNUMBER), Qt::CaseInsensitive)) {
|
||||||
|
header.insert("lensSerialNumber", Imf::StringAttribute(text.toStdString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dateTime.isValid()) {
|
if (dateTime.isValid()) {
|
||||||
header.insert("capDate", Imf::StringAttribute(dateTime.toString(QStringLiteral("yyyy:MM:dd HH:mm:ss")).toStdString()));
|
header.insert("capDate", Imf::StringAttribute(dateTime.toString(QStringLiteral("yyyy:MM:dd HH:mm:ss")).toStdString()));
|
||||||
@ -519,8 +543,6 @@ static void setMetadata(const QImage &image, Imf::Header &header)
|
|||||||
// If a file doesn’t have a chromaticities attribute, display software should assume that the
|
// If a file doesn’t have a chromaticities attribute, display software should assume that the
|
||||||
// file’s primaries and the white point match Rec. ITU-R BT.709-3.
|
// file’s primaries and the white point match Rec. ITU-R BT.709-3.
|
||||||
// header.insert("chromaticities", Imf::ChromaticitiesAttribute(Imf::Chromaticities()));
|
// header.insert("chromaticities", Imf::ChromaticitiesAttribute(Imf::Chromaticities()));
|
||||||
|
|
||||||
// TODO: EXR 3.2 attributes (see readMetadata())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EXRHandler::write(const QImage &image)
|
bool EXRHandler::write(const QImage &image)
|
||||||
|
@ -24,15 +24,22 @@
|
|||||||
#define META_KEY_HOSTCOMPUTER "HostComputer"
|
#define META_KEY_HOSTCOMPUTER "HostComputer"
|
||||||
#define META_KEY_LATITUDE "Latitude"
|
#define META_KEY_LATITUDE "Latitude"
|
||||||
#define META_KEY_LONGITUDE "Longitude"
|
#define META_KEY_LONGITUDE "Longitude"
|
||||||
#define META_KEY_HOSTCOMPUTER "HostComputer"
|
|
||||||
#define META_KEY_MANUFACTURER "Manufacturer"
|
|
||||||
#define META_KEY_MODEL "Model"
|
|
||||||
#define META_KEY_OWNER "Owner"
|
#define META_KEY_OWNER "Owner"
|
||||||
#define META_KEY_SOFTWARE "Software"
|
#define META_KEY_SOFTWARE "Software"
|
||||||
#define META_KEY_TITLE "Title"
|
#define META_KEY_TITLE "Title"
|
||||||
#define META_KEY_XML_GIMP "XML:org.gimp.xml"
|
#define META_KEY_XML_GIMP "XML:org.gimp.xml"
|
||||||
#define META_KEY_XMP_ADOBE "XML:com.adobe.xmp"
|
#define META_KEY_XMP_ADOBE "XML:com.adobe.xmp"
|
||||||
|
|
||||||
|
// Camera info metadata keys
|
||||||
|
#define META_KEY_MANUFACTURER "Manufacturer"
|
||||||
|
#define META_KEY_MODEL "Model"
|
||||||
|
#define META_KEY_SERIALNUMBER "SerialNumber"
|
||||||
|
|
||||||
|
// Lens info metadata keys
|
||||||
|
#define META_KEY_LENS_MANUFACTURER "LensManufacturer"
|
||||||
|
#define META_KEY_LENS_MODEL "LensModel"
|
||||||
|
#define META_KEY_LENS_SERIALNUMBER "LensSerialNumber"
|
||||||
|
|
||||||
// QList uses some extra space for stuff, hence the 32 here suggested by Thiago Macieira
|
// QList uses some extra space for stuff, hence the 32 here suggested by Thiago Macieira
|
||||||
static constexpr int kMaxQVectorSize = std::numeric_limits<int>::max() - 32;
|
static constexpr int kMaxQVectorSize = std::numeric_limits<int>::max() - 32;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user