ScreenConfiguration: R6 Screen Configuration Class

ScreenConfigurationR Documentation

R6 Screen Configuration Class

Description

Provides methods for converting between pixel, millimeter, and degree units.

Public fields

screen_size_x_mm

Screen width in mm.

screen_size_y_mm

Screen height in mm.

screen_res_x_pix

Horizontal screen resolution in pixels.

screen_res_y_pix

Vertical screen resolution in pixels.

viewing_distance_mm

Viewing distance in mm.

Methods

Public methods


Method new()

Creates a new ScreenConfiguration object with screen and viewing distance parameters.

Usage
ScreenConfiguration$new(
  screen_size_x_mm,
  screen_size_y_mm,
  screen_res_x_pix,
  screen_res_y_pix,
  viewing_distance_mm
)
Arguments
screen_size_x_mm

Screen width in millimeters.

screen_size_y_mm

Screen height in millimeters.

screen_res_x_pix

Horizontal screen resolution in pixels.

screen_res_y_pix

Vertical screen resolution in pixels.

viewing_distance_mm

Viewing distance in millimeters.

Returns

A new ScreenConfiguration object.

Examples
sc <- ScreenConfiguration$new(500, 300, 1920, 1080, 600)

Method pix_to_mm()

Converts pixel coordinates to millimeter coordinates on the screen.

Usage
ScreenConfiguration$pix_to_mm(x, y)
Arguments
x

Horizontal pixel coordinate.

y

Vertical pixel coordinate.

Returns

A list with x and y in millimeters.

Examples
sc$pix_to_mm(960, 540)

Method pix_to_deg()

Converts pixel coordinates to an angular gaze direction in degrees.

Usage
ScreenConfiguration$pix_to_deg(x, y)
Arguments
x

Horizontal pixel coordinate.

y

Vertical pixel coordinate.

Returns

A list with azimuth ("azi") and elevation ("ele") in degrees.

Examples
sc$pix_to_deg(960, 540)

Method mm_to_deg()

Converts millimeter coordinates to an angular gaze direction in degrees.

Usage
ScreenConfiguration$mm_to_deg(x, y)
Arguments
x

Horizontal position in millimeters.

y

Vertical position in millimeters.

Returns

A list with azimuth ("azi") and elevation ("ele") in degrees.

Examples
sc$mm_to_deg(100, 50)

Method mm_to_pix()

Converts millimeter coordinates on the screen to pixel coordinates.

Usage
ScreenConfiguration$mm_to_pix(x, y)
Arguments
x

Horizontal position in millimeters.

y

Vertical position in millimeters.

Returns

A list with x and y in pixels.

Examples
sc$mm_to_pix(100, 50)

Method deg_to_mm()

Converts an angular gaze direction in degrees to millimeter coordinates on the screen.

Usage
ScreenConfiguration$deg_to_mm(azi, ele)
Arguments
azi

Azimuth in degrees (Fick angles).

ele

Elevation in degrees (Fick angles).

Returns

A list with x and y in millimeters.

Examples
sc$deg_to_mm(2, 1)

Method deg_to_pix()

Converts an angular gaze direction in degrees to pixel coordinates.

Usage
ScreenConfiguration$deg_to_pix(azi, ele)
Arguments
azi

Azimuth in degrees (Fick angles).

ele

Elevation in degrees (Fick angles).

Returns

A list with x and y in pixels.

Examples
sc$deg_to_pix(2, 1)

Method screen_extents()

Computes the horizontal and vertical extents of the screen (in degrees).

Usage
ScreenConfiguration$screen_extents()
Returns

A list with width and height in degrees.

Examples
sc$screen_extents()

Method clone()

The objects of this class are cloneable with this method.

Usage
ScreenConfiguration$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

sc <- ScreenConfiguration$new(500, 300, 1920, 1080, 600)
sc$pix_to_deg(960, 540)

## ------------------------------------------------
## Method `ScreenConfiguration$new`
## ------------------------------------------------

sc <- ScreenConfiguration$new(500, 300, 1920, 1080, 600)

## ------------------------------------------------
## Method `ScreenConfiguration$pix_to_mm`
## ------------------------------------------------

sc$pix_to_mm(960, 540)

## ------------------------------------------------
## Method `ScreenConfiguration$pix_to_deg`
## ------------------------------------------------

sc$pix_to_deg(960, 540)

## ------------------------------------------------
## Method `ScreenConfiguration$mm_to_deg`
## ------------------------------------------------

sc$mm_to_deg(100, 50)

## ------------------------------------------------
## Method `ScreenConfiguration$mm_to_pix`
## ------------------------------------------------

sc$mm_to_pix(100, 50)

## ------------------------------------------------
## Method `ScreenConfiguration$deg_to_mm`
## ------------------------------------------------

sc$deg_to_mm(2, 1)

## ------------------------------------------------
## Method `ScreenConfiguration$deg_to_pix`
## ------------------------------------------------

sc$deg_to_pix(2, 1)

## ------------------------------------------------
## Method `ScreenConfiguration$screen_extents`
## ------------------------------------------------

sc$screen_extents()

ETDQualitizer documentation built on May 21, 2026, 9:07 a.m.