Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

539 lines
20 KiB

  1. /*
  2. File: QuickTimeVRFormat.h
  3. Contains: QuickTime VR interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1997-2007 by Apple Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __QUICKTIMEVRFORMAT__
  11. #define __QUICKTIMEVRFORMAT__
  12. #ifndef __CONDITIONALMACROS__
  13. #include <ConditionalMacros.h>
  14. #endif
  15. #ifndef __MOVIES__
  16. #include <Movies.h>
  17. #endif
  18. #ifndef __QUICKTIMEVR__
  19. #include <QuickTimeVR.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. /* QuickTime is not available to 64-bit clients */
  38. #if !__LP64__
  39. /* File Format Version numbers */
  40. #define kQTVRMajorVersion (2)
  41. #define kQTVRMinorVersion (0)
  42. /* User data type for the Movie Controller type specifier*/
  43. enum {
  44. kQTControllerType = kQTVRControllerSubType, /* Atom & ID of where our*/
  45. kQTControllerID = 1 /* ...controller name is stored*/
  46. };
  47. /* VRWorld atom types*/
  48. enum {
  49. kQTVRWorldHeaderAtomType = FOUR_CHAR_CODE('vrsc'),
  50. kQTVRImagingParentAtomType = FOUR_CHAR_CODE('imgp'),
  51. kQTVRPanoImagingAtomType = FOUR_CHAR_CODE('impn'),
  52. kQTVRObjectImagingAtomType = FOUR_CHAR_CODE('imob'),
  53. kQTVRNodeParentAtomType = FOUR_CHAR_CODE('vrnp'),
  54. kQTVRNodeIDAtomType = FOUR_CHAR_CODE('vrni'),
  55. kQTVRNodeLocationAtomType = FOUR_CHAR_CODE('nloc'),
  56. kQTVRCursorParentAtomType = FOUR_CHAR_CODE('vrcp'), /* New with 2.1*/
  57. kQTVRCursorAtomType = FOUR_CHAR_CODE('CURS'), /* New with 2.1*/
  58. kQTVRColorCursorAtomType = FOUR_CHAR_CODE('crsr') /* New with 2.1*/
  59. };
  60. /* NodeInfo atom types*/
  61. enum {
  62. kQTVRNodeHeaderAtomType = FOUR_CHAR_CODE('ndhd'),
  63. kQTVRHotSpotParentAtomType = FOUR_CHAR_CODE('hspa'),
  64. kQTVRHotSpotAtomType = FOUR_CHAR_CODE('hots'),
  65. kQTVRHotSpotInfoAtomType = FOUR_CHAR_CODE('hsin'),
  66. kQTVRLinkInfoAtomType = FOUR_CHAR_CODE('link')
  67. };
  68. /* Miscellaneous atom types*/
  69. enum {
  70. kQTVRStringAtomType = FOUR_CHAR_CODE('vrsg'),
  71. kQTVRStringEncodingAtomType = FOUR_CHAR_CODE('vrse'), /* New with 2.1*/
  72. kQTVRPanoSampleDataAtomType = FOUR_CHAR_CODE('pdat'),
  73. kQTVRObjectInfoAtomType = FOUR_CHAR_CODE('obji'),
  74. kQTVRImageTrackRefAtomType = FOUR_CHAR_CODE('imtr'), /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  75. kQTVRHotSpotTrackRefAtomType = FOUR_CHAR_CODE('hstr'), /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  76. kQTVRAngleRangeAtomType = FOUR_CHAR_CODE('arng'),
  77. kQTVRTrackRefArrayAtomType = FOUR_CHAR_CODE('tref'),
  78. kQTVRPanConstraintAtomType = FOUR_CHAR_CODE('pcon'),
  79. kQTVRTiltConstraintAtomType = FOUR_CHAR_CODE('tcon'),
  80. kQTVRFOVConstraintAtomType = FOUR_CHAR_CODE('fcon'),
  81. kQTVRCubicViewAtomType = FOUR_CHAR_CODE('cuvw'), /* New with 5.0*/
  82. kQTVRCubicFaceDataAtomType = FOUR_CHAR_CODE('cufa') /* New with 5.0*/
  83. };
  84. enum {
  85. kQTVRObjectInfoAtomID = 1,
  86. kQTVRObjectImageTrackRefAtomID = 1, /* New with 2.1, it adds a track reference to select between multiple image tracks*/
  87. kQTVRObjectHotSpotTrackRefAtomID = 1 /* New with 2.1, it adds a track reference to select between multiple hotspot tracks*/
  88. };
  89. /* Track reference types*/
  90. enum {
  91. kQTVRImageTrackRefType = FOUR_CHAR_CODE('imgt'),
  92. kQTVRHotSpotTrackRefType = FOUR_CHAR_CODE('hott')
  93. };
  94. /* Old hot spot types*/
  95. enum {
  96. kQTVRHotSpotNavigableType = FOUR_CHAR_CODE('navg')
  97. };
  98. /* Valid bits used in QTVRLinkHotSpotAtom*/
  99. enum {
  100. kQTVRValidPan = 1L << 0,
  101. kQTVRValidTilt = 1L << 1,
  102. kQTVRValidFOV = 1L << 2,
  103. kQTVRValidViewCenter = 1L << 3
  104. };
  105. /* Values for flags field in QTVRPanoSampleAtom*/
  106. enum {
  107. kQTVRPanoFlagHorizontal = 1L << 0,
  108. kQTVRPanoFlagLast = 1L << 31
  109. };
  110. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  111. enum {
  112. kQTVRSameFile = 0
  113. };
  114. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  115. struct QTVRSampleDescription {
  116. UInt32 descSize; /* total size of the QTVRSampleDescription*/
  117. UInt32 descType; /* must be 'qtvr'*/
  118. UInt32 reserved1; /* must be zero*/
  119. UInt16 reserved2; /* must be zero*/
  120. UInt16 dataRefIndex; /* must be zero*/
  121. UInt32 data; /* Will be extended to hold vrWorld QTAtomContainer*/
  122. };
  123. typedef struct QTVRSampleDescription QTVRSampleDescription;
  124. typedef QTVRSampleDescription * QTVRSampleDescriptionPtr;
  125. typedef QTVRSampleDescriptionPtr * QTVRSampleDescriptionHandle;
  126. /*
  127. =================================================================================================
  128. Definitions and structures used in the VRWorld QTAtomContainer
  129. -------------------------------------------------------------------------------------------------
  130. */
  131. struct QTVRStringAtom {
  132. UInt16 stringUsage;
  133. UInt16 stringLength;
  134. unsigned char theString[4]; /* field previously named "string"*/
  135. };
  136. typedef struct QTVRStringAtom QTVRStringAtom;
  137. typedef QTVRStringAtom * QTVRStringAtomPtr;
  138. struct QTVRWorldHeaderAtom {
  139. UInt16 majorVersion;
  140. UInt16 minorVersion;
  141. QTAtomID nameAtomID;
  142. UInt32 defaultNodeID;
  143. UInt32 vrWorldFlags;
  144. UInt32 reserved1;
  145. UInt32 reserved2;
  146. };
  147. typedef struct QTVRWorldHeaderAtom QTVRWorldHeaderAtom;
  148. typedef QTVRWorldHeaderAtom * QTVRWorldHeaderAtomPtr;
  149. /* Valid bits used in QTVRPanoImagingAtom*/
  150. enum {
  151. kQTVRValidCorrection = 1L << 0,
  152. kQTVRValidQuality = 1L << 1,
  153. kQTVRValidDirectDraw = 1L << 2,
  154. kQTVRValidFirstExtraProperty = 1L << 3
  155. };
  156. struct QTVRPanoImagingAtom {
  157. UInt16 majorVersion;
  158. UInt16 minorVersion;
  159. UInt32 imagingMode;
  160. UInt32 imagingValidFlags;
  161. UInt32 correction;
  162. UInt32 quality;
  163. UInt32 directDraw;
  164. UInt32 imagingProperties[6]; /* for future properties*/
  165. UInt32 reserved1;
  166. UInt32 reserved2;
  167. };
  168. typedef struct QTVRPanoImagingAtom QTVRPanoImagingAtom;
  169. typedef QTVRPanoImagingAtom * QTVRPanoImagingAtomPtr;
  170. struct QTVRNodeLocationAtom {
  171. UInt16 majorVersion;
  172. UInt16 minorVersion;
  173. OSType nodeType;
  174. UInt32 locationFlags;
  175. UInt32 locationData;
  176. UInt32 reserved1;
  177. UInt32 reserved2;
  178. };
  179. typedef struct QTVRNodeLocationAtom QTVRNodeLocationAtom;
  180. typedef QTVRNodeLocationAtom * QTVRNodeLocationAtomPtr;
  181. /*
  182. =================================================================================================
  183. Definitions and structures used in the Nodeinfo QTAtomContainer
  184. -------------------------------------------------------------------------------------------------
  185. */
  186. struct QTVRNodeHeaderAtom {
  187. UInt16 majorVersion;
  188. UInt16 minorVersion;
  189. OSType nodeType;
  190. QTAtomID nodeID;
  191. QTAtomID nameAtomID;
  192. QTAtomID commentAtomID;
  193. UInt32 reserved1;
  194. UInt32 reserved2;
  195. };
  196. typedef struct QTVRNodeHeaderAtom QTVRNodeHeaderAtom;
  197. typedef QTVRNodeHeaderAtom * QTVRNodeHeaderAtomPtr;
  198. struct QTVRAngleRangeAtom {
  199. Float32 minimumAngle;
  200. Float32 maximumAngle;
  201. };
  202. typedef struct QTVRAngleRangeAtom QTVRAngleRangeAtom;
  203. typedef QTVRAngleRangeAtom * QTVRAngleRangeAtomPtr;
  204. struct QTVRHotSpotInfoAtom {
  205. UInt16 majorVersion;
  206. UInt16 minorVersion;
  207. OSType hotSpotType;
  208. QTAtomID nameAtomID;
  209. QTAtomID commentAtomID;
  210. SInt32 cursorID[3];
  211. /* canonical view for this hot spot*/
  212. Float32 bestPan;
  213. Float32 bestTilt;
  214. Float32 bestFOV;
  215. QTVRFloatPoint bestViewCenter;
  216. /* Bounding box for this hot spot*/
  217. Rect hotSpotRect;
  218. UInt32 flags;
  219. UInt32 reserved1;
  220. UInt32 reserved2;
  221. };
  222. typedef struct QTVRHotSpotInfoAtom QTVRHotSpotInfoAtom;
  223. typedef QTVRHotSpotInfoAtom * QTVRHotSpotInfoAtomPtr;
  224. struct QTVRLinkHotSpotAtom {
  225. UInt16 majorVersion;
  226. UInt16 minorVersion;
  227. UInt32 toNodeID;
  228. UInt32 fromValidFlags;
  229. Float32 fromPan;
  230. Float32 fromTilt;
  231. Float32 fromFOV;
  232. QTVRFloatPoint fromViewCenter;
  233. UInt32 toValidFlags;
  234. Float32 toPan;
  235. Float32 toTilt;
  236. Float32 toFOV;
  237. QTVRFloatPoint toViewCenter;
  238. Float32 distance;
  239. UInt32 flags;
  240. UInt32 reserved1;
  241. UInt32 reserved2;
  242. };
  243. typedef struct QTVRLinkHotSpotAtom QTVRLinkHotSpotAtom;
  244. typedef QTVRLinkHotSpotAtom * QTVRLinkHotSpotAtomPtr;
  245. /*
  246. =================================================================================================
  247. Definitions and structures used in Panorama and Object tracks
  248. -------------------------------------------------------------------------------------------------
  249. */
  250. struct QTVRPanoSampleAtom {
  251. UInt16 majorVersion;
  252. UInt16 minorVersion;
  253. UInt32 imageRefTrackIndex; /* track reference index of the full res image track*/
  254. UInt32 hotSpotRefTrackIndex; /* track reference index of the full res hot spot track*/
  255. Float32 minPan;
  256. Float32 maxPan;
  257. Float32 minTilt;
  258. Float32 maxTilt;
  259. Float32 minFieldOfView;
  260. Float32 maxFieldOfView;
  261. Float32 defaultPan;
  262. Float32 defaultTilt;
  263. Float32 defaultFieldOfView;
  264. /* Info for highest res version of image track*/
  265. UInt32 imageSizeX; /* pixel width of the panorama (e.g. 768)*/
  266. UInt32 imageSizeY; /* pixel height of the panorama (e.g. 2496)*/
  267. UInt16 imageNumFramesX; /* diced frames wide (e.g. 1)*/
  268. UInt16 imageNumFramesY; /* diced frames high (e.g. 24)*/
  269. /* Info for highest res version of hotSpot track*/
  270. UInt32 hotSpotSizeX; /* pixel width of the hot spot panorama (e.g. 768)*/
  271. UInt32 hotSpotSizeY; /* pixel height of the hot spot panorama (e.g. 2496)*/
  272. UInt16 hotSpotNumFramesX; /* diced frames wide (e.g. 1)*/
  273. UInt16 hotSpotNumFramesY; /* diced frames high (e.g. 24)*/
  274. UInt32 flags;
  275. OSType panoType;
  276. UInt32 reserved2;
  277. };
  278. typedef struct QTVRPanoSampleAtom QTVRPanoSampleAtom;
  279. typedef QTVRPanoSampleAtom * QTVRPanoSampleAtomPtr;
  280. /*
  281. View atom for cubes (since same fields in QTVRPanoSampleAtom are set to special
  282. values for backwards compatibility and hence are ignored by the cubic engine)
  283. */
  284. struct QTVRCubicViewAtom {
  285. Float32 minPan;
  286. Float32 maxPan;
  287. Float32 minTilt;
  288. Float32 maxTilt;
  289. Float32 minFieldOfView;
  290. Float32 maxFieldOfView;
  291. Float32 defaultPan;
  292. Float32 defaultTilt;
  293. Float32 defaultFieldOfView;
  294. };
  295. typedef struct QTVRCubicViewAtom QTVRCubicViewAtom;
  296. typedef QTVRCubicViewAtom * QTVRCubicViewAtomPtr;
  297. struct QTVRCubicFaceData {
  298. Float32 orientation[4]; /* WXYZ quaternion of absolute orientation*/
  299. Float32 center[2]; /* Center of image relative to center of projection (default = (0,0)) in normalized units*/
  300. Float32 aspect; /* aspect>1 => tall pixels; aspect <1 => squat pixels (default = 1)*/
  301. Float32 skew; /* skew x by y (default = 0)*/
  302. };
  303. typedef struct QTVRCubicFaceData QTVRCubicFaceData;
  304. typedef QTVRCubicFaceData * QTVRCubicFaceDataPtr;
  305. /* Special resolution values for the Image Track Reference Atoms. Use only one value per track reference.*/
  306. enum {
  307. kQTVRFullTrackRes = kQTVRFullRes,
  308. kQTVRHalfTrackRes = kQTVRHalfRes,
  309. kQTVRQuarterTrackRes = kQTVRQuarterRes,
  310. kQTVRPreviewTrackRes = 0x8000
  311. };
  312. struct QTVRTrackRefEntry {
  313. UInt32 trackRefType;
  314. UInt16 trackResolution;
  315. UInt32 trackRefIndex;
  316. };
  317. typedef struct QTVRTrackRefEntry QTVRTrackRefEntry;
  318. /*
  319. =================================================================================================
  320. Object File format 2.0
  321. -------------------------------------------------------------------------------------------------
  322. */
  323. enum {
  324. kQTVRObjectAnimateViewFramesOn = (1L << 0),
  325. kQTVRObjectPalindromeViewFramesOn = (1L << 1),
  326. kQTVRObjectStartFirstViewFrameOn = (1L << 2),
  327. kQTVRObjectAnimateViewsOn = (1L << 3),
  328. kQTVRObjectPalindromeViewsOn = (1L << 4),
  329. kQTVRObjectSyncViewToFrameRate = (1L << 5),
  330. kQTVRObjectDontLoopViewFramesOn = (1L << 6),
  331. kQTVRObjectPlayEveryViewFrameOn = (1L << 7),
  332. kQTVRObjectStreamingViewsOn = (1L << 8)
  333. };
  334. enum {
  335. kQTVRObjectWrapPanOn = (1L << 0),
  336. kQTVRObjectWrapTiltOn = (1L << 1),
  337. kQTVRObjectCanZoomOn = (1L << 2),
  338. kQTVRObjectReverseHControlOn = (1L << 3),
  339. kQTVRObjectReverseVControlOn = (1L << 4),
  340. kQTVRObjectSwapHVControlOn = (1L << 5),
  341. kQTVRObjectTranslationOn = (1L << 6)
  342. };
  343. enum {
  344. kGrabberScrollerUI = 1, /* "Object" */
  345. kOldJoyStickUI = 2, /* "1.0 Object as Scene" */
  346. kJoystickUI = 3, /* "Object In Scene"*/
  347. kGrabberUI = 4, /* "Grabber only"*/
  348. kAbsoluteUI = 5 /* "Absolute pointer"*/
  349. };
  350. struct QTVRObjectSampleAtom {
  351. UInt16 majorVersion; /* kQTVRMajorVersion*/
  352. UInt16 minorVersion; /* kQTVRMinorVersion*/
  353. UInt16 movieType; /* ObjectUITypes*/
  354. UInt16 viewStateCount; /* The number of view states 1 based*/
  355. UInt16 defaultViewState; /* The default view state number. The number must be 1 to viewStateCount*/
  356. UInt16 mouseDownViewState; /* The mouse down view state. The number must be 1 to viewStateCount*/
  357. UInt32 viewDuration; /* The duration of each view including all animation frames in a view*/
  358. UInt32 columns; /* Number of columns in movie*/
  359. UInt32 rows; /* Number rows in movie*/
  360. Float32 mouseMotionScale; /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  361. Float32 minPan; /* Start horizontal pan angle in degrees*/
  362. Float32 maxPan; /* End horizontal pan angle in degrees*/
  363. Float32 defaultPan; /* Initial horizontal pan angle in degrees (poster view)*/
  364. Float32 minTilt; /* Start vertical pan angle in degrees*/
  365. Float32 maxTilt; /* End vertical pan angle in degrees*/
  366. Float32 defaultTilt; /* Initial vertical pan angle in degrees (poster view) */
  367. Float32 minFieldOfView; /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  368. Float32 fieldOfView; /* the field of view range must be >= 1*/
  369. Float32 defaultFieldOfView; /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  370. Float32 defaultViewCenterH;
  371. Float32 defaultViewCenterV;
  372. Float32 viewRate;
  373. Float32 frameRate;
  374. UInt32 animationSettings; /* 32 reserved bit fields*/
  375. UInt32 controlSettings; /* 32 reserved bit fields*/
  376. };
  377. typedef struct QTVRObjectSampleAtom QTVRObjectSampleAtom;
  378. typedef QTVRObjectSampleAtom * QTVRObjectSampleAtomPtr;
  379. /*
  380. =================================================================================================
  381. QuickTime VR Authoring Components
  382. -------------------------------------------------------------------------------------------------
  383. */
  384. /*
  385. ComponentDescription constants for QTVR Export components
  386. (componentType = MovieExportType; componentSubType = MovieFileType)
  387. */
  388. enum {
  389. kQTVRFlattenerManufacturer = FOUR_CHAR_CODE('vrwe'), /* aka QTVRFlattenerType*/
  390. kQTVRSplitterManufacturer = FOUR_CHAR_CODE('vrsp'),
  391. kQTVRObjExporterManufacturer = FOUR_CHAR_CODE('vrob')
  392. };
  393. /* QuickTime VR Flattener atom types*/
  394. enum {
  395. kQTVRFlattenerSettingsParentAtomType = FOUR_CHAR_CODE('VRWe'), /* parent of settings atoms (other than compression)*/
  396. kQTVRFlattenerPreviewResAtomType = FOUR_CHAR_CODE('PRes'), /* preview resolution Int16*/
  397. kQTVRFlattenerImportSpecAtomType = FOUR_CHAR_CODE('ISpe'), /* import file spec FSSpec*/
  398. kQTVRFlattenerCreatePreviewAtomType = FOUR_CHAR_CODE('Prev'), /* Boolean*/
  399. kQTVRFlattenerImportPreviewAtomType = FOUR_CHAR_CODE('IPre'), /* Boolean*/
  400. kQTVRFlattenerBlurPreviewAtomType = FOUR_CHAR_CODE('Blur') /* Boolean*/
  401. };
  402. /* QuickTime VR Splitter atom types*/
  403. enum {
  404. kQTVRSplitterSettingsParentAtomType = FOUR_CHAR_CODE('VRSp'), /* parent of settings atoms (other than compression)*/
  405. kQTVRSplitterGenerateHTMLAtomType = FOUR_CHAR_CODE('Ghtm'), /* Boolean*/
  406. kQTVRSplitterOverwriteFilesAtomType = FOUR_CHAR_CODE('Owfi'), /* Boolean*/
  407. kQTVRSplitterUseFlattenerAtomType = FOUR_CHAR_CODE('Usef'), /* Boolean*/
  408. kQTVRSplitterShowControllerAtomType = FOUR_CHAR_CODE('Shco'), /* Boolean*/
  409. kQTVRSplitterTargetMyselfAtomType = FOUR_CHAR_CODE('Tgtm') /* Boolean*/
  410. };
  411. /* QuickTime VR Object Exporter atom types*/
  412. enum {
  413. kQTVRObjExporterSettingsBlockSize = FOUR_CHAR_CODE('bsiz'), /* block size for compression*/
  414. kQTVRObjExporterSettingsTargetSize = FOUR_CHAR_CODE('tsiz') /* target file size*/
  415. };
  416. #if OLDROUTINENAMES
  417. typedef QTVRStringAtom VRStringAtom;
  418. typedef QTVRWorldHeaderAtom VRWorldHeaderAtom;
  419. typedef QTVRPanoImagingAtom VRPanoImagingAtom;
  420. typedef QTVRNodeLocationAtom VRNodeLocationAtom;
  421. typedef QTVRNodeHeaderAtom VRNodeHeaderAtom;
  422. typedef QTVRAngleRangeAtom VRAngleRangeAtom;
  423. typedef QTVRHotSpotInfoAtom VRHotSpotInfoAtom;
  424. typedef QTVRLinkHotSpotAtom VRLinkHotSpotAtom;
  425. typedef QTVRPanoSampleAtom VRPanoSampleAtom;
  426. typedef QTVRTrackRefEntry VRTrackRefEntry;
  427. typedef QTVRObjectSampleAtom VRObjectSampleAtom;
  428. #endif /* OLDROUTINENAMES */
  429. #endif // !__LP64__
  430. #if PRAGMA_STRUCT_ALIGN
  431. #pragma options align=reset
  432. #elif PRAGMA_STRUCT_PACKPUSH
  433. #pragma pack(pop)
  434. #elif PRAGMA_STRUCT_PACK
  435. #pragma pack()
  436. #endif
  437. #ifdef PRAGMA_IMPORT_OFF
  438. #pragma import off
  439. #elif PRAGMA_IMPORT
  440. #pragma import reset
  441. #endif
  442. #ifdef __cplusplus
  443. }
  444. #endif
  445. #endif /* __QUICKTIMEVRFORMAT__ */