diff --git a/docs.sh b/docs.sh new file mode 100644 index 0000000..9f4d7c8 --- /dev/null +++ b/docs.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Generating documentation for frameloom source" +#This is a little dumb +cp ./frameloom ./docs/frameloom.js +./node_modules/.bin/jsdoc2md ./docs/frameloom.js > ./docs/README.md +rm ./docs/frameloom.js \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..6376565 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,193 @@ +## Functions + +
Promise
Shells out to execute a command with async/await. + Async wrapper to exec module.
+Promise
Delays process for specified amount of time in milliseconds.
+string
Pads a numerical value with preceding zeros to make strings same length.
+Shuffles an array into a random state.
+Clears the temporary directory of all files. + Establishes a directory if none exists.
+string
Exports all frames from video. Appends number to the string + to keep frames in alternating order to be quickly stitched together + or re-sorted.
+Re-arranges the frames into the order specified in the pattern.
+ Calls patternSort()
to perform the rename and unlink actions
Alternate frame sorting method.
+Standard frame sorting method.
+Ramdomly sort frames for re-stitching.
+Render the frames into a video using ffmpeg.
+Parses the arguments and runs the process of exporting, sorting and then + "weaving" the frames back into a video
+Promise
+Shells out to execute a command with async/await.
+ Async wrapper to exec module.
+
+**Kind**: global function
+**Returns**: Promise
- Promise containing the complete stdio
+
+| Param | Type | Description |
+| --- | --- | --- |
+| cmd | string
| Command to execute |
+
+
+
+## delay(ms) ⇒ Promise
+Delays process for specified amount of time in milliseconds.
+
+**Kind**: global function
+**Returns**: Promise
- Promise that resolves after set time
+
+| Param | Type | Description |
+| --- | --- | --- |
+| ms | integer
| Milliseconds to delay for |
+
+
+
+## zeroPad(i, max) ⇒ string
+Pads a numerical value with preceding zeros to make strings same length.
+
+**Kind**: global function
+**Returns**: string
- Padded number as a string
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| i | integer
| | Number to pad |
+| max | integer
| 5
| (optional) Maximum length of string to pad to |
+
+
+
+## shuffle(a)
+Shuffles an array into a random state.
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| a | array
| Array to randomize |
+
+
+
+## clear()
+Clears the temporary directory of all files.
+ Establishes a directory if none exists.
+
+**Kind**: global function
+
+
+## frames(video, order) ⇒ string
+Exports all frames from video. Appends number to the string
+ to keep frames in alternating order to be quickly stitched together
+ or re-sorted.
+
+**Kind**: global function
+**Returns**: string
- String with the export order, not sure why I did this
+
+| Param | Type | Description |
+| --- | --- | --- |
+| video | string
| String representing path to video |
+| order | integer
| Integer to be appended to pathname of file |
+
+
+
+## weave(pattern, realtime)
+Re-arranges the frames into the order specified in the pattern.
+ Calls `patternSort()` to perform the rename and unlink actions
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| pattern | array
| Pattern of the frames per input |
+| realtime | boolean
| Flag to turn on or off realtime behavior (drop frames / number of vids) |
+
+
+
+## altSort(list, pattern, realtime)
+Alternate frame sorting method.
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| list | array
| List of frames to group |
+| pattern | array
| Array representing pattern |
+| realtime | boolean
| Flag to group with "realtime" behavior |
+
+
+
+## standardSort(list, pattern, realtime)
+Standard frame sorting method.
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| list | array
| List of frames to group |
+| pattern | array
| Array representing pattern |
+| realtime | boolean
| Flag to group with "realtime" behavior |
+
+
+
+## randomSort(list, pattern, realtime)
+Ramdomly sort frames for re-stitching.
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| list | array
| List of frames to group |
+| pattern | array
| Array representing pattern |
+| realtime | boolean
| Flag to group with "realtime" behavior |
+
+
+
+## render(output)
+Render the frames into a video using ffmpeg.
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| output | string
| Path to export the video to |
+
+
+
+## main(arg)
+Parses the arguments and runs the process of exporting, sorting and then
+ "weaving" the frames back into a video
+
+**Kind**: global function
+
+| Param | Type | Description |
+| --- | --- | --- |
+| arg | object
| Object containing all arguments |
+