Simplify a transform by removing nested group transforms and identities.
| 842 | // Simplify a transform by removing nested group transforms and identities. |
| 843 | // |
| 844 | ConstTransformRcPtr simplifyTransform(const ConstGroupTransformRcPtr & gt) |
| 845 | { |
| 846 | ConstConfigRcPtr config = Config::CreateRaw(); |
| 847 | ConstProcessorRcPtr p = config->getProcessor(gt); |
| 848 | ConstProcessorRcPtr opt = p->getOptimizedProcessor(OPTIMIZATION_DEFAULT); |
| 849 | GroupTransformRcPtr finalGt = opt->createGroupTransform(); |
| 850 | if (finalGt->getNumTransforms() == 1) |
| 851 | { |
| 852 | return finalGt->getTransform(0); |
| 853 | } |
| 854 | return finalGt; |
| 855 | } |
| 856 | |
| 857 | ConstTransformRcPtr invertTransform(const ConstTransformRcPtr & t) |
| 858 | { |
no test coverage detected