UNPKG

tethr

Version:

Controlls USB-connected cameras, webcam, and smartphone camera from browser

113 lines 2.84 kB
import { BiMap } from 'bim'; /** * All configuration names in the order of dependencies. */ export const ConfigNameList = (() => { const names = [ 'aperture', 'autoFocusFrameCenter', 'autoFocusFrameSize', 'batteryLevel', 'burstInterval', 'burstNumber', 'canRunAutoFocus', 'canRunManualFocus', 'canStartLiveview', 'canTakePhoto', 'captureDelay', 'colorMode', 'colorTemperature', 'contrast', 'dateTime', 'destinationToSave', 'digitalZoom', 'driveMode', 'exposureComp', 'exposureMeteringMode', 'exposureMode', 'facingMode', 'flashMode', 'focalLength', 'focusDistance', 'focusMeteringMode', 'focusMode', 'focusPeaking', 'functionalMode', 'imageAspect', 'imageQuality', 'imageSize', 'iso', 'liveview', 'liveviewMagnifyRatio', 'liveviewSize', 'manualFocusOptions', 'manufacturer', 'model', 'serialNumber', 'sharpness', 'shutterSpeed', 'shutterSound', 'timelapseInterval', 'timelapseNumber', 'whiteBalance', ]; const dependencies = new Map([ ['aperture', ['exposureMode']], ['shutterSpeed', ['exposureMode', 'driveMode', 'iso']], ['exposureComp', ['exposureMode']], ['iso', ['exposureMode']], ['colorTemperature', ['whiteBalance']], ]); const sortedNames = []; const set = new Set(); const add = (name) => { if (set.has(name)) { return; } dependencies.get(name)?.forEach(add); sortedNames.push(name); set.add(name); }; names.forEach(add); return sortedNames; })(); // Table export const ConfigForDevicePropTable = new BiMap([ [0x5001, 'batteryLevel'], [0x5005, 'whiteBalance'], [0x5007, 'aperture'], [0x5008, 'focalLength'], [0x5009, 'focusDistance'], [0x500d, 'shutterSpeed'], [0x500e, 'exposureMode'], [0x500f, 'iso'], [0x5010, 'exposureComp'], [0x5012, 'captureDelay'], [0x5013, 'driveMode'], [0x5017, 'colorMode'], [0x501a, 'timelapseNumber'], [0x501b, 'timelapseInterval'], ]); export const ExposureModeTable = new BiMap([ [0x1, 'M'], [0x2, 'P'], [0x3, 'A'], [0x4, 'S'], [0x5, 'creative'], [0x6, 'action'], [0x7, 'portrait'], ]); export const WhiteBalanceTable = new BiMap([ [0x1, 'manual'], [0x2, 'auto'], [0x3, 'custom'], [0x4, 'daylight'], [0x5, 'fluorescent'], [0x6, 'tungsten'], ]); export const DriveModeTable = new BiMap([ [0x1, 'normal'], [0x2, 'burst'], [0x3, 'timelapse'], ]); //# sourceMappingURL=configs.js.map