13.07.2015 Views

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Some Useful Examples and ScenariosCreating an Effect DescriptionRequired Atoms of an Effects DescriptionThere are several required atoms that an effect description must contain. The first is the kParameterWhatNameatom. The kParameterWhatName atom contains the name of the effect. This specifies which of the availableeffects to use.The code snippet shown in Listing 6-10 (page 338) adds a kParameterWhatName atom to the atom containereffectDescription. The constant kCrossFadeTransitionType contains the name of the cross-fadeeffect.Listing 6-10Adding a kParameterWhatName atom to the atom container effectDescriptioneffectCode = kCrossFadeTransitionType;QTInsertChild(effectDescription, kParentAtomIsContainer,kParameterWhatName, kParameterWhatID, 0,sizeof(effectCode), &effectCode, nil);In addition to the kParameterWhatName atom, the effect description for an effect that uses sources mustcontain one or more kEffectSourceName atoms. Each of these atoms contains the name of one of the effect’ssources. An input map is used to map these names to the actual tracks of the movie that are the sources.“Creating an Input Map” (page 340) describes how to create the input map.Parameter Atoms of an Effects DescriptionIn addition to the required atoms, the effects description contains a variable number of parameter atoms. Thenumber and types of parameter atoms vary from effect to effect. For example, the cross fade effect has onlyone parameter, while the general convolution filter effect has nine. Some effects have no parameters at all,and do not require any parameter atoms.You can obtain the list of parameter atoms for a given effect by calling the effect component usingImageCodecGetParameterList. The parameter description atoms it returns include default settings foreach parameter in the form of parameter atoms that you can insert into your effect description.The QTInsertChild function is used to add these parameters to the effect description, as seen in the codeexample in Listing 6-10 (page 338).Consider, for instance, the push effect. Its effect description contains a kParameterWhatName atom, twokEffectSourceName atoms, and two parameter atoms, one of which is a tween.The kParameterWhatName atom specifies that this is a 'push' effect.<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.338

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!