Sprite
media is used to store character-based animation data in QuickTime
movies. It has a media type of 'sprt'.
Sprite Sample Description
Sprite Sample Data
The sprite sample description uses the standard sample description header, as described in “Sample Description Atoms.”
The data format field in the sample description is always
set to 'sprt'.
The sprite media handler adds no additional fields to the sample
description.
All sprite samples are stored in QT atom structures. The sprite media uses both key frames and differenced frames. The key frames contain all of the sprite’s image data, and the initial settings for each of the sprite’s properties.
A key frame always contains a shared data atom of type 'dflt'.
This atom contains data to be shared between the sprites, consisting
mainly of image data and sample descriptions. The shared data atom
contains a single sprite image container atom, with an atom type value
of 'imct' and an ID value
of 1.
The sprite image container atom stores one or more sprite
image atoms of type 'imag'. Each
sprite image atom contains an image sample description immediately
followed by the sprite’s compressed image data. The sprite image
atoms should have ID numbers starting at 1 and counting consecutively
upward.
The key frame also must contain definitions for each sprite
in atoms of type 'sprt'.
Sprite atoms should have ID numbers start at 1 and count consecutively
upward. Each sprite atom contains a list of properties. Table 3-9 shows
all currently defined sprite properties.
Property name |
Value |
Description |
|---|---|---|
|
1 |
Describes the sprite’s location and scaling within its sprite world or sprite track. By modifying a sprite’s matrix, you can modify the sprite’s location so that it appears to move in a smooth path on the screen or so that it jumps from one place to another. You can modify a sprite’s size, so that it shrinks, grows, or stretches. Depending on which image compressor is used to create the sprite images, other transformations, such as rotation, may be supported as well. Translation-only matrices provide the best performance. |
|
4 |
Specifies whether or not the sprite is visible. To make
a sprite visible, you set the sprite’s visible property to |
|
5 |
Contains a 16-bit integer value specifying the layer
into which the sprite is to be drawn. Sprites with lower layer numbers
appear in front of sprites with higher layer numbers. To designate
a sprite as a background sprite, you should assign it the special layer
number |
|
6 |
Specifies a graphics mode and blend color that indicates
how to blend a sprite with any sprites behind it and with the background.
To set a sprite’s graphics mode, you call |
|
8 |
Specifies another sprite by ID that delegates QT events. |
|
100 |
Contains the atom ID of the sprite’s image atom. |
The override sample differs from the key frame sample in two ways. First, the override sample does not contain a shared data atom. All shared data must appear in the key frame. Second, only those sprite properties that change need to be specified. If none of a sprite’s properties change in a given frame, then the sprite does not need an atom in the differenced frame.
The override sample can be used in one of two ways: combined, as with video key frames, to construct the current frame; or the current frame can be derived by combining only the key frame and the current override sample.
Refer to the section “Sprite Track Media Format” for
information on how override samples are indicated in the file, using kSpriteTrackPropertySampleFormat and
the default behavior of the kKeyFrameAndSingleOverride format.
Last updated: 2007-09-04