Static functions¶
Functions that work with Frame objects.
Everything related to making LinMaze Frames.
-
Frame.
multi_make
(list_of_frames)[source]¶ Renders a list of frames with multiprocessing.
Parameters: list_of_frames ([Frame]) – A list of Frame objects that sould be rendered. Returns: A list of rendered Frames.
-
Frame.
transition
(left, right, transition_width)[source]¶ Takes two 2 dimensional matrices representing a grayscale image and returns them with a smooth transition of given width between them.
Parameters: - left (np.array with ndim=2) – The image on the left.
- right (np.array with ndim=2) – The image on the right.
- transition_width (int) – The width of the smooth transition.
Abstract Frame classes¶
Abstract classes for all Frames to inherit from.
Frame¶
-
class
Frame.
Frame
(width, height, rgb=(1, 1, 1))[source]¶ The visual component of the blocks that the mouse navigates in.
Parameters: - width (int) – The width of the Frame in pixels.
- height (int) – The height of the Frame in pixels.
- rgb ((float, float, float)) – The Red, Green and Blue levels of the Frame.
-
static
ext_make
(frame)[source]¶ Tries to load the given Frame from cache or makes it and returns the rendered Frame.
-
make_texture
()[source]¶ Makes the Frame’s texture field that stores RGB data to be used as an OpenGL texture .
Random Frame¶
-
class
Frame.
RandomFrame
(width, height, seed)[source]¶ Bases:
Frame.Frame
Abstract class all randomly generated Frames inherit from.
Parameters: seed – The seed of the random number generator
Wave Frame¶
-
class
Frame.
WaveFrame
(width, height, wavelength, angle)[source]¶ Bases:
Frame.Frame
Generic grating Frame, for more specific ones to inherit form.
Parameters: - wavelength (int) – The wavelength of the grating in pixels, ie. the distance between the middles of the white portions.
- angle (float) – The angle of the graing where 0 is vertical.
Specific Frames¶
All the different types of Frames you can make.
Binary noise¶
-
class
Frame.
BinaryNoise
(width, height, seed)[source]¶ Bases:
Frame.RandomFrame
Creates a Frame with noise, that only has black and white pixels
Greyscale noise¶
-
class
Frame.
GreyNoise
(width, height, seed)[source]¶ Bases:
Frame.RandomFrame
Generates a frame with grayscale noise
Checkerboard pattern¶
-
class
Frame.
Checkerboard
(width, height, side_length)[source]¶ Bases:
Frame.Frame
A Frame with a checkerboard pattern.
Parameters: side_length (int) – The lenght of sides of the squares that make up the checkerboard pattern in pixels.
Cloud pattern¶
-
class
Frame.
Cloud
(width, height, seed)[source]¶ Bases:
Frame.RandomFrame
A Frame with a random cloud pattern in it.
Marble pattern¶
-
class
Frame.
Marble
(width, height, seed)[source]¶ Bases:
Frame.RandomFrame
Generates a Frame with a marble pattern.
Wood grain pattern¶
-
class
Frame.
Wood
(width, height, seed)[source]¶ Bases:
Frame.RandomFrame
Generates a Frame with a wood grain pattern.
Sine wave modulated grating¶
-
class
Frame.
SineWave
(width, height, wavelength, angle)[source]¶ Bases:
Frame.WaveFrame
Sine wave modulated grating pattern Frame.
Square wave modulated grating¶
-
class
Frame.
SquareWave
(width, height, wavelength, angle)[source]¶ Bases:
Frame.WaveFrame
Square wave modulated grating pattern Frame.
Image file as Frame¶
-
class
Frame.
ImageFile
(height, filename)[source]¶ Bases:
Frame.Frame
A Frame made from a given image file.
Parameters: filename (string) – The name of the file the Frame should be made from.