本文整理汇总了C++中TupLayer::framesTotal方法的典型用法代码示例。如果您正苦于以下问题:C++ TupLayer::framesTotal方法的具体用法?C++ TupLayer::framesTotal怎么用?C++ TupLayer::framesTotal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupLayer
的用法示例。
在下文中一共展示了TupLayer::framesTotal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: framesTotal
int TupGraphicsScene::framesTotal()
{
TupLayer *layer = k->scene->layer(k->framePosition.layer);
if (layer)
return layer->framesTotal();
else
return -1;
}
示例2: selectFrame
bool TupCommandExecutor::selectFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::selectFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
// bool prioritary = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene || scenePos < 0 || position < 0)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
if (position < layer->framesTotal()) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
QString msg = "TupCommandExecutor::selectFrame() - Invalid frame index -> " + QString::number(position);
#ifdef Q_OS_WIN32
qDebug() << msg;
#else
tError() << msg;
#endif
#endif
return false;
}
}
return false;
}
示例3: drawCurrentPhotogram
void TupGraphicsScene::drawCurrentPhotogram()
{
#ifdef K_DEBUG
T_FUNCINFO;
#endif
TupLayer *layer = k->scene->layer(k->framePosition.layer);
int frames = layer->framesTotal();
if (k->framePosition.frame >= frames)
k->framePosition.frame = frames - 1;
if (k->spaceMode == TupProject::FRAMES_EDITION) {
drawPhotogram(k->framePosition.frame);
} else if (k->spaceMode == TupProject::BACKGROUND_EDITION) {
cleanWorkSpace();
drawBackground();
}
}
示例4: drawPhotogram
void TupGraphicsScene::drawPhotogram(int photogram)
{
/*
#ifdef K_DEBUG
T_FUNCINFO;
#endif
*/
// Q_CHECK_PTR(k->scene);
if (photogram < 0 || !k->scene)
return;
cleanWorkSpace();
bool valid = false;
// Drawing frames from another layers
for (int i=0; i < k->scene->layersTotal(); i++) {
TupLayer *layer = k->scene->layer(i);
if (layer->framesTotal() > 0 && photogram < layer->framesTotal()) {
TupFrame *mainFrame = layer->frame(photogram);
QString currentFrame = "";
if (mainFrame) {
currentFrame = mainFrame->frameName();
if (layer) {
if (layer->isVisible()) {
// Painting the background
drawBackground();
// Painting previews frames
if (k->onionSkin.previous > 0 && photogram > 0) {
double opacity = k->opacity;
double opacityFactor = opacity / (double)qMin(layer->frames().count(), k->onionSkin.previous);
int limit = photogram - k->onionSkin.previous;
if (limit < 0)
limit = 0;
QString frameBehind = "";
for (int frameIndex = photogram-1; frameIndex >= limit; frameIndex--) {
TupFrame *frame = layer->frame(frameIndex);
QString previousFrame = frame->frameName();
if (frame && previousFrame.compare(currentFrame) != 0
&& frameBehind.compare(previousFrame) != 0) {
addFrame(frame, opacity, Preview);
}
frameBehind = previousFrame;
opacity -= opacityFactor;
}
}
// valid = true;
// k->layerCounter = i;
addFrame(mainFrame, TupGraphicsScene::Current);
// Painting next frames
if (k->onionSkin.next > 0 && layer->framesTotal() > photogram + 1) {
double opacity = k->opacity;
double opacityFactor = opacity / (double)qMin(layer->frames().count(), k->onionSkin.next);
int limit = photogram + k->onionSkin.next;
if (limit >= layer->frames().count())
limit = layer->frames().count() - 1;
QString frameLater = "";
for (int frameIndex = photogram+1; frameIndex <= limit; frameIndex++) {
TupFrame * frame = layer->frame(frameIndex);
QString nextFrame = frame->frameName();
if (frame && nextFrame.compare(currentFrame) != 0
&& frameLater.compare(nextFrame) != 0) {
addFrame(frame, opacity, Next);
}
frameLater = nextFrame;
opacity -= opacityFactor;
}
}
// SQA: Crashpoint when layers are deleted
valid = true;
k->layerCounter = i;
// addFrame(mainFrame, TupGraphicsScene::Current);
}
}
}
}
//.........这里部分代码省略.........