コード例 #1
0
ファイル: kis_kra_loader.cpp プロジェクト: IGLOU-EU/krita
void KisKraLoader::loadAnimationMetadata(const KoXmlElement &element, KisImageWSP image)
{
    QDomDocument qDom;
    KoXml::asQDomElement(qDom, element);
    QDomElement qElement = qDom.firstChildElement();

    float framerate;
    KisTimeRange range;
    int currentTime;

    KisImageAnimationInterface *animation = image->animationInterface();

    if (KisDomUtils::loadValue(qElement, "framerate", &framerate)) {
        animation->setFramerate(framerate);
    }

    if (KisDomUtils::loadValue(qElement, "range", &range)) {
        animation->setFullClipRange(range);
    }

    if (KisDomUtils::loadValue(qElement, "currentTime", &currentTime)) {
        animation->switchCurrentTimeAsync(currentTime);
    }
}
コード例 #2
0
 int framesPerSecond() {
     return image->animationInterface()->framerate();
 }
コード例 #3
0
    int baseNumFrames() const {
        KisImageAnimationInterface *i = image->animationInterface();
        if (!i) return 1;

        return i->totalLength();
    }