aboutsummaryrefslogtreecommitdiff
path: root/src/frame.py
diff options
context:
space:
mode:
authorBrianna2017-07-15 19:40:08 -0400
committerGitHub2017-07-15 19:40:08 -0400
commitf420ad69f5f6f3c830fea890a760ce0ce61ba571 (patch)
tree2a7f9df3eebbae8da4317516f84dfe7490b5d36a /src/frame.py
parent94d4acc1f4f4abe4029e8f9c050932b67cae8cec (diff)
parentbcb8f27c2e4434d2296dcd66bf279b76ee0d0a4f (diff)
Merge audio-mixing branch
some basic audio features + more user feedback + merging static components
Diffstat (limited to 'src/frame.py')
-rw-r--r--src/frame.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/frame.py b/src/frame.py
index 57d33b0..cddb611 100644
--- a/src/frame.py
+++ b/src/frame.py
@@ -5,6 +5,11 @@ from PyQt5 import QtGui
from PIL import Image
from PIL.ImageQt import ImageQt
import sys
+import os
+
+
+class Frame:
+ '''Controller class for all frames.'''
class FramePainter(QtGui.QPainter):
@@ -14,7 +19,7 @@ class FramePainter(QtGui.QPainter):
'''
def __init__(self, width, height):
image = BlankFrame(width, height)
- self.image = ImageQt(image)
+ self.image = QtGui.QImage(ImageQt(image))
super().__init__(self.image)
def setPen(self, RgbTuple):
@@ -43,5 +48,19 @@ def FloodFrame(width, height, RgbaTuple):
def BlankFrame(width, height):
- '''The base frame used by each component to start drawing'''
+ '''The base frame used by each component to start drawing.'''
return FloodFrame(width, height, (0, 0, 0, 0))
+
+
+def Checkerboard(width, height):
+ '''
+ A checkerboard to represent transparency to the user.
+ TODO: Would be cool to generate this image with numpy instead.
+ '''
+ image = FloodFrame(1920, 1080, (0, 0, 0, 0))
+ image.paste(Image.open(
+ os.path.join(Frame.core.wd, "background.png")),
+ (0, 0)
+ )
+ image = image.resize((width, height))
+ return image