本文整理汇总了C++中DocumentApi::moveCel方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentApi::moveCel方法的具体用法?C++ DocumentApi::moveCel怎么用?C++ DocumentApi::moveCel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentApi
的用法示例。
在下文中一共展示了DocumentApi::moveCel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drop_range_op
//.........这里部分代码省略.........
dstLayerStep = 1;
}
else {
srcLayerBegin = from.layerEnd();
srcLayerStep = -1;
srcLayerEnd = from.layerBegin()-1;
dstLayerBegin = to.layerEnd();
dstLayerStep = -1;
}
if (to.frameBegin() <= from.frameBegin()) {
srcFrameBegin = from.frameBegin();
srcFrameStep = frame_t(1);
srcFrameEnd = from.frameEnd()+1;
dstFrameBegin = to.frameBegin();
dstFrameStep = frame_t(1);
}
else {
srcFrameBegin = from.frameEnd();
srcFrameStep = frame_t(-1);
srcFrameEnd = from.frameBegin()-1;
dstFrameBegin = to.frameEnd();
dstFrameStep = frame_t(-1);
}
for (int srcLayerIdx = srcLayerBegin,
dstLayerIdx = dstLayerBegin; srcLayerIdx != srcLayerEnd; ) {
for (frame_t srcFrame = srcFrameBegin,
dstFrame = dstFrameBegin; srcFrame != srcFrameEnd; ) {
LayerImage* srcLayer = static_cast<LayerImage*>(layers[srcLayerIdx]);
LayerImage* dstLayer = static_cast<LayerImage*>(layers[dstLayerIdx]);
switch (op) {
case Move: api.moveCel(srcLayer, srcFrame, dstLayer, dstFrame); break;
case Copy: api.copyCel(srcLayer, srcFrame, dstLayer, dstFrame); break;
}
srcFrame += srcFrameStep;
dstFrame += dstFrameStep;
}
srcLayerIdx += srcLayerStep;
dstLayerIdx += dstLayerStep;
}
resultRange = to;
}
break;
case DocumentRange::kFrames:
{
frame_t srcFrameBegin = 0, srcFrameStep, srcFrameEnd = 0;
frame_t dstFrameBegin = 0, dstFrameStep;
switch (op) {
case Move:
if (place == kDocumentRangeBefore) {
if (to.frameBegin() <= from.frameBegin()) {
srcFrameBegin = from.frameBegin();
srcFrameStep = frame_t(1);
srcFrameEnd = from.frameEnd()+1;
dstFrameBegin = to.frameBegin();
dstFrameStep = frame_t(1);
}
else {
srcFrameBegin = from.frameEnd();