CInema: Clean up size issues
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.2 KiB |
|
@ -8,15 +8,17 @@ Output = namedtuple('Output', ['video'])
|
||||||
class Tracer(object):
|
class Tracer(object):
|
||||||
def __init__(self, core):
|
def __init__(self, core):
|
||||||
self.core = core
|
self.core = core
|
||||||
self.framebuffer = Image(*core.desired_video_dimensions())
|
|
||||||
self.core.set_video_buffer(self.framebuffer)
|
|
||||||
self._video_fifo = []
|
self._video_fifo = []
|
||||||
|
|
||||||
def yield_frames(self, skip=0, limit=None):
|
def yield_frames(self, skip=0, limit=None):
|
||||||
|
self.framebuffer = Image(*self.core.desired_video_dimensions())
|
||||||
|
self.core.set_video_buffer(self.framebuffer)
|
||||||
self.core.reset()
|
self.core.reset()
|
||||||
skip = (skip or 0) + 1
|
skip = (skip or 0) + 1
|
||||||
while skip > 0:
|
while skip > 0:
|
||||||
frame = self.core.frame_counter
|
frame = self.core.frame_counter
|
||||||
|
self.framebuffer = Image(*self.core.desired_video_dimensions())
|
||||||
|
self.core.set_video_buffer(self.framebuffer)
|
||||||
self.core.run_frame()
|
self.core.run_frame()
|
||||||
skip -= 1
|
skip -= 1
|
||||||
while frame <= self.core.frame_counter and limit != 0:
|
while frame <= self.core.frame_counter and limit != 0:
|
||||||
|
|
|
@ -3,7 +3,6 @@ import os.path
|
||||||
import mgba.core
|
import mgba.core
|
||||||
import mgba.image
|
import mgba.image
|
||||||
import cinema.movie
|
import cinema.movie
|
||||||
import itertools
|
|
||||||
import glob
|
import glob
|
||||||
import re
|
import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
@ -73,7 +72,7 @@ class VideoTest(CinemaTest):
|
||||||
self.tracer = cinema.movie.Tracer(self.core)
|
self.tracer = cinema.movie.Tracer(self.core)
|
||||||
|
|
||||||
def generate_frames(self):
|
def generate_frames(self):
|
||||||
for i, frame in zip(itertools.count(), self.tracer.video(**self.output_settings())):
|
for i, frame in enumerate(self.tracer.video(**self.output_settings())):
|
||||||
try:
|
try:
|
||||||
baseline = VideoFrame.load(os.path.join(self.path, self.BASELINE % i))
|
baseline = VideoFrame.load(os.path.join(self.path, self.BASELINE % i))
|
||||||
yield baseline, frame, VideoFrame.diff(baseline, frame)
|
yield baseline, frame, VideoFrame.diff(baseline, frame)
|
||||||
|
@ -85,7 +84,7 @@ class VideoTest(CinemaTest):
|
||||||
assert not any(any(diffs[0].image.convert("L").point(bool).getdata()) for diffs in self.diffs)
|
assert not any(any(diffs[0].image.convert("L").point(bool).getdata()) for diffs in self.diffs)
|
||||||
|
|
||||||
def generate_baseline(self):
|
def generate_baseline(self):
|
||||||
for i, frame in zip(itertools.count(), self.tracer.video(**self.output_settings())):
|
for i, frame in enumerate(self.tracer.video(**self.output_settings())):
|
||||||
frame.save(os.path.join(self.path, self.BASELINE % i))
|
frame.save(os.path.join(self.path, self.BASELINE % i))
|
||||||
|
|
||||||
|
|
||||||
|
|