forked from RobertGawron/supper-resolution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSRImage.py
40 lines (29 loc) · 744 Bytes
/
SRImage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
__version__ = '2.1'
__licence__ = 'FreeBSD License'
__author__ = 'Robert Gawron'
from PIL import Image
import Camera
"""
Abstraction of an image, later it will a wrapper for C module.
"""
class SRImage:
def __init__(self):
pass
def openFromFile(self, filename):
self.image = Image.open(filename)
def openFromLibImg(self, image):
self.image = image
def openFromArray(self, array):
assert(False)
def save(self, filename):
self.image.save(filename)
#tmp fix
def toLibImgType(self):
return self.image
@property
def w(self):
return self.image.size[0]
@property
def h(self):
return self.image.size[1]