Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
MakePano.h
/* |
File: MakePano.h |
Contains: Code for creating a QuickTime VR panoramic movie from a panoramic image. |
These should work fine, but the API's are currently in flux. |
A later version will be more streamlined and consistent. |
Written by: Ken Turkowski |
Based largely on MakeQTVRPanorama code by Tim Monroe, Ed Harp (and others?). |
Copyright: © 1996-2000 by Apple Computer, Inc. All rights reserved. |
Change History (most recent first): |
<2> 11/24/99 rtm minor clean-up |
<1> 12/01/98 rtm first file |
To Do: |
*/ |
#ifndef __MAKEPANO__ |
#define __MAKEPANO__ |
#ifndef __MOVIES__ |
# include <Movies.h> |
#endif /* __MOVIES__ */ |
#ifdef __cplusplus |
extern "C" { |
#endif /* __cplusplus */ |
typedef struct MakeQTVRParams { |
long tilesH; /* The number of tiles horizontally ... */ |
long tilesV; /* ... and vertically */ |
CodecType tileCodec; /* Codec to be used if compression is needed */ |
CodecQ tileQuality; /* Quality of compression to be used */ |
char *sceneName; /* Optional name to give to the whole scene */ |
char *nodeName; /* Optional name to give to this node */ |
CodecQ dynamicQuality; /* Rendering quality to use during panning */ |
CodecQ staticQuality; /* Rendering quality to use after panning */ |
TimeValue trackDuration; /* 7200, 3600, or other suitable number */ |
/* Media limits - in degrees */ |
long wraps; /* The panorama wraps around - or not */ |
float minPan; |
float maxPan; |
float minTilt; |
float maxTilt; |
float minFieldOfView; |
float maxFieldOfView; |
/* Initial view */ |
float defaultPan; /* Pan angle at center of window */ |
float defaultTilt; |
float defaultFieldOfView; |
long windowWidth; /* Width of the desired viewing window */ |
long windowHeight; /* Height of the desired viewing window */ |
} MakeQTVRParams; |
/******************************************************************************** |
******************************************************************************** |
******************************************************************************** |
*** Cylindrical movies to cylindrical panorama movies |
******************************************************************************** |
******************************************************************************** |
********************************************************************************/ |
/******************************************************************************** |
* Cylindrical movie to cylindrical panorama movie version 1 |
* |
* NOT RECOMMENDED - Use VRMovieToQTVRCylPano2v0 or VRMovieToQTVRCylPano2h0 instead. |
********************************************************************************/ |
OSErr VRMovieToQTVRCylPano1x0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcTileSpec, /* Cylindrical tile movie for the panoramic image */ |
FSSpec *srcHSTileSpec, /* Cylindrical tile movie for the hot spot image */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cylindrical movie to cylindrical panorama movie version 2V - rotated source and tiles |
* |
* This converts a tile movie to a cylindrical QuickTime VR movie. |
* An optional hot spot tile movie and/or fast start movie can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The tiles are assumed to be rotated 90 degrees counter-clockwise (i.e. up is to the left). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the vertical |
* dimension (circumference) is larger than the horizontal (axis). |
********************************************************************************/ |
OSErr VRMovieToQTVRCylPano2v0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcTileSpec, /* Cylindrical tile movie for the panoramic image */ |
FSSpec *srcHSTileSpec, /* Cylindrical tile movie for the hot spot image */ |
FSSpec *srcFSTileSpec, /* Cylindrical tile movie for the fast start image */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cylindrical movie to cylindrical panorama movie version 2H - non-rotated source and tiles |
* |
* This converts a tile movie to a cylindrical QuickTime VR movie. |
* An optional hot spot tile movie and/or fast start movie can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The images are assumed to be in normal orientation (i.e. up is toward the top - not rotated). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the horizontal |
* dimension (circumference) is larger than the vertical (axis). |
********************************************************************************/ |
OSErr VRMovieToQTVRCylPano2h0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcTileSpec, /* Cylindrical tile movie for the panoramic image */ |
FSSpec *srcHSTileSpec, /* Cylindrical tile movie for the hot spot image */ |
FSSpec *srcFSTileSpec, /* Cylindrical tile movie for the fast start image */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
******************************************************************************** |
******************************************************************************** |
*** Cylindrical image files to cylindrical panorama movies |
******************************************************************************** |
******************************************************************************** |
********************************************************************************/ |
/******************************************************************************** |
* Cylindrical image to vertical (rotated) QuickTime VR |
* |
* This converts a cylindrical image file to a cylindrical QuickTime VR movie. |
* An optional hot spot image file and/or fast start image file can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The images are assumed to be rotated 90 degrees counter-clockwise (i.e. up is to the left). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the vertical |
* dimension (circumference) is larger than the horizontal (axis). |
********************************************************************************/ |
OSErr VRPictToQTVRCylPano2v0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcPictSpec, /* Source image, rotated 90 degrees counter-clockwise (classic orientation) */ |
FSSpec *srcHSPictSpec, /* Hot spot image, rotated 90 degrees counter-clockwise (classic orientation) */ |
FSSpec *srcFSPictSpec, /* Fast start image, rotated 90 degrees counter-clockwise (classic orientation) */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cylindrical image to horizontal QuickTime VR |
* |
* This converts a cylindrical image file to a cylindrical QuickTime VR movie. |
* An optional hot spot image file and/or fast start image file can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The images are assumed to be in normal orientation (i.e. up is toward the top - not rotated). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the horizontal |
* dimension (circumference) is larger than the vertical (axis). |
********************************************************************************/ |
OSErr VRPictToQTVRCylPano2h0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcPictSpec, /* Source image, non-rotated (modern orientation) */ |
FSSpec *srcHSPictSpec, /* Hot spot image, non-rotated (modern orientation) */ |
FSSpec *srcFSPictSpec, /* Fast start image, non-rotated (modern orientation) */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
******************************************************************************** |
******************************************************************************** |
*** Cylindrical GWorlds to cylindrical panorama movies |
******************************************************************************** |
******************************************************************************** |
********************************************************************************/ |
/******************************************************************************** |
* Cylindrical GWorld to vertical (rotated) QuickTime VR |
* |
* This converts a cylindrical GWorld to a cylindrical QuickTime VR movie. |
* An optional hot spot GWorld and/or fast start GWorld can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The images are assumed to be rotated 90 degrees counter-clockwise (i.e. up is to the left). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the vertical |
* dimension (circumference) is larger than the horizontal (axis). |
********************************************************************************/ |
OSErr VRGWorldToQTVRCylPano2v0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
GWorldPtr srcGW, /* Source GWorld, rotated 90 degrees counter-clockwise (classic orientation) */ |
GWorldPtr srcHSGW, /* Source hot spot GWorld, rotated 90 degrees counter-clockwise (classic orientation) */ |
GWorldPtr srcFSGW, /* Source fast start GWorld, rotated 90 degrees counter-clockwise (classic orientation) */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cylindrical GWorld to horizontal QuickTime VR |
* |
* This converts a cylindrical GWorld to a cylindrical QuickTime VR movie. |
* An optional hot spot GWorld and/or fast start GWorld can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* The images are assumed to be in normal orientation (i.e. up is toward the top - not rotated). |
* For a wrapping panoramic image of VFOV < 145 degrees, this means that the horizontal |
* dimension (circumference) is larger than the vertical (axis). |
********************************************************************************/ |
OSErr VRGWorldToQTVRCylPano2h0( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
GWorldPtr srcGW, /* Source GWorld, non-rotated (modern orientation) */ |
GWorldPtr srcHSGW, /* Source hot spot GWorld, non-rotated (modern orientation) */ |
GWorldPtr srcFSGW, /* Source fast start GWorld, non-rotated (modern orientation) */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
******************************************************************************** |
******************************************************************************** |
*** Cubic movies/pictures/GWorlds to cubic panorama movies |
******************************************************************************** |
******************************************************************************** |
********************************************************************************/ |
/******************************************************************************** |
* Cubic movies to cubic panorama movies |
* |
* This converts a movie with 6 frames into a cubic QuickTime VR panorama movie. |
* An optional hot spot movie and/or fast start movie can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
********************************************************************************/ |
OSErr VRMovieToQTVRCubicPano( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec *srcFramesSpec, /* Source movie with the panorama faces */ |
FSSpec *srcHSFramesSpec, /* Source movie with the hot spot faces */ |
FSSpec *srcFSFramesSpec, /* Source movie with the fast start faces */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cubic picture files to cubic panorama movies |
* |
* This converts a set of 6 picture files to a cubic QuickTime VR panorama movie. |
* An optional hot spot picture files and/or fast start picture files can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* There are certain restrictions on sizes for tiling: |
* Adjacent tiles duplicate their edges, therefore the GW size should be evenly |
* divisible into tiles, taking this overlap into account. Tile size is: |
* t = (f + n - 1) / n, where |
* t is the tile size (width or height), |
* f is the face size (width or height - same as above), |
* n is the number of tiles in that dimension (width or height) |
* e.g. a 767x767 face is divided into 4=2x2 tiles of size 384x384 |
* a 766x766 face is divided into 9=3x3 tiles of size 256x256. |
********************************************************************************/ |
OSErr VRPictsToQTVRCubicPano( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
FSSpec **srcPictSpecs, /* Source images */ |
FSSpec **srcHSPictSpecs, /* Hot spot images */ |
FSSpec **srcFSPictSpecs, /* Fast start images */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
/******************************************************************************** |
* Cubic GWorlds to cubic panorama movies |
* |
* This converts a set of 6 GWorlds to a cubic QuickTime VR panorama movie. |
* An optional hot spot GWorlds and/or fast start GWorlds can also be specified. |
* The window dimensions, tiling, track duration, compression codec, |
* compression qualities and rendering qualities (static and dynamic) are mandatory. |
* |
* There are certain restrictions on sizes for tiling: |
* Adjacent tiles duplicate their edges, therefore the GW size should be evenly |
* divisible into tiles, taking this overlap into account. Tile size is: |
* t = (f + n - 1) / n, where |
* t is the tile size (width or height), |
* f is the face size (width or height - same as above), |
* n is the number of tiles in that dimension (width or height) |
* e.g. a 767x767 face is divided into 4=2x2 tiles of size 384x384 |
* a 766x766 face is divided into 9=3x3 tiles of size 256x256. |
********************************************************************************/ |
OSErr VRGWorldsToQTVRCubicPano( |
MakeQTVRParams *qtvrParams, /* Parameters used to create the movie */ |
GWorldPtr *srcGWs, /* Source GWorlds - in standard order */ |
GWorldPtr *srcHSGWs, /* Source hot spot GWorlds - in standard order */ |
GWorldPtr *srcFSGWs, /* Source fast start GWorlds - in standard order */ |
FSSpec *dstMovieSpec /* Destination movie */ |
); |
#ifdef __cplusplus |
} |
#endif /* __cplusplus */ |
#endif /* __MAKEPANO__ */ |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14