resize frame only once
This commit is contained in:
parent
76021b1b78
commit
9d7e6ecdac
1 changed files with 1 additions and 1 deletions
|
@ -72,10 +72,10 @@ class Timeline(Video):
|
||||||
self._ready = True
|
self._ready = True
|
||||||
else:
|
else:
|
||||||
_framePos = int(math.ceil((float(timestamp) / (gst.SECOND) * float(self.framerate))))
|
_framePos = int(math.ceil((float(timestamp) / (gst.SECOND) * float(self.framerate))))
|
||||||
|
frame = frame.resize((1, self.tile_height), Image.ANTIALIAS)
|
||||||
for framePos in range(self.lastPos, _framePos):
|
for framePos in range(self.lastPos, _framePos):
|
||||||
tile = int(math.floor(float(framePos) / self.input_tile_width))
|
tile = int(math.floor(float(framePos) / self.input_tile_width))
|
||||||
tilePos = framePos - (tile * self.input_tile_width)
|
tilePos = framePos - (tile * self.input_tile_width)
|
||||||
frame = frame.resize((1, self.tile_height), Image.ANTIALIAS)
|
|
||||||
for i in range(self.tile_height):
|
for i in range(self.tile_height):
|
||||||
self.tiles[tile].putpixel((tilePos, i), frame.getpixel((0, i)))
|
self.tiles[tile].putpixel((tilePos, i), frame.getpixel((0, i)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue