本文整理汇总了C++中KisImageWSP::profile方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::profile方法的具体用法?C++ KisImageWSP::profile怎么用?C++ KisImageWSP::profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::profile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveXML
QDomElement KisKraSaver::saveXML(QDomDocument& doc, KisImageWSP image)
{
QDomElement imageElement = doc.createElement("IMAGE"); // Legacy!
Q_ASSERT(image);
imageElement.setAttribute(NAME, m_d->imageName);
imageElement.setAttribute(MIME, NATIVE_MIMETYPE);
imageElement.setAttribute(WIDTH, image->width());
imageElement.setAttribute(HEIGHT, image->height());
imageElement.setAttribute(COLORSPACE_NAME, image->colorSpace()->id());
imageElement.setAttribute(DESCRIPTION, m_d->doc->documentInfo()->aboutInfo("comment"));
// XXX: Save profile as blob inside the image, instead of the product name.
if (image->profile() && image->profile()-> valid()) {
imageElement.setAttribute(PROFILE, image->profile()->name());
}
imageElement.setAttribute(X_RESOLUTION, image->xRes()*72.0);
imageElement.setAttribute(Y_RESOLUTION, image->yRes()*72.0);
quint32 count = 1; // We don't save the root layer, but it does count
KisSaveXmlVisitor visitor(doc, imageElement, count, true);
image->rootLayer()->accept(visitor);
m_d->nodeFileNames = visitor.nodeFileNames();
return imageElement;
}
示例2: 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;
}