mountain_tapir package¶
Submodules¶
mountain_tapir.algorithm module¶
mountain_tapir.config module¶
-
class
mountain_tapir.config.
Config
[source]¶
mountain_tapir.constants module¶
mountain_tapir.controller module¶
-
class
mountain_tapir.controller.
Controller
(model, uiVars)[source]¶ -
addRegions
(delta)[source]¶ Change the number of regions. Note that the number of regions will not be decrease below one.
Parameters: delta – The change required in the number of regions (negative to decrease the number of regions).
-
putImageInPreviewRegion
(imageFile, canvas, region)[source]¶ Put an image in a preview region (or remove the existing image if None is supplied)
-
redrawUsingImages
(imageFiles)[source]¶ Redraw the preview pane and populate the regions using the supplied list of images.
Parameters: imageFiles – The list of image files to use. If there are more images than regions then some will not be used. If there are fewer images than regions then some regions will end up empty.
-
mountain_tapir.image_file module¶
-
class
mountain_tapir.image_file.
ImageFile
(fileName)[source]¶ A class to provide image-based methods for a given file.
-
getImageObject
(dimensions, purpose)[source]¶ Return a
PIL.Image
with the specified dimensions.Parameters: - dimensions – An iterable pair - (width, height).
- purpose – A string describing the purpose of the image. This is used for logging.
-
makeImage
(purpose, dimensions, canvas)[source]¶ Make a
PIL.Image
and put it in the supplied canvas.Parameters: - purpose – A string describing the purpose of the image. This is used for both logging and also when persisting the image so that TK doesn’t garbage collect it.
- dimensions – An iterable pair - (width, height).
- canvas – The
tkinter.Canvas
where the image will be displayed.
-
mountain_tapir.mountain_tapir module¶
mountain_tapir.preview module¶
mountain_tapir.recent_images module¶
mountain_tapir.region_maker module¶
-
class
mountain_tapir.region_maker.
RegionMaker
[source]¶ A region is a tuple (left, top, width, height).
-
static
makeCollageRegions
(model)[source]¶ Start with the whole area as a region. Each iteration pick the ‘worst’ region and split it either horizontally or vertically at a random point. Remove the old region and add the two new regions.
The worst region is defined to be the region furthest from the TARGET_RATIO.
-
static