MCPcopy Create free account
hub / github.com/Tencent/libpag / AdjustTrackMatteLayer

Function AdjustTrackMatteLayer

exporter/src/export/PAGExport.cpp:180–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180static void AdjustTrackMatteLayer(std::shared_ptr<PAGExportSession> session) {
181 pag::ID maxID = 0;
182 std::vector<pag::Layer*> trackMatteLayers = {};
183 for (auto& composition : session->compositions) {
184 if (composition->type() == pag::CompositionType::Vector) {
185 auto vectorComposition = static_cast<pag::VectorComposition*>(composition);
186 for (size_t i = 0; i < vectorComposition->layers.size(); i++) {
187 auto layer = vectorComposition->layers[i];
188 maxID = std::max(maxID, layer->id);
189 if (layer->trackMatteLayer != nullptr && i > 0) {
190 trackMatteLayers.push_back(layer->trackMatteLayer);
191 }
192 }
193 }
194 }
195 for (auto layer : trackMatteLayers) {
196 maxID += 1;
197 auto itemIter = session->itemHandleMap.find(layer->id);
198 if (itemIter != session->itemHandleMap.end()) {
199 session->itemHandleMap[maxID] = itemIter->second;
200 }
201 layer->id = maxID;
202 }
203}
204
205PAGExport::PAGExport(const PAGExportConfigParam& configParam)
206 : itemHandle(configParam.activeItemHandle),

Callers 1

exportAsFileMethod · 0.85

Calls 4

sizeMethod · 0.80
push_backMethod · 0.80
findMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected