| 454 | } |
| 455 | |
| 456 | static pag::ImageFillRule* GetImageFillRule(const AEGP_StreamRefH& streamHandle, float frameRate, |
| 457 | uint16_t tagLevel, AEEffectType type) { |
| 458 | if (tagLevel < static_cast<uint16_t>(pag::TagCode::ImageFillRule)) { |
| 459 | PAGExportSessionManager::GetInstance()->recordWarning(AlertInfoType::TagLevelImageFillRule); |
| 460 | return nullptr; |
| 461 | } |
| 462 | |
| 463 | auto imageFillRule = new pag::ImageFillRule(); |
| 464 | QVariantMap map = {}; |
| 465 | map["frameRate"] = frameRate; |
| 466 | if (type == AEEffectType::ImageFillRule) { |
| 467 | imageFillRule->scaleMode = |
| 468 | GetValue(streamHandle, "ADBE Image Fill Rule1-0001", AEStreamParser::ScaleModeParser); |
| 469 | imageFillRule->timeRemap = |
| 470 | GetProperty(streamHandle, "ADBE Image Fill Rule1-0002", AEStreamParser::TimeParser, map); |
| 471 | } else { |
| 472 | imageFillRule->scaleMode = |
| 473 | GetValue(streamHandle, "ADBE Image Fill Rule2-0001", AEStreamParser::ScaleModeParser); |
| 474 | imageFillRule->timeRemap = |
| 475 | GetProperty(streamHandle, "ADBE Image Fill Rule2-0002", AEStreamParser::TimeParser, map); |
| 476 | |
| 477 | if (tagLevel < static_cast<uint16_t>(pag::TagCode::ImageFillRuleV2)) { |
| 478 | PAGExportSessionManager::GetInstance()->recordWarning(AlertInfoType::TagLevelImageFillRuleV2); |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | if (!(type == AEEffectType::ImageFillRuleV2 && |
| 483 | tagLevel >= static_cast<uint16_t>(pag::TagCode::ImageFillRuleV2)) && |
| 484 | imageFillRule->timeRemap->animatable()) { |
| 485 | auto timeRemap = imageFillRule->timeRemap; |
| 486 | for (auto& keyFrame : static_cast<pag::AnimatableProperty<pag::Frame>*>(timeRemap)->keyframes) { |
| 487 | keyFrame->interpolationType = pag::KeyframeInterpolationType::Linear; |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | return imageFillRule; |
| 492 | } |
| 493 | |
| 494 | static void GetAttachment(const AEGP_EffectRefH& effectHandle, float frameRate, pag::Layer* layer, |
| 495 | uint16_t tagLevel) { |
no test coverage detected