Screen package#

CheckFrame class#

class CFSVM.Element.Screen.CheckFrame(kwargs)#

Bases: CFSVM.Element.SpatialElement

Handling checkframes on the screen.

Derived from SpatialElement.

Constructor Summary
CheckFrame(kwargs)#
Parameters:
Property Summary
checker_length#

Int - length in pixels of every checker rectangle in the checkframe.

checker_width#

Int - width in pixels of every checker rectangle in the checkframe.

color_codes#

Cell array of chars contating HEX color codes e.g. {‘#0072BD’, ‘#D95319’, ‘#EDB120’, ‘#7E2F8E’} Red-Green {‘#00FF00’, ‘#FF0000’} White-Black {‘#FFFFFF’, ‘#000000’}

colors#

A matrix of size (3,N) for N=number of checkers

rects#

A matrix of size (4,N) for N=number of checkers.

Method Summary
static get_edge_checker_rects(start_coord, checker_length, checker_width, number_of_checkers, edge_shift, is_y)#

Calculates edge rects, given start_coord of the edge, checker parameters, edge shift and boolean is_y if the edge is vertical.

initiate(screenfield)#

Initiates checkframe for a screenfield by generating rects and colors matrices.

Parameters:

screenfieldScreenField object.

static nearest_divisor_of_n_to_m(n, m)#

Given two whole numbers, n and m, finds a third whole number c that holds n_mod_c==0 and has the minimal abs(c-m).

reset()#

Empties rect and color props.

CustomScreen class#

class CFSVM.Element.Screen.CustomScreen(kwargs)#

Storing and manipulating left and right screen areas.

Constructor Summary
CustomScreen(kwargs)#
Parameters:
  • background_colorbackground_color.

  • is_stereo – bool for setting two screenfields. Defaults to false.

  • initial_rect – [x0, y0, x1, y1] array with pixel positions, if is_stereo, position of the left field. Defaults to [0,0,950, 1080].

  • shiftshift. Defaults to 10.

Property Summary
background_color#

Char array of 7 chars containing HEX color.

fields#

Cell array of ScreenField objects.

frame_rate#

Float for display refresh rate.

inter_frame_interval#

Float for empirical time between two frames, approximately equals to 1/frame_rate.

shift#

Int for number of pixels shifted on keypress while adjusting screens.

window#

PTB window object.

Method Summary
adjust(frame)#

Creates interface for adjusting screens to the stereoscope view.

Creates solid frame[s], that can be moved, resized or shifted relative to each other by keyboard keys.

Parameters:

frame@CheckFrame object.

ScreenField class#

class CFSVM.Element.Screen.ScreenField(rect)#

Bases: CFSVM.Element.SpatialElement

Describes fields of the screen as properties of CustomScreen.

Constructor Summary
ScreenField(rect)#
Parameters:

rectrect