aboutsummaryrefslogtreecommitdiff
path: root/src/frame.py
diff options
context:
space:
mode:
authortassaron2017-07-13 00:05:11 -0400
committertassaron2017-07-13 00:05:11 -0400
commit8811b699a9c2d6b78af1e2a332d3031aef73aec4 (patch)
treee62f318fb625c5c79314de2eb0ce4b7b93e7496c /src/frame.py
parent2e37dafd7036973a315b525f131850a6fb6d0b35 (diff)
merge consecutive static components
Diffstat (limited to 'src/frame.py')
-rw-r--r--src/frame.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/frame.py b/src/frame.py
index c066cdb..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):
@@ -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