toViewCoordinatesTransformation

fun toViewCoordinatesTransformation(context: Context, cameraId: String, intrinsicParameters: PinholeCameraIntrinsicParameters, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Parameters

context

Android context.

cameraId

A camera id.

intrinsicParameters

camera intrinsic parameters.

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(context: Context, characteristics: CameraCharacteristics, intrinsicParameters: PinholeCameraIntrinsicParameters, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Parameters

context

Android context.

characteristics

Information about the camera.

intrinsicParameters

camera intrinsic parameters.

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(orientation: CameraToDisplayOrientation, intrinsicParameters: PinholeCameraIntrinsicParameters, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Parameters

orientation

amount of rotation between display and camera sensor. CameraToDisplayOrientation.ORIENTATION_UNKNOWN indicates that orientation is unknown and must be ignored (Y coordinates are not reversed either).

intrinsicParameters

camera intrinsic parameters.

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(rotation: Rotation2D?, intrinsicParameters: PinholeCameraIntrinsicParameters, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Parameters

rotation

counter-clockwise rotation indicating the amount of display rotation respect the camera sensor.

intrinsicParameters

camera intrinsic parameters.

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(context: Context, cameraId: String, pivot: Point2D, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Parameters

context

Android context.

cameraId

A camera id.

pivot

point to use as pivot for rotation.

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(context: Context, characteristics: CameraCharacteristics, pivot: Point2D, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Parameters

context

Android context.

characteristics

Information about the camera.

pivot

point to use as pivot for rotation

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(orientation: CameraToDisplayOrientation, pivot: Point2D, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Parameters

orientation

amount of rotation between display and camera sensor. CameraToDisplayOrientation.ORIENTATION_UNKNOWN indicates that orientation is unknown and must be ignored (Y coordinates are not reversed either).

pivot

point to use as pivot for rotation

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(rotation: Rotation2D?, pivot: Point2D, result: ProjectiveTransformation2D)

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Parameters

rotation

counter-clockwise rotation indicating the amount of display rotation respect the camera sensor.

pivot

point to use as pivot for rotation

result

instance where computed transformation will be stored.


fun toViewCoordinatesTransformation(context: Context, cameraId: String, intrinsicParameters: PinholeCameraIntrinsicParameters): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Return

2D transformation.

Parameters

context

Android context.

cameraId

A camera id.

intrinsicParameters

camera intrinsic parameters.


fun toViewCoordinatesTransformation(context: Context, characteristics: CameraCharacteristics, intrinsicParameters: PinholeCameraIntrinsicParameters): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Return

2D transformation.

Parameters

context

Android context.

characteristics

Information about the camera.

intrinsicParameters

camera intrinsic parameters.


fun toViewCoordinatesTransformation(orientation: CameraToDisplayOrientation, intrinsicParameters: PinholeCameraIntrinsicParameters): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Return

2D transformation.

Parameters

orientation

amount of rotation between display and camera sensor. CameraToDisplayOrientation.ORIENTATION_UNKNOWN indicates that orientation is unknown and must be ignored (Y coordinates are not reversed either).

intrinsicParameters

camera intrinsic parameters.


fun toViewCoordinatesTransformation(rotation: Rotation2D?, intrinsicParameters: PinholeCameraIntrinsicParameters): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Return

2D transformation or the identity if rotation is null

Parameters

rotation

counter-clockwise rotation indicating the amount of display rotation respect the camera sensor.

intrinsicParameters

camera intrinsic parameters.


fun toViewCoordinatesTransformation(context: Context, cameraId: String, pivot: Point2D): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Return

2D transformation.

Parameters

context

Android context.

cameraId

A camera id.

pivot

point to use as pivot for rotation.


fun toViewCoordinatesTransformation(context: Context, characteristics: CameraCharacteristics, pivot: Point2D): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

This method takes into account current display and camera orientation.

Return

2D transformation.

Parameters

context

Android context.

characteristics

Information about the camera.

pivot

point to use as pivot for rotation.


fun toViewCoordinatesTransformation(orientation: CameraToDisplayOrientation, pivot: Point2D): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Return

2D transformation.

Parameters

orientation

amount of rotation between display and camera sensor. CameraToDisplayOrientation.ORIENTATION_UNKNOWN indicates that orientation is unknown and must be ignored (Y coordinates are not reversed either).

pivot

point to use as pivot for rotation.


fun toViewCoordinatesTransformation(rotation: Rotation2D?, pivot: Point2D): ProjectiveTransformation2D

Creates 2D transformation to convert 2D point coordinates from OpenGL coordinates to Android view coordinates.

It must be noticed that OpenGL uses a right handed coordinate system where y coordinates increase upwards, whereas Android uses y coordinates that increase downwards and takes into account screen and camera sensor orientation.

Return

2D transformation.

Parameters

rotation

counter-clockwise rotation indicating the amount of display rotation respect the camera sensor.

pivot

point to use as pivot for rotation.