PageSourceSearch

https://asenno.com/_app/immutable/chunks/NmuP78Ao.js

js asenno.com collected 2026-10-08 13:54:22 UTC 3,680 bytes, 37 lines download raw bytes

1function t(t,o,l){const{width:n,height:r}=o,{patternType:a,contrast:s,size:i,windowSize:c}=l
2t.save(),t.imageSmoothingEnabled=!1,t.clearRect(0,0,n,r)
3const f=Math.round(2.55*s),d=Math.round(255-2.55*s),h=`rgb(${f}, ${f}, ${f})`,p=`rgb(${d}, ${d}, ${d})`
4switch(a){case"ansi":((t,e,o,l,n)=>{const r=e/4,a=o/4
5for(let e=0;e<4;e++){const o=Math.floor(e*a),s=Math.floor((e+1)*a)-o
6for(let a=0;a<4;a++){const i=Math.floor(a*r),c=Math.floor((a+1)*r)-i
7t.fillStyle=(e+a)%2==0?l:n,t.fillRect(i,o,c,s)}}t.save(),t.font="bold 20px monospace",t.textAlign="center",t.fillStyle="#808080",t.globalAlpha=.5,t.fillText("ANSI 4\xd74",e/2,o-30),t.restore()})(t,n,r,h,p)
8break
9case"checkerboard":((t,e,o,l,n,r)=>{const a=Math.ceil(e/l),s=Math.ceil(o/l)
10for(let i=0;i<s;i++){const s=Math.floor(i*l),c=Math.floor((i+1)*l),f=Math.min(c-s,o-s)
11for(let o=0;o<a;o++){const a=Math.floor(o*l),c=Math.floor((o+1)*l),d=Math.min(c-a,e-a)
12t.fillStyle=(i+o)%2==0?n:r,t.fillRect(a,s,d,f)}}})(t,n,r,i,h,p)
13break
14case"stripes":((t,e,o,l,n,r)=>{const a=Math.ceil(e/l)
15for(let s=0;s<a;s++){const a=Math.floor(s*l),i=Math.floor((s+1)*l),c=Math.min(i-a,e-a)
16t.fillStyle=s%2==0?n:r,t.fillRect(a,0,c,o)}})(t,n,r,i,h,p)
17break
18case"concentric":((t,e,o,l,n,r)=>{const a=e/2,s=o/2,i=Math.max(e,o)
19for(let e=Math.ceil(i/(2*l));e>=0;e--){const o=e*l*2
20t.fillStyle=e%2==0?n:r,t.fillRect(a-o/2,s-o/2,o,o)}})(t,n,r,i,h,p)
21break
22case"window":e(t,n,r,c,h,p,!1)
23break
24case"window-inverse":e(t,n,r,c,h,p,!0)
25break
26case"window-ladders":((t,e,o)=>{t.fillStyle="rgb(0, 0, 0)",t.fillRect(0,0,e,o)
27const l=.02*Math.min(e,o),n=(e-6*l)/5,r=(o-3*l)/2;[10,20,30,40,50,60,70,80,90,100].forEach((e,o)=>{const a=Math.floor(o/5),s=l+o%5*(n+l),i=l+a*(r+l),c=Math.round(2.55*e),f=`rgb(${c}, ${c}, ${c})`
28t.fillStyle=f,t.fillRect(s,i,n,r),t.save(),t.font=`${Math.max(12,.08*Math.min(n,r))}px monospace`,t.textAlign="center",t.textBaseline="middle",t.fillStyle=e>50?"rgb(0, 0, 0)":"rgb(255, 255, 255)",t.fillText(`${e}%`,s+n/2,i+r/2),t.restore()}),t.save(),t.font="bold 16px monospace",t.textAlign="center",t.fillStyle="rgb(128, 128, 128)",t.globalAlpha=.8,t.fillText("Window Ladders - Local Dimming Test",e/2,o-30),t.font="12px monospace",t.fillText("Each window shows different brightness levels on pure black background",e/2,o-10),t.restore()})(t,n,r)}t.restore()}function e(t,e,o,l,n,r,a){const s=l/100,i=Math.sqrt(e*o*s*(e/o)),c=i*(o/e),f=e/2,d=f-i/2,h=o/2-c/2
29a?(t.fillStyle=n,t.fillRect(0,0,e,o),t.fillStyle=r,t.fillRect(d,h,i,c)):(t.fillStyle=r,t.fillRect(0,0,e,o),t.fillStyle=n,t.fillRect(d,h,i,c)),t.save(),t.font="16px monospace",t.textAlign="center",t.fillStyle=a?r:n,t.globalAlpha=.7,t.fillText(`${l}% Window`,f,h-20)
30const p=((t,e)=>{const o=t.match(/\d+/g),l=e.match(/\d+/g)
31if(!o||!l)return"N/A"
32const n=parseInt(o[0])/255,r=parseInt(l[0])/255
33if(0===r)return"\u221e:1"
34const a=n/r
35return a>1e3?">1000:1":`${Math.round(a)}:1`})(n,r)
36t.fillText(`Contrast: ${p}`,f,h+c+40),t.restore()}const o="Contrast Test Pattern - AV Tools | asenno",l="contrast",n={patternType:"ansi",contrast:100,size:50,windowSize:10},r={ansi:"ANSI Contrast",checkerboard:"Checkerboard",stripes:"Vertical Stripes",concentric:"Concentric Squares",window:"Window Contrast","window-inverse":"Inverse Window","window-ladders":"Window Ladders"},a={infoText:"Comprehensive contrast testing patterns. ANSI 4\xd74 is the industry standard for contrast measurement. Window patterns test local dimming behavior and zone-based contrast. Window Ladders shows multiple brightness levels on pure black to test local dimming zones. Adjust contrast percentage to test different levels."}
37export{a as controls,n as defaultSettings,l as id,r as patternTypes,t as render,o as title}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.