Eyetracker |

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics Class Reference
Inheritance diagram for pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics:

## Public Member Functions
| __init__ (self, libeyelink, tracker)
| draw_menu_screen (self)
| close (self)
| new_array (self)
| set_tracker (self, tracker)
| setup_cal_display (self)
| exit_cal_display (self)
| record_abort_hide (self)
| clear_cal_display (self)
| erase_cal_target (self)
| draw_cal_target (self, x, y)
| play_beep (self, beepid)
| draw_line (self, x1, y1, x2, y2, colorindex)
| draw_lozenge (self, x, y, w, h, colorindex)
| draw_title (self)
| get_mouse_state (self)
| get_input_key (self)
| exit_image_display (self)
| alert_printf (self, msg)
| setup_image_display (self, width, height)
| image_title (self, text)
| draw_image_line (self, width, line, totlines, buff)
| set_image_palette (self, r, g, b)

## Public Attributes
| libeyelink = libeyelink
| display = libeyelink.display
| screen = Screen(disptype=settings.DISPTYPE, mousevisible=False)
| kb = Keyboard(keylist=None, timeout=0)
| mouse = Mouse(timeout=0)
| tmp_file = os.path.join(tempfile.gettempdir(), '__eyelink__.jpg')
int | xc = self.display.dispsize[0]/2
int | yc = self.display.dispsize[1]/2
bool | extra_info = True
int | ld = 40
| fontsize = libeyelink.fontsize
str | title = ""
bool | display_open = True
dict | color
| font = pygame.font.SysFont('Courier New', 11)
str | state = None
list | pal = None
tuple | size = (0,0)
int | last_mouse_state = -1
str | bit64 = '64bit' in platform.architecture()
| imagebuffer = self.new_array()
| menuscreen = Screen(disptype=settings.DISPTYPE, mousevisible=False)
| tracker = tracker
| tracker_version = tracker.getTrackerVersion()
| cam_img = self.new_array()
bool | esc_pressed = True
int | scale = totlines/320.

## Protected Attributes
| _size

## Detailed Description

        Implements the EyeLink graphics that are shown on the experimental PC, such
        as the camera image, and the calibration dots. This class only implements
        the drawing operations, and little to no of the logic behind the set-up,
        which is implemented in PyLink.

## Constructor & Destructor Documentation

## ◆ __init__()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.__init__ | ( |  | self,
|  |  | libeyelink,
|  |  | tracker )

            Constructor.

            Arguments:
            libeyelink  --  A libeyelink object.
            tracker     --  An tracker object as returned by pylink.EyeLink().

## Member Function Documentation

## ◆ alert_printf()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.alert_printf | ( |  | self,
|  |  | msg )

            Prints alert message.

            Arguments:
            msg     --  The message to be played.

## ◆ clear_cal_display()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.clear_cal_display | ( |  | self | ) |

    Clears the calibration display

## ◆ close()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.close | ( |  | self | ) |

            Is called when the connection and display are shutting down.

## ◆ draw_cal_target()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_cal_target | ( |  | self,
|  |  | x,
|  |  | y )

            Draws calibration target.

            Arguments:
            x       --  The X coordinate of the target.
            y       --  The Y coordinate of the target.

## ◆ draw_image_line()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_image_line | ( |  | self,
|  |  | width,
|  |  | line,
|  |  | totlines,
|  |  | buff )

            Draws a single eye video frame, line by line.

            Arguments:

            width       --  Width of the video.
            line        --  Line nr of current line.
            totlines    --  Total lines in video.
            buff        --  Frame buffer.
            imagesize   --  The size of the image, which is (usually?) 192x160 px.

## ◆ draw_line()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_line | ( |  | self,
|  |  | x1,
|  |  | y1,
|  |  | x2,
|  |  | y2,
|  |  | colorindex )

            Unlike the function name suggests, this draws a single pixel. I.e.
            the end coordinates are always exactly one pixel away from the start
            coordinates.

            Arguments:
            x1          --  The starting x.
            y1          --  The starting y.
            x2          --  The end x.
            y2          --  The end y.
            colorIndex  --  A color index.

## ◆ draw_lozenge()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_lozenge | ( |  | self,
|  |  | x,
|  |  | y,
|  |  | w,
|  |  | h,
|  |  | colorindex )

            desc:
                Draws a rectangle.

            arguments:
                x:
                    desc:   X coordinate.
                    type:   int
                y:
                    desc:   Y coordinate.
                    type:   int
                w:
                    desc:   A width.
                    type:   int
                h:
                    desc:   A height.
                    type:   int
                colorindex:
                    desc:   A colorindex.
                    type:   int

## ◆ draw_menu_screen()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_menu_screen | ( |  | self | ) |

            desc:
                Draws the menu screen.

## ◆ draw_title()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.draw_title | ( |  | self | ) |

            desc:
                Draws title info.

## ◆ erase_cal_target()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.erase_cal_target | ( |  | self | ) |

    TODO: What does this do?

## ◆ exit_cal_display()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.exit_cal_display | ( |  | self | ) |

    Exits calibration display.

## ◆ exit_image_display()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.exit_image_display | ( |  | self | ) |

    Exits the image display.

## ◆ get_input_key()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.get_input_key | ( |  | self | ) |

            Gets an input key.

            Returns:
            A list containing a single pylink key identifier.

## ◆ get_mouse_state()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.get_mouse_state | ( |  | self | ) |

            desc:
                Gets the mouse position and state.

            returns:
                desc:   A (pos, state) tuple.
                type:   tuple.

## ◆ image_title()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.image_title | ( |  | self,
|  |  | text )

            Sets the current image title.

            Arguments:
            text    --  An image title.

## ◆ new_array()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.new_array | ( |  | self | ) |

            Creates a new array with a system-specific format.

            Returns:
            An array.

## ◆ play_beep()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.play_beep | ( |  | self,
|  |  | beepid )

            Plays a sound.

            Arguments:
            beepid      --  A number that identifies the sound.

## ◆ record_abort_hide()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.record_abort_hide | ( |  | self | ) |

    TODO: What does this do?

## ◆ set_image_palette()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.set_image_palette | ( |  | self,
|  |  | r,
|  |  | g,
|  |  | b )

            Sets the image palette.

            TODO: What this function actually does is highly mysterious. Figure it
            out!

            Arguments:
            r       --  The red channel.
            g       --  The green channel.
            b       --  The blue channel.

## ◆ set_tracker()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.set_tracker | ( |  | self,
|  |  | tracker )

            Connects the tracker to the graphics environment.

            Arguments:
            tracker     --  An tracker object as returned by pylink.EyeLink().

## ◆ setup_cal_display()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.setup_cal_display | ( |  | self | ) |

            Sets up the initial calibration display, which contains a menu with
            instructions.

## ◆ setup_image_display()

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.setup_image_display | ( |  | self,
|  |  | width,
|  |  | height )

            Initializes the buffer that will contain the camera image.

            Arguments:
            width       --  The width of the image.
            height      --  The height of the image.

## Member Data Documentation

## ◆ _size

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics._size
| protected

Initial value:
= int(self.scale*self.size[0]), int(
self.scale*self.size[1])

## ◆ bit64

str pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.bit64 = '64bit' in platform.architecture()

## ◆ cam_img

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.cam_img = self.new_array()

## ◆ color

dict pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.color

Initial value:
= {
pylink.CR_HAIR_COLOR: pygame.Color('white'),
pylink.PUPIL_HAIR_COLOR: pygame.Color('white'),
pylink.PUPIL_BOX_COLOR: pygame.Color('green'),
pylink.SEARCH_LIMIT_BOX_COLOR: pygame.Color('red'),
pylink.MOUSE_CURSOR_COLOR: pygame.Color('red'),
'font': pygame.Color('white'),
}

## ◆ display

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.display = libeyelink.display

## ◆ display_open

bool pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.display_open = True

## ◆ esc_pressed

bool pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.esc_pressed = True

## ◆ extra_info

bool pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.extra_info = True

## ◆ font

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.font = pygame.font.SysFont('Courier New', 11)

## ◆ fontsize

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.fontsize = libeyelink.fontsize

## ◆ imagebuffer

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.imagebuffer = self.new_array()

## ◆ kb

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.kb = Keyboard(keylist=None, timeout=0)

## ◆ last_mouse_state

int pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.last_mouse_state = -1

## ◆ ld

int pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.ld = 40

## ◆ libeyelink

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.libeyelink = libeyelink

## ◆ menuscreen

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.menuscreen = Screen(disptype=settings.DISPTYPE, mousevisible=False)

## ◆ mouse

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.mouse = Mouse(timeout=0)

## ◆ pal

list pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.pal = None

## ◆ scale

int pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.scale = totlines/320.

## ◆ screen

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.screen = Screen(disptype=settings.DISPTYPE, mousevisible=False)

## ◆ size

tuple pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.size = (0,0)

## ◆ state

str pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.state = None

## ◆ title

str pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.title = ""

## ◆ tmp_file

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.tmp_file = os.path.join(tempfile.gettempdir(), '__eyelink__.jpg')

## ◆ tracker

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.tracker = tracker

## ◆ tracker_version

pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.tracker_version = tracker.getTrackerVersion()

## ◆ xc

int pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.xc = self.display.dispsize[0]/2

## ◆ yc

int pygaze._eyetracker.eyelinkgraphics.EyelinkGraphics.yc = self.display.dispsize[1]/2

The documentation for this class was generated from the following file:

- C:/Users/lurax/eyetrackingTobii/pygaze/_eyetracker/eyelinkgraphics.py