All files / core/src index.ts

100% Statements 192/192
99.39% Branches 163/164
100% Functions 17/17
100% Lines 165/165

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508                                                                          55x 55x   55x   55x 55x                   55x                   255x 255x 1488x 255x 255x 255x 251x 125x 14x 6x 249x 8x 249x 249x 249x 255x 968x 968x 960x 960x 46x 960x   887x 887x       249x 244x 244x 244x     244x 3x             241x 241x 2589x     184267x 184267x 184267x 7x 184260x 184260x 184258x     1194x 1194x 7x 1187x     938x                       451x 451x 7009x 7009x 7009x 7009x 6x           7003x   445x   241x 241x 9x 9x 9x 9x 20x 20x 20x 20x   9x   241x 241x 241x 1x           240x 240x 240x 240x 240x 240x 240x 2x           231x 231x 231x 231x         231x 231x 231x       231x 231x 231x 231x 231x 231x               255x 255x               255x 205x 205x     3x                 215x 255x   255x 1303x 174190x 174190x 174186x 2090x       174186x 5x 174181x 174181x 2x 174179x     255x 4x 4x 4x 4x   200x                                   255x 255x       397013x 389696x 389696x 387834x 387834x 387834x 589322x 589322x 385955x   387834x       1151212x       10x                   3x 3x 2x 3x                                   383769x 383768x 1x 383767x 383767x 383669x 383669x 383669x   383669x 13141x 486x 486x 486x 12655x   2x 12653x 383669x 383669x         383669x 205x 205x   383669x       43x 301729x 43x                                                                                                                                                                                                                                                                                  
import { computePhotometricMetrics } from './metrics.js';
import type { IESDiagnosticCode } from './diagnostics.js';
import { lineRange, profileRanges, TokenReader, type SourceField, type SourceRange } from './source.js';
import { IES_FORMAT_LINE, IES_HEADER, iesKeywordDescription, iesSecondFieldDescription } from './fieldDescriptions.js';
 
/** Embedded LM-63 lamp tilt correction. Angles are degrees; factors are dimensionless. */
export interface IESTilt {
  geometry: number;
  angles: number[];
  factors: number[];
}
 
export interface IESProfile {
  version: string;
  metadata: Record<string, string>;
  lampCount: number;
  lumensPerLamp: number;
  candelaMultiplier: number;
  photometricType: number;
  units: 'feet' | 'meters';
  dimensions: { width: number; length: number; height: number };
  ballastFactor: number;
  /** Raw second field: multiplier in 1986/1991, reserved in 1995/2002, generation code in 2019. */
  ballastLampPhotometricFactor: number;
  /** LM-63-2019 provenance code, not an intensity multiplier. Absent in earlier editions. */
  fileGenerationType?: number;
  inputWatts: number;
  verticalAngles: number[];
  horizontalAngles: number[];
  /** Horizontal-major values in candela, with candela and ballast multipliers applied. */
  candelaValues: number[][];
  tilt: IESTilt | null;
}
 
export class IESParseError extends Error {
  constructor(
    message: string,
    public readonly code: IESDiagnosticCode = 'IES_PARSE_ERROR',
    public readonly field?: string,
    /** Where the error was detected in the source text. */
    public readonly range?: SourceRange,
  ) {
    super(message);
    this.name = 'IESParseError';
  }
}
 
function fail(
  message: string,
  code: IESDiagnosticCode = 'IES_PARSE_ERROR',
  field?: string,
  range?: SourceRange,
): never {
  throw new IESParseError(message, code, field, range);
}
 
/**
 * Parse LM-63-1986, IESNA91, LM-63-1995, LM-63-2002 and LM-63-2019. External TILT files are rejected.
 * Errors carry the source range of the offending token or line.
 * @param fields Optional sink that receives a described {@link SourceField} for every header line and
 * token as it is read, including those read before an error. Prefer `describePhotometrySource`.
 */
export function parseIES(text: string, fields?: SourceField[]): IESProfile {
  const lines = text.replace(/^/, '').split(/\r\n?|\n/);
  const formatLine = lineRange(lines, 0);
  const tiltLine = lines.findIndex((line) => /^\s*TILT\s*=/i.test(line));
  const first = lines[0]!.trim();
  let version = 'LM-63-1986';
  if (/^IESNA91$/i.test(first)) version = 'LM-63-1991';
  else if (/^IESNA:LM-63-(1995|2002)$/i.test(first)) version = first.toUpperCase().slice(6);
  else if (/^IES:LM-63-2019$/i.test(first)) version = 'LM-63-2019';
  else if (/^IES/i.test(first))
    fail(`Unsupported IES header: ${first}`, 'IES_UNSUPPORTED_HEADER', 'version', formatLine);
  if (fields && version !== 'LM-63-1986')
    fields.push({ ...formatLine, name: 'Format line', description: IES_FORMAT_LINE[version]! });
  const metadata: Record<string, string> = Object.create(null);
  let lastKey = '';
  const metadataEnd = tiltLine < 0 ? lines.length : tiltLine;
  for (let index = version === 'LM-63-1986' ? 0 : 1; index < metadataEnd; index++) {
    const match = /^\s*\[([^\]]+)\]\s*(.*)$/.exec(lines[index]!);
    if (match) {
      const key = match[1]!.toUpperCase();
      if (fields)
        fields.push({ ...lineRange(lines, index), name: `[${key}]`, description: iesKeywordDescription(key) });
      if (key === 'MORE' && lastKey) metadata[lastKey] += `\n${match[2]}`;
      else {
        metadata[key] = metadata[key] ? `${metadata[key]}\n${match[2]}` : match[2]!;
        lastKey = key;
      }
    }
  }
  if (tiltLine < 0) fail('Missing TILT=NONE or TILT=INCLUDE declaration', 'IES_MISSING_TILT', 'TILT', formatLine);
  const tiltRange = lineRange(lines, tiltLine);
  if (fields) fields.push({ ...tiltRange, name: IES_HEADER.tilt[0], description: IES_HEADER.tilt[1] });
  const tiltMode = lines[tiltLine]!.replace(/^\s*TILT\s*=\s*/i, '')
    .trim()
    .toUpperCase();
  if (tiltMode !== 'NONE' && tiltMode !== 'INCLUDE') {
    fail(
      'External TILT files are unsupported; use TILT=NONE or embed the data with TILT=INCLUDE',
      'IES_EXTERNAL_TILT',
      'TILT',
      tiltRange,
    );
  }
  const reader = new TokenReader(lines, tiltLine + 1);
  const note = (name: string, description: string): void => {
    fields!.push({ ...reader.range(), name, description });
  };
  function number(label: string, describe?: readonly [string, string]): number {
    const token = reader.next();
    if (fields && describe && token !== undefined) note(describe[0], describe[1]);
    if (!token || !/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(token))
      fail(`Missing or invalid ${label}`, 'IES_INVALID_NUMBER', label, reader.range());
    const value = Number(token);
    if (!Number.isFinite(value)) fail(`Non-finite ${label}`, 'IES_INVALID_NUMBER', label, reader.range());
    return value;
  }
  function count(label: string, describe?: readonly [string, string], max = 100_000): number {
    const value = number(label, describe);
    if (!Number.isInteger(value) || value < 1 || value > max)
      fail(`${label} must be a positive integer <= ${max}`, 'IES_INVALID_COUNT', label, lineRange(lines, reader.line));
    return value;
  }
  function nonnegative(value: number, message: string, field: string): void {
    if (value < 0) fail(message, 'IES_INVALID_RANGE', field, reader.range());
  }
  let firstAngle: SourceRange | undefined;
  /** Reads strictly increasing angles, reporting the first one out of order or range. */
  function angles(
    length: number,
    label: string,
    numberLabel: string,
    [name, description]: readonly [string, string],
    min: number,
    max: number,
  ): number[] {
    const values: number[] = [];
    for (let i = 0; i < length; i++) {
      const value = number(numberLabel);
      if (i === 0) firstAngle = reader.range();
      if (fields) note(name, `${description} #${i + 1} (degrees)`);
      if (value < min || value > max || (i > 0 && value <= values[i - 1]!))
        fail(
          `${label} must be strictly increasing within ${min}..${max} degrees`,
          'IES_INVALID_ANGLES',
          label,
          reader.range(),
        );
      values.push(value);
    }
    return values;
  }
  let tilt: IESTilt | null = null;
  if (tiltMode === 'INCLUDE') {
    const geometry = count('tilt geometry', IES_HEADER.tiltGeometry, 3);
    const length = count('tilt angle count', IES_HEADER.tiltCount);
    const tiltAngles = angles(length, 'Tilt angles', 'tilt angle', IES_HEADER.tiltAngle, 0, 180);
    const factors = Array.from({ length }, (_, i) => {
      const factor = number('tilt factor');
      if (fields) note(IES_HEADER.tiltFactor[0], `${IES_HEADER.tiltFactor[1]} #${i + 1}`);
      nonnegative(factor, 'Tilt factors must be nonnegative', 'tilt factor');
      return factor;
    });
    tilt = { geometry, angles: tiltAngles, factors };
  }
  const lampCount = count('lamp count', IES_HEADER.lampCount);
  const lumensPerLamp = number('lumens per lamp', IES_HEADER.lumensPerLamp);
  if (lumensPerLamp < 0 && lumensPerLamp !== -1)
    fail(
      'Lumens per lamp must be nonnegative or -1 for absolute photometry',
      'IES_INVALID_RANGE',
      'lumens per lamp',
      reader.range(),
    );
  const multipliers = 'Multipliers and input watts must be nonnegative';
  const multiplierField = 'multipliers / input watts';
  const candelaMultiplier = number('candela multiplier', IES_HEADER.candelaMultiplier);
  nonnegative(candelaMultiplier, multipliers, multiplierField);
  const verticalCount = count('vertical angle count', IES_HEADER.verticalCount);
  const horizontalCount = count('horizontal angle count', IES_HEADER.horizontalCount);
  if (verticalCount * horizontalCount > 10_000_000)
    fail(
      'Photometric table exceeds 10 million samples',
      'IES_TABLE_LIMIT',
      'angle counts',
      lineRange(lines, reader.line),
    );
  const photometricType = count('photometric type', IES_HEADER.photometricType, 3);
  const ranges: Record<string, SourceRange> = { version: formatLine, photometricType: reader.range() };
  const unit = count('units', IES_HEADER.units, 2);
  const dimensions = {
    width: number('width', IES_HEADER.width),
    length: number('length', IES_HEADER.length),
    height: number('height', IES_HEADER.height),
  };
  const ballastFactor = number('ballast factor', IES_HEADER.ballastFactor);
  nonnegative(ballastFactor, multipliers, multiplierField);
  const ballastLampPhotometricFactor = number(
    'ballast lamp factor / reserved field / file generation type',
    iesSecondFieldDescription(version),
  );
  nonnegative(ballastLampPhotometricFactor, multipliers, multiplierField);
  ranges.ballastLampPhotometricFactor = ranges.fileGenerationType = reader.range();
  const inputWatts = number('input watts', IES_HEADER.inputWatts);
  nonnegative(inputWatts, multipliers, multiplierField);
  const typeC = photometricType === 1;
  const verticalAngles = angles(
    verticalCount,
    'Vertical angles',
    'vertical angle',
    IES_HEADER.verticalAngle,
    typeC ? 0 : -90,
    typeC ? 180 : 90,
  );
  ranges.verticalAngles = firstAngle!;
  const horizontalAngles = angles(
    horizontalCount,
    'Horizontal angles',
    'horizontal angle',
    IES_HEADER.horizontalAngle,
    typeC ? 0 : -90,
    typeC ? 360 : 90,
  );
  if (typeC) {
    const span = horizontalAngles.at(-1)! - horizontalAngles[0]!;
    if (
      horizontalCount === 1 ? horizontalAngles[0] !== 0 : span !== 90 && span !== 180 && !(span > 180 && span <= 360)
    ) {
      fail(
        'Type C horizontal coverage must be axial (0), quadrant (90), bilateral (180), or full (>180)',
        'IES_INVALID_COVERAGE',
        'horizontal angles',
        reader.range(),
      );
    }
  }
  // The ballast-lamp factor was replaced by a reserved field in 1995; 2019 repurposes it as provenance.
  const legacyFactor = version === 'LM-63-1986' || version === 'LM-63-1991' ? ballastLampPhotometricFactor : 1;
  const scale = candelaMultiplier * ballastFactor * legacyFactor;
  const [candelaName, candelaDescription] = IES_HEADER.candela;
  const candelaValues = Array.from({ length: horizontalCount }, (_row, h) =>
    Array.from({ length: verticalCount }, (_column, v) => {
      const value = number('candela value');
      if (h === 0 && v === 0) ranges.candelaValues = reader.range();
      if (fields)
        note(
          candelaName,
          `${candelaDescription} at horizontal ${horizontalAngles[h]}°, vertical ${verticalAngles[v]}° (before multiplier)`,
        );
      if (value < 0)
        fail('Candela values must be nonnegative', 'IES_NEGATIVE_CANDELA', 'candela values', reader.range());
      const scaled = value * scale;
      if (!Number.isFinite(scaled))
        fail('Scaled candela values must be finite', 'IES_SCALED_OVERFLOW', 'candela values', reader.range());
      return scaled;
    }),
  );
  if (reader.next() !== undefined) {
    const trailing = reader.range();
    let extra = 1;
    while (reader.next() !== undefined) extra++;
    fail(`Unexpected trailing data (${extra} tokens)`, 'IES_TRAILING_DATA', undefined, trailing);
  }
  const profile: IESProfile = {
    version,
    metadata,
    lampCount,
    lumensPerLamp,
    candelaMultiplier,
    photometricType,
    units: unit === 1 ? 'feet' : 'meters',
    dimensions,
    ballastFactor,
    ballastLampPhotometricFactor,
    ...(version === 'LM-63-2019' ? { fileGenerationType: ballastLampPhotometricFactor } : {}),
    inputWatts,
    verticalAngles,
    horizontalAngles,
    candelaValues,
    tilt,
  };
  profileRanges.set(profile, ranges);
  return profile;
}
 
function bracket(angles: number[], angle: number): [number, number, number] {
  if (angles.length === 1 || angle <= angles[0]!) return [0, 0, 0];
  const last = angles.length - 1;
  if (angle >= angles[last]!) return [last, last, 0];
  let lo = 0;
  let hi = last;
  while (hi - lo > 1) {
    const mid = (lo + hi) >>> 1;
    if (angles[mid]! <= angle) lo = mid;
    else hi = mid;
  }
  return [lo, hi, (angle - angles[lo]!) / (angles[hi]! - angles[lo]!)];
}
 
function lerp(a: number, b: number, t: number): number {
  return a + (b - a) * t;
}
 
/** LM-63 photometric types that sampling, metrics, charts and the 3D viewer support: 1 (Type C). */
export const SUPPORTED_PHOTOMETRIC_TYPES: readonly number[] = Object.freeze([1]);
 
export type PhotometricTypeSupport =
  | { supported: true }
  | { supported: false; code: 'IES_UNSUPPORTED_COORDINATES'; photometricType: number; message: string };
 
/** Report whether a profile can be sampled, charted and previewed in 3D, so hosts can decide whether to mount a viewer.
 * Type A/B profiles stay available for parsing, inspection, validation and summaries.
 */
export function getPhotometricTypeSupport(profile: Pick<IESProfile, 'photometricType'>): PhotometricTypeSupport {
  const type = profile.photometricType;
  if (SUPPORTED_PHOTOMETRIC_TYPES.includes(type)) return { supported: true };
  const name = type === 2 ? 'Type B' : type === 3 ? 'Type A' : `photometric type ${type}`;
  return {
    supported: false,
    code: 'IES_UNSUPPORTED_COORDINATES',
    photometricType: type,
    message: `This file uses ${name} coordinates (photometric type ${type}). It can be parsed, inspected and validated; 3D previews, intensity sampling, charts and flux metrics support Type C photometry only (type 1).`,
  };
}
 
/** Sample Type C luminous intensity in candela using bilinear interpolation and LM-63 symmetries.
 * Vertical 0° points down; horizontal angles wrap around the luminaire. Missing hemispheres are dark.
 * Tilt correction is applied at the supplied luminaire tilt angle (default 0°).
 */
export function sampleIntensity(
  profile: IESProfile,
  verticalDegrees: number,
  horizontalDegrees: number,
  tiltDegrees = 0,
): number {
  if (profile.photometricType !== 1) throw new Error('Intensity sampling supports Type C photometry only (type 1)');
  if (![verticalDegrees, horizontalDegrees, tiltDegrees].every(Number.isFinite))
    throw new RangeError('Sample angles must be finite');
  const va = profile.verticalAngles;
  if (verticalDegrees < va[0]! || verticalDegrees > va.at(-1)!) return 0;
  const ha = profile.horizontalAngles;
  const span = ha.at(-1)! - ha[0]!;
  let h = (((horizontalDegrees - ha[0]!) % 360) + 360) % 360;
  let h0: number, h1: number, ht: number;
  if (ha.length === 1) [h0, h1, ht] = [0, 0, 0];
  else if (span <= 180) {
    h %= 2 * span;
    if (h > span) h = 2 * span - h;
    [h0, h1, ht] = bracket(ha, h + ha[0]!);
  } else if (h > span) {
    // Some exporters omit the duplicate 360° plane; interpolate across that seam.
    [h0, h1, ht] = [ha.length - 1, 0, (h - span) / (360 - span)];
  } else [h0, h1, ht] = bracket(ha, h + ha[0]!);
  const [v0, v1, vt] = bracket(va, verticalDegrees);
  let value = lerp(
    lerp(profile.candelaValues[h0]![v0]!, profile.candelaValues[h0]![v1]!, vt),
    lerp(profile.candelaValues[h1]![v0]!, profile.candelaValues[h1]![v1]!, vt),
    ht,
  );
  if (profile.tilt) {
    const [a, b, t] = bracket(profile.tilt.angles, Math.abs(tiltDegrees));
    value *= lerp(profile.tilt.factors[a]!, profile.tilt.factors[b]!, t);
  }
  return value;
}
 
export function summarizeIES(profile: IESProfile) {
  let peakCandela = 0;
  for (const row of profile.candelaValues) for (const value of row) peakCandela = Math.max(peakCandela, value);
  return {
    format: 'IES LM-63',
    version: profile.version,
    metadata: profile.metadata,
    photometricType: profile.photometricType,
    photometricTypeName: profile.photometricType === 1 ? 'C' : profile.photometricType === 2 ? 'B' : 'A',
    photometry: profile.lumensPerLamp === -1 ? 'absolute' : 'relative',
    lightSource: profile.metadata.LAMP?.trim() || profile.metadata.LAMPCAT?.trim() || 'not specified',
    lampCatalog: profile.metadata.LAMPCAT?.trim() || 'not specified',
    luminaire: profile.metadata.LUMINAIRE?.trim() || 'not specified',
    manufacturer: profile.metadata.MANUFAC?.trim() || 'not specified',
    lampCount: profile.lampCount,
    lumensPerLamp: profile.lumensPerLamp,
    inputWatts: profile.inputWatts,
    peakCandela,
    verticalAngles: profile.verticalAngles.length,
    horizontalAngles: profile.horizontalAngles.length,
    units: profile.units,
    dimensions: profile.dimensions,
    hasTilt: profile.tilt !== null,
    fileGenerationType: profile.fileGenerationType ?? null,
    ...computePhotometricMetrics(profile),
  };
}
 
export { validateIES, diagnoseIES } from './diagnostics.js';
export type { IESDiagnostic, IESDiagnosticCode, IESValidationOptions, IESValidationResult } from './diagnostics.js';
export { calculateFluxBreakdown, calculateLuminousFlux, computePhotometricMetrics, getBeamAngles } from './metrics.js';
export type {
  PhotometricGrid,
  PhotometricMetrics,
  BeamAngles,
  BeamAngleStatus,
  FluxBreakdown,
  ZonalLumens,
} from './metrics.js';
export { LDTParseError, parseLDT, validateLDT, measuredCPlaneIndices, writeLDT } from './ldt.js';
export type { LDTProfile, LDTLampSet, LDTDimensions } from './ldt.js';
export {
  LampSetSelectionError,
  detectPhotometricFormat,
  parsePhotometry,
  toPhotometricDocument,
  toIESProfile,
  serializeIES,
  serializeLDT,
} from './photometry.js';
export type {
  PhotometricDocument,
  PhotometricLampSet,
  PhotometryOptions,
  PhotometricInput,
  ConversionResult,
  ConversionWarning,
  SerializeLDTOptions,
} from './photometry.js';
 
export {
  inputFormat,
  ldtDiagnostics,
  validatePhotometry,
  inspectPhotometry,
  inspectParsedPhotometry,
  describePhotometrySource,
} from './inspection.js';
export type {
  InputFormat,
  PhotometryDiagnostic,
  PhotometryInspection,
  PhotometrySourceDescription,
} from './inspection.js';
export type { SourceRange, SourceField } from './source.js';
export * from './fieldDescriptions.js';
export {
  LOG_DECADES,
  buildConeDiagram,
  buildIntensityCurves,
  buildIntensityTable,
  buildIntensityTopology,
  buildIsoluxGrid,
  buildLuminanceTable,
  extractContours,
  formatGraphValue,
  groundIlluminance,
  isoluxContourLevels,
  logRadius,
  logTicks,
  niceTicks,
  orientGraphPoint,
} from './charts.js';
export type {
  ConeDiagram,
  ConeOptions,
  ConePlane,
  ConeRow,
  Contour,
  ContourGrid,
  ContourLevelOptions,
  GraphAxis,
  IntensityCurve,
  IntensityCurveOptions,
  IntensityCurves,
  IntensityTable,
  IntensityTableOptions,
  IntensityTopology,
  IsoluxGrid,
  IsoluxOptions,
  LuminanceTable,
  LuminanceTableOptions,
  Point2,
  Point3,
  TopologyOptions,
  TopologyVertex,
  UpAxis,
} from './charts.js';
export {
  LUX_PER_FOOTCANDLE,
  METERS_PER_FOOT,
  formatIlluminance,
  formatLength,
  illuminanceInUnits,
  illuminanceLegend,
  illuminanceRampRgb,
  illuminanceUnit,
  lengthFromUnits,
  lengthInUnits,
  lengthUnit,
  peakReceiverIlluminance,
  peakReceiverLuminance,
  rulerTicks,
  saturationLuminance,
  autoExposureValue,
  AUTO_EXPOSURE_PEAK,
} from './measurement.js';
export type { IlluminanceLegend, MeasurementUnits, RulerTick } from './measurement.js';
export { luminousShape, projectedLuminousArea } from './shape.js';
export type { LuminousShape, LuminousShapeKind } from './shape.js';