void projectMetadata(const File &src, File &dst)
This is a pure virtual function. It must be overloaded by all derived classes. Project a Template's metadata through the transform, modifying its contents in some way and storing the modified data in dst.
-
function definition:
virtual void projectMetadata(const File &src, File &dst) const = 0
-
parameters:
Parameter Type Description src const File & Input File. It is immutable dst File & Output File. Should contain the modified data from the input template. -
output: (void)
- example:
class IncrementPropertyTransform : public MetadataTransform { Q_OBJECT Q_PROPERTY(QString key READ get_key WRITE set_key RESET reset_key STORED false) BR_PROPERTY(QString, key, "") void projectMetadata(const File &src, File &dst) const { dst = src; dst.set(key, src.get<int>(key, 0) + 1); } }; BR_REGISTER(Transform, IncrementPropertyTransform) MetadataTransform *m_transform = (MetadataTransform *)Transform::make("IncrementProperty(property1)", NULL); File in("picture.jpg"), out; in.set("property1", 10); m_transform->projectMetadata(in, out); out.flat(); // Returns "picture.jpg[property1=11]"
void project(const Template &src, Template &dst)
Project a Template through the transform by passing its metadata through projectMetadata and storing the result in dst. All matrices in src are passed unchanged to dst.