UNPKG

ts-onvif

Version:

Client to ONVIF devices

102 lines (101 loc) 4.34 kB
/** * Imaging ver20 module * @author Andrew D.Laptev <a.d.laptev@gmail.com> * @see https://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl */ import { Onvif } from './onvif'; import Service from './service'; import { ReferenceToken } from './interfaces/common'; import { ImagingOptions20, ImagingSettings20, ImagingStatus20, MoveOptions20 } from './interfaces/onvif'; import { Capabilities, GetCurrentPreset, GetImagingSettings, GetMoveOptions, GetOptions, GetPresets, GetStatus, ImagingPreset, Move, SetCurrentPreset, SetImagingSettings, Stop } from './interfaces/imaging.2'; interface VideoSourceTokenExtended { videoSourceToken?: ReferenceToken; } type GetImagingSettingsExtended = VideoSourceTokenExtended & Omit<GetImagingSettings, 'videoSourceToken'>; type SetImagingSettingsExtended = VideoSourceTokenExtended & Omit<SetImagingSettings, 'videoSourceToken'>; type GetOptionsExtended = VideoSourceTokenExtended & Omit<GetOptions, 'videoSourceToken'>; type MoveExtended = VideoSourceTokenExtended & Omit<Move, 'videoSourceToken'>; type GetMoveOptionsExtended = VideoSourceTokenExtended & Omit<GetMoveOptions, 'videoSourceToken'>; type StopExtended = VideoSourceTokenExtended & Omit<Stop, 'videoSourceToken'>; type GetStatusExtended = VideoSourceTokenExtended & Omit<GetStatus, 'videoSourceToken'>; type GetPresetsExtended = VideoSourceTokenExtended & Omit<GetPresets, 'videoSourceToken'>; type GetCurrentPresetExtended = VideoSourceTokenExtended & Omit<GetCurrentPreset, 'videoSourceToken'>; type SetCurrentPresetExtended = VideoSourceTokenExtended & Omit<SetCurrentPreset, 'videoSourceToken'>; /** * Imaging service * @example * ```ts * const is = await cam.imaging.getImagingSettings(); * is.brightness = 70; * await cam.imaging.setImagingSettings({ * imagingSettings: is, * forcePersistence: true, * }); * ``` */ export default class Imaging extends Service { constructor(onvif: Onvif); private videoSourceToken; private static backlightCompensationToBuild; private static exposureToBuild; private static focusConfigurationToBuild; private static wideDynamicRangeToBuild; private static whiteBalanceToBuild; private static imagingSettingsToBuild; private static focusMoveToBuild; /** * Returns the capabilities of the imaging service. */ getServiceCapabilities(): Promise<Capabilities>; /** * Get the imaging configuration for the requested video source. * @param options */ getImagingSettings({ videoSourceToken }?: GetImagingSettingsExtended): Promise<ImagingSettings20>; /** * Set the imaging configuration for the requested video source. * @param options */ setImagingSettings({ videoSourceToken, imagingSettings, forcePersistence, }: SetImagingSettingsExtended): Promise<void>; /** * Get valid ranges for imaging parameters that have device-specific ranges. * @param options */ getOptions({ videoSourceToken }?: GetOptionsExtended): Promise<ImagingOptions20>; /** * Move the focus lens in absolute, relative, or continuous manner. * @param options */ move({ videoSourceToken, focus }: MoveExtended): Promise<void>; /** * Get valid ranges for focus lens move options. * @param options */ getMoveOptions({ videoSourceToken }?: GetMoveOptionsExtended): Promise<MoveOptions20>; /** * Stop ongoing focus movement for the requested video source. * @param options */ stop({ videoSourceToken }?: StopExtended): Promise<void>; /** * Get imaging status for the requested video source. * @param options */ getStatus({ videoSourceToken }?: GetStatusExtended): Promise<ImagingStatus20>; /** * Get imaging presets available for the requested video source. * @param options */ getPresets({ videoSourceToken }?: GetPresetsExtended): Promise<ImagingPreset[]>; /** * Get the current imaging preset for the requested video source. * @param options */ getCurrentPreset({ videoSourceToken }?: GetCurrentPresetExtended): Promise<ImagingPreset>; /** * Apply an imaging preset to the requested video source. * @param options */ setCurrentPreset({ videoSourceToken, presetToken }: SetCurrentPresetExtended): Promise<void>; } export {};