本文整理汇总了C++中KisImageWSP::endAnnotations方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageWSP::endAnnotations方法的具体用法?C++ KisImageWSP::endAnnotations怎么用?C++ KisImageWSP::endAnnotations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageWSP
的用法示例。
在下文中一共展示了KisImageWSP::endAnnotations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLayer
KisImageBuilder_Result CSVSaver::getLayer(CSVLayerRecord* layer, KisDocument* exportDoc, KisKeyframeSP keyframe, const QString &path, int frame, int idx)
{
//render to the temp layer
KisImageWSP image = exportDoc->image();
KisPaintDeviceSP device = image->rootLayer()->firstChild()->projection();
layer->channel->fetchFrame(keyframe, device);
QRect bounds = device->exactBounds();
if (bounds.isEmpty()) {
layer->last = ""; //empty frame
return KisImageBuilder_RESULT_OK;
}
layer->last = QString("frame%1-%2.png").arg(idx + 1,5,10,QChar('0')).arg(frame,5,10,QChar('0'));
QString filename = path;
filename.append(layer->last);
//save to PNG
KisSequentialConstIterator it(device, image->bounds());
const KoColorSpace* cs = device->colorSpace();
bool isThereAlpha = false;
do {
if (cs->opacityU8(it.oldRawData()) != OPACITY_OPAQUE_U8) {
isThereAlpha = true;
break;
}
} while (it.nextPixel());
if (!KisPNGConverter::isColorSpaceSupported(cs)) {
device = new KisPaintDevice(*device.data());
KUndo2Command *cmd= device->convertTo(KoColorSpaceRegistry::instance()->rgb8());
delete cmd;
}
KisPNGOptions options;
options.alpha = isThereAlpha;
options.interlace = false;
options.compression = 8;
options.tryToSaveAsIndexed = false;
options.transparencyFillColor = QColor(0,0,0);
options.saveSRGBProfile = true; //TVPaint can use only sRGB
options.forceSRGB = false;
KisPNGConverter kpc(exportDoc);
KisImageBuilder_Result result = kpc.buildFile(QUrl::fromLocalFile(filename), image->bounds(),
image->xRes(), image->yRes(), device,
image->beginAnnotations(), image->endAnnotations(),
options, (KisMetaData::Store* )0 );
return result;
}