ADC Home > Reference Library > Technical Q&As > QuickTime > Video Effects & Transitions >

QuickTime Effects - How to set up parameter description values when using kParameterTypeDataImage


Q: I'm trying to use the effect parameter data type kParameterTypeDataImage in my QuickTime Effect, but I can't find any documentation on how to set up the values for the kParameterDataDefaultItem, kParameterDataBehavior and kParameterDataRange atoms with this specific data type.

A: An effect parameter kParameterDataType atom defines the type of data for a specific effect parameter. The data type kParameterTypeDataImage specifies a reference to image data.

When using kParameterTypeDataImage as the parameter data type, the following guidelines should be used for setting up the associated parameter description atoms:

  • kParameterDataRange - this is an ImageRangeRecord and defines the legal range of values the specified effect parameter can take. The first field of this record is imageFlags and should be set to 0 ( zero ). This value is defined as the constant kParameterImageNoFlags.

  • kParameterDataBehavior - this atom suggests how the effect parameter should be displayed by the client application. It's first field is behaviorType and should be set to kParameterItemDragImage, this allows the image to be changed by dragging a new image onto the control. The behaviorFlags field should be 0 ( kParameterImageNoFlags ).

  • kParameterDataDefaultItem - this atom contains the default value for the parameter and must either be 3 short values specifying a solid color, or PICT image data.

    If the size of the default item ( kParameterDataDefaultItem ) is less than the minimum size of a Picture ( < 10 bytes - see QuickDraw.h ), QuickTime will assume the data is a solid color when creating the default image.

    If the size of the default item ( kParameterDataDefaultItem ) is greater than the minimum size of a Picture ( > 10 bytes - see QuickDraw.h ), QuickTime will assume the item contains valid PICT data to be used as the default image.

These constants can be found in ImageCodec.h along with the other effect parameter records, flags and values.

The listings below demonstrate how QuickTime sets up the associated parameter atoms when the data type is kParameterTypeDataImage, listing 1 as the ripple mask for the "Ripple" effect and listing 2 as the matte for the "Gradient Wipe" effect.

Listing 1. kParameterTypeDataImage for Ripple Effect

// --------------------
    // mask
    kParameterAtomTypeAndID, 104, noChildren,
    {
        OSType { "mask" };
        long { "1" };
        kAtomNotInterpolated;
        string { "Ripple mask" };
    };
    
    kParameterDataType, 104, noChildren,
    {
        kParameterTypeDataImage;
    };
                
    kParameterDataRange, 104, noChildren,
    {
        long { "0" };
    };

    kParameterDataBehavior, 104, noChildren,
    {
        kParameterItemDragImage;
        long { "0" };
    };
        
    kParameterDataDefaultItem, 104, noChildren,
    {
        short { "0" }; // black as shorts
        short { "0" }; // black as shorts
        short { "0" }; // black as shorts
    };

Listing 2. kParameterTypeDataImage for Gradient Wipe Effect.

// --------------------
    // matt
    kParameterAtomTypeAndID, 104, noChildren,
    {
        OSType { "matt" };
        long { "1" };
        kAtomNotInterpolated;
        string { "Matte" };
    };
    
    kParameterDataType, 104, noChildren,
    {
        kParameterTypeDataImage;
    };
                
    kParameterDataRange, 104, noChildren,
    {
        long { "0" };
    };

    kParameterDataBehavior, 104, noChildren,
    {
        kParameterItemDragImage;
        long { "0" };
    };
        
    kParameterDataDefaultItem, 104, noChildren,
    { // PICT
        lstring { 
        $"129A 0000 0000 0100 0155 0011 02FF 0C00" /*.?.......U...?.. */
        $"FFFE 0000 0048 0000 0048 0000 0000 0000" /*??...H...H...... */
        $"0100 0155 0000 0000 00A1 01F2 0016 3842" /*...U.....°.Ú..8B */
        $"494D 0000 0000 0000 0100 0155 4772 8970" /*IM.........UGr?p */
        $"68AF 626A 0001 000A 0000 0000 0100 0155" /*hÿbj...........U */
        $"0098 8158 0000 0000 0100 0155 0000 0000" /*.ÚÅX.......U.... */
        $"0000 0000 0048 0000 0048 0000 0000 0008" /*.....H...H...... */
        $"0001 0008 0000 0000 0000 0000 0000 0000" /*................ */
        $"0000 0028 0000 00FF 0000 FFFF FFFF FFFF" /*...(...?..?????? */
        $"0001 FEFE FEFE FEFE 0002 FDFD FDFD FDFD" /*..??????..?????? */
        $"0003 FCFC FCFC FCFC 0004 FBFB FBFB FBFB" /*..      ..?????? */
        $"0005 FAFA FAFA FAFA 0006 F9F9 F9F9 F9F9" /*..??????..?????? */
        $"0007 F8F8 F8F8 F8F8 0008 F7F7 F7F7 F7F7" /*..ØØØØØØ..òòòòòò */
        $"0009 F6F6 F6F6 F6F6 000A F5F5 F5F5 F5F5" /*.?àààààà..?????? */
        $"000B F4F4 F4F4 F4F4 000C F3F3 F3F3 F3F3" /*..??????..ÛÛÛÛÛÛ */
        $"000D F2F2 F2F2 F2F2 000E F1F1 F1F1 F1F1" /*.¨ÚÚÚÚÚÚ..?????? */
        $"000F F0F0 F0F0 F0F0 0010 EFEF EFEF EFEF" /*..??????..       */

     ... PICT DATA CONTINUES ...

       $"0006 8100 8100 A900 00FF"                 /* ..Å.Å.©..? */
       };
    };

References:


[Dec 09, 2003]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.