APNGFrameData pack/unpack for BinaryPacker.js
npm install uupaa.binarypacker0x0002.js
APNGFrameData pack/unpack for BinaryPacker.js
- BinaryPacker0x0002.js wiki
- WebModule
- Slide
- Development
``js
var formatID = 0x0002; // APNGFrameData
var source = {
x: 1, y: 2, w: 101, h: 102,
delay: 16.666, blend: 4, dispose: 5,
pixels: new Uint8Array([1,2,3,4,5])
};
var packed = BinaryPacker.pack(source, formatID);
var result = BinaryPacker.unpack(packed);
if ( source.x === result.x &&
source.y === result.y &&
source.w === result.w &&
source.h === result.h) {
console.log("OK");
} else {
console.log("ERROR");
}
`
`js
importScripts("lib/BinaryPacker.js");
importScripts("lib/BinaryPacker0x0002.js");
...
`
`js
var BinaryPacker = require("lib/BinaryPacker.js");
var BinaryPacker0x0002 = require("lib/BinaryPacker0x0002.js");
...
``