Microsoft DirectX 8.1 (C++) |
The easiest solution for writing a transform filter is to use the transform filter classes, which work well for most types of transform filters. Typically, a noncopying transform filter is derived from the CTransInPlaceFilter class and its associated pin classes; a copy transform filter is derived from the CTransformFilter filter class and its associated pin classes.
Transform filter classes are hierarchical, with the transform-in-place classes at the bottom of the hierarchy tree. CTransInPlaceFilter is derived from CTransformFilter, which is derived from CBaseFilter, as shown in the following illustration.
The CTransInPlaceInputPin class is derived from the CTransformInputPin class. The CTransformInputPin class is derived from the CBaseInputPin class, as shown in the following illustration.
The CTransInPlaceOutputPin class is derived from the CTransformOutputPin class. The CTransformOutputPin class is derived from the CBaseOutputPin class, as shown in the following illustration.
Copy transform and transform-in-place classes share many features, because the transform-in-place classes derive almost all member functions from the copy transform classes. The principal additions made by the transform classes over the base classes is that all required pin member functions are implemented - so for default implementation, you need only to derive a main filter class (from CTransInPlaceFilter or CTransformFilter).