@automovie/ingest 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.d.ts +5 -0
  4. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js +8 -0
  5. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js.map +1 -0
  6. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.d.ts +5 -0
  7. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js +15 -0
  8. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js.map +1 -0
  9. package/lib/AutoMovieExternalModelIngestProfile.d.ts +11 -0
  10. package/lib/AutoMovieExternalModelIngestProfile.js +3 -0
  11. package/lib/AutoMovieExternalModelIngestProfile.js.map +1 -0
  12. package/lib/AutoMovieExternalMotionAdoptionDecision.d.ts +11 -0
  13. package/lib/AutoMovieExternalMotionAdoptionDecision.js +3 -0
  14. package/lib/AutoMovieExternalMotionAdoptionDecision.js.map +1 -0
  15. package/lib/AutoMovieGltfMotionInterpretationProfile.d.ts +9 -0
  16. package/lib/AutoMovieGltfMotionInterpretationProfile.js +3 -0
  17. package/lib/AutoMovieGltfMotionInterpretationProfile.js.map +1 -0
  18. package/lib/IAutoMovieExternalModelInspection.d.ts +48 -0
  19. package/lib/IAutoMovieExternalModelInspection.js +3 -0
  20. package/lib/IAutoMovieExternalModelInspection.js.map +1 -0
  21. package/lib/IAutoMovieExternalModelResource.d.ts +18 -0
  22. package/lib/IAutoMovieExternalModelResource.js +3 -0
  23. package/lib/IAutoMovieExternalModelResource.js.map +1 -0
  24. package/lib/IAutoMovieExternalMotionAdoption.d.ts +23 -0
  25. package/lib/IAutoMovieExternalMotionAdoption.js +3 -0
  26. package/lib/IAutoMovieExternalMotionAdoption.js.map +1 -0
  27. package/lib/IAutoMovieExternalMotionBoneMapping.d.ts +15 -0
  28. package/lib/IAutoMovieExternalMotionBoneMapping.js +3 -0
  29. package/lib/IAutoMovieExternalMotionBoneMapping.js.map +1 -0
  30. package/lib/IAutoMovieExternalMotionInspection.d.ts +25 -0
  31. package/lib/IAutoMovieExternalMotionInspection.js +3 -0
  32. package/lib/IAutoMovieExternalMotionInspection.js.map +1 -0
  33. package/lib/IAutoMovieExternalMotionNativeDecision.d.ts +20 -0
  34. package/lib/IAutoMovieExternalMotionNativeDecision.js +3 -0
  35. package/lib/IAutoMovieExternalMotionNativeDecision.js.map +1 -0
  36. package/lib/IAutoMovieExternalMotionNativeHandoff.d.ts +18 -0
  37. package/lib/IAutoMovieExternalMotionNativeHandoff.js +3 -0
  38. package/lib/IAutoMovieExternalMotionNativeHandoff.js.map +1 -0
  39. package/lib/IAutoMovieExternalMotionNodeInspection.d.ts +21 -0
  40. package/lib/IAutoMovieExternalMotionNodeInspection.js +3 -0
  41. package/lib/IAutoMovieExternalMotionNodeInspection.js.map +1 -0
  42. package/lib/IAutoMovieExternalMotionRetargetDecision.d.ts +24 -0
  43. package/lib/IAutoMovieExternalMotionRetargetDecision.js +3 -0
  44. package/lib/IAutoMovieExternalMotionRetargetDecision.js.map +1 -0
  45. package/lib/IAutoMovieExternalMotionRetargetHandoff.d.ts +22 -0
  46. package/lib/IAutoMovieExternalMotionRetargetHandoff.js +3 -0
  47. package/lib/IAutoMovieExternalMotionRetargetHandoff.js.map +1 -0
  48. package/lib/IAutoMovieExternalMotionSource.d.ts +18 -0
  49. package/lib/IAutoMovieExternalMotionSource.js +3 -0
  50. package/lib/IAutoMovieExternalMotionSource.js.map +1 -0
  51. package/lib/IAutoMovieIngestResult.d.ts +17 -0
  52. package/lib/IAutoMovieIngestResult.js +3 -0
  53. package/lib/IAutoMovieIngestResult.js.map +1 -0
  54. package/lib/adoptAutoMovieExternalMotion.d.ts +32 -0
  55. package/lib/adoptAutoMovieExternalMotion.js +215 -0
  56. package/lib/adoptAutoMovieExternalMotion.js.map +1 -0
  57. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.d.ts +28 -0
  58. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.js +3 -0
  59. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.js.map +1 -0
  60. package/lib/audio/IAutoMovieProductionAudioProcessing.d.ts +18 -0
  61. package/lib/audio/IAutoMovieProductionAudioProcessing.js +3 -0
  62. package/lib/audio/IAutoMovieProductionAudioProcessing.js.map +1 -0
  63. package/lib/audio/IAutoMovieProductionWaveSourceFormat.d.ts +39 -0
  64. package/lib/audio/IAutoMovieProductionWaveSourceFormat.js +3 -0
  65. package/lib/audio/IAutoMovieProductionWaveSourceFormat.js.map +1 -0
  66. package/lib/audio/decodeProductionAudioAsset.d.ts +33 -0
  67. package/lib/audio/decodeProductionAudioAsset.js +257 -0
  68. package/lib/audio/decodeProductionAudioAsset.js.map +1 -0
  69. package/lib/audio/index.d.ts +4 -0
  70. package/lib/audio/index.js +21 -0
  71. package/lib/audio/index.js.map +1 -0
  72. package/lib/decodeAutoMoviePpmImage.d.ts +30 -0
  73. package/lib/decodeAutoMoviePpmImage.js +84 -0
  74. package/lib/decodeAutoMoviePpmImage.js.map +1 -0
  75. package/lib/humanoidSkeleton.d.ts +24 -0
  76. package/lib/humanoidSkeleton.js +80 -0
  77. package/lib/humanoidSkeleton.js.map +1 -0
  78. package/lib/index.d.ts +23 -0
  79. package/lib/index.js +40 -0
  80. package/lib/index.js.map +1 -0
  81. package/lib/ingestDocument.d.ts +23 -0
  82. package/lib/ingestDocument.js +173 -0
  83. package/lib/ingestDocument.js.map +1 -0
  84. package/lib/inspectAutoMovieExternalModelBytes.d.ts +32 -0
  85. package/lib/inspectAutoMovieExternalModelBytes.js +219 -0
  86. package/lib/inspectAutoMovieExternalModelBytes.js.map +1 -0
  87. package/lib/internal/COMPONENT_BYTES.d.ts +2 -0
  88. package/lib/internal/COMPONENT_BYTES.js +13 -0
  89. package/lib/internal/COMPONENT_BYTES.js.map +1 -0
  90. package/lib/internal/IAccessorSource.d.ts +16 -0
  91. package/lib/internal/IAccessorSource.js +3 -0
  92. package/lib/internal/IAccessorSource.js.map +1 -0
  93. package/lib/internal/IExternalModelAccessorReader.d.ts +9 -0
  94. package/lib/internal/IExternalModelAccessorReader.js +3 -0
  95. package/lib/internal/IExternalModelAccessorReader.js.map +1 -0
  96. package/lib/internal/IHumanoidSlot.d.ts +15 -0
  97. package/lib/internal/IHumanoidSlot.js +3 -0
  98. package/lib/internal/IHumanoidSlot.js.map +1 -0
  99. package/lib/internal/IParsedContainer.d.ts +16 -0
  100. package/lib/internal/IParsedContainer.js +3 -0
  101. package/lib/internal/IParsedContainer.js.map +1 -0
  102. package/lib/internal/SHAPE_COMPONENTS.d.ts +6 -0
  103. package/lib/internal/SHAPE_COMPONENTS.js +25 -0
  104. package/lib/internal/SHAPE_COMPONENTS.js.map +1 -0
  105. package/lib/internal/accessorElementByteLength.d.ts +12 -0
  106. package/lib/internal/accessorElementByteLength.js +28 -0
  107. package/lib/internal/accessorElementByteLength.js.map +1 -0
  108. package/lib/internal/accessorReader.d.ts +16 -0
  109. package/lib/internal/accessorReader.js +52 -0
  110. package/lib/internal/accessorReader.js.map +1 -0
  111. package/lib/internal/accessorValues.d.ts +18 -0
  112. package/lib/internal/accessorValues.js +38 -0
  113. package/lib/internal/accessorValues.js.map +1 -0
  114. package/lib/internal/collectExternalResources.d.ts +13 -0
  115. package/lib/internal/collectExternalResources.js +51 -0
  116. package/lib/internal/collectExternalResources.js.map +1 -0
  117. package/lib/internal/compareCodeUnits.d.ts +12 -0
  118. package/lib/internal/compareCodeUnits.js +17 -0
  119. package/lib/internal/compareCodeUnits.js.map +1 -0
  120. package/lib/internal/composeLocalTransform.d.ts +21 -0
  121. package/lib/internal/composeLocalTransform.js +53 -0
  122. package/lib/internal/composeLocalTransform.js.map +1 -0
  123. package/lib/internal/decodeDataUri.d.ts +14 -0
  124. package/lib/internal/decodeDataUri.js +61 -0
  125. package/lib/internal/decodeDataUri.js.map +1 -0
  126. package/lib/internal/decodeGlb.d.ts +13 -0
  127. package/lib/internal/decodeGlb.js +56 -0
  128. package/lib/internal/decodeGlb.js.map +1 -0
  129. package/lib/internal/decodeJson.d.ts +12 -0
  130. package/lib/internal/decodeJson.js +77 -0
  131. package/lib/internal/decodeJson.js.map +1 -0
  132. package/lib/internal/fileExtension.d.ts +12 -0
  133. package/lib/internal/fileExtension.js +21 -0
  134. package/lib/internal/fileExtension.js.map +1 -0
  135. package/lib/internal/finiteTuple.d.ts +14 -0
  136. package/lib/internal/finiteTuple.js +29 -0
  137. package/lib/internal/finiteTuple.js.map +1 -0
  138. package/lib/internal/gltfHumanoidBones.d.ts +15 -0
  139. package/lib/internal/gltfHumanoidBones.js +39 -0
  140. package/lib/internal/gltfHumanoidBones.js.map +1 -0
  141. package/lib/internal/humanoidBoneOfName.d.ts +18 -0
  142. package/lib/internal/humanoidBoneOfName.js +67 -0
  143. package/lib/internal/humanoidBoneOfName.js.map +1 -0
  144. package/lib/internal/inspectExternalModelHierarchy.d.ts +12 -0
  145. package/lib/internal/inspectExternalModelHierarchy.js +51 -0
  146. package/lib/internal/inspectExternalModelHierarchy.js.map +1 -0
  147. package/lib/internal/inspectExternalMotion.d.ts +23 -0
  148. package/lib/internal/inspectExternalMotion.js +152 -0
  149. package/lib/internal/inspectExternalMotion.js.map +1 -0
  150. package/lib/internal/inspectExternalMotionNodes.d.ts +15 -0
  151. package/lib/internal/inspectExternalMotionNodes.js +58 -0
  152. package/lib/internal/inspectExternalMotionNodes.js.map +1 -0
  153. package/lib/internal/integerIndex.d.ts +12 -0
  154. package/lib/internal/integerIndex.js +23 -0
  155. package/lib/internal/integerIndex.js.map +1 -0
  156. package/lib/internal/integerIndices.d.ts +12 -0
  157. package/lib/internal/integerIndices.js +23 -0
  158. package/lib/internal/integerIndices.js.map +1 -0
  159. package/lib/internal/nonNegativeInteger.d.ts +12 -0
  160. package/lib/internal/nonNegativeInteger.js +22 -0
  161. package/lib/internal/nonNegativeInteger.js.map +1 -0
  162. package/lib/internal/object.d.ts +12 -0
  163. package/lib/internal/object.js +21 -0
  164. package/lib/internal/object.js.map +1 -0
  165. package/lib/internal/optionalArray.d.ts +12 -0
  166. package/lib/internal/optionalArray.js +18 -0
  167. package/lib/internal/optionalArray.js.map +1 -0
  168. package/lib/internal/optionalObject.d.ts +12 -0
  169. package/lib/internal/optionalObject.js +18 -0
  170. package/lib/internal/optionalObject.js.map +1 -0
  171. package/lib/internal/optionalStringArray.d.ts +12 -0
  172. package/lib/internal/optionalStringArray.js +22 -0
  173. package/lib/internal/optionalStringArray.js.map +1 -0
  174. package/lib/internal/positiveInteger.d.ts +12 -0
  175. package/lib/internal/positiveInteger.js +22 -0
  176. package/lib/internal/positiveInteger.js.map +1 -0
  177. package/lib/internal/readMotionAccessor.d.ts +15 -0
  178. package/lib/internal/readMotionAccessor.js +41 -0
  179. package/lib/internal/readMotionAccessor.js.map +1 -0
  180. package/lib/internal/requiredArray.d.ts +12 -0
  181. package/lib/internal/requiredArray.js +21 -0
  182. package/lib/internal/requiredArray.js.map +1 -0
  183. package/lib/internal/uniqueStrings.d.ts +12 -0
  184. package/lib/internal/uniqueStrings.js +18 -0
  185. package/lib/internal/uniqueStrings.js.map +1 -0
  186. package/lib/internal/validNodeIndex.d.ts +12 -0
  187. package/lib/internal/validNodeIndex.js +20 -0
  188. package/lib/internal/validNodeIndex.js.map +1 -0
  189. package/lib/internal/validateAccessorRange.d.ts +14 -0
  190. package/lib/internal/validateAccessorRange.js +37 -0
  191. package/lib/internal/validateAccessorRange.js.map +1 -0
  192. package/lib/internal/validateHumanoidSkinning.d.ts +20 -0
  193. package/lib/internal/validateHumanoidSkinning.js +91 -0
  194. package/lib/internal/validateHumanoidSkinning.js.map +1 -0
  195. package/lib/internal/validatePayloadClosure.d.ts +21 -0
  196. package/lib/internal/validatePayloadClosure.js +74 -0
  197. package/lib/internal/validatePayloadClosure.js.map +1 -0
  198. package/lib/internal/validateSparseAccessor.d.ts +14 -0
  199. package/lib/internal/validateSparseAccessor.js +50 -0
  200. package/lib/internal/validateSparseAccessor.js.map +1 -0
  201. package/lib/internal/vrmHumanoidBones.d.ts +15 -0
  202. package/lib/internal/vrmHumanoidBones.js +132 -0
  203. package/lib/internal/vrmHumanoidBones.js.map +1 -0
  204. package/lib/isAutoMovieExternalModelIngestProfile.d.ts +18 -0
  205. package/lib/isAutoMovieExternalModelIngestProfile.js +24 -0
  206. package/lib/isAutoMovieExternalModelIngestProfile.js.map +1 -0
  207. package/package.json +45 -3
  208. package/src/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.ts +7 -0
  209. package/src/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.ts +21 -0
  210. package/src/AutoMovieExternalModelIngestProfile.ts +15 -0
  211. package/src/AutoMovieExternalMotionAdoptionDecision.ts +14 -0
  212. package/src/AutoMovieGltfMotionInterpretationProfile.ts +10 -0
  213. package/src/IAutoMovieExternalModelInspection.ts +62 -0
  214. package/src/IAutoMovieExternalModelResource.ts +20 -0
  215. package/src/IAutoMovieExternalMotionAdoption.ts +30 -0
  216. package/src/IAutoMovieExternalMotionBoneMapping.ts +17 -0
  217. package/src/IAutoMovieExternalMotionInspection.ts +32 -0
  218. package/src/IAutoMovieExternalMotionNativeDecision.ts +25 -0
  219. package/src/IAutoMovieExternalMotionNativeHandoff.ts +22 -0
  220. package/src/IAutoMovieExternalMotionNodeInspection.ts +26 -0
  221. package/src/IAutoMovieExternalMotionRetargetDecision.ts +31 -0
  222. package/src/IAutoMovieExternalMotionRetargetHandoff.ts +28 -0
  223. package/src/IAutoMovieExternalMotionSource.ts +20 -0
  224. package/src/IAutoMovieIngestResult.ts +19 -0
  225. package/src/adoptAutoMovieExternalMotion.ts +387 -0
  226. package/src/audio/IAutoMovieDecodedProductionAudioAsset.ts +35 -0
  227. package/src/audio/IAutoMovieProductionAudioProcessing.ts +21 -0
  228. package/src/audio/IAutoMovieProductionWaveSourceFormat.ts +50 -0
  229. package/src/audio/decodeProductionAudioAsset.ts +451 -0
  230. package/src/audio/index.ts +4 -0
  231. package/src/decodeAutoMoviePpmImage.ts +103 -0
  232. package/src/humanoidSkeleton.ts +105 -0
  233. package/src/index.ts +23 -0
  234. package/src/ingestDocument.ts +242 -0
  235. package/src/inspectAutoMovieExternalModelBytes.ts +346 -0
  236. package/src/internal/COMPONENT_BYTES.ts +12 -0
  237. package/src/internal/IAccessorSource.ts +18 -0
  238. package/src/internal/IExternalModelAccessorReader.ts +12 -0
  239. package/src/internal/IHumanoidSlot.ts +17 -0
  240. package/src/internal/IParsedContainer.ts +18 -0
  241. package/src/internal/SHAPE_COMPONENTS.ts +27 -0
  242. package/src/internal/accessorElementByteLength.ts +24 -0
  243. package/src/internal/accessorReader.ts +76 -0
  244. package/src/internal/accessorValues.ts +35 -0
  245. package/src/internal/collectExternalResources.ts +69 -0
  246. package/src/internal/compareCodeUnits.ts +15 -0
  247. package/src/internal/composeLocalTransform.ts +56 -0
  248. package/src/internal/decodeDataUri.ts +70 -0
  249. package/src/internal/decodeGlb.ts +70 -0
  250. package/src/internal/decodeJson.ts +76 -0
  251. package/src/internal/fileExtension.ts +18 -0
  252. package/src/internal/finiteTuple.ts +33 -0
  253. package/src/internal/gltfHumanoidBones.ts +48 -0
  254. package/src/internal/humanoidBoneOfName.ts +75 -0
  255. package/src/internal/inspectExternalModelHierarchy.ts +61 -0
  256. package/src/internal/inspectExternalMotion.ts +292 -0
  257. package/src/internal/inspectExternalMotionNodes.ts +81 -0
  258. package/src/internal/integerIndex.ts +28 -0
  259. package/src/internal/integerIndices.ts +24 -0
  260. package/src/internal/nonNegativeInteger.ts +22 -0
  261. package/src/internal/object.ts +22 -0
  262. package/src/internal/optionalArray.ts +17 -0
  263. package/src/internal/optionalObject.ts +20 -0
  264. package/src/internal/optionalStringArray.ts +22 -0
  265. package/src/internal/positiveInteger.ts +22 -0
  266. package/src/internal/readMotionAccessor.ts +60 -0
  267. package/src/internal/requiredArray.ts +19 -0
  268. package/src/internal/uniqueStrings.ts +16 -0
  269. package/src/internal/validNodeIndex.ts +19 -0
  270. package/src/internal/validateAccessorRange.ts +53 -0
  271. package/src/internal/validateHumanoidSkinning.ts +152 -0
  272. package/src/internal/validatePayloadClosure.ts +116 -0
  273. package/src/internal/validateSparseAccessor.ts +109 -0
  274. package/src/internal/vrmHumanoidBones.ts +176 -0
  275. package/src/isAutoMovieExternalModelIngestProfile.ts +28 -0
@@ -0,0 +1,257 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeProductionAudioAsset = void 0;
4
+ /**
5
+ * Decode one complete supported RIFF/WAVE file into finite mono samples at a requested rate.
6
+ *
7
+ * The parser walks the RIFF chunks by id, requires the declared RIFF extent, `nBlockAlign`, and `nAvgBytesPerSec` to agree with the format fields, and refuses a duplicate `fmt ` or `data` chunk, an odd chunk without its pad byte, and terminal bytes too short for a chunk header. An extensible header follows the Microsoft WAVEFORMATEXTENSIBLE contract (https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible): "The cbSize member must be at least 22", `wValidBitsPerSample` "can be any value not exceeding the container size", "the channels specified in dwChannelMask must be present in the prescribed order (from least significant bit up)" with SPEAKER_FRONT_LEFT `0x1`, SPEAKER_FRONT_RIGHT `0x2`, and SPEAKER_FRONT_CENTER `0x4`, and "the number of bits set in dwChannelMask should be the same as the number of channels". The SubFormat is admitted only when every byte after its leading 16-bit tag equals the `xxxxxxxx-0000-0010-8000-00aa00389b71` template that Ksmedia.h's `IS_VALID_WAVEFORMATEX_GUID` compares (https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/converting-between-format-tags-and-subformat-guids), so a vendor GUID whose low word happens to read as PCM is not decoded as PCM.
8
+ *
9
+ * The supported subset is deliberately narrow: 16-bit PCM in a 16-bit container, 32-bit IEEE float in a 32-bit container, mono front-center, and stereo front-left/front-right. A legal declaration outside it, such as 20 valid bits in a 24-bit container or a front-left/front-center pair, is refused as unsupported by field rather than misread as the nearest supported layout. Every decoded sample is checked finite before the mono fold and before any resampling, so a NaN or infinity in one channel refuses the whole asset at its frame and channel instead of averaging into a plausible number.
10
+ *
11
+ * PCM codes scale by 1/32768, so -32768 reads as exactly -1 and 32767 just under 1. Stereo folds to the mean of its two channels. A source at another rate is resampled by linear interpolation between neighboring source samples, holding the last sample past the end, to `round(frames * rate / sourceRate)` samples, which may round to zero for a short source and a low target rate. No low-pass filter runs first, so downsampling a source with content above the target Nyquist frequency aliases it.
12
+ *
13
+ * Field admission refusals throw `Audio asset "<path>" [<reason>] <message>`, where the reason names the field, such as `riff-size`, `block-align`, or `unsupported-wave-layout`. Buffer size follows source frames and the requested rate ratio; this function imposes no product memory budget, so platform allocation errors may propagate outside that refusal format.
14
+ *
15
+ * @param props.path Asset path, used only in refusal messages.
16
+ * @param props.bytes Complete file bytes; they are only read.
17
+ * @param props.sampleRate Output rate in samples per second; a positive safe integer.
18
+ * @returns The source facts as declared and new mono samples the caller owns.
19
+ *
20
+ * @evidence contracts/development/implementation.md#principled-implementation Chunks are found by id in RIFF order with the even-byte pad rule, the format fields are checked against WAVEFORMATEXTENSIBLE's own consistency rules and the KSDATAFORMAT GUID template, samples scale by 1/32768 or read as IEEE floats, and resampling is two-tap linear interpolation; that interpolation has no anti-alias filter, which the documentation states as the remaining limitation when a source is downsampled.
21
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One linear pass validates the container, a second folds frames to mono, and a third resamples only when the rates differ; private refusal, chunk and hex helpers keep WAVE parsing local, while production speech probes consume the public decoder's format facts and mono samples.
22
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No file, path or rate is special-cased: every unsupported declaration throws with a field-named reason instead of decoding as the nearest supported layout, and the only constants are the WAVE format tags, speaker masks and GUID tail the Microsoft contract defines.
23
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation cites the WAVEFORMATEXTENSIBLE rules it enforces, lists the supported subset, gives the PCM scale, stereo fold, resampled length and aliasing limitation, and states the refusal message shape and parameter units.
24
+ * @evidence contracts/development/implementation.md#efficient-algorithms Time follows RIFF chunk headers, source frames times channels and output samples; storage follows source and output frames, each encoded sample is read once through one DataView, and the mono buffer becomes the result when rates match.
25
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The decoder is a pure function of one call's bytes and rate and coordinates no work across requests; any caching of decoded assets would belong to its caller.
26
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The call owns source-frame mono storage and, on resampling, rate-ratio-sized output storage; no product memory budget bounds a requested allocation. Temporary buffers become collectable on return/throw, the returned buffer transfers to its caller, and no raw bytes, handles or tasks are retained.
27
+ */
28
+ const decodeProductionAudioAsset = (props) => {
29
+ if (Number.isSafeInteger(props.sampleRate) === false || props.sampleRate <= 0)
30
+ fail(props.path, "decode-rate", `cannot be decoded at ${props.sampleRate} Hz: a decode target rate is a positive whole number of samples per second.`);
31
+ const bytes = props.bytes;
32
+ if (bytes.byteLength < 12)
33
+ fail(props.path, "riff-header", `is ${bytes.byteLength} bytes, too short to carry a RIFF/WAVE header. ${SUPPORTED_AUDIO}`);
34
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
35
+ const riff = asciiTag(bytes, 0);
36
+ const form = asciiTag(bytes, 8);
37
+ if (riff !== "RIFF" || form !== "WAVE")
38
+ fail(props.path, "riff-form", `is not a RIFF/WAVE container: it begins "${riff}" (${leadingHex(bytes)}) and declares form "${form}". ${SUPPORTED_AUDIO}`);
39
+ const declaredRiffBytes = view.getUint32(4, true) + 8;
40
+ if (declaredRiffBytes !== bytes.byteLength)
41
+ fail(props.path, "riff-size", `declares a RIFF extent of ${declaredRiffBytes} bytes but contains ${bytes.byteLength} bytes.`);
42
+ let cursor = 12;
43
+ let format = null;
44
+ let data = null;
45
+ while (cursor < bytes.byteLength) {
46
+ if (cursor + 8 > bytes.byteLength)
47
+ fail(props.path, "chunk-header", `has ${bytes.byteLength - cursor} terminal RIFF bytes that cannot carry a chunk header.`);
48
+ const id = asciiTag(bytes, cursor);
49
+ const size = view.getUint32(cursor + 4, true);
50
+ const body = cursor + 8;
51
+ const paddedEnd = body + size + (size % 2);
52
+ if (paddedEnd > bytes.byteLength)
53
+ fail(props.path, "chunk-extent", `is a truncated RIFF/WAVE container: its "${id}" chunk declares ${size} bytes but only ${bytes.byteLength - body} remain.`);
54
+ if (id === "fmt ") {
55
+ if (format !== null)
56
+ fail(props.path, "duplicate-fmt", 'has more than one RIFF/WAVE "fmt " chunk.');
57
+ format = { offset: body, size };
58
+ }
59
+ else if (id === "data") {
60
+ if (data !== null)
61
+ fail(props.path, "duplicate-data", 'has more than one RIFF/WAVE "data" chunk.');
62
+ data = { offset: body, size };
63
+ }
64
+ cursor = paddedEnd;
65
+ }
66
+ if (format === null)
67
+ return fail(props.path, "missing-fmt", `has no RIFF/WAVE "fmt " chunk. ${SUPPORTED_AUDIO}`);
68
+ if (format.size < 16)
69
+ fail(props.path, "fmt-size", `has a "fmt " chunk of ${format.size} bytes; a WAVE format chunk is at least 16 bytes.`);
70
+ const declaredTag = view.getUint16(format.offset, true);
71
+ const channels = view.getUint16(format.offset + 2, true);
72
+ const sourceSampleRate = view.getUint32(format.offset + 4, true);
73
+ const averageBytesPerSecond = view.getUint32(format.offset + 8, true);
74
+ const blockAlign = view.getUint16(format.offset + 12, true);
75
+ const containerBits = view.getUint16(format.offset + 14, true);
76
+ const extensible = declaredTag === WAVE_FORMAT_EXTENSIBLE;
77
+ let sampleTag = declaredTag;
78
+ let validBits = containerBits;
79
+ let channelMask = null;
80
+ let subFormatGuid = null;
81
+ if (extensible) {
82
+ if (format.size < 18)
83
+ fail(props.path, "extensible.cbSize", `declares an extensible WAVE format in a "fmt " chunk of ${format.size} bytes, which cannot carry cbSize.`);
84
+ const extensionBytes = view.getUint16(format.offset + 16, true);
85
+ if (extensionBytes < 22)
86
+ fail(props.path, "extensible.cbSize", `declares extensible cbSize ${extensionBytes}; at least 22 bytes are required.`);
87
+ if (18 + extensionBytes > format.size)
88
+ fail(props.path, "extensible.truncated", `declares ${extensionBytes} extensible bytes but its "fmt " chunk carries only ${format.size - 18}.`);
89
+ validBits = view.getUint16(format.offset + 18, true);
90
+ channelMask = view.getUint32(format.offset + 20, true);
91
+ sampleTag = view.getUint16(format.offset + 24, true);
92
+ const guidBytes = bytes.subarray(format.offset + 24, format.offset + 40);
93
+ subFormatGuid = waveGuid(guidBytes);
94
+ if (SUBFORMAT_TAIL.some((byte, index) => guidBytes[index + 2] !== byte))
95
+ fail(props.path, "unsupported-wave-subformat", `carries unsupported extensible SubFormat ${subFormatGuid}. ${SUPPORTED_AUDIO}`);
96
+ if (sampleTag !== WAVE_FORMAT_PCM && sampleTag !== WAVE_FORMAT_FLOAT)
97
+ fail(props.path, "unsupported-wave-subformat", `carries unsupported extensible SubFormat ${subFormatGuid}. ${SUPPORTED_AUDIO}`);
98
+ if (validBits === 0 || validBits > containerBits)
99
+ fail(props.path, "extensible.valid-bits", `declares ${validBits} valid bits in a ${containerBits}-bit container.`);
100
+ }
101
+ const float = sampleTag === WAVE_FORMAT_FLOAT && containerBits === 32;
102
+ const pcm = sampleTag === WAVE_FORMAT_PCM && containerBits === 16;
103
+ if (float === false && pcm === false)
104
+ fail(props.path, "unsupported-wave-precision", `carries WAVE sample format 0x${hex4(sampleTag)} at ${containerBits} bits per sample. ${SUPPORTED_AUDIO}`);
105
+ if (validBits !== containerBits)
106
+ fail(props.path, "unsupported-wave-precision", `carries ${validBits} valid bits in a ${containerBits}-bit container. ${SUPPORTED_AUDIO}`);
107
+ if (channels !== 1 && channels !== 2)
108
+ fail(props.path, "unsupported-wave-channels", `declares ${channels} channels. ${SUPPORTED_AUDIO}`);
109
+ if (sourceSampleRate === 0)
110
+ fail(props.path, "sample-rate", "declares a sample rate of 0 Hz; a WAV asset states a positive rate.");
111
+ const bytesPerSample = containerBits / 8;
112
+ const expectedBlockAlign = channels * bytesPerSample;
113
+ if (blockAlign !== expectedBlockAlign)
114
+ fail(props.path, "block-align", `declares nBlockAlign ${blockAlign}, expected ${expectedBlockAlign} for ${channels} channels at ${containerBits} bits.`);
115
+ const expectedAverageBytesPerSecond = sourceSampleRate * blockAlign;
116
+ if (averageBytesPerSecond !== expectedAverageBytesPerSecond)
117
+ fail(props.path, "average-bytes-per-second", `declares nAvgBytesPerSec ${averageBytesPerSecond}, expected ${expectedAverageBytesPerSecond}.`);
118
+ const speakers = channels === 1 ? ["front-center"] : ["front-left", "front-right"];
119
+ if (channelMask !== null) {
120
+ if (channelMask === 0)
121
+ fail(props.path, "unsupported-wave-layout", `declares unsupported channel mask ${hex8(channelMask)}. ${SUPPORTED_AUDIO}`);
122
+ const count = bitCount(channelMask);
123
+ if (count !== channels)
124
+ fail(props.path, "wave-channel-mask-count", `declares ${channels} channels but channel mask ${hex8(channelMask)} names ${count}.`);
125
+ const supportedMask = channels === 1 ? MONO_MASK : STEREO_MASK;
126
+ if (channelMask !== supportedMask)
127
+ fail(props.path, "unsupported-wave-layout", `declares unsupported channel mask ${hex8(channelMask)}. ${SUPPORTED_AUDIO}`);
128
+ }
129
+ if (data === null)
130
+ return fail(props.path, "missing-data", `has no RIFF/WAVE "data" chunk. ${SUPPORTED_AUDIO}`);
131
+ if (data.size % blockAlign !== 0)
132
+ fail(props.path, "data-frame", `has a "data" chunk of ${data.size} bytes, which is not a whole number of ${channels}-channel ${containerBits}-bit sample frames.`);
133
+ const sourceFrames = data.size / blockAlign;
134
+ if (sourceFrames === 0)
135
+ fail(props.path, "empty-data", "carries no sample frames; a declared cue asset has to contain the sound it is cued for.");
136
+ const mono = new Float32Array(sourceFrames);
137
+ for (let frame = 0; frame < sourceFrames; ++frame) {
138
+ // A mono sample is stored as read, so a float source's -0 stays -0.
139
+ let sum = 0;
140
+ let monoSample = 0;
141
+ for (let channel = 0; channel < channels; ++channel) {
142
+ const at = data.offset + (frame * channels + channel) * bytesPerSample;
143
+ const sample = float
144
+ ? view.getFloat32(at, true)
145
+ : view.getInt16(at, true) / 32_768;
146
+ if (Number.isFinite(sample) === false)
147
+ fail(props.path, "non-finite-pcm", `contains a non-finite PCM sample at frame ${frame}, channel ${channel}.`);
148
+ if (channels === 1)
149
+ monoSample = sample;
150
+ else
151
+ sum += sample;
152
+ }
153
+ mono[frame] = channels === 1 ? monoSample : sum / channels;
154
+ }
155
+ const resampling = sourceSampleRate !== props.sampleRate;
156
+ const samples = resampling
157
+ ? resampleMono(mono, sourceSampleRate, props.sampleRate)
158
+ : mono;
159
+ return {
160
+ sourceSampleRate,
161
+ sourceChannels: channels,
162
+ sourceFrames,
163
+ durationSeconds: sourceFrames / sourceSampleRate,
164
+ sourceFormat: {
165
+ kind: "wave",
166
+ header: extensible ? "wave-format-extensible" : "wave-format-ex",
167
+ encoding: float ? "float-f32le" : "pcm-s16le",
168
+ containerBits: containerBits,
169
+ validBits: validBits,
170
+ sampleRate: sourceSampleRate,
171
+ channels: channels,
172
+ layout: {
173
+ kind: channels === 1 ? "mono" : "stereo",
174
+ speakers,
175
+ source: extensible ? "channel-mask" : "legacy-default",
176
+ mask: channelMask,
177
+ },
178
+ subFormatGuid,
179
+ },
180
+ processing: {
181
+ kind: channels === 1
182
+ ? resampling
183
+ ? "resample"
184
+ : "copy"
185
+ : resampling
186
+ ? "downmix-resample"
187
+ : "downmix",
188
+ outputChannels: 1,
189
+ outputSampleRate: props.sampleRate,
190
+ matrix: channels === 1 ? [[1]] : [[0.5, 0.5]],
191
+ },
192
+ samples,
193
+ };
194
+ };
195
+ exports.decodeProductionAudioAsset = decodeProductionAudioAsset;
196
+ /** Current deterministic source subset accepted by the production decoder. */
197
+ const SUPPORTED_AUDIO = 'Supported audio assets are RIFF/WAVE ("*.wav") containers carrying 16-bit PCM or 32-bit IEEE float samples, mono front-center or stereo front-left/front-right.';
198
+ const WAVE_FORMAT_PCM = 0x0001;
199
+ const WAVE_FORMAT_FLOAT = 0x0003;
200
+ const WAVE_FORMAT_EXTENSIBLE = 0xfffe;
201
+ /** SPEAKER_FRONT_CENTER. */
202
+ const MONO_MASK = 0x0000_0004;
203
+ /** SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT. */
204
+ const STEREO_MASK = 0x0000_0003;
205
+ /** SubFormat GUID bytes 2 through 15 shared by every `WAVE_FORMAT_*` GUID. */
206
+ const SUBFORMAT_TAIL = Uint8Array.from([
207
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b,
208
+ 0x71,
209
+ ]);
210
+ /** Throw the decoder's refusal. The explicit function type on the constant is what lets TypeScript narrow after a statement call, so callers need no non-null assertion. */
211
+ const fail = (asset, reason, message) => {
212
+ throw new Error(`Audio asset "${asset}" [${reason}] ${message}`);
213
+ };
214
+ const resampleMono = (source, from, to) => {
215
+ const length = Math.round((source.length * to) / from);
216
+ const output = new Float32Array(length);
217
+ const step = from / to;
218
+ for (let index = 0; index < length; ++index) {
219
+ const position = index * step;
220
+ const left = Math.floor(position);
221
+ const right = Math.min(source.length - 1, left + 1);
222
+ const weight = position - left;
223
+ output[index] = source[left] * (1 - weight) + source[right] * weight;
224
+ }
225
+ return output;
226
+ };
227
+ const asciiTag = (bytes, offset) => {
228
+ let text = "";
229
+ for (let index = offset; index < offset + 4; ++index) {
230
+ const byte = bytes[index];
231
+ text += byte >= 0x20 && byte <= 0x7e ? String.fromCharCode(byte) : ".";
232
+ }
233
+ return text;
234
+ };
235
+ const leadingHex = (bytes) => `0x${hexBytes(bytes, 0, 4)}`;
236
+ /** Canonical GUID text: the first three fields are little-endian in the file, the last two are byte strings. */
237
+ const waveGuid = (bytes) => `${hexBytes(bytes, 3, -1)}-${hexBytes(bytes, 5, 3)}-${hexBytes(bytes, 7, 5)}-${hexBytes(bytes, 8, 10)}-${hexBytes(bytes, 10, 16)}`;
238
+ /** Hex digits of `bytes[from]` toward `to` (exclusive), in either direction. */
239
+ const hexBytes = (bytes, from, to) => {
240
+ const direction = to > from ? 1 : -1;
241
+ let text = "";
242
+ for (let index = from; index !== to; index += direction)
243
+ text += bytes[index].toString(16).padStart(2, "0");
244
+ return text;
245
+ };
246
+ const bitCount = (value) => {
247
+ let remaining = value >>> 0;
248
+ let count = 0;
249
+ while (remaining !== 0) {
250
+ count += remaining & 1;
251
+ remaining >>>= 1;
252
+ }
253
+ return count;
254
+ };
255
+ const hex4 = (value) => value.toString(16).padStart(4, "0");
256
+ const hex8 = (value) => `0x${(value >>> 0).toString(16).padStart(8, "0")}`;
257
+ //# sourceMappingURL=decodeProductionAudioAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeProductionAudioAsset.js","sourceRoot":"","sources":["../../src/audio/decodeProductionAudioAsset.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,MAAM,0BAA0B,GASO,CAAC,KAS9C,EAAyC,EAAE;IAC1C,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC;QAC3E,IAAI,CACF,KAAK,CAAC,IAAI,EACV,aAAa,EACb,wBAAwB,KAAK,CAAC,UAAU,6EAA6E,CACtH,CAAC;IACJ,MAAM,KAAK,GAAe,KAAK,CAAC,KAAK,CAAC;IACtC,IAAI,KAAK,CAAC,UAAU,GAAG,EAAE;QACvB,IAAI,CACF,KAAK,CAAC,IAAI,EACV,aAAa,EACb,MAAM,KAAK,CAAC,UAAU,kDAAkD,eAAe,EAAE,CAC1F,CAAC;IACJ,MAAM,IAAI,GAAa,IAAI,QAAQ,CACjC,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,CACjB,CAAC;IACF,MAAM,IAAI,GAAW,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxC,MAAM,IAAI,GAAW,QAAQ,CAAC,KAAK,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E,IAAI,SAAS,GAAW,KAAK,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,GAAW,CAAC,CAAC;IACtB,OAAO,SAAS,KAAK,CAAC,EAAE,CAAC;QACvB,KAAK,IAAI,SAAS,GAAG,CAAC,CAAC;QACvB,SAAS,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,IAAI,GAA8B,CAAC,KAAa,EAAU,EAAE,CAChE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAEtC,MAAM,IAAI,GAA8B,CAAC,KAAa,EAAU,EAAE,CAChE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./decodeProductionAudioAsset";
2
+ export * from "./IAutoMovieDecodedProductionAudioAsset";
3
+ export * from "./IAutoMovieProductionAudioProcessing";
4
+ export * from "./IAutoMovieProductionWaveSourceFormat";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./decodeProductionAudioAsset"), exports);
18
+ __exportStar(require("./IAutoMovieDecodedProductionAudioAsset"), exports);
19
+ __exportStar(require("./IAutoMovieProductionAudioProcessing"), exports);
20
+ __exportStar(require("./IAutoMovieProductionWaveSourceFormat"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/audio/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,0EAAwD;AACxD,wEAAsD;AACtD,yEAAuD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Decode one raw P6 RGB8 image under an explicitly supplied transfer convention.
3
+ * The @automovie/ingest entry exposes this codec without the
4
+ * broader glTF SDK's runtime imports or declaration-library requirements.
5
+ * The initial subset admits maxval 255, comments before numeric header tokens
6
+ * and exactly one whitespace byte between maxval and raster. It rejects P3,
7
+ * 16-bit samples, image sequences and trailing bytes. A raster byte that happens
8
+ * to be whitespace or '#' is pixel data and is never skipped.
9
+ * Netpbm normally specifies BT.709; sRGB is its documented common variation.
10
+ * The decoder preserves samples without performing colour conversion.
11
+ * See https://netpbm.sourceforge.net/doc/ppm.html.
12
+ *
13
+ * @evidence contracts/development/implementation.md#principled-implementation The documented P6 header and exact RGB raster length determine decoding; explicit transfer metadata avoids relabeling standard BT.709 samples as sRGB. Pixel/header budgets are validated before the detached output allocation.
14
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This renderer-free byte codec performs only admission and RGB extraction; capture calibration, foreground observation and source publication remain with their owners.
15
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No header repair, ignored trailing image, post-header whitespace skipping, unsupported maxval rescaling or implicit colour conversion changes fixed bytes.
16
+ * @evidence contracts/development/common.md#meaningful-documentation States the admitted P6 subset, comments, delimiter/raster distinction, detached ownership, transfer declaration, unsupported variants and budget refusal.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms Parsing costs O(H) for admitted header bytes and one O(P) RGB copy for P pixels; maxHeaderBytes and maxPixels bound both populations before allocation.
18
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each synchronous call decodes caller-supplied fixed bytes once and defines no cross-request cache.
19
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns one detached RGB8 result; borrowed source bytes and constant header scratch are released from the call without handles or global retention.
20
+ */
21
+ export declare function decodeAutoMoviePpmImage(bytes: Uint8Array, options: {
22
+ maxPixels: number;
23
+ maxHeaderBytes: number;
24
+ transfer: "srgb" | "bt709" | "linear";
25
+ }): {
26
+ width: number;
27
+ height: number;
28
+ rgb8: Uint8Array;
29
+ transfer: "srgb" | "bt709" | "linear";
30
+ };
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeAutoMoviePpmImage = decodeAutoMoviePpmImage;
4
+ /**
5
+ * Decode one raw P6 RGB8 image under an explicitly supplied transfer convention.
6
+ * The @automovie/ingest entry exposes this codec without the
7
+ * broader glTF SDK's runtime imports or declaration-library requirements.
8
+ * The initial subset admits maxval 255, comments before numeric header tokens
9
+ * and exactly one whitespace byte between maxval and raster. It rejects P3,
10
+ * 16-bit samples, image sequences and trailing bytes. A raster byte that happens
11
+ * to be whitespace or '#' is pixel data and is never skipped.
12
+ * Netpbm normally specifies BT.709; sRGB is its documented common variation.
13
+ * The decoder preserves samples without performing colour conversion.
14
+ * See https://netpbm.sourceforge.net/doc/ppm.html.
15
+ *
16
+ * @evidence contracts/development/implementation.md#principled-implementation The documented P6 header and exact RGB raster length determine decoding; explicit transfer metadata avoids relabeling standard BT.709 samples as sRGB. Pixel/header budgets are validated before the detached output allocation.
17
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This renderer-free byte codec performs only admission and RGB extraction; capture calibration, foreground observation and source publication remain with their owners.
18
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No header repair, ignored trailing image, post-header whitespace skipping, unsupported maxval rescaling or implicit colour conversion changes fixed bytes.
19
+ * @evidence contracts/development/common.md#meaningful-documentation States the admitted P6 subset, comments, delimiter/raster distinction, detached ownership, transfer declaration, unsupported variants and budget refusal.
20
+ * @evidence contracts/development/implementation.md#efficient-algorithms Parsing costs O(H) for admitted header bytes and one O(P) RGB copy for P pixels; maxHeaderBytes and maxPixels bound both populations before allocation.
21
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each synchronous call decodes caller-supplied fixed bytes once and defines no cross-request cache.
22
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns one detached RGB8 result; borrowed source bytes and constant header scratch are released from the call without handles or global retention.
23
+ */
24
+ function decodeAutoMoviePpmImage(bytes, options) {
25
+ if (!(bytes instanceof Uint8Array) ||
26
+ !options ||
27
+ !Number.isSafeInteger(options.maxPixels) ||
28
+ options.maxPixels <= 0 ||
29
+ !Number.isSafeInteger(options.maxHeaderBytes) ||
30
+ options.maxHeaderBytes <= 0 ||
31
+ !["srgb", "bt709", "linear"].includes(options.transfer))
32
+ throw new Error("PPM decoding requires bytes, explicit transfer and positive integer budgets");
33
+ const whitespace = (byte) => byte === 32 || (byte >= 9 && byte <= 13);
34
+ if (bytes[0] !== 80 || bytes[1] !== 54 || !whitespace(bytes[2]))
35
+ throw new Error("Only a raw P6 image is supported");
36
+ let cursor = 2;
37
+ const advance = () => {
38
+ if (++cursor > options.maxHeaderBytes || cursor >= bytes.length)
39
+ throw new Error("PPM header is truncated or exceeds maxHeaderBytes");
40
+ };
41
+ const token = () => {
42
+ while (cursor < bytes.length) {
43
+ if (bytes[cursor] === 35) {
44
+ while (bytes[cursor] !== 10 && bytes[cursor] !== 13)
45
+ advance();
46
+ }
47
+ else if (!whitespace(bytes[cursor]))
48
+ break;
49
+ advance();
50
+ }
51
+ let value = 0, digits = 0;
52
+ while (bytes[cursor] >= 48 && bytes[cursor] <= 57) {
53
+ value = value * 10 + bytes[cursor] - 48;
54
+ digits++;
55
+ if (!Number.isSafeInteger(value))
56
+ throw new Error("PPM numeric header exceeds safe integer precision");
57
+ advance();
58
+ }
59
+ if (!digits || !(whitespace(bytes[cursor]) || bytes[cursor] === 35))
60
+ throw new Error("PPM header requires decimal integer tokens");
61
+ return value;
62
+ };
63
+ const width = token(), height = token(), maximum = token();
64
+ if (maximum !== 255)
65
+ throw new Error("Only maxval 255 RGB8 PPM images are supported");
66
+ if (!whitespace(bytes[cursor]) || cursor + 1 > options.maxHeaderBytes)
67
+ throw new Error("PPM raster needs exactly one whitespace delimiter within the header budget");
68
+ cursor++;
69
+ const pixels = width * height;
70
+ if (width <= 0 ||
71
+ height <= 0 ||
72
+ !Number.isSafeInteger(pixels) ||
73
+ pixels > options.maxPixels)
74
+ throw new Error("PPM dimensions are invalid or exceed maxPixels");
75
+ if (bytes.length - cursor !== 3 * pixels)
76
+ throw new Error("PPM requires exactly one complete RGB8 raster without trailing bytes");
77
+ return {
78
+ width,
79
+ height,
80
+ rgb8: new Uint8Array(bytes.subarray(cursor)),
81
+ transfer: options.transfer,
82
+ };
83
+ }
84
+ //# sourceMappingURL=decodeAutoMoviePpmImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeAutoMoviePpmImage.js","sourceRoot":"","sources":["../src/decodeAutoMoviePpmImage.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iCACE,KAAiB,EACjB,OAIC;IAOD,IACE,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC;QAC9B,CAAC,OAAO;QACR,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC;QACxC,OAAO,CAAC,SAAS,IAAI,CAAC;QACtB,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,cAAc,CAAC;QAC7C,OAAO,CAAC,cAAc,IAAI,CAAC;QAC3B,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;QAEvD,MAAM,IAAI,KAAK,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,OAAO,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { IAutoMovieSkeleton } from "@automovie/interface";
2
+ import type { Document } from "@gltf-transform/core";
3
+ /**
4
+ * Retarget a parsed glTF's skins onto a normalized humanoid {@link IAutoMovieSkeleton} by matching joint names to {@link AutoMovieHumanoidBone} slots.
5
+ *
6
+ * This naming-based mapper currently has test callers in this repository. Production motion adoption uses an explicit mapping against inspected nodes, so this export does not establish a production rig-inference flow.
7
+ *
8
+ * Every skin is read in document order and the first joint to claim a slot keeps it, because exporters bind clothes, hair and accessories as separate skins in no guaranteed order and the body rig must be found wherever it sits. A joint name maps through the supported Blender-style, Mixamo, VRM-style and Unreal mannequin aliases; fingers, eyes and jaw are not mapped.
9
+ *
10
+ * The hierarchy is rebuilt over mapped joints only: a bone's parent is its nearest mapped ancestor in the node tree, and the local TRS of every skipped helper node between them composes into the bone's rest, because {@link IAutoMovieBone.rest} is relative to `parent` and a dropped helper offset or roll would misplace every bone beneath it. With finite unit-quaternion TRS inputs, composition represents the affine product up to floating-point rounding when each helper scale commutes with its child rotation; otherwise it drops shear. This mapper does not admit or normalize raw node TRS. A root bone keeps its own local TRS, since armature and scene transforms belong to the imported object rather than the skeleton. Bones carry no constraint.
11
+ *
12
+ * @param doc Parsed document; it is only read.
13
+ * @param skeletonId Id for the returned skeleton.
14
+ * @returns The skeleton with bones in first-claim order, or `null` when no skin joint maps to the required `hips` slot.
15
+ *
16
+ * @evidence contracts/development/implementation.md#principled-implementation Slots come from a normalized alias table, the hierarchy from a child-to-parent map walked to the nearest mapped ancestor, and each rest from composing skipped helper TRS with `composeLocalTransform`; that composition drops the shear a non-uniform helper scale under a rotated child would need, the limitation the documentation states.
17
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns slot claiming and hierarchy rebuilding, while name normalization and transform composition live in internal modules the byte inspector and motion adoption share, so the alias table and the composition formula each exist once.
18
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The alias table is this importer's declared naming vocabulary, not proof of bone anatomy; the table is a `Map`, so a joint named after an `Object.prototype` member such as `constructor` maps to nothing instead of an inherited function, and first-claim order is the documented rule for duplicate slots.
19
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the every-skin first-claim rule and its reason, the covered naming conventions and unmapped fingers, eyes and jaw, the helper composition and its exactness, the root-bone exception, the null cases, and that constraints are left empty.
20
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins and joints, joint-name text normalization, nodes and child links, and each mapped bone's walk to the nearest mapped ancestor; hash lookups have expected constant cost, while each helper walk may revisit ancestors.
21
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Slot and parent maps are call-local; repeated ancestor walks remain bounded by mapped slots and document depth, while mutable Document contents and the requested skeleton id preclude a retained identity-only cache.
22
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The slot and parent maps and the helper arrays are local and released on return or throw; the returned skeleton holds new transform objects proportional to the mapped bones, at most the humanoid slot count, owned by the caller.
23
+ */
24
+ export declare const humanoidSkeleton: (doc: Document, skeletonId?: string) => IAutoMovieSkeleton | null;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.humanoidSkeleton = void 0;
4
+ const composeLocalTransform_1 = require("./internal/composeLocalTransform");
5
+ const humanoidBoneOfName_1 = require("./internal/humanoidBoneOfName");
6
+ /**
7
+ * Retarget a parsed glTF's skins onto a normalized humanoid {@link IAutoMovieSkeleton} by matching joint names to {@link AutoMovieHumanoidBone} slots.
8
+ *
9
+ * This naming-based mapper currently has test callers in this repository. Production motion adoption uses an explicit mapping against inspected nodes, so this export does not establish a production rig-inference flow.
10
+ *
11
+ * Every skin is read in document order and the first joint to claim a slot keeps it, because exporters bind clothes, hair and accessories as separate skins in no guaranteed order and the body rig must be found wherever it sits. A joint name maps through the supported Blender-style, Mixamo, VRM-style and Unreal mannequin aliases; fingers, eyes and jaw are not mapped.
12
+ *
13
+ * The hierarchy is rebuilt over mapped joints only: a bone's parent is its nearest mapped ancestor in the node tree, and the local TRS of every skipped helper node between them composes into the bone's rest, because {@link IAutoMovieBone.rest} is relative to `parent` and a dropped helper offset or roll would misplace every bone beneath it. With finite unit-quaternion TRS inputs, composition represents the affine product up to floating-point rounding when each helper scale commutes with its child rotation; otherwise it drops shear. This mapper does not admit or normalize raw node TRS. A root bone keeps its own local TRS, since armature and scene transforms belong to the imported object rather than the skeleton. Bones carry no constraint.
14
+ *
15
+ * @param doc Parsed document; it is only read.
16
+ * @param skeletonId Id for the returned skeleton.
17
+ * @returns The skeleton with bones in first-claim order, or `null` when no skin joint maps to the required `hips` slot.
18
+ *
19
+ * @evidence contracts/development/implementation.md#principled-implementation Slots come from a normalized alias table, the hierarchy from a child-to-parent map walked to the nearest mapped ancestor, and each rest from composing skipped helper TRS with `composeLocalTransform`; that composition drops the shear a non-uniform helper scale under a rotated child would need, the limitation the documentation states.
20
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns slot claiming and hierarchy rebuilding, while name normalization and transform composition live in internal modules the byte inspector and motion adoption share, so the alias table and the composition formula each exist once.
21
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The alias table is this importer's declared naming vocabulary, not proof of bone anatomy; the table is a `Map`, so a joint named after an `Object.prototype` member such as `constructor` maps to nothing instead of an inherited function, and first-claim order is the documented rule for duplicate slots.
22
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the every-skin first-claim rule and its reason, the covered naming conventions and unmapped fingers, eyes and jaw, the helper composition and its exactness, the root-bone exception, the null cases, and that constraints are left empty.
23
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins and joints, joint-name text normalization, nodes and child links, and each mapped bone's walk to the nearest mapped ancestor; hash lookups have expected constant cost, while each helper walk may revisit ancestors.
24
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Slot and parent maps are call-local; repeated ancestor walks remain bounded by mapped slots and document depth, while mutable Document contents and the requested skeleton id preclude a retained identity-only cache.
25
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The slot and parent maps and the helper arrays are local and released on return or throw; the returned skeleton holds new transform objects proportional to the mapped bones, at most the humanoid slot count, owned by the caller.
26
+ */
27
+ const humanoidSkeleton = (doc, skeletonId = "skeleton") => {
28
+ const skins = doc.getRoot().listSkins();
29
+ if (skins.length === 0)
30
+ return null;
31
+ const slotByNode = new Map();
32
+ const used = new Set();
33
+ for (const skin of skins)
34
+ for (const joint of skin.listJoints()) {
35
+ const slot = (0, humanoidBoneOfName_1.humanoidBoneOfName)(joint.getName());
36
+ if (slot !== undefined && used.has(slot) === false) {
37
+ slotByNode.set(joint, slot);
38
+ used.add(slot);
39
+ }
40
+ }
41
+ if (used.has("hips") === false)
42
+ return null;
43
+ const parentNode = new Map();
44
+ for (const node of doc.getRoot().listNodes())
45
+ for (const child of node.listChildren())
46
+ parentNode.set(child, node);
47
+ const bones = [];
48
+ for (const [node, slot] of slotByNode) {
49
+ const helpers = [];
50
+ let ancestor = parentNode.get(node);
51
+ let parent = null;
52
+ while (ancestor !== undefined) {
53
+ const mapped = slotByNode.get(ancestor);
54
+ if (mapped !== undefined) {
55
+ parent = mapped;
56
+ break;
57
+ }
58
+ helpers.push(ancestor);
59
+ ancestor = parentNode.get(ancestor);
60
+ }
61
+ let rest = localTransform(node);
62
+ if (parent !== null)
63
+ for (const helper of helpers)
64
+ rest = (0, composeLocalTransform_1.composeLocalTransform)(localTransform(helper), rest);
65
+ bones.push({ bone: slot, parent, rest, constraint: null });
66
+ }
67
+ return { id: skeletonId, bones };
68
+ };
69
+ exports.humanoidSkeleton = humanoidSkeleton;
70
+ const localTransform = (node) => {
71
+ const t = node.getTranslation();
72
+ const r = node.getRotation();
73
+ const s = node.getScale();
74
+ return {
75
+ translation: { x: t[0], y: t[1], z: t[2] },
76
+ rotation: { x: r[0], y: r[1], z: r[2], w: r[3] },
77
+ scale: { x: s[0], y: s[1], z: s[2] },
78
+ };
79
+ };
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;IACnC,MAAM,CAAC,GAAS,IAAI,CAAC,QAAQ,EAAE,CAAC;IAChC,OAAO;QACL,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1C,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QAChD,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;KACrC,CAAC;AACJ,CAAC,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ export * from "./audio";
2
+ export * from "./ingestDocument";
3
+ export * from "./humanoidSkeleton";
4
+ export * from "./IAutoMovieExternalModelResource";
5
+ export * from "./IAutoMovieExternalModelInspection";
6
+ export * from "./AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE";
7
+ export * from "./IAutoMovieExternalMotionNodeInspection";
8
+ export * from "./IAutoMovieExternalMotionInspection";
9
+ export * from "./AutoMovieExternalModelIngestProfile";
10
+ export * from "./AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES";
11
+ export * from "./isAutoMovieExternalModelIngestProfile";
12
+ export * from "./inspectAutoMovieExternalModelBytes";
13
+ export * from "./IAutoMovieExternalMotionSource";
14
+ export * from "./IAutoMovieExternalMotionBoneMapping";
15
+ export * from "./AutoMovieExternalMotionAdoptionDecision";
16
+ export * from "./IAutoMovieExternalMotionNativeDecision";
17
+ export * from "./IAutoMovieExternalMotionRetargetDecision";
18
+ export * from "./IAutoMovieExternalMotionNativeHandoff";
19
+ export * from "./IAutoMovieExternalMotionRetargetHandoff";
20
+ export * from "./IAutoMovieExternalMotionAdoption";
21
+ export * from "./adoptAutoMovieExternalMotion";
22
+ export * from "./IAutoMovieIngestResult";
23
+ export * from "./decodeAutoMoviePpmImage";