1function e(e,{width:a,height:l},n){const{mode:s}=n 2switch(e.imageSmoothingEnabled=!1,e.clearRect(0,0,a,l),e.fillStyle="#000000",e.fillRect(0,0,a,l),s){case"comparison":((e,a,l,n)=>{const{gammaType:s,customGamma:i,comparisonMode:r,showReferences:c}=n,f=[{name:"Linear",gamma:1,color:"#ff4444"},{name:"sRGB",gamma:"srgb",color:"#44ff44"},{name:"2.2",gamma:2.2,color:"#4444ff"},{name:"2.4",gamma:2.4,color:"#ffff44"}] 3switch("custom"===s&&f.push({name:`Custom ${i}`,gamma:i,color:"#ff44ff"}),r){case"side-by-side":((e,o,a,l)=>{const n=.15*a,s=.02*a,i=o-80-40 4l.forEach((o,l)=>{const r=.15*a+l*(n+s) 5e.fillStyle=o.color,e.font="bold 12px monospace",e.textAlign="left",e.fillText(o.name,20,r+n/2+4) 6for(let a=0;a<i;a++){const l=t(a/i,o.gamma),s=Math.round(255*l) 7e.fillStyle=`rgb(${s}, ${s}, ${s})`,e.fillRect(100+a,r,1,n)}e.strokeStyle=o.color,e.lineWidth=1,e.strokeRect(100,r,i,n)})})(e,a,l,f) 8break 9case"overlay":((e,a,l,n)=>{const s=.4*l,i=(l-s)/2,r=.8*a,c=(a-r)/2 10n.forEach((a,l)=>{const n=.3+.15*l 11for(let l=0;l<r;l++){t(l/r,a.gamma) 12const f=o(a.color) 13e.fillStyle=`rgba(${f.r}, ${f.g}, ${f.b}, ${n})`,e.fillRect(c+l,i,1,s)}}),e.fillStyle="rgba(0, 0, 0, 0.8)",e.fillRect(20,20,200,20*n.length+20),n.forEach((t,o)=>{e.fillStyle=t.color,e.font="12px monospace",e.textAlign="left",e.fillText(t.name,30,40+20*o)})})(e,a,l,f) 14break 15case"split":((e,o,a,l)=>{const n=Math.min(l.length,4),s=o/n 16l.slice(0,n).forEach((o,l)=>{const i=l*s,r=.6*a,c=(a-r)/2 17for(let a=0;a<s;a++){const l=t(a/s,o.gamma),n=Math.round(255*l) 18e.fillStyle=`rgb(${n}, ${n}, ${n})`,e.fillRect(i+a,c,1,r)}e.fillStyle=o.color,e.font="bold 14px monospace",e.textAlign="center",e.fillText(o.name,i+s/2,c-20),l<n-1&&(e.strokeStyle="rgba(255, 255, 255, 0.5)",e.lineWidth=2,e.beginPath(),e.moveTo(i+s,c-40),e.lineTo(i+s,c+r+40),e.stroke())})})(e,a,l,f)}c&&((e,t,o)=>{const a=o-40;[{value:.18,name:"18% Gray",color:"#ffff00"},{value:.5,name:"50% Gray",color:"#00ffff"}].forEach((o,l)=>{const n=o.value*t 19e.strokeStyle=o.color,e.lineWidth=2,e.beginPath(),e.moveTo(n,a),e.lineTo(n,a+30),e.stroke(),e.fillStyle=o.color,e.font="bold 10px monospace",e.textAlign="center",e.fillText(o.name,n,a-5)})})(e,a,l)})(e,a,l,n) 20break 21case"ramps":((e,o,a,l)=>{const{gammaType:n,customGamma:s,testRegion:i,showValues:r}=l,c=.5*a,f=(a-c)/2,h=.8*o,p=(o-h)/2 22let g=0,d=1 23switch(i){case"shadows":g=0,d=.25 24break 25case"midtones":g=.25,d=.75 26break 27case"highlights":g=.75,d=1}for(let o=0;o<h;o++){const a=t(g+o/h*(d-g),"custom"===n?s:n),l=Math.round(255*a) 28e.fillStyle=`rgb(${l}, ${l}, ${l})`,e.fillRect(p+o,f,1,c)}if(r){const o=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1] 29e.strokeStyle="rgba(255, 255, 255, 0.5)",e.lineWidth=1,e.fillStyle="#ffffff",e.font="10px monospace",e.textAlign="center",o.forEach(o=>{if(o>=g&&o<=d){const a=p+(o-g)/(d-g)*h,l=t(o,"custom"===n?s:n),i=Math.round(255*l) 30e.beginPath(),e.moveTo(a,f),e.lineTo(a,f+c),e.stroke(),e.fillText(`${Math.round(100*o)}%`,a,f-10),e.fillText(i.toString(),a,f+c+15)}})}e.fillStyle="#ffffff",e.font="bold 16px monospace",e.textAlign="center" 31const b="custom"===n?`Custom ${s}`:m[n] 32e.fillText(`${b} - ${u[i]}`,o/2,40)})(e,a,l,n) 33break 34case"patches":((e,o,a,l)=>{const{gammaType:n,customGamma:s,showValues:i}=l,r=30,c=(o-180)/5,f=(.6*a-90)/2,h=.15*a;[{input:0,name:"Black",row:0,col:0},{input:.05,name:"5%",row:0,col:1},{input:.1,name:"10%",row:0,col:2},{input:.18,name:"18% Gray",row:0,col:3},{input:.25,name:"25%",row:0,col:4},{input:.5,name:"50% Gray",row:1,col:0},{input:.75,name:"75%",row:1,col:1},{input:.9,name:"90%",row:1,col:2},{input:.95,name:"95%",row:1,col:3},{input:1,name:"White",row:1,col:4}].forEach(o=>{const a=r+o.col*(c+r),l=h+r+o.row*(f+r),m="custom"===n?s:n,u=t(o.input,m),p=Math.round(255*u) 35if(e.fillStyle=`rgb(${p}, ${p}, ${p})`,e.fillRect(a,l,c,f),e.strokeStyle="rgba(255, 255, 255, 0.5)",e.lineWidth=2,e.strokeRect(a,l,c,f),i){const t=p>128?"#000000":"#ffffff" 36e.fillStyle=t,e.font="bold 12px monospace",e.textAlign="center",e.fillText(o.name,a+c/2,l+f/2-5),e.font="10px monospace",e.fillText(`RGB: ${p}`,a+c/2,l+f/2+8),e.fillText(`In: ${Math.round(100*o.input)}%`,a+c/2,l+f/2+20)}}),e.fillStyle="#ffffff",e.font="bold 16px monospace",e.textAlign="center" 37const u="custom"===n?`Custom ${s}`:m[n] 38e.fillText(`Reference Patches - ${u}`,o/2,40)})(e,a,l,n) 39break 40case"scurve":((e,o,a,l)=>{const{gammaType:n,customGamma:s,showValues:i}=l,r=[{name:"Deep Shadow",start:0,end:.1,color:"#ff4444"},{name:"Shadow Detail",start:.1,end:.25,color:"#ff8844"},{name:"Midtone Transition",start:.25,end:.75,color:"#44ff44"},{name:"Highlight Detail",start:.75,end:.9,color:"#4488ff"},{name:"Near White",start:.9,end:1,color:"#8844ff"}],c=a/r.length,f="custom"===n?s:n 41r.forEach((a,l)=>{const n=l*c,s=.8*o,r=.1*o 42for(let o=0;o<s;o++){const l=t(a.start+(a.end-a.start)*(o/s),f),i=Math.round(255*l) 43e.fillStyle=`rgb(${i}, ${i}, ${i})`,e.fillRect(r+o,n,1,c)}e.strokeStyle=a.color,e.lineWidth=2,e.strokeRect(r,n,s,c),i&&(e.fillStyle=a.color,e.font="bold 12px monospace",e.textAlign="left",e.fillText(a.name,20,n+c/2),e.font="10px monospace",e.fillText(`${Math.round(100*a.start)}-${Math.round(100*a.end)}%`,20,n+c/2+15)),[.25,.5,.75].filter(e=>e>
43=a.start&&e<=a.end).forEach(o=>{const l=(o-a.start)/(a.end-a.start),m=r+l*s,h=t(o,f),u=Math.round(255*h) 44e.strokeStyle="rgba(255, 255, 255, 0.8)",e.lineWidth=1,e.beginPath(),e.moveTo(m,n),e.lineTo(m,n+c),e.stroke(),i&&(e.fillStyle="#ffffff",e.font="9px monospace",e.textAlign="center",e.fillText(u.toString(),m,n+c-5))})})})(e,a,l,n) 45break 46case"verification":((e,o,a,l)=>{const{gammaType:n,customGamma:s,showValues:i,bitDepth:r}=l,c=o/8,f=a/6,m="custom"===n?s:n,h=Math.pow(2,r)-1 47for(let o=0;o<6;o++)for(let a=0;a<8;a++){const l=a*c,n=o*f,s=(8*o+a)/47,u=t(s,m),p=Math.round(u*h),g=Math.min(h,Math.max(0,p)),d=Math.round(g/h*255) 48if(e.fillStyle=`rgb(${d}, ${d}, ${d})`,e.fillRect(l,n,c,f),e.strokeStyle="rgba(128, 128, 128, 0.3)",e.lineWidth=1,e.strokeRect(l,n,c,f),i&&c>60&&f>40){const t=d>128?"#000000":"#ffffff" 49e.fillStyle=t,e.font="10px monospace",e.textAlign="center",e.fillText(`${Math.round(100*s)}%`,l+c/2,n+f/2-5),e.fillText(`${r}b: ${g}`,l+c/2,n+f/2+8)}}})(e,a,l,n)}n.showValues&&((e,t,o,a)=>{const{gammaType:l,customGamma:n,mode:s,comparisonMode:i,testRegion:r,bitDepth:c}=a 50e.fillStyle="rgba(0, 0, 0, 0.8)",e.fillRect(t-220,10,210,120),e.fillStyle="#ffffff",e.font="bold 12px monospace",e.textAlign="left",e.fillText("Gamma Test Info:",t-210,30),e.font="10px monospace" 51let p=45 52const g="custom"===l?`Custom ${n}`:m[l] 53e.fillText(`Gamma: ${g}`,t-210,p),p+=12,e.fillText(`Mode: ${f[s]}`,t-210,p),p+=12,"comparison"===s&&(e.fillText(`Compare: ${h[i]}`,t-210,p),p+=12),"ramps"===s&&(e.fillText(`Region: ${u[r]}`,t-210,p),p+=12),e.fillText(`Bit Depth: ${c}-bit`,t-210,p),p+=12,e.fillStyle="#cccccc",e.font="9px monospace",e.fillText("Formula: Out = In^(1/\u03b3)",t-210,p+10)})(e,a,0,n)}function t(e,t){return"srgb"===t?e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055:"rec709"===t?e<.018?4.5*e:1.09929682680944*Math.pow(e,.45)-.099296826809442:"number"==typeof t?Math.pow(e,1/t):Math.pow(e,1/2.2)}function o(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e) 54return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:{r:255,g:255,b:255}}function a(e){const t=Object.keys(f),o=t.indexOf(e) 55return t[(o+1)%t.length]}function l(e){const t=Object.keys(m),o=t.indexOf(e) 56return t[(o+1)%t.length]}function n(e){const t=Object.keys(h),o=t.indexOf(e) 57return t[(o+1)%t.length]}function s(e){const t=Object.keys(u),o=t.indexOf(e) 58return t[(o+1)%t.length]}const i="Gamma Curves Test - AV Tools | asenno",r="gamma-curves",c={mode:"comparison",gammaType:"srgb",customGamma:2.2,showReferences:!0,showValues:!0,showSCurve:!1,comparisonMode:"side-by-side",testRegion:"all",bitDepth:8},f={comparison:"Gamma Comparison",ramps:"Gamma Ramps",patches:"Reference Patches",scurve:"S-Curve Analysis",verification:"Verification Grid"},m={srgb:"sRGB (2.2 + linear)",gamma22:"Pure 2.2 Gamma",gamma24:"Pure 2.4 Gamma",gamma18:"Pure 1.8 Gamma",rec709:"Rec.709 (BT.709)",custom:"Custom Gamma"},h={"side-by-side":"Side by Side",overlay:"Overlay",split:"Split Screen"},u={all:"Full Range (0-100%)",shadows:"Shadows (0-25%)",midtones:"Midtones (25-75%)",highlights:"Highlights (75-100%)"},p={handlers:{m:e=>({...e,mode:a(e.mode)}),g:e=>({...e,gammaType:l(e.gammaType)}),c:e=>({...e,comparisonMode:n(e.comparisonMode)}),r:e=>({...e,testRegion:s(e.testRegion)}),v:e=>({...e,showValues:!e.showValues}),f:e=>({...e,showReferences:!e.showReferences}),s:e=>({...e,showSCurve:!e.showSCurve}),"+":e=>({...e,customGamma:Math.min(3,Math.round(10*(e.customGamma+.1))/10)}),"-":e=>({...e,customGamma:Math.max(1,Math.round(10*(e.customGamma-.1))/10)}),b:e=>({...e,bitDepth:8===e.bitDepth?10:10===e.bitDepth?12:8})}},g={infoText:"Comprehensive gamma curve testing and calibration. Compare different gamma curves, verify display gamma accuracy, and analyze shadow/midtone transitions."} 59export{h as comparisonModes,g as controls,c as defaultSettings,m as gammaTypes,r as id,p as keyboard,f as modes,e as render,u as testRegions,i 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.