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

Function GetTextAnimator

exporter/src/export/data/TextProperty.cpp:416–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416static pag::TextAnimator* GetTextAnimator(const AEGP_StreamRefH& streamHandle) {
417 auto animator = new pag::TextAnimator();
418 const auto& Suites = GetSuites();
419 const auto& PluginID = GetPluginID();
420
421 A_long numStreams = 0;
422 Suites->DynamicStreamSuite4()->AEGP_GetNumStreamsInGroup(streamHandle, &numStreams);
423 for (long index = 0; index < numStreams; index++) {
424 AEGP_StreamRefH childStreamHandle = nullptr;
425 Suites->DynamicStreamSuite4()->AEGP_GetNewStreamRefByIndex(PluginID, streamHandle, index,
426 &childStreamHandle);
427 if (childStreamHandle == nullptr) {
428 continue;
429 }
430 if (!IsStreamHidden(childStreamHandle) && IsStreamActive(childStreamHandle)) {
431 auto type = GetTextAnimatorType(childStreamHandle);
432 if (type == TextAnimatorType::Selectors) {
433 auto selectors = GetTextSelectors(childStreamHandle);
434 animator->selectors.insert(animator->selectors.end(), selectors.begin(), selectors.end());
435 } else if (type == TextAnimatorType::AnimatorProperties) {
436 animator->colorProperties = GetTextAnimatorColorProperties(childStreamHandle);
437 animator->typographyProperties = GetTextAnimatorTypographyProperties(childStreamHandle);
438 }
439 }
440 Suites->StreamSuite4()->AEGP_DisposeStream(childStreamHandle);
441 }
442 if (!animator->verify()) {
443 delete animator;
444 return nullptr;
445 }
446 return animator;
447}
448
449static std::vector<pag::TextAnimator*> GetTextAnimators(const AEGP_StreamRefH& streamHandle) {
450 const auto& Suites = GetSuites();

Callers 1

GetTextAnimatorsFunction · 0.85

Calls 10

GetSuitesFunction · 0.85
GetPluginIDFunction · 0.85
IsStreamHiddenFunction · 0.85
IsStreamActiveFunction · 0.85
GetTextAnimatorTypeFunction · 0.85
GetTextSelectorsFunction · 0.85
insertMethod · 0.80
verifyMethod · 0.45

Tested by

no test coverage detected