UNPKG

amaran-light-cli

Version:

Command line tool for controlling Aputure Amaran lights via WebSocket to a local Amaran desktop app.

57 lines 2.11 kB
import { ERROR_MESSAGES } from '../constants.js'; import { CurveType } from '../types.js'; import * as approximations from './approximations.js'; import * as mathematical from './mathematical.js'; export * from './approximations.js'; export * from './mathematical.js'; export * from './realistic.js'; export const CURVE_FUNCTIONS = { [CurveType.HANN]: mathematical.hannCurve, [CurveType.WIDER_MIDDLE_SMALL]: (x) => mathematical.widerMiddleCurve(x, 'small'), [CurveType.WIDER_MIDDLE_MEDIUM]: (x) => mathematical.widerMiddleCurve(x, 'medium'), [CurveType.WIDER_MIDDLE_LARGE]: (x) => mathematical.widerMiddleCurve(x, 'large'), [CurveType.CIE_DAYLIGHT]: approximations.cieDaylightCurve, [CurveType.SUN_ALTITUDE]: approximations.sunAltitudeCurve, [CurveType.PEREZ_DAYLIGHT]: approximations.perezDaylightCurve, [CurveType.PHYSICS]: (x) => Math.sin(Math.PI * x) ** 1.2, [CurveType.BLACKBODY]: (x) => Math.sin(Math.PI * x) ** 1.5, [CurveType.HAZY]: (x) => Math.sin(Math.PI * x) ** 0.8, }; /** * Parse a curve type string into a CurveType enum key */ export function parseCurveType(curve) { const normalizedCurve = curve.toLowerCase(); switch (normalizedCurve) { case 'hann': return 'HANN'; case 'wider-middle-small': return 'WIDER_MIDDLE_SMALL'; case 'wider-middle-medium': case 'wider-middle': return 'WIDER_MIDDLE_MEDIUM'; case 'wider-middle-large': return 'WIDER_MIDDLE_LARGE'; case 'cie-daylight': return 'CIE_DAYLIGHT'; case 'sun-altitude': return 'SUN_ALTITUDE'; case 'perez-daylight': return 'PEREZ_DAYLIGHT'; case 'physics': return 'PHYSICS'; case 'blackbody': return 'BLACKBODY'; case 'hazy': return 'HAZY'; default: throw new Error(ERROR_MESSAGES.invalidCurve); } } /** * Get all available curve type names */ export function getAvailableCurves() { return Object.values(CurveType); } //# sourceMappingURL=index.js.map