nx_server_plugin_sdk 1.0 Server Plugin SDK

Classes | Public Types | Public Member Functions | List of all members
nxcip::CameraPtzManager Class Referenceabstract

Pan-tilt-zoom management. More...

`#include <camera_plugin.h>`

Inheritance diagram for nxcip::CameraPtzManager:

## Classes
struct | Limits

## Public Types
enum | Capability { ContinuousPanCapability = 0x00000001, ContinuousTiltCapability = 0x00000002, ContinuousZoomCapability = 0x00000004, AbsolutePanCapability = 0x00000010, AbsoluteTiltCapability = 0x00000020, AbsoluteZoomCapability = 0x00000040, FlipPtzCapability = 0x00000100, LimitsPtzCapability = 0x00000200, DevicePositioningPtzCapability = 0x00001000, LogicalPositioningPtzCapability = 0x00002000, ContinuousPtzCapabilities = ContinuousPanCapability | ContinuousTiltCapability | ContinuousZoomCapability, AbsolutePtzCapabilities = AbsolutePanCapability | AbsoluteTiltCapability | AbsoluteZoomCapability }
enum | CoordinateSpace { DevicePtzCoordinateSpace, LogicalPtzCoordinateSpace }
enum | Orientation { Horizontal = 0x1, Vertical = 0x2 }

## Public Member Functions
virtual int | getCapabilities () const =0
| Returns bitset of Capability enumeration members.
virtual int | continuousMove (double panSpeed, double tiltSpeed, double zoomSpeed)=0
| Starts or stops continuous PTZ movement. More...
virtual int | absoluteMove (CoordinateSpace space, double pan, double tilt, double zoom, double speed)=0
| Sets camera PTZ position in the given coordinate space. More...
virtual int | getPosition (CoordinateSpace space, double *pan, double *tilt, double *zoom)=0
| Gets PTZ position from camera in the given coordinate space. More...
virtual int | getLimits (CoordinateSpace space, Limits *limits)=0
| Gets PTZ limits of the camera. More...
virtual int | getFlip (int *flip)=0
| Gets the camera streams's flipped state. More...
Public Member Functions inherited from nxpl::PluginInterface
virtual void * | queryInterface (const nxpl::NX_GUID &interfaceID)=0
| Cast to type, specified by interfaceID. More...
virtual int | addRef () const =0
| Increment reference counter. More...
virtual int | releaseRef () const =0
| Decrement reference counter. More...

## Detailed Description

Pan-tilt-zoom management.

VMS client has several PTZ support levels, and the more features are supported by the camera's PTZ manager, the smoother will be the client's experience.

These levels are as follows:

- Continuous PTZ. Manager must support continuous movement.
- Absolute PTZ. Manager must additionally support absolute positioning. This adds support for saved positions and tours.
- Advanced PTZ. Manager must additionally support absolute positioning in logical space — that is, in degrees for pan, tilt and fov. On this support level user can zoom in by selecting a region on an image from camera and can center the camera on an object by clicking on it.

Logical space for absolute positioning is defined as follows:

- Pan is in degrees, from -180 to 180.
- Tilt is in degrees, from -90 to 90. -90 corresponds to camera pointing straight down, 90 - straight up.
- Fov is in degrees, from 0 to 360.

## Member Enumeration Documentation

## ◆ Capability

enum nxcip::CameraPtzManager::Capability

Enumerator
ContinuousPanCapability | Camera supports continuous pan.
ContinuousTiltCapability | Camera supports continuous tilt.
ContinuousZoomCapability | Camera supports continuous zoom.
AbsolutePanCapability | Camera supports absolute pan.
AbsoluteTiltCapability | Camera supports absolute tilt.
AbsoluteZoomCapability | Camera supports absolute zoom.
FlipPtzCapability | Camera supports flip state queries.
LimitsPtzCapability | Camera supports coordinate space limits queries.
DevicePositioningPtzCapability | Camera supports absolute positioning in device-specific coordinate space.
LogicalPositioningPtzCapability | Camera supports absolute positioning in logical space — degrees for pan, tilt and fov (zoom).

## ◆ CoordinateSpace

enum nxcip::CameraPtzManager::CoordinateSpace

Enumerator
DevicePtzCoordinateSpace | Device-specific coordinate space.
LogicalPtzCoordinateSpace | Logical coordinate space — degrees for pan, tilt and fov (zoom).

## Member Function Documentation

## ◆ absoluteMove()

virtual int nxcip::CameraPtzManager::absoluteMove | ( | CoordinateSpace | space,
|  | double | pan,
|  | double | tilt,
|  | double | zoom,
|  | double | speed
| ) |  |
| pure virtual

Sets camera PTZ position in the given coordinate space.

Note that for the function to succeed, this controller must have a capability corresponding to the provided coordinate space, that is `DevicePositioningPtzCapability` or `LogicalPositioningPtzCapability`.

This function is expected to be implemented if this controller has at least one of the `AbsolutePtzCapabilities`.

Parameters

  space | Coordinate space of the provided position.
  pan |
  tilt |
  zoom |
  speed | Movement speed, in range [0, 1].

Returns
  NX_NO_ERROR on success, error code otherwise.

## ◆ continuousMove()

virtual int nxcip::CameraPtzManager::continuousMove | ( | double | panSpeed,
|  | double | tiltSpeed,
|  | double | zoomSpeed
| ) |  |
| pure virtual

Starts or stops continuous PTZ movement.

Speed is specified in image-based coordinate space and all of its components are expected to be in range `[-1, 1]`. This means that implementation must handle flipped / mirrored state of the video stream.

Passing zero in speed should stop PTZ movement.

This function is expected to be implemented if this controller has at least one of the `Ptz::Capability::continuousPanTiltZoom`.

Parameters

  panSpeed |
  tiltSpeed |
  zoomSpeed |

Returns
  NX_NO_ERROR on success, error code otherwise.

## ◆ getFlip()

virtual int nxcip::CameraPtzManager::getFlip | ( | int * | flip | ) |
| pure virtual

Gets the camera streams's flipped state.

This function is expected to be implemented only if this controller has `FlipPtzCapability`.

Parameters

  [out] | flip | Flipped state of the camera's video stream, a bitset of Orientation enumeration members.

Returns
  NX_NO_ERROR on success, error code otherwise.

## ◆ getLimits()

virtual int nxcip::CameraPtzManager::getLimits | ( | CoordinateSpace | space,
|  | Limits * | limits
| ) |  |
| pure virtual

Gets PTZ limits of the camera.

This function is expected to be implemented only if this controller has `LimitsPtzCapability`.``

````

Parameters

  | space | Coordinate space to get limits in.
  [out] | limits | Ptz limits.

Returns
  NX_NO_ERROR on success, error code otherwise.

## ◆ getPosition()

virtual int nxcip::CameraPtzManager::getPosition | ( | CoordinateSpace | space,
|  | double * | pan,
|  | double * | tilt,
|  | double * | zoom
| ) |  |
| pure virtual

Gets PTZ position from camera in the given coordinate space.

This function is expected to be implemented if this controller has at least one of the `AbsolutePtzCapabilities`.

Parameters

  | space | Coordinate space to get position in.
  [out] | pan |
  [out] | tilt |
  [out] | zoom |

Returns
  NX_NO_ERROR on success, error code otherwise.

See also
  absoluteMove

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

- src/camera/camera_plugin.h