Changeset - d5750b2aaa9e
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 8 months ago 2024-05-21 21:50:01
drewp@bigasterisk.com
minor cam edits
3 files changed with 10 insertions and 6 deletions:
0 comments (0 inline, 0 general)
web/calibrate/FindSafeExposure.ts
Show inline comments
 
@@ -28,12 +28,13 @@ export class FindSafeExposure {
 
      if (this.plot.data.length > 50 || Math.abs(this.expoStep) < 1) {
 
        this.expo = this.expoMin;
 
        await this.gatherSample();
 
        break;
 
      }
 
    }
 
    return this.expo;
 
  }
 
  
 
  step(currentOverexposed: number) {
 
    const maxAllowedOverexposedPixels = 5;
 
    const turnaroundScale = 0.6;
 
    const stepsPerSide = 3;
web/calibrate/Light9Calibrate.ts
Show inline comments
 
@@ -78,13 +78,13 @@ export class Light9Calibrate extends Lit
 
    });
 
  }
 

	
 
  async findSafeExposure(ev: MouseEvent) {
 
    await this.withButtonSpinner(ev, async () => {
 
      const algo = new FindSafeExposure(this.cam!, this.plot!);
 
      await algo.run();
 
      const expo = await algo.run();
 
    });
 
  }
 
  async setToZero(ev: MouseEvent) {
 
    await this.withButtonSpinner(ev, async () => {
 
      this.collector.updateSettings([
 
        [this.device, "http://light9.bigasterisk.com/color", "#000000"],
web/calibrate/Light9Camera.ts
Show inline comments
 
@@ -82,18 +82,20 @@ export class Light9Camera extends LitEle
 
    };
 
    const stream = await navigator.mediaDevices.getUserMedia(constraints);
 
    const t = stream.getVideoTracks()[0];
 
    await t.applyConstraints({
 
      brightness: 0,
 
      contrast: 32,
 
      colorTemperature: 6600,
 
      colorTemperature: 4600,
 
      exposureMode: "manual",
 
      exposureTime: 250,
 
      whiteBalanceMode: "manual",
 
      focusMode: "manual",
 
      focusDistance: 235,
 
      // this could stop focus from moving around, but it also makes my cam
 
      // click on every page reload
 
      //   focusMode: "manual",
 
      //   focusDistance: 235,
 
    } as MediaTrackConstraints);
 

	
 
    this.vtrack = t;
 
    this.videoEl.srcObject = stream;
 
    this.videoEl.play();
 
    this.videoSettings = this.vtrack.getSettings();
 
@@ -152,12 +154,13 @@ export class Light9CameraSettingsTable e
 
        padding: 1px 6px;
 
      }
 
    `,
 
  ];
 

	
 
  boring = [
 
    "autoGainControl",
 
    "aspectRatio",
 
    "backgroundBlur",
 
    "channelCount",
 
    "deviceId",
 
    "displaySurface",
 
    "echoCancellation",
 
@@ -198,25 +201,25 @@ export class Light9CameraSettingsTable e
 
    }
 
    return html`<table>
 
      ${rows}
 
    </table>`;
 
  }
 

	
 
  private renderRow(key: string, rows: any[]) {
 
  private renderRow(key: string, out: TemplateResult<1>[]) {
 
    let valueDisplay = "";
 
    if (this.videoSettings[key] !== undefined) {
 
      valueDisplay = JSON.stringify(this.videoSettings[key]);
 
    }
 
    let adjuster = html``;
 
    let conf = this.adjustable[key];
 
    if (conf !== undefined) {
 
      adjuster = html`
 
        <input type="range" min="${conf.min}" max="${conf.max}" value="${this.videoSettings[key]}" data-param="${key}" @input=${this.setFromSlider} />
 
      `;
 
    }
 
    rows.push(
 
    out.push(
 
      html`<tr>
 
        <td>${key}</td>
 
        <td>${valueDisplay}</td>
 
        <td>${adjuster}</td>
 
      </tr>`
 
    );
0 comments (0 inline, 0 general)