1.scratch缓冲画布是怎么工作的,由最下层的video,中间的处理画布,最上层的展现画布组成
2.视频的一帧 = 一个像素 = 4个值(R G B ALPHA)
var videos = {
video1: "video/demovideo1",
video2: "video/demovideo2"
};
var effectFunction = null;
window.onload = function() {
var video = document.getElementById("video");
video.src = videos["video1"] + getFormatExtension();
video.load();
// add click handlers to control anchors
var controlLinks = document.querySelectorAll("a.control");
for (var i = 0; i < controlLinks.length; i++) {
controlLinks[i].onclick = handleControl;
}
// add click handlers to effect anchors
var effectLinks = document.querySelectorAll("a.effect");
for (var i = 0; i < effectLinks.length; i++) {
effectLinks[i].onclick = setEffect;
}
// add click handlers to videoSelection anchors
var videoLinks = document.querySelectorAll("a.videoSelection");
for (var i = 0; i < videoLinks.length; i++) {
videoLinks[i].onclick = setVideo;
}
// add click handlers to video play
//video.onplay = processFrame;
//video.onended = endedHandler;
video.addEventListener("play", processFrame, false);
video.addEventListener("ended", endedHandler, false);
pushUnpushButtons("video1", []);
pushUnpushButtons("normal", []);
};
function setEffect(e) {
var id = e.target.getAttribute("id");
if (id == "normal") {
pushUnpushButtons("normal", ["west