本文整理汇总了C++中Composition::setFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Composition::setFrame方法的具体用法?C++ Composition::setFrame怎么用?C++ Composition::setFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composition
的用法示例。
在下文中一共展示了Composition::setFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupCompositionJson
void Loader::setupCompositionJson(Composition& comp, const ofJson& json)
{
// Basics
comp.name_ = json.value("name", "noname");
comp.allocate(json.value("width", 1), json.value("height", 1));
comp.setLength(json.value("length", 0));
comp.setFrameRate(json.value("frameRate", 0));
// Layers
const ofJson& layers = json["layer"];
if(layers.is_array()) {
map<shared_ptr<Layer>, int> all;
map<shared_ptr<Layer>, int> children;
int layer_count = layers.size();
for(int i = layer_count; i--;) { // reverse iterate for draw priority
const ofJson& layer = layers[i];
const string& type_name = layer.value("layerType", "unknown");
shared_ptr<Layer> l = nullptr;
shared_ptr<LayerCap> c = nullptr;
if(type_name == "composition") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<CompositionCap>();
setupCompositionJson(*cap, layer);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
else if(type_name == "solid") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<PlaneCap>();
setupPlaneJson(*cap, layer);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
else if(type_name == "sequence") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<SequenceCap>();
setupSequenceJson(*cap, layer);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
else if(type_name == "image") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<ImageCap>();
setupImageJson(*cap, layer);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
else if(type_name == "movie") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<MovieCap>();
setupMovieJson(*cap, layer);
cap->setComposition(&comp);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
else if(type_name == "camera") {
auto ll = make_shared<CameraLayer>();
setupCameraLayerJson(*ll, layer, comp);
comp.camera_.push_back(ll);
l = ll;
}
else if(type_name == "shape") {
auto ll = make_shared<AVLayer>();
setupAVLayerJson(*ll, layer);
auto cap = make_shared<ShapeCap>();
setupShapeJson(*cap, layer);
comp.av_.push_back(ll);
l = ll;
c = cap;
}
if(!l) {
continue;
}
if(c) {
l->setCap(c);
}
all.insert(pair<shared_ptr<Layer>,int>(l, layer.value("index", 0)));
auto parent = layer.find("parent");
if(parent != end(layer)) {
children.insert(pair<shared_ptr<Layer>,int>(l, *parent));
}
}
// search parent
for(auto &child : children) {
for(auto &parent : all) {
if(child.second == parent.second) {
child.first->setParent(parent.first);
}
}
}
}
//.........这里部分代码省略.........