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.FrameAbstract 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.FrameGeneric 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.RandomFrameCreates a Frame with noise, that only has black and white pixels
Greyscale noise¶
-
class
Frame.GreyNoise(width, height, seed)[source]¶ Bases:
Frame.RandomFrameGenerates a frame with grayscale noise
Checkerboard pattern¶
-
class
Frame.Checkerboard(width, height, side_length)[source]¶ Bases:
Frame.FrameA 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.RandomFrameA Frame with a random cloud pattern in it.
Marble pattern¶
-
class
Frame.Marble(width, height, seed)[source]¶ Bases:
Frame.RandomFrameGenerates a Frame with a marble pattern.
Wood grain pattern¶
-
class
Frame.Wood(width, height, seed)[source]¶ Bases:
Frame.RandomFrameGenerates a Frame with a wood grain pattern.
Sine wave modulated grating¶
-
class
Frame.SineWave(width, height, wavelength, angle)[source]¶ Bases:
Frame.WaveFrameSine wave modulated grating pattern Frame.
Square wave modulated grating¶
-
class
Frame.SquareWave(width, height, wavelength, angle)[source]¶ Bases:
Frame.WaveFrameSquare wave modulated grating pattern Frame.
Image file as Frame¶
-
class
Frame.ImageFile(height, filename)[source]¶ Bases:
Frame.FrameA Frame made from a given image file.
Parameters: filename (string) – The name of the file the Frame should be made from.