Prechádzať zdrojové kódy

Include chroma in alpha power

Kirk Trombley 3 rokov pred
rodič
commit
754cf3622c
1 zmenil súbory, kde vykonal 7 pridanie a 2 odobranie
  1. 7 2
      web/metrics.js

+ 7 - 2
web/metrics.js

@@ -3,7 +3,11 @@ const metrics = {
     option: "Geometric Difference (α)",
     displayName: String.raw`\alpha`,
     displayBody: p => String.raw`
-      \sigma\left(${p}\right)^{2 - L\left(\vec{q}\right)} \Theta\left(${p}\right)^{L\left(\vec{q}\right)}
+      \frac{
+        \sigma\left(${p}\right)^{1 - (C\left(\left\{\vec{q}\right\}\right) - L\left(\left\{\vec{q}\right\}\right))}
+      }{
+        \Theta\left(${p}\right)^{-1 - (C\left(\left\{\vec{q}\right\}\right) - L\left(\left\{\vec{q}\right\}\right))}
+      }
     `,
     evaluate: () => 0, // calculated below
   },
@@ -127,6 +131,7 @@ const applyMetrics = (data, target) => {
     Object.entries(metrics)
       .map(([name, metric]) => [name, metric.evaluate(data, target)])
   );
-  scores.alpha = Math.pow(scores.sigma, 2 - target.lightness) * Math.pow(scores.bigTheta, target.lightness);
+  const power = target.chroma + 1 - target.lightness;
+  scores.alpha = Math.pow(scores.sigma, 2 - power) * Math.pow(scores.bigTheta, power);
   return scores;
 };