Remove from_path and from_array methods

Having these methods and the constructor arguments is a bit redundant.
This commit is contained in:
Tony S Yu
2013-10-21 23:02:47 -05:00
parent 8869724b51
commit a951232702
-37
View File
@@ -309,23 +309,6 @@ class Picture(object):
self._modified = False
self.scale = 1
@staticmethod
def from_path(path):
"""Creates a Picture from an image file.
Parameters
----------
path : str
Path to the image file.
Returns
-------
pic : Picture
A Picture with the image file data loaded.
"""
return Picture(path=path)
@staticmethod
def from_size(size, color='black'):
"""Return a Picture of the specified size and a uniform color.
@@ -344,26 +327,6 @@ class Picture(object):
array = np.ones(rgb_size, dtype=np.uint8) * color
return Picture(array=array)
@staticmethod
def from_array(array):
"""Creates a single color Picture.
Parameters
----------
color : tuple
RGB tuple with the fill color for the picture [0-255]
size : tuple
Width and height of the picture in pixels.
Returns
-------
pic : Picture
A Picture with the given color and size.
"""
return Picture(array=array)
def save(self, path):
"""Saves the picture to the given path.