This file contains hidden or 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
// Takes an ArrayBuffer; returns an array of these objects: | |
// { | |
// seconds: *number of seconds into the video of this image*, | |
// bytes: *the bytes of this image, as an ArrayBuffer* | |
// } | |
var parseBif = function(buffer) { | |
var data = new Uint8Array(buffer); | |
// Make sure this really is a BIF. | |
var magicNumber = [0x89, 0x42, 0x49, 0x46, 0x0d, 0x0a, 0x1a, 0x0a]; |
This file contains hidden or 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
// This work (SDLblit.cpp, by Cory Bloyd) is free of known copyright restrictions. | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
#include <SDL.h> | |
inline uint32_t argb(uint8_t a, uint8_t r, uint8_t g, uint8_t b) { return (a<<24) | (r << 16) | (g << 8) | (b << 0); } | |
int main(int argc, char *argv[]) { | |
SDL_Init(SDL_INIT_VIDEO); | |
SDL_Rect screenRect = { 0,0,1024,1024 }; |