Class CameraSettings

The CameraSettings implements several custom settings for the camera such as horizontal FOV, clip distance, shutter speed, etc.

The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the settings with updates values. It also implies that the values of the settings cannot be directly modified.

The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

Constructors

  • Parameters

    • OptionalprojectionType: EnumValue<ProjectionType, number>
    • OptionalorthographicProjectionHeight: number
    • OptionalhorizontalFOV: rsx.Degree
    • OptionalnearClipDistance: number
    • OptionalfarClipDistance: number
    • OptionalaspectRatio: EnumValue<ViewportAspectRatio, number>
    • OptionalcustomAspectRatio: number
    • OptionalshutterSpeed: number
    • OptionalisoValue: number
    • OptionalfStop: number
    • OptionalfovMode: EnumValue<FieldOfViewMode, number>
    • OptionalfocalLength: number
    • OptionalfocusDistance: number
    • OptionalsensorWidth: number
    • OptionalapertureBladeCount: number

    Returns CameraSettings

Properties

_apertureBladeCount: number
_aspectRatio: EnumValue<ViewportAspectRatio, number>
_customAspectRatio: number
_farClipDistance: number
_focalLength: number
_focusDistance: number
_fovMode: EnumValue<FieldOfViewMode, number>
_fStop: number
_horizontalFOV: rsx.Degree
_isoValue: number
_nearClipDistance: number
_orthographicProjectionHeight: number
_projectionType: EnumValue<ProjectionType, number>
_sensorWidth: number
_shutterSpeed: number

Accessors

  • get apertureBladeCount(): number
  • Determines the number of blades of the aperture on a camera. Should be in range [3, 32]. The more blades are used the rounder the aperture hole is. The most important case is bokeh shape while rendering depth-of-field.

    Returns number

  • set apertureBladeCount(value): void
  • Parameters

    • value: number

    Returns void

  • get customAspectRatio(): number
  • Determines the current viewport aspect ratio (width / height).

    Returns number

  • set customAspectRatio(value): void
  • Parameters

    • value: number

    Returns void

  • get farClipDistance(): number
  • Determines the distance from the frustum to the far clipping plane. Anything farther than the far clipping plane will not be rendered. Increasing this value decreases depth buffer precision.

    Returns number

  • set farClipDistance(value): void
  • Parameters

    • value: number

    Returns void

  • get focalLength(): number
  • Determines the focal length in mm. Focal length primarily controls the field-of-view of the camera, if the physically based field-of-field mode is enabled. Smaller values result in a wider field-of-view.

    Focal length also controls the aperture diameter, as the F-stop value is dependent on focal length. For example, a lens with a focal length of 80mm and a F-stop value of 2.0 will result in aperture diameter of 80/2.0=40mm. See the documentation about F-stop to be aware how aperture diameter influences the resulting image.

    Soft range corresponding to real-world cameras is [10, 600], while a good standard size is 35mm.

    Returns number

  • set focalLength(value): void
  • Parameters

    • value: number

    Returns void

  • get focusDistance(): number
  • Determines the distance in meters at which objects will appear perfectly in focus. Objects in front or behind this distance will slowly go out of focus.

    The range in which the objects remain in focus is determined primarily by the f-stop number, focal distance and the sensor size.

    Returns number

  • set focusDistance(value): void
  • Parameters

    • value: number

    Returns void

  • get fStop(): number
  • Determines the size of the camera aperture when open (i.e. the size of the opening through which the light enters the camera). The value is in f/mm, where 'f' represents the focal distance of the camera.

    Larger values result in smaller aperture, which implies less light entering the camera and also results in shallow depth of field. Exposure times might need to be increased to compensate for the lack of light.

    Smaller values results in larger aperture, which implies more light entering the camera and also results in a deep depth of field.

    Some common real-world F-stop values are: - 1.4 - 2.0 - 2.8 - 4.0 - 5.6 - 8.0 - 11.0 - 16.0 - 22.0 - 32.0

    Returns number

  • set fStop(value): void
  • Parameters

    • value: number

    Returns void

  • get horizontalFOV(): rsx.Degree
  • Horizontal field of view. Determines how wide the camera viewing angle is along the horizontal axis. Vertical FOV is calculated from the horizontal FOV and the aspect ratio.

    Returns rsx.Degree

  • set horizontalFOV(value): void
  • Parameters

    Returns void

  • get isoValue(): number
  • ISO value controlling the sensitivity of the camera film/sensor. Lower values make the film less sensitive, while higher values make it more sensitive. Reasonable range is usually [100, 3200] but higher values are allowed.

    Returns number

  • set isoValue(value): void
  • Parameters

    • value: number

    Returns void

  • get nearClipDistance(): number
  • Determines the distance from the frustum to the near clipping plane. Anything closer than the near clipping plane will not be rendered. Decreasing this value decreases depth buffer precision.

    Returns number

  • set nearClipDistance(value): void
  • Parameters

    • value: number

    Returns void

  • get orthographicProjectionHeight(): number
  • The height of the orthographic project, when the ProjectionMode is Orthographic. The height is specified in world units.

    Returns number

    The orthographic projection width is calculated based on the AspectRatio.

  • set orthographicProjectionHeight(value): void
  • Parameters

    • value: number

    Returns void

  • get sensorWidth(): number
  • Determines the width of the camera sensor in mm. Sensor height will be automatically determined from the width and the aspect ratio. Sensor size is relevant when computing the circle of confusion of the depth of field. If using the physically based field-of-view mode this will also control the camera's field of view (along with focal length). Soft range for this value is [10,50].

    Returns number

  • set sensorWidth(value): void
  • Parameters

    • value: number

    Returns void

  • get shutterSpeed(): number
  • Determines the time in 1/seconds the camera shutter stays open while recording a single image. Lower values result in more light reaching the sensor and therefore brighter image. Lower values also result in more motion blur if the camera is recording moving objects or the camera itself is moving.

    Returns number

  • set shutterSpeed(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Clones this instance and returns a new CameraSettings with identical values.

    Returns CameraSettings

  • Determines if this CameraSettings instance is equal to the other instance.

    Returns boolean