本文整理汇总了C++中KisImageWSP::annotation方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::annotation方法的具体用法?C++ KisImageWSP::annotation怎么用?C++ KisImageWSP::annotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::annotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveBinaryData
bool KisKraSaver::saveBinaryData(KoStore* store, KisImageWSP image, const QString & uri, bool external)
{
QString location;
// Save the layers data
quint32 count = 0;
KisKraSaveVisitor visitor(image, store, count, m_d->imageName, m_d->nodeFileNames);
if (external)
visitor.setExternalUri(uri);
image->rootLayer()->accept(visitor);
// saving annotations
// XXX this only saves EXIF and ICC info. This would probably need
// a redesign of the dtd of the krita file to do this more generally correct
// e.g. have <ANNOTATION> tags or so.
KisAnnotationSP annotation = image->annotation("exif");
if (annotation) {
location = external ? QString::null : uri;
location += m_d->imageName + EXIF_PATH;
if (store->open(location)) {
store->write(annotation->annotation());
store->close();
}
}
if (image->profile()) {
const KoColorProfile *profile = image->profile();
KisAnnotationSP annotation;
if (profile) {
QByteArray profileRawData = profile->rawData();
if (!profileRawData.isEmpty()) {
if (profile->type() == "icc") {
annotation = new KisAnnotation(ICC, profile->name(), profile->rawData());
} else {
annotation = new KisAnnotation(PROFILE, profile->name(), profile->rawData());
}
}
}
if (annotation) {
location = external ? QString::null : uri;
location += m_d->imageName + ICC_PATH;
if (store->open(location)) {
store->write(annotation->annotation());
store->close();
}
}
}
return true;
}