Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Atom Types

The following constants represent atom types for sprite media:

enum {
    kSpriteAtomType                     = 'sprt',
    kSpriteImagesContainerAtomType      = 'imct',
    kSpriteImageAtomType                = 'imag',
    kSpriteImageDataAtomType            = 'imda',
    kSpriteImageDataRefAtomType         = 'imre',
    kSpriteImageDataRefTypeAtomType     = 'imrt',
    kSpriteImageGroupIDAtomType         = 'imgr',
    kSpriteImageRegistrationAtomType    = 'imrg',
    kSpriteImageDefaultImageIndexAtomType ='defi',
    kSpriteSharedDataAtomType           = 'dflt',
    kSpriteNameAtomType                 = 'name',
    kSpriteImageNameAtomType            = 'name',
    kSpriteUsesImageIDsAtomType         = 'uses',
    kSpriteBehaviorsAtomType            = 'beha',
    kSpriteImageBehaviorAtomType        = 'imag',
    kSpriteCursorBehaviorAtomType       = 'crsr',
    kSpriteStatusStringsBehaviorAtomType = 'sstr',
    kSpriteVariablesContainerAtomType    = 'vars',
    kSpriteStringVariableAtomType        = 'strv',
    kSpriteFloatingPointVariableAtomType = 'flov'
    kSpriteSharedDataAtomType           = 'dflt',
    kSpriteURLLinkAtomType              = 'url '
    kSpritePropertyMatrix               = 1
    kSpritePropertyVisible              = 4
    kSpritePropertyLayer                = 5
    kSpritePropertyGraphicsMode         = 6
    kSpritePropertyImageIndex           = 100
    kSpritePropertyBackgroundColor      = 101
    kSpritePropertyOffscreenBitDepth    = 102
    kSpritePropertySampleFormat         = 103
};
Constant descriptions
kSpriteAtomType

The atom is a parent atom that describes a sprite. It contains atoms that describe properties of the sprite. Optionally, it may also include an atom of type kSpriteNameAtomType that defines the name of the sprite.

kSpriteImagesContainerAtomType

The atom is a parent atom that contains atoms of type kSpriteImageAtomType.

kSpriteImageAtomType

The atom is a parent atom that contains an atom of type kSpriteImageDataAtomType. Optionally, it may also include an atom of type kSpriteNameAtomType that defines the name of the image.

kSpriteImageDataAtomType

The atom is a leaf atom that contains image data.

kSpriteSharedDataAtomType

The atom is a parent atom that contains shared sprite data, such as an atom container of type kSpriteImagesContainerAtomType.

kSpriteNameAtomType

The atom is a leaf atom that contains the name of a sprite or an image. The leaf data is composed of one or more ASCII characters.

kSpritePropertyImageIndex

A leaf atom containing the image index property which is of type short. This atom is a child atom of kSpriteAtom.

kSpritePropertyLayer

A leaf atom containing the layer property which is of type short. This atom is a child atom of kSpriteAtom.

kSpritePropertyMatrix

A leaf atom containing the matrix property which is of type MatrixRecord. This atom is a child atom of kSpriteAtom.

kSpritePropertyVisible

A leaf atom containing the visible property which is of type short. This atom is a child atom of kSpriteAtom.

kSpritePropertyGraphicsMode

A leaf atom containing the graphics mode property which is of type ModifyerTrackGraphicsModeRecord. This atom is a child atom of kSpriteAtom.

kSpritePropertyBackgroundColor

A leaf atom containing the background color property which is of type RGBColor. This atom is used in a sprite track’s MediaPropertyAtom atom container.

kSpritePropertyOffscreenBitDepth

A leaf atom containing the preferred offscreen bitdepth which is of type short. This atom is used in a sprite track’s MediaPropertyAtom atom container.

kSpritePropertySampleFormat

A leaf atom containing the sample format property, which is of type short. This atom is used in a sprite track’s MediaPropertyAtom atom container.

kSpriteImageRegistrationAtomType

Sprite images have a default registration point of 0, 0. To specify a different point, add an atom of type kSpriteImageRegistrationAtomType as a child atom of the kSpriteImageAtomType and set its leaf data to a FixedPoint value with the desired registration point.

kSpriteImageGroupIDAtomType

You must assign group IDs to sets of equivalent images in your key frame sample. For example, if the sample contains ten images where the first two images are equivalent, and the last eight images are equivalent, then you could assign a group ID of 1000 to the first two images, and a group ID of 1001 to the last eight images. This divides the images in the sample into two sets. The actual ID does not matter, it just needs to be a unique positive integer.

Each image in a sprite media key frame sample is assigned to a group. Add an atom of type kSpriteImageGroupIDAtomType as a child of the kSpriteImageAtomType atom and set its leaf data to a long containing the group ID.

Important:  You must assign group IDs to your sprite sample if you want a sprite to display images with non-equivalent image descriptions (i.e., images with different dimensions).

For each of the following atom types (added to QuickTime 4)––except kSpriteBehaviorsAtomType––you fill in the structure QTSpriteButtonBehaviorStruct, which contains a value for each of the four states.

kSpriteBehaviorsAtomType

This is the parent atom of kSpriteImageBehaviorAtomType, kSpriteCursorBehaviorAtomType, and kSpriteStatusStringsBehaviorAtomType.

kSpriteImageBehaviorAtomType

Specifies the imageIndex.

kSpriteCursorBehaviorAtomType

Specifies the cursorID.

kSpriteStatusStringsBehaviorAtomType

Specifies an ID of a string variable contained in a sprite track to display in the status area of the browser.

Note: All sprite media—specifically the leaf data in the QT atom containers for sample and sprite track properties—should be written in big-endian format.

kSpriteUsesImageIDsAtomType

This atom allows a sprite to specify which images it uses—in other words, the subset of images that its imageIndex property can refer to.

You add an atom of type kSpriteUsesImageIDsAtomType as a child of a kSpriteAtomType atom, setting its leaf data to an array of QT atom IDs. This array contains the IDs of the images used, not the indices.

Although QuickTime does not currently use this atom internally, tools that edit sprite media can use the information provided to optimize certain operations, such as cut, copy, and paste.

kSpriteImageRegistrationAtomType

Sprite images have a default registration point of 0, 0. To specify a different point, you add an atom of type kSpriteImageRegistrationAtomType as a child atom of the kSpriteImageAtomType and set its leaf data to a FixedPoint value with the desired registration point.

kSpriteImageGroupIDAtomType

You must assign group IDs to sets of equivalent images in your key frame sample. For example, if the sample contains ten images where the first two images are equivalent, and the last eight images are equivalent, then you could assign a group ID of 1000 to the first two images, and a group ID of 1001 to the last eight images. This divides the images in the sample into two sets. The actual ID does not matter; it just needs to be a unique positive integer.

Each image in a sprite media key frame sample is assigned to a group. You add an atom of type kSpriteImageGroupIDAtomType as a child of the kSpriteImageAtomType atom and set its leaf data to a long containing the group ID.

Important:  You must assign group IDs to your sprite sample if you want a sprite to display images with non-equivalent image descriptions (that is, images with different dimensions).

You use the following atom types, which were added to QuickTime 4, to specify that an image is referenced and how to access it.

kSpriteImageDataRefAtomType

Add this atom as a child of the kSpriteImageAtomType atom instead of a kSpriteImageDataAtomType. Its ID should be 1. Its data should contain the data reference (similar to the dataRef parameter of GetDataHandler).

kSpriteImageDataRefTypeAtomType

Add this atom as a child of the kSpriteImageAtomType atom. Its ID should be 1. Its data should contain the data reference type (similar to the dataRefType parameter of GetDataHandler).

kSpriteImageDefaultImageIndexAtomType

You may optionally add this atom as a child of the kSpriteImageAtomType atom. Its ID should be 1. Its data should contain a short, which specifies an image index of a traditional image to use while waiting for the referenced image to load.

The following constants represent formats of a sprite track. The value of the constant indicates how override samples in a sprite track should be interpreted. You set a sprite track’s format by creating a kSpriteTrackPropertySampleFormat atom.

enum {
    kKeyFrameAndSingleOverride      = 1L << 1,
    kKeyFrameAndAllOverrides        = 1L << 2
};
Constant descriptions
kKeyFrameAndSingleOverride

The current state of the sprite track is defined by the most recent key frame sample and the current override sample. This is the default format.

kKeyFrameAndAllOverrides

The current state of the sprite track is defined by the most recent key frame sample and all subsequent override samples up to and including the current override sample.



< Previous PageNext Page > Hide TOC


Last updated: 2007-09-04




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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice