-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/jsonformat #12
Open
mikewoodworth
wants to merge
2
commits into
develop
Choose a base branch
from
feature/jsonformat
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
#JSON format# | ||
|
||
object { | ||
version: int //this doc describes version 1 | ||
timescale: int | ||
hasAlpha: boolean | ||
framesize: object { //frame size (currently ignored by player) | ||
width: int | ||
height: int | ||
} | ||
frames: array [ | ||
object { //one object per frame.. pass object to blit callback | ||
x: string //frame blit description base64 encoded into string (defined below) | ||
d: number //frame display duration (in timescale defined above) | ||
m: //optional user entered metadata will be returned in callback - any format | ||
} | ||
//additonal frames | ||
] | ||
} | ||
|
||
|
||
#Frame Blit Description# | ||
|
||
The blit description is 1 or more blits packets, each prefaced by a PPS description. The PPS describes the attributes of the blit packets following it. | ||
Format below is var name, followed by size _in bits_. Sizes in {} are based on values encoded previously in the stream. | ||
|
||
##PPS## | ||
blit_type 8 //describes the type of blit packet encoded (see list below) | ||
src_image_index 8 //the source atlas image to blit from, if a frame is made of multiple src atlas images, multiple PPS must be encoded. | ||
block_size 5 //pixel size of blits (width and height) | ||
frame_type 3 //{0 = iFrame, 1 = pFrame } | ||
blitcount 16 //number of blits in this pps, next PPS will start at next byte start after the last blit in this pps | ||
|
||
//all the follwing bitdepth values encode the bitdepth of values encoded in the blit packets follwing this PPS | ||
srcxy_bitdepth 4 //sx/y bitdepth (only need one, since we make sure src image is square | ||
dest_x_bitdepth 4 | ||
dest_y_bitdepth 4 | ||
src_w_bitdepth 4 | ||
src_h_bitdepth 4 | ||
dest_w_bitdepth 4 | ||
dest_h_bitdepth 4 | ||
reserved 52 //reserved | ||
|
||
|
||
##Blit Packets## | ||
(if bitdepth for a value is defined as zero in the PPS, use 0 as retrieved value for further computation) | ||
|
||
###Blit Type 1### | ||
(currently blit type 1 is the only defined type) | ||
Blit Type 1 copies a single block of size src_block_width x src_block_height, from the atlas image at index src_image_index at x,y offset of src_x, src_y into the canvas at offset dest_x, dest_y (scaling it to size of dest_block_width, dest_block_height if defined). | ||
|
||
src_x {srcxy_bitdepth} //to retrieve nominal x multiply by block_size | ||
src_y {srcxy_bitdepth} //to retrieve nominal y multiply by block_size | ||
src_block_width {src_w_bitdepth} //computed as (1+value) in blocksize, to retrieve nominal pixel width multiply by block_size | ||
src_block_height {src_h_bitdepth} //computed as (1+value) in blocksize, to retrieve nominal pixel height multiply by block_size | ||
dest_x {dest_x_bitdepth} //to retrieve nominal x multiply by block_size | ||
dest_y {dest_y_bitdepth} //to retrieve nominal y multiply by block_size | ||
dest_block_width {dest_w_bitdepth} //computed as (1+value) in blocksize, to retrieve nominal pixel width multiply by block_size (if zero, then src size) | ||
dest_block_height {dest_h_bitdepth} //computed as (1+value) in blocksize, to retrieve nominal pixel height multiply by block_size (if zero, then src size) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be clarified a bit?