home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / Luminance.doc < prev    next >
MacBinary  |  1995-09-26  |  24.5 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Luminance.doc

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert WANG Integrated Word Processor (document/wangIWP) ext Unsupported
1% dexvert Dynamic Publisher Document (document/dynamicPublisherDocument) ext Unsupported
1% dexvert Excellence! Document (document/excellenceDocument) ext Unsupported
1% dexvert Norton Textra Writer (document/textraWriter) ext Unsupported
1% dexvert IBM DisplayWrite Document (document/ibmDisplayWriteDocument) ext Unsupported
1% dexvert Open Access Document (document/openAccessDocument) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Sep 26 19:59:48 1995, modified Tue Sep 26 19:59:48 1995, creator 'CWIE', type ASCII, 24436 bytes "Luminance.doc" , at 0x5ff4 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 4c 75 6d 69 6e 61 | 6e 63 65 2e 64 6f 63 00 |..Lumina|nce.doc.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 5f 74 00 | 00 01 9a ac 8e 44 74 ac |....._t.|.....Dt.|
|00000060| 8e 44 74 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.Dt.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ef c2 00 00 |........|........|
|00000080| 23 69 66 20 30 0d 4c 75 | 6d 69 6e 61 6e 63 65 2e |#if 0.Lu|minance.|
|00000090| 64 6f 63 0d 54 68 69 73 | 20 66 69 6c 65 20 64 6f |doc.This| file do|
|000000a0| 63 75 6d 65 6e 74 73 20 | 4c 75 6d 69 6e 61 6e 63 |cuments |Luminanc|
|000000b0| 65 2e 63 2e 0d 0d 48 49 | 53 54 4f 52 59 3a 0d 33 |e.c...HI|STORY:.3|
|000000c0| 2f 31 31 2f 39 32 20 64 | 67 70 20 61 64 64 65 64 |/11/92 d|gp added|
|000000d0| 20 70 72 6f 74 6f 74 79 | 70 65 73 20 74 6f 20 73 | prototy|pes to s|
|000000e0| 75 70 70 6c 65 6d 65 6e | 74 20 74 68 65 20 65 78 |upplemen|t the ex|
|000000f0| 70 6c 61 6e 61 74 69 6f | 6e 73 20 6f 66 20 74 68 |planatio|ns of th|
|00000100| 65 20 72 6f 75 74 69 6e | 65 73 2e 0d 33 2f 32 34 |e routin|es..3/24|
|00000110| 2f 39 34 09 64 67 70 20 | 61 64 64 65 64 20 4c 54 |/94.dgp |added LT|
|00000120| 6f 45 2c 20 4c 54 6f 45 | 4f 72 64 65 72 65 64 2c |oE, LToE|Ordered,|
|00000130| 20 61 6e 64 20 45 54 6f | 4c 2e 0d 31 30 2f 31 37 | and ETo|L..10/17|
|00000140| 2f 39 34 20 64 67 70 20 | 75 70 64 61 74 65 64 2c |/94 dgp |updated,|
|00000150| 20 69 6e 20 72 65 73 70 | 6f 6e 73 65 20 74 6f 20 | in resp|onse to |
|00000160| 71 75 65 72 69 65 73 20 | 62 79 20 4c 61 6e 20 5a |queries |by Lan Z|
|00000170| 68 61 6e 67 2e 0d 0d 49 | 4e 54 52 4f 44 55 43 54 |hang...I|NTRODUCT|
|00000180| 49 4f 4e 3a 0d 0d 54 68 | 65 20 70 75 72 70 6f 73 |ION:..Th|e purpos|
|00000190| 65 20 6f 66 20 74 68 65 | 73 65 20 73 75 62 72 6f |e of the|se subro|
|000001a0| 75 74 69 6e 65 73 20 69 | 73 20 61 63 63 75 72 61 |utines i|s accura|
|000001b0| 74 65 20 63 6f 6e 74 72 | 6f 6c 20 6f 66 20 63 6f |te contr|ol of co|
|000001c0| 6e 74 72 61 73 74 20 6f | 66 20 76 69 73 75 61 6c |ntrast o|f visual|
|000001d0| 20 0d 73 74 69 6d 75 6c | 69 20 66 6f 72 20 76 69 | .stimul|i for vi|
|000001e0| 73 69 6f 6e 20 65 78 70 | 65 72 69 6d 65 6e 74 73 |sion exp|eriments|
|000001f0| 2e 20 54 68 65 73 65 20 | 73 75 62 72 6f 75 74 69 |. These |subrouti|
|00000200| 6e 65 73 20 73 65 74 20 | 75 70 20 74 68 65 20 43 |nes set |up the C|
|00000210| 6f 6c 6f 72 20 4c 6f 6f | 6b 75 70 20 54 61 62 6c |olor Loo|kup Tabl|
|00000220| 65 20 0d 28 43 4c 55 54 | 29 20 6f 66 20 61 20 76 |e .(CLUT|) of a v|
|00000230| 69 64 65 6f 20 66 72 61 | 6d 65 73 74 6f 72 65 20 |ideo fra|mestore |
|00000240| 6f 6e 20 74 68 65 20 4d | 61 63 20 49 49 20 28 65 |on the M|ac II (e|
|00000250| 2e 67 2e 20 74 68 65 20 | 41 70 70 6c 65 20 4d 61 |.g. the |Apple Ma|
|00000260| 63 20 49 49 20 43 6f 6c | 6f 72 20 56 69 64 65 6f |c II Col|or Video|
|00000270| 20 0d 43 61 72 64 29 20 | 74 6f 20 70 72 6f 70 65 | .Card) |to prope|
|00000280| 72 6c 79 20 64 72 69 76 | 65 20 61 20 6d 6f 6e 6f |rly driv|e a mono|
|00000290| 63 68 72 6f 6d 65 20 6d | 6f 6e 69 74 6f 72 20 28 |chrome m|onitor (|
|000002a0| 65 2e 67 2e 20 74 68 65 | 20 41 70 70 6c 65 20 48 |e.g. the| Apple H|
|000002b0| 69 67 68 20 52 65 73 6f | 6c 75 74 69 6f 6e 20 0d |igh Reso|lution .|
|000002c0| 4d 6f 6e 6f 63 68 72 6f | 6d 65 20 4d 6f 6e 69 74 |Monochro|me Monit|
|000002d0| 6f 72 29 20 76 69 61 20 | 61 6e 20 49 6e 73 74 69 |or) via |an Insti|
|000002e0| 74 75 74 65 20 66 6f 72 | 20 53 65 6e 73 6f 72 79 |tute for| Sensory|
|000002f0| 20 52 65 73 65 61 72 63 | 68 20 28 49 53 52 29 20 | Researc|h (ISR) |
|00000300| 56 69 64 65 6f 20 0d 41 | 74 74 65 6e 75 61 74 6f |Video .A|ttenuato|
|00000310| 72 2e 20 54 68 65 20 49 | 53 52 20 56 69 64 65 6f |r. The I|SR Video|
|00000320| 20 41 74 74 65 6e 75 61 | 74 6f 72 20 63 6f 6e 73 | Attenua|tor cons|
|00000330| 69 73 74 73 20 6f 66 20 | 72 65 73 69 73 74 69 76 |ists of |resistiv|
|00000340| 65 20 64 69 76 69 64 65 | 72 73 20 77 68 69 63 68 |e divide|rs which|
|00000350| 20 0d 61 74 74 65 6e 75 | 61 74 65 20 74 68 65 20 | .attenu|ate the |
|00000360| 74 68 72 65 65 20 63 6f | 6c 6f 72 20 73 69 67 6e |three co|lor sign|
|00000370| 61 6c 20 66 72 6f 6d 20 | 74 68 65 20 76 69 64 65 |al from |the vide|
|00000380| 6f 20 66 72 61 6d 65 73 | 74 6f 72 65 20 62 79 20 |o frames|tore by |
|00000390| 64 69 66 66 65 72 65 6e | 74 20 0d 61 6d 6f 75 6e |differen|t .amoun|
|000003a0| 74 73 20 61 6e 64 20 63 | 6f 6d 62 69 6e 65 20 74 |ts and c|ombine t|
|000003b0| 68 65 6d 20 74 6f 20 70 | 72 6f 64 75 63 65 20 6f |hem to p|roduce o|
|000003c0| 6e 65 20 6d 6f 6e 6f 63 | 68 72 6f 6d 65 20 73 69 |ne monoc|hrome si|
|000003d0| 67 6e 61 6c 2e 0d 0d 54 | 68 65 20 76 69 64 65 6f |gnal...T|he video|
|000003e0| 20 61 74 74 65 6e 75 61 | 74 6f 72 20 61 6e 64 20 | attenua|tor and |
|000003f0| 74 68 65 20 74 68 65 6f | 72 79 20 62 65 68 69 6e |the theo|ry behin|
|00000400| 64 20 74 68 65 20 61 6c | 67 6f 72 69 74 68 6d 73 |d the al|gorithms|
|00000410| 20 64 65 73 63 72 69 62 | 65 64 20 68 65 72 65 20 | describ|ed here |
|00000420| 61 72 65 0d 74 68 65 20 | 74 6f 70 69 63 20 6f 66 |are.the |topic of|
|00000430| 20 61 20 70 61 70 65 72 | 3a 0d 44 2e 47 2e 20 50 | a paper|:.D.G. P|
|00000440| 65 6c 6c 69 20 61 6e 64 | 20 4c 2e 20 5a 68 61 6e |elli and| L. Zhan|
|00000450| 67 20 28 31 39 39 31 29 | 20 41 63 63 75 72 61 74 |g (1991)| Accurat|
|00000460| 65 20 63 6f 6e 74 72 6f | 6c 20 6f 66 20 63 6f 6e |e contro|l of con|
|00000470| 74 72 61 73 74 20 6f 6e | 20 6d 69 63 72 6f 63 6f |trast on| microco|
|00000480| 6d 70 75 74 65 72 20 64 | 69 73 70 6c 61 79 73 2e |mputer d|isplays.|
|00000490| 20 0d 56 69 73 69 6f 6e | 20 52 65 73 65 61 72 63 | .Vision| Researc|
|000004a0| 68 2c 20 33 31 3a 31 33 | 33 37 2d 31 33 36 30 2e |h, 31:13|37-1360.|
|000004b0| 0d 0d 41 63 68 69 65 76 | 69 6e 67 20 74 68 65 20 |..Achiev|ing the |
|000004c0| 67 6f 61 6c 20 6f 66 20 | 61 63 63 75 72 61 74 65 |goal of |accurate|
|000004d0| 20 63 6f 6e 74 72 6f 6c | 20 6f 66 20 63 6f 6e 74 | control| of cont|
|000004e0| 72 61 73 74 20 72 65 71 | 75 69 72 65 64 20 73 6f |rast req|uired so|
|000004f0| 6c 76 69 6e 67 20 66 69 | 76 65 20 0d 70 72 6f 62 |lving fi|ve .prob|
|00000500| 6c 65 6d 73 3a 0d 31 2e | 20 54 68 65 20 6c 75 6d |lems:.1.| The lum|
|00000510| 69 6e 61 6e 63 65 20 6f | 66 20 74 68 65 20 6d 6f |inance o|f the mo|
|00000520| 6e 69 74 6f 72 20 69 73 | 20 6e 6f 6e 6c 69 6e 65 |nitor is| nonline|
|00000530| 61 72 6c 79 20 72 65 6c | 61 74 65 64 20 74 6f 20 |arly rel|ated to |
|00000540| 74 68 65 20 69 6e 70 75 | 74 20 76 6f 6c 74 61 67 |the inpu|t voltag|
|00000550| 65 0d 77 68 69 63 68 20 | 64 65 70 65 6e 64 73 20 |e.which |depends |
|00000560| 6c 69 6e 65 61 72 6c 79 | 20 6f 6e 20 74 68 65 20 |linearly| on the |
|00000570| 74 72 69 70 6c 65 74 20 | 6c 6f 61 64 65 64 20 69 |triplet |loaded i|
|00000580| 6e 74 6f 20 74 68 65 20 | 43 4c 55 54 2e 20 54 68 |nto the |CLUT. Th|
|00000590| 69 73 20 69 73 20 73 6f | 6c 76 65 64 20 62 79 0d |is is so|lved by.|
|000005a0| 61 6c 6c 6f 77 69 6e 67 | 20 74 68 65 20 75 73 65 |allowing| the use|
|000005b0| 72 20 74 6f 20 70 72 6f | 76 69 64 65 20 61 20 70 |r to pro|vide a p|
|000005c0| 6f 6c 79 6e 6f 6d 69 61 | 6c 20 28 49 20 72 65 63 |olynomia|l (I rec|
|000005d0| 6f 6d 6d 65 6e 64 20 34 | 74 68 20 6f 72 64 65 72 |ommend 4|th order|
|000005e0| 29 20 64 65 73 63 72 69 | 62 69 6e 67 20 74 68 65 |) descri|bing the|
|000005f0| 0d 6e 6f 6e 6c 69 6e 65 | 61 72 20 72 65 6c 61 74 |.nonline|ar relat|
|00000600| 69 6f 6e 73 68 69 70 20 | 62 65 74 77 65 65 6e 20 |ionship |between |
|00000610| 6c 75 6d 69 6e 61 6e 63 | 65 20 61 6e 64 20 6e 6f |luminanc|e and no|
|00000620| 6d 69 6e 61 6c 20 76 6f | 6c 74 61 67 65 2e 20 28 |minal vo|ltage. (|
|00000630| 46 6f 72 20 63 6f 6d 70 | 75 74 61 74 69 6f 6e 61 |For comp|utationa|
|00000640| 6c 0d 72 65 61 73 6f 6e | 73 2c 20 79 6f 75 20 6d |l.reason|s, you m|
|00000650| 75 73 74 20 61 6c 73 6f | 20 73 75 70 70 6c 79 20 |ust also| supply |
|00000660| 61 20 71 75 61 64 72 61 | 74 69 63 20 66 69 74 2e |a quadra|tic fit.|
|00000670| 29 20 54 68 65 20 73 75 | 62 72 6f 75 74 69 6e 65 |) The su|broutine|
|00000680| 73 20 4c 54 6f 56 20 61 | 6e 64 20 56 54 6f 4c 0d |s LToV a|nd VToL.|
|00000690| 75 73 65 20 74 68 69 73 | 20 70 6f 6c 79 6e 6f 6d |use this| polynom|
|000006a0| 69 61 6c 20 74 6f 20 63 | 6f 6e 76 65 72 74 20 62 |ial to c|onvert b|
|000006b0| 61 63 6b 20 61 6e 64 20 | 66 6f 72 74 68 2e 0d 32 |ack and |forth..2|
|000006c0| 2e 20 41 66 66 6f 72 64 | 61 62 6c 65 20 66 72 61 |. Afford|able fra|
|000006d0| 6d 65 73 74 6f 72 65 73 | 20 66 6f 72 20 6d 69 63 |mestores| for mic|
|000006e0| 72 6f 63 6f 6d 70 75 74 | 65 72 73 20 68 61 76 65 |rocomput|ers have|
|000006f0| 20 38 20 62 69 74 20 44 | 69 67 69 74 61 6c 20 74 | 8 bit D|igital t|
|00000700| 6f 20 41 6e 61 6c 6f 67 | 0d 43 6f 6e 76 65 72 74 |o Analog|.Convert|
|00000710| 65 72 73 20 28 44 41 43 | 73 29 2c 20 77 68 69 63 |ers (DAC|s), whic|
|00000720| 68 20 63 61 6e 20 6f 6e | 6c 79 20 72 65 70 72 65 |h can on|ly repre|
|00000730| 73 65 6e 74 20 32 35 36 | 20 64 69 66 66 65 72 65 |sent 256| differe|
|00000740| 6e 74 20 6c 75 6d 69 6e | 61 6e 63 65 73 2e 20 54 |nt lumin|ances. T|
|00000750| 68 69 73 20 69 73 0d 6e | 6f 74 20 65 6e 6f 75 67 |his is.n|ot enoug|
|00000760| 68 20 70 72 65 63 69 73 | 69 6f 6e 20 74 6f 20 70 |h precis|ion to p|
|00000770| 72 6f 64 75 63 65 20 74 | 68 72 65 73 68 6f 6c 64 |roduce t|hreshold|
|00000780| 2d 63 6f 6e 74 72 61 73 | 74 20 70 61 74 74 65 72 |-contras|t patter|
|00000790| 6e 73 2c 20 77 68 69 63 | 68 20 61 72 65 20 69 6d |ns, whic|h are im|
|000007a0| 70 6f 72 74 61 6e 74 0d | 66 6f 72 20 76 69 73 69 |portant.|for visi|
|000007b0| 6f 6e 20 65 78 70 65 72 | 69 6d 65 6e 74 73 2e 20 |on exper|iments. |
|000007c0| 54 68 69 73 20 69 73 20 | 73 6f 6c 76 65 64 20 62 |This is |solved b|
|000007d0| 79 20 74 68 65 20 49 53 | 52 20 56 69 64 65 6f 20 |y the IS|R Video |
|000007e0| 41 74 74 65 6e 75 61 74 | 6f 72 20 77 68 69 63 68 |Attenuat|or which|
|000007f0| 0d 63 6f 6d 62 69 6e 65 | 73 20 74 68 65 20 6f 75 |.combine|s the ou|
|00000800| 74 70 75 74 73 20 6f 66 | 20 74 68 65 20 74 68 72 |tputs of| the thr|
|00000810| 65 65 20 44 41 43 73 20 | 28 22 72 65 64 22 2c 20 |ee DACs |("red", |
|00000820| 22 67 72 65 65 6e 22 2c | 20 61 6e 64 20 22 62 6c |"green",| and "bl|
|00000830| 75 65 22 29 20 77 69 74 | 68 20 76 61 72 69 6f 75 |ue") wit|h variou|
|00000840| 73 0d 61 74 74 65 6e 75 | 61 74 69 6f 6e 73 20 74 |s.attenu|ations t|
|00000850| 6f 20 79 69 65 6c 64 20 | 6f 6e 65 20 6d 6f 6e 6f |o yield |one mono|
|00000860| 63 68 72 6f 6d 65 20 73 | 69 67 6e 61 6c 20 77 68 |chrome s|ignal wh|
|00000870| 69 63 68 20 63 61 6e 20 | 72 65 70 72 65 73 65 6e |ich can |represen|
|00000880| 74 20 6c 6f 77 20 63 6f | 6e 74 72 61 73 74 73 0d |t low co|ntrasts.|
|00000890| 28 62 79 20 76 61 72 79 | 69 6e 67 20 61 6e 20 61 |(by vary|ing an a|
|000008a0| 74 74 65 6e 75 61 74 65 | 64 20 44 41 43 29 20 61 |ttenuate|d DAC) a|
|000008b0| 6e 64 20 68 69 67 68 20 | 63 6f 6e 74 72 61 73 74 |nd high |contrast|
|000008c0| 73 20 28 62 79 20 76 61 | 72 79 69 6e 67 20 61 6e |s (by va|rying an|
|000008d0| 20 75 6e 61 74 74 65 6e | 75 61 74 65 64 0d 44 41 | unatten|uated.DA|
|000008e0| 43 29 2e 0d 33 2e 20 44 | 41 43 73 20 61 72 65 20 |C)..3. D|ACs are |
|000008f0| 6f 6e 6c 79 20 61 63 63 | 75 72 61 74 65 20 74 6f |only acc|urate to|
|00000900| 20 b1 20 61 20 6c 65 61 | 73 74 20 73 69 67 6e 69 | . a lea|st signi|
|00000910| 66 69 63 61 6e 74 20 62 | 69 74 20 28 4c 53 42 29 |ficant b|it (LSB)|
|00000920| 2e 20 54 68 65 20 42 72 | 6f 6f 6b 74 72 65 65 20 |. The Br|ooktree |
|00000930| 44 41 43 73 0d 75 73 65 | 64 20 62 79 20 41 70 70 |DACs.use|d by App|
|00000940| 6c 65 20 61 6e 64 20 52 | 61 73 74 65 72 4f 70 73 |le and R|asterOps|
|00000950| 20 61 72 65 20 73 70 65 | 63 69 66 69 65 64 20 74 | are spe|cified t|
|00000960| 6f 20 68 61 76 65 20 61 | 20 b1 31 20 4c 53 42 20 |o have a| .1 LSB |
|00000970| 22 69 6e 74 65 67 72 61 | 74 65 64 0d 6c 69 6e 65 |"integra|ted.line|
|00000980| 61 72 69 74 79 22 20 65 | 72 72 6f 72 2c 20 77 68 |arity" e|rror, wh|
|00000990| 69 63 68 20 6d 65 61 6e | 73 20 74 68 61 74 20 74 |ich mean|s that t|
|000009a0| 68 65 20 76 6f 6c 74 61 | 67 65 20 70 72 6f 64 75 |he volta|ge produ|
|000009b0| 63 65 64 20 62 79 20 61 | 6e 79 20 6e 75 6d 62 65 |ced by a|ny numbe|
|000009c0| 72 20 77 69 6c 6c 0d 64 | 65 76 69 61 74 65 20 66 |r will.d|eviate f|
|000009d0| 72 6f 6d 20 61 20 6c 69 | 6e 65 20 63 6f 6e 6e 65 |rom a li|ne conne|
|000009e0| 63 74 69 6e 67 20 74 68 | 65 20 30 20 61 6e 64 20 |cting th|e 0 and |
|000009f0| 32 35 35 20 70 6f 69 6e | 74 73 20 62 79 20 61 74 |255 poin|ts by at|
|00000a00| 20 6d 6f 73 74 20 31 20 | 4c 53 42 2c 20 77 68 69 | most 1 |LSB, whi|
|00000a10| 63 68 20 69 73 0d 64 65 | 66 69 6e 65 64 20 61 73 |ch is.de|fined as|
|00000a20| 20 31 2f 32 35 35 20 74 | 69 6d 65 73 20 74 68 65 | 1/255 t|imes the|
|00000a30| 20 76 6f 6c 74 61 67 65 | 20 64 69 66 66 65 72 65 | voltage| differe|
|00000a40| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 30 20 61 6e |nce betw|een 0 an|
|00000a50| 64 20 32 35 35 2e 20 49 | 20 61 73 73 75 6d 65 20 |d 255. I| assume |
|00000a60| 61 0d 73 6c 69 67 68 74 | 6c 79 20 73 74 72 6f 6e |a.slight|ly stron|
|00000a70| 67 65 72 20 72 65 73 74 | 72 69 63 74 69 6f 6e 20 |ger rest|riction |
|00000a80| 77 69 6c 6c 20 68 6f 6c | 64 2c 20 74 68 61 74 20 |will hol|d, that |
|00000a90| 74 68 65 20 64 69 66 66 | 65 72 65 6e 63 65 20 62 |the diff|erence b|
|00000aa0| 65 74 77 65 65 6e 20 61 | 6e 79 20 74 77 6f 0d 73 |etween a|ny two.s|
|00000ab0| 65 74 74 69 6e 67 73 20 | 77 69 6c 6c 20 62 65 20 |ettings |will be |
|00000ac0| 69 6e 20 65 72 72 6f 72 | 20 62 79 20 61 74 20 6d |in error| by at m|
|00000ad0| 6f 73 74 20 6f 6e 65 20 | 4c 53 42 2e 20 53 6f 20 |ost one |LSB. So |
|00000ae0| 69 74 20 69 73 20 69 6d | 70 6f 72 74 61 6e 74 20 |it is im|portant |
|00000af0| 74 6f 20 61 6c 6c 6f 77 | 20 74 68 65 0d 75 73 65 |to allow| the.use|
|00000b00| 72 20 74 6f 20 73 70 65 | 63 69 66 79 20 77 68 61 |r to spe|cify wha|
|00000b10| 74 20 72 61 6e 67 65 20 | 6f 66 20 6c 75 6d 69 6e |t range |of lumin|
|00000b20| 61 6e 63 65 73 20 77 69 | 6c 6c 20 62 65 20 75 73 |ances wi|ll be us|
|00000b30| 65 64 20 74 6f 20 70 72 | 65 73 65 6e 74 20 61 20 |ed to pr|esent a |
|00000b40| 70 61 72 74 69 63 75 6c | 61 72 0d 73 74 69 6d 75 |particul|ar.stimu|
|00000b50| 6c 75 73 20 61 6e 64 20 | 74 6f 20 66 69 78 20 74 |lus and |to fix t|
|00000b60| 68 65 20 63 6f 61 72 73 | 65 73 74 20 44 41 43 73 |he coars|est DACs|
|00000b70| 20 28 69 2e 65 2e 20 74 | 68 6f 73 65 20 77 69 74 | (i.e. t|hose wit|
|00000b80| 68 20 74 68 65 20 6c 65 | 61 73 74 20 61 74 74 65 |h the le|ast atte|
|00000b90| 6e 75 61 74 69 6f 6e 20 | 69 6e 0d 74 68 65 20 49 |nuation |in.the I|
|00000ba0| 53 52 20 56 69 64 65 6f | 20 41 74 74 65 6e 75 61 |SR Video| Attenua|
|00000bb0| 74 6f 72 29 20 61 6e 64 | 20 6f 6e 6c 79 20 76 61 |tor) and| only va|
|00000bc0| 72 79 20 74 68 65 20 66 | 69 6e 65 20 44 41 43 73 |ry the f|ine DACs|
|00000bd0| 20 74 6f 20 70 72 6f 64 | 75 63 65 20 74 68 65 20 | to prod|uce the |
|00000be0| 73 70 65 63 69 66 69 65 | 64 0d 6c 75 6d 69 6e 61 |specifie|d.lumina|
|00000bf0| 6e 63 65 73 2e 20 54 68 | 65 20 72 61 6e 67 65 20 |nces. Th|e range |
|00000c00| 73 65 74 74 69 6e 67 20 | 69 73 20 64 6f 6e 65 20 |setting |is done |
|00000c10| 62 79 20 53 65 74 4c 75 | 6d 69 6e 61 6e 63 65 52 |by SetLu|minanceR|
|00000c20| 61 6e 67 65 28 29 20 77 | 68 69 63 68 20 69 73 20 |ange() w|hich is |
|00000c30| 63 61 6c 6c 65 64 0d 61 | 75 74 6f 6d 61 74 69 63 |called.a|utomatic|
|00000c40| 61 6c 6c 79 20 62 79 20 | 53 65 74 4c 75 6d 69 6e |ally by |SetLumin|
|00000c50| 61 6e 63 65 28 29 20 61 | 6e 64 20 53 65 74 4c 75 |ance() a|nd SetLu|
|00000c60| 6d 69 6e 61 6e 63 65 73 | 28 29 2e 0d 34 2e 20 41 |minances|()..4. A|
|00000c70| 70 70 6c 65 27 73 20 73 | 6f 66 74 77 61 72 65 20 |pple's s|oftware |
|00000c80| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 66 6f 72 20 |environm|ent for |
|00000c90| 67 72 61 70 68 69 63 73 | 2c 20 51 75 69 63 6b 44 |graphics|, QuickD|
|00000ca0| 72 61 77 2c 20 69 73 6e | 27 74 20 64 65 73 69 67 |raw, isn|'t desig|
|00000cb0| 6e 65 64 20 66 6f 72 0d | 76 69 73 69 6f 6e 20 65 |ned for.|vision e|
|00000cc0| 78 70 65 72 69 6d 65 6e | 74 73 2e 20 54 68 65 20 |xperimen|ts. The |
|00000cd0| 66 61 63 69 6c 69 74 69 | 65 73 20 66 6f 72 20 63 |faciliti|es for c|
|00000ce0| 72 65 61 74 69 6e 67 20 | 69 6d 61 67 65 73 20 61 |reating |images a|
|00000cf0| 72 65 20 66 69 6e 65 2c | 20 62 75 74 20 74 68 65 |re fine,| but the|
|00000d00| 20 63 6f 6e 74 72 6f 6c | 0d 6f 66 20 74 68 65 20 | control|.of the |
|00000d10| 43 4c 55 54 73 20 70 72 | 6f 76 69 64 65 64 20 62 |CLUTs pr|ovided b|
|00000d20| 79 20 74 68 65 20 50 61 | 6c 65 74 74 65 20 61 6e |y the Pa|lette an|
|00000d30| 64 20 43 6f 6c 6f 72 20 | 4d 61 6e 61 67 65 72 73 |d Color |Managers|
|00000d40| 20 69 73 20 75 6e 73 61 | 74 69 73 66 61 63 74 6f | is unsa|tisfacto|
|00000d50| 72 79 20 66 6f 72 0d 76 | 69 73 69 6f 6e 20 72 65 |ry for.v|ision re|
|00000d60| 73 65 61 72 63 68 20 62 | 65 63 61 75 73 65 20 61 |search b|ecause a|
|00000d70| 20 6c 6f 74 20 68 61 70 | 70 65 6e 73 20 62 65 68 | lot hap|pens beh|
|00000d80| 69 6e 64 20 79 6f 75 72 | 20 62 61 63 6b 2e 20 49 |ind your| back. I|
|00000d90| 6e 20 70 61 72 74 69 63 | 75 6c 61 72 20 74 68 65 |n partic|ular the|
|00000da0| 0d 50 61 6c 65 74 74 65 | 20 4d 61 6e 61 67 65 72 |.Palette| Manager|
|00000db0| 20 6c 69 6b 65 73 20 74 | 6f 20 6d 61 69 6e 74 61 | likes t|o mainta|
|00000dc0| 69 6e 20 61 20 63 6f 6e | 73 69 73 74 65 6e 74 20 |in a con|sistent |
|00000dd0| 63 6f 6c 6f 72 20 65 6e | 76 69 72 6f 6e 6d 65 6e |color en|vironmen|
|00000de0| 74 20 61 63 72 6f 73 73 | 20 74 68 65 0d 65 6e 74 |t across| the.ent|
|00000df0| 69 72 65 20 64 65 73 6b | 74 6f 70 2c 20 77 68 69 |ire desk|top, whi|
|00000e00| 63 68 20 69 6e 63 6c 75 | 64 65 73 20 61 6c 6c 20 |ch inclu|des all |
|00000e10| 79 6f 75 72 20 73 63 72 | 65 65 6e 73 2e 20 57 65 |your scr|eens. We|
|00000e20| 6c 6c 2c 20 69 6e 20 76 | 69 73 69 6f 6e 20 65 78 |ll, in v|ision ex|
|00000e30| 70 65 72 69 6d 65 6e 74 | 73 20 77 65 0d 67 65 6e |periment|s we.gen|
|00000e40| 65 72 61 6c 6c 79 20 77 | 61 6e 74 20 74 6f 20 74 |erally w|ant to t|
|00000e50| 72 65 61 74 20 65 61 63 | 68 20 73 63 72 65 65 6e |reat eac|h screen|
|00000e60| 20 61 73 20 61 20 74 6f | 74 61 6c 6c 79 20 73 65 | as a to|tally se|
|00000e70| 70 61 72 61 74 65 20 64 | 65 76 69 63 65 2c 20 75 |parate d|evice, u|
|00000e80| 6e 61 66 66 65 63 74 65 | 64 20 62 79 0d 77 68 61 |naffecte|d by.wha|
|00000e90| 74 20 77 65 20 64 6f 20 | 74 6f 20 74 68 65 20 6f |t we do |to the o|
|00000ea0| 74 68 65 72 20 73 63 72 | 65 65 6e 73 2e 20 54 68 |ther scr|eens. Th|
|00000eb0| 69 73 20 69 73 20 73 6f | 6c 76 65 64 20 62 79 20 |is is so|lved by |
|00000ec0| 74 68 65 20 72 6f 75 74 | 69 6e 65 20 47 44 53 65 |the rout|ine GDSe|
|00000ed0| 74 45 6e 74 72 69 65 73 | 28 29 0d 77 68 69 63 68 |tEntries|().which|
|00000ee0| 20 6d 61 6b 65 73 20 61 | 20 6c 6f 77 2d 6c 65 76 | makes a| low-lev|
|00000ef0| 65 6c 20 63 61 6c 6c 20 | 74 6f 20 74 68 65 20 76 |el call |to the v|
|00000f00| 69 64 65 6f 20 64 72 69 | 76 65 72 20 74 6f 20 63 |ideo dri|ver to c|
|00000f10| 68 61 6e 67 65 20 74 68 | 65 20 43 4c 55 54 20 64 |hange th|e CLUT d|
|00000f20| 69 72 65 63 74 6c 79 0d | 77 69 74 68 6f 75 74 20 |irectly.|without |
|00000f30| 51 75 69 63 6b 44 72 61 | 77 27 73 20 6b 6e 6f 77 |QuickDra|w's know|
|00000f40| 6c 65 64 67 65 2e 20 28 | 54 68 69 73 20 77 69 6c |ledge. (|This wil|
|00000f50| 6c 20 77 6f 72 6b 20 77 | 69 74 68 20 61 6e 79 20 |l work w|ith any |
|00000f60| 76 69 64 65 6f 20 63 61 | 72 64 20 74 68 61 74 20 |video ca|rd that |
|00000f70| 77 6f 72 6b 73 0d 77 69 | 74 68 20 74 68 65 20 4d |works.wi|th the M|
|00000f80| 61 63 20 49 49 2e 29 20 | 54 68 65 20 72 6f 75 74 |ac II.) |The rout|
|00000f90| 69 6e 65 20 4c 6f 61 64 | 4c 75 6d 69 6e 61 6e 63 |ine Load|Luminanc|
|00000fa0| 65 73 28 29 2c 20 77 68 | 69 63 68 20 69 73 20 75 |es(), wh|ich is u|
|00000fb0| 73 65 64 20 62 65 6c 6f | 77 2c 20 69 73 20 6a 75 |sed belo|w, is ju|
|00000fc0| 73 74 20 61 0d 63 6f 6e | 76 65 6e 69 65 6e 74 20 |st a.con|venient |
|00000fd0| 67 6c 75 65 20 72 6f 75 | 74 69 6e 65 20 66 6f 72 |glue rou|tine for|
|00000fe0| 20 63 61 6c 6c 69 6e 67 | 20 47 44 53 65 74 45 6e | calling| GDSetEn|
|00000ff0| 74 72 69 65 73 28 29 2e | 0d 35 2e 20 41 70 70 6c |tries().|.5. Appl|
|00001000| 65 20 73 70 65 63 69 66 | 69 65 73 20 74 68 61 74 |e specif|ies that|
|00001010| 20 74 68 65 20 76 69 64 | 65 6f 20 64 72 69 76 65 | the vid|eo drive|
|00001020| 72 20 73 68 6f 75 6c 64 | 20 73 69 6c 65 6e 74 6c |r should| silentl|
|00001030| 79 20 69 6d 70 6c 65 6d | 65 6e 74 20 67 61 6d 6d |y implem|ent gamm|
|00001040| 61 0d 63 6f 72 72 65 63 | 74 69 6f 6e 20 74 6f 20 |a.correc|tion to |
|00001050| 61 74 74 65 6d 70 74 20 | 74 6f 20 63 6f 72 72 65 |attempt |to corre|
|00001060| 63 74 20 66 6f 72 20 74 | 68 65 20 64 69 73 70 6c |ct for t|he displ|
|00001070| 61 79 27 73 20 6e 6f 6e | 6c 69 6e 65 61 72 20 72 |ay's non|linear r|
|00001080| 65 6c 61 74 69 6f 6e 20 | 62 65 74 77 65 65 6e 0d |elation |between.|
|00001090| 6c 75 6d 69 6e 61 6e 63 | 65 20 61 6e 64 20 69 6e |luminanc|e and in|
|000010a0| 70 75 74 20 76 6f 6c 74 | 61 67 65 2e 20 57 65 20 |put volt|age. We |
|000010b0| 64 6f 6e 27 74 20 77 61 | 6e 74 20 74 68 69 73 20 |don't wa|nt this |
|000010c0| 62 65 63 61 75 73 65 20 | 74 68 69 73 20 68 69 64 |because |this hid|
|000010d0| 64 65 6e 20 67 61 6d 6d | 61 0d 63 6f 72 72 65 63 |den gamm|a.correc|
|000010e0| 74 69 6f 6e 20 6c 6f 73 | 65 73 20 70 72 65 63 69 |tion los|es preci|
|000010f0| 73 69 6f 6e 20 61 6e 64 | 20 69 6e 74 65 72 66 65 |sion and| interfe|
|00001100| 72 65 73 20 77 69 74 68 | 20 74 68 65 20 6f 70 65 |res with| the ope|
|00001110| 72 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 49 53 |ration o|f the IS|
|00001120| 52 20 56 69 64 65 6f 0d | 41 74 74 65 6e 75 61 74 |R Video.|Attenuat|
|00001130| 6f 72 2c 20 77 68 69 63 | 68 20 77 69 6c 6c 20 73 |or, whic|h will s|
|00001140| 65 65 6d 20 74 6f 20 6f | 70 65 72 61 74 65 20 4e |eem to o|perate N|
|00001150| 4f 4e 6c 69 6e 65 61 72 | 6c 79 20 69 66 20 74 68 |ONlinear|ly if th|
|00001160| 69 73 20 67 61 6d 6d 61 | 20 63 6f 72 72 65 63 74 |is gamma| correct|
|00001170| 69 6f 6e 0d 74 61 6b 65 | 73 20 70 6c 61 63 65 20 |ion.take|s place |
|00001180| 75 6e 62 65 6b 6e 6f 77 | 6e 73 74 20 74 6f 20 75 |unbeknow|nst to u|
|00001190| 73 2e 20 54 68 69 73 20 | 69 73 20 73 6f 6c 76 65 |s. This |is solve|
|000011a0| 64 20 62 79 20 74 68 65 | 20 72 6f 75 74 69 6e 65 |d by the| routine|
|000011b0| 20 47 44 4c 69 6e 65 61 | 72 47 61 6d 6d 61 28 29 | GDLinea|rGamma()|
|000011c0| 0d 77 68 69 63 68 20 6d | 61 6b 65 73 20 61 20 6c |.which m|akes a l|
|000011d0| 6f 77 2d 6c 65 76 65 6c | 20 63 61 6c 6c 20 74 6f |ow-level| call to|
|000011e0| 20 74 68 65 20 76 69 64 | 65 6f 20 64 72 69 76 65 | the vid|eo drive|
|000011f0| 72 20 61 6e 64 20 6c 6f | 61 64 73 20 61 20 6c 69 |r and lo|ads a li|
|00001200| 6e 65 61 72 20 67 61 6d | 6d 61 20 74 61 62 6c 65 |near gam|ma table|
|00001210| 2c 0d 69 2e 65 2e 20 6e | 6f 20 63 6f 72 72 65 63 |,.i.e. n|o correc|
|00001220| 74 69 6f 6e 2e 0d 0d 53 | 55 4d 4d 41 52 59 3a 0d |tion...S|UMMARY:.|
|00001230| 0d 64 6f 75 62 6c 65 20 | 45 54 6f 4c 28 4c 75 6d |.double |EToL(Lum|
|00001240| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|00001250| 2c 69 6e 74 20 65 6e 74 | 72 79 29 3b 0d 52 65 74 |,int ent|ry);.Ret|
|00001260| 75 72 6e 73 20 74 68 65 | 20 6c 75 6d 69 6e 61 6e |urns the| luminan|
|00001270| 63 65 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |ce assoc|iated wi|
|00001280| 74 68 20 74 68 65 20 70 | 61 72 74 69 63 75 6c 61 |th the p|articula|
|00001290| 72 20 65 6e 74 72 79 2e | 0d 0d 69 6e 74 20 4c 54 |r entry.|..int LT|
|000012a0| 6f 45 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |oE(Lumin|anceReco|
|000012b0| 72 64 20 2a 4c 50 2c 64 | 6f 75 62 6c 65 20 4c 2c |rd *LP,d|ouble L,|
|000012c0| 69 6e 74 20 66 69 72 73 | 74 45 6e 74 72 79 2c 69 |int firs|tEntry,i|
|000012d0| 6e 74 20 6c 61 73 74 45 | 6e 74 72 79 29 3b 0d 52 |nt lastE|ntry);.R|
|000012e0| 65 74 75 72 6e 73 20 74 | 68 65 20 69 6e 64 65 78 |eturns t|he index|
|000012f0| 20 6f 66 20 74 68 65 20 | 74 61 62 6c 65 20 65 6e | of the |table en|
|00001300| 74 72 79 20 69 6e 20 73 | 70 65 63 69 66 69 65 64 |try in s|pecified|
|00001310| 20 72 61 6e 67 65 20 77 | 69 74 68 20 6c 75 6d 69 | range w|ith lumi|
|00001320| 6e 61 6e 63 65 20 63 6c | 6f 73 65 73 74 20 74 6f |nance cl|osest to|
|00001330| 20 4c 2e 0d 0d 69 6e 74 | 20 4c 74 6f 45 4f 72 64 | L...int| LtoEOrd|
|00001340| 65 72 65 64 28 4c 75 6d | 69 6e 61 6e 63 65 52 65 |ered(Lum|inanceRe|
|00001350| 63 6f 72 64 20 2a 4c 50 | 2c 64 6f 75 62 6c 65 20 |cord *LP|,double |
|00001360| 4c 2c 69 6e 74 20 66 69 | 72 73 74 45 6e 74 72 79 |L,int fi|rstEntry|
|00001370| 2c 69 6e 74 20 6c 61 73 | 74 45 6e 74 72 79 29 3b |,int las|tEntry);|
|00001380| 0d 52 65 74 75 72 6e 73 | 20 74 68 65 20 69 6e 64 |.Returns| the ind|
|00001390| 65 78 20 6f 66 20 74 68 | 65 20 74 61 62 6c 65 20 |ex of th|e table |
|000013a0| 65 6e 74 72 79 20 69 6e | 20 73 70 65 63 69 66 69 |entry in| specifi|
|000013b0| 65 64 20 72 61 6e 67 65 | 20 77 69 74 68 20 6c 75 |ed range| with lu|
|000013c0| 6d 69 6e 61 6e 63 65 20 | 63 6c 6f 73 65 73 74 20 |minance |closest |
|000013d0| 74 6f 20 4c 2e 0d 52 75 | 6e 73 20 66 61 73 74 20 |to L..Ru|ns fast |
|000013e0| 62 79 20 61 73 73 75 6d | 69 6e 67 20 61 6e 20 6f |by assum|ing an o|
|000013f0| 72 64 65 72 65 64 20 74 | 61 62 6c 65 20 66 72 6f |rdered t|able fro|
|00001400| 6d 20 66 69 72 73 74 45 | 6e 74 72 79 20 74 6f 20 |m firstE|ntry to |
|00001410| 6c 61 73 74 45 6e 74 72 | 79 2c 20 65 69 74 68 65 |lastEntr|y, eithe|
|00001420| 72 20 0d 69 6e 63 72 65 | 61 73 69 6e 67 20 6f 72 |r .incre|asing or|
|00001430| 20 64 65 63 72 65 61 73 | 69 6e 67 2e 0d 0d 64 6f | decreas|ing...do|
|00001440| 75 62 6c 65 20 53 65 74 | 4c 75 6d 69 6e 61 6e 63 |uble Set|Luminanc|
|00001450| 65 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |e(GDHand|le devic|
|00001460| 65 2c 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |e,Lumina|nceRecor|
|00001470| 64 20 2a 4c 50 0d 09 2c | 69 6e 74 20 65 6e 74 72 |d *LP..,|int entr|
|00001480| 79 2c 64 6f 75 62 6c 65 | 20 6c 75 6d 69 6e 61 6e |y,double| luminan|
|00001490| 63 65 0d 09 2c 64 6f 75 | 62 6c 65 20 6c 6f 77 4c |ce..,dou|ble lowL|
|000014a0| 75 6d 69 6e 61 6e 63 65 | 2c 64 6f 75 62 6c 65 20 |uminance|,double |
|000014b0| 68 69 67 68 4c 75 6d 69 | 6e 61 6e 63 65 29 0d 53 |highLumi|nance).S|
|000014c0| 65 74 20 6f 6e 65 20 65 | 6e 74 72 79 20 69 6e 20 |et one e|ntry in |
|000014d0| 74 68 65 20 43 6f 6c 6f | 72 53 70 65 63 20 74 61 |the Colo|rSpec ta|
|000014e0| 62 6c 65 20 28 61 6e 64 | 20 74 68 65 20 43 4c 55 |ble (and| the CLU|
|000014f0| 54 20 69 66 20 64 65 76 | 69 63 65 20 69 73 20 6e |T if dev|ice is n|
|00001500| 6f 74 20 4e 55 4c 4c 29 | 20 74 6f 0d 61 20 73 70 |ot NULL)| to.a sp|
|00001510| 65 63 69 66 69 65 64 20 | 6c 75 6d 69 6e 61 6e 63 |ecified |luminanc|
|00001520| 65 2e 20 49 74 27 73 20 | 6f 6b 20 66 6f 72 20 6c |e. It's |ok for l|
|00001530| 6f 77 4c 75 6d 69 6e 61 | 6e 63 65 20 74 6f 20 62 |owLumina|nce to b|
|00001540| 65 20 67 72 65 61 74 65 | 72 20 74 68 61 6e 20 68 |e greate|r than h|
|00001550| 69 67 68 4c 75 6d 69 6e | 61 6e 63 65 2e 0d 53 65 |ighLumin|ance..Se|
|00001560| 74 4c 75 6d 69 6e 61 6e | 63 65 28 29 20 73 65 74 |tLuminan|ce() set|
|00001570| 73 20 61 20 73 69 6e 67 | 6c 65 20 65 6e 74 72 79 |s a sing|le entry|
|00001580| 20 74 6f 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | to the |specifie|
|00001590| 64 20 6c 75 6d 69 6e 61 | 6e 63 65 2e 20 59 6f 75 |d lumina|nce. You|
|000015a0| 20 6d 75 73 74 20 61 6c | 73 6f 0d 69 6e 64 69 63 | must al|so.indic|
|000015b0| 61 74 65 20 74 68 65 20 | 6c 75 6d 69 6e 61 6e 63 |ate the |luminanc|
|000015c0| 65 20 72 61 6e 67 65 20 | 74 68 61 74 20 79 6f 75 |e range |that you|
|000015d0| 20 61 72 65 20 77 6f 72 | 6b 69 6e 67 20 6f 76 65 | are wor|king ove|
|000015e0| 72 2c 20 74 6f 20 61 6c | 6c 6f 77 20 6f 70 74 69 |r, to al|low opti|
|000015f0| 6d 61 6c 20 63 68 6f 69 | 63 65 0d 6f 66 20 77 68 |mal choi|ce.of wh|
|00001600| 69 63 68 20 64 61 63 73 | 20 74 6f 20 66 69 78 2c |ich dacs| to fix,|
|00001610| 20 65 74 63 2e 2c 20 74 | 6f 20 79 69 65 6c 64 20 | etc., t|o yield |
|00001620| 6d 69 6e 69 6d 75 6d 20 | 65 72 72 6f 72 20 69 6e |minimum |error in|
|00001630| 20 72 65 6c 61 74 69 76 | 65 20 6c 75 6d 69 6e 61 | relativ|e lumina|
|00001640| 6e 63 65 2e 20 0d 53 65 | 74 4c 75 6d 69 6e 61 6e |nce. .Se|tLuminan|
|00001650| 63 65 73 28 29 20 64 6f | 65 73 20 69 74 73 20 77 |ces() do|es its w|
|00001660| 6f 72 6b 20 62 79 20 6d | 61 6b 69 6e 67 20 61 20 |ork by m|aking a |
|00001670| 63 61 6c 6c 20 74 6f 20 | 53 65 74 4c 75 6d 69 6e |call to |SetLumin|
|00001680| 61 6e 63 65 28 29 20 66 | 6f 72 20 65 61 63 68 20 |ance() f|or each |
|00001690| 65 6e 74 72 79 2e 0d 53 | 65 74 4c 75 6d 69 6e 61 |entry..S|etLumina|
|000016a0| 6e 63 65 20 74 61 6b 65 | 73 20 31 20 6d 73 20 74 |nce take|s 1 ms t|
|000016b0| 6f 20 73 65 74 20 75 70 | 20 74 68 65 20 72 61 6e |o set up| the ran|
|000016c0| 67 65 20 28 62 79 20 63 | 61 6c 6c 69 6e 67 20 53 |ge (by c|alling S|
|000016d0| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 52 61 6e 67 65 |etLumina|nceRange|
|000016e0| 29 2c 20 77 68 69 63 68 | 0d 69 74 20 6f 6e 6c 79 |), which|.it only|
|000016f0| 20 68 61 73 20 74 6f 20 | 64 6f 20 6f 6e 63 65 2e | has to |do once.|
|00001700| 20 52 65 70 65 61 74 65 | 64 20 63 61 6c 6c 73 20 | Repeate|d calls |
|00001710| 74 6f 20 53 65 74 4c 75 | 6d 69 6e 61 6e 63 65 20 |to SetLu|minance |
|00001720| 77 69 74 68 20 74 68 65 | 20 73 61 6d 65 20 72 61 |with the| same ra|
|00001730| 6e 67 65 20 77 69 6c 6c | 0d 6e 6f 74 20 63 61 75 |nge will|.not cau|
|00001740| 73 65 20 72 65 2d 63 6f | 6d 70 75 74 61 74 69 6f |se re-co|mputatio|
|00001750| 6e 20 6f 66 20 74 68 65 | 20 72 61 6e 67 65 2e 20 |n of the| range. |
|00001760| 4f 6e 63 65 20 74 68 65 | 20 72 61 6e 67 65 20 69 |Once the| range i|
|00001770| 73 20 73 65 74 2c 20 53 | 65 74 4c 75 6d 69 6e 61 |s set, S|etLumina|
|00001780| 6e 63 65 20 74 61 6b 65 | 73 0d 61 62 6f 75 74 20 |nce take|s.about |
|00001790| 30 2e 31 20 6d 73 2e 20 | 49 66 20 53 65 74 4c 75 |0.1 ms. |If SetLu|
|000017a0| 6d 69 6e 61 6e 63 65 20 | 69 73 20 74 6f 6f 20 73 |minance |is too s|
|000017b0| 6c 6f 77 20 66 6f 72 20 | 61 20 72 65 61 6c 2d 74 |low for |a real-t|
|000017c0| 69 6d 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |ime appl|ication |
|000017d0| 79 6f 75 20 63 61 6e 20 | 74 65 6c 6c 0d 69 74 20 |you can |tell.it |
|000017e0| 74 6f 20 6a 75 73 74 20 | 63 6f 6d 70 75 74 65 2c |to just |compute,|
|000017f0| 20 62 75 74 20 6e 6f 74 | 20 6c 6f 61 64 20 74 68 | but not| load th|
|00001800| 65 20 6e 65 77 20 43 6f | 6c 6f 72 53 70 65 63 20 |e new Co|lorSpec |
|00001810| 74 61 62 6c 65 20 28 6a | 75 73 74 20 73 75 70 70 |table (j|ust supp|
|00001820| 6c 79 20 4e 55 4c 4c 20 | 69 6e 20 70 6c 61 63 65 |ly NULL |in place|
|00001830| 0d 6f 66 20 64 65 76 69 | 63 65 29 2c 20 61 6e 64 |.of devi|ce), and|
|00001840| 20 79 6f 75 20 63 61 6e | 20 74 68 65 6e 20 71 75 | you can| then qu|
|00001850| 69 63 6b 6c 79 20 6c 6f | 61 64 20 79 6f 75 72 20 |ickly lo|ad your |
|00001860| 43 6f 6c 6f 72 53 70 65 | 63 20 74 61 62 6c 65 20 |ColorSpe|c table |
|00001870| 69 6e 74 6f 20 74 68 65 | 20 43 4c 55 54 0d 6c 61 |into the| CLUT.la|
|00001880| 74 65 72 20 62 79 20 63 | 61 6c 6c 69 6e 67 20 4c |ter by c|alling L|
|00001890| 6f 61 64 4c 75 6d 69 6e | 61 6e 63 65 73 28 29 2e |oadLumin|ances().|
|000018a0| 0d 0d 64 6f 75 62 6c 65 | 20 53 65 74 4c 75 6d 69 |..double| SetLumi|
|000018b0| 6e 61 6e 63 65 73 41 6e | 64 52 61 6e 67 65 28 47 |nancesAn|dRange(G|
|000018c0| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 2c 4c |DHandle |device,L|
|000018d0| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|000018e0| 4c 50 0d 09 2c 69 6e 74 | 20 66 69 72 73 74 45 6e |LP..,int| firstEn|
|000018f0| 74 72 79 2c 69 6e 74 20 | 6c 61 73 74 45 6e 74 72 |try,int |lastEntr|
|00001900| 79 0d 09 2c 64 6f 75 62 | 6c 65 20 66 69 72 73 74 |y..,doub|le first|
|00001910| 4c 75 6d 69 6e 61 6e 63 | 65 2c 64 6f 75 62 6c 65 |Luminanc|e,double|
|00001920| 20 6c 61 73 74 4c 75 6d | 69 6e 61 6e 63 65 0d 09 | lastLum|inance..|
|00001930| 2c 64 6f 75 62 6c 65 20 | 6c 6f 77 4c 75 6d 69 6e |,double |lowLumin|
|00001940| 61 6e 63 65 2c 64 6f 75 | 62 6c 65 20 68 69 67 68 |ance,dou|ble high|
|00001950| 4c 75 6d 69 6e 61 6e 63 | 65 29 0d 2f 2a 0d 53 65 |Luminanc|e)./*.Se|
|00001960| 74 20 61 20 73 65 72 69 | 65 73 20 6f 66 20 65 6e |t a seri|es of en|
|00001970| 74 72 69 65 73 20 69 6e | 20 74 68 65 20 43 6f 6c |tries in| the Col|
|00001980| 6f 72 53 70 65 63 20 74 | 61 62 6c 65 20 28 61 6e |orSpec t|able (an|
|00001990| 64 20 74 68 65 20 43 4c | 55 54 20 69 66 20 64 65 |d the CL|UT if de|
|000019a0| 76 69 63 65 20 69 73 20 | 6e 6f 74 20 4e 55 4c 4c |vice is |not NULL|
|000019b0| 29 0d 74 6f 20 61 20 6c | 69 6e 65 61 72 20 73 65 |).to a l|inear se|
|000019c0| 71 75 65 6e 63 65 20 6f | 66 20 6c 75 6d 69 6e 61 |quence o|f lumina|
|000019d0| 6e 63 65 73 2e 20 0d 55 | 73 65 73 20 6c 61 73 74 |nces. .U|ses last|
|000019e0| 20 74 77 6f 20 61 72 67 | 75 6d 65 6e 74 73 20 74 | two arg|uments t|
|000019f0| 6f 20 73 65 74 20 74 68 | 65 20 6c 75 6d 69 6e 61 |o set th|e lumina|
|00001a00| 6e 63 65 20 72 61 6e 67 | 65 20 6f 66 20 69 6e 74 |nce rang|e of int|
|00001a10| 65 72 65 73 74 2e 0d 2a | 2f 0d 64 6f 75 62 6c 65 |erest..*|/.double|
|00001a20| 20 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 28 47 | SetLumi|nances(G|
|00001a30| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 2c 4c |DHandle |device,L|
|00001a40| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00001a50| 4c 50 0d 09 2c 69 6e 74 | 20 66 69 72 73 74 45 6e |LP..,int| firstEn|
|00001a60| 74 72 79 2c 69 6e 74 20 | 6c 61 73 74 45 6e 74 72 |try,int |lastEntr|
|00001a70| 79 0d 09 2c 64 6f 75 62 | 6c 65 20 66 69 72 73 74 |y..,doub|le first|
|00001a80| 4c 75 6d 69 6e 61 6e 63 | 65 2c 64 6f 75 62 6c 65 |Luminanc|e,double|
|00001a90| 20 6c 61 73 74 4c 75 6d | 69 6e 61 6e 63 65 29 0d | lastLum|inance).|
|00001aa0| 2f 2a 0d 53 65 74 20 61 | 20 73 65 72 69 65 73 20 |/*.Set a| series |
|00001ab0| 6f 66 20 65 6e 74 72 69 | 65 73 20 69 6e 20 74 68 |of entri|es in th|
|00001ac0| 65 20 43 6f 6c 6f 72 53 | 70 65 63 20 74 61 62 6c |e ColorS|pec tabl|
|00001ad0| 65 20 28 61 6e 64 20 74 | 68 65 20 43 4c 55 54 20 |e (and t|he CLUT |
|00001ae0| 69 66 20 64 65 76 69 63 | 65 20 69 73 20 6e 6f 74 |if devic|e is not|
|00001af0| 20 4e 55 4c 4c 29 0d 74 | 6f 20 61 20 6c 69 6e 65 | NULL).t|o a line|
|00001b00| 61 72 20 73 65 71 75 65 | 6e 63 65 20 6f 66 20 6c |ar seque|nce of l|
|00001b10| 75 6d 69 6e 61 6e 63 65 | 73 2e 20 41 73 73 75 6d |uminance|s. Assum|
|00001b20| 65 20 74 68 69 73 20 69 | 73 20 74 68 65 20 65 6e |e this i|s the en|
|00001b30| 74 69 72 65 20 6c 75 6d | 69 6e 61 6e 63 65 20 72 |tire lum|inance r|
|00001b40| 61 6e 67 65 20 6f 66 20 | 0d 69 6e 74 65 72 65 73 |ange of |.interes|
|00001b50| 74 2e 0d 2a 2f 0d 53 65 | 74 4c 75 6d 69 6e 61 6e |t..*/.Se|tLuminan|
|00001b60| 63 65 73 28 29 20 61 6e | 64 20 53 65 74 4c 75 6d |ces() an|d SetLum|
|00001b70| 69 6e 61 6e 63 65 73 41 | 6e 64 52 61 6e 67 65 28 |inancesA|ndRange(|
|00001b80| 29 20 62 6f 74 68 20 70 | 72 6f 64 75 63 65 20 61 |) both p|roduce a|
|00001b90| 20 6c 69 6e 65 61 72 20 | 72 65 6c 61 74 69 6f 6e | linear |relation|
|00001ba0| 73 68 69 70 0d 62 65 74 | 77 65 65 6e 20 43 4c 55 |ship.bet|ween CLU|
|00001bb0| 54 20 65 6e 74 72 79 20 | 61 6e 64 20 6c 75 6d 69 |T entry |and lumi|
|00001bc0| 6e 61 6e 63 65 20 6f 76 | 65 72 20 74 68 65 20 72 |nance ov|er the r|
|00001bd0| 61 6e 67 65 20 66 69 72 | 73 74 4c 75 6d 69 6e 61 |ange fir|stLumina|
|00001be0| 6e 63 65 20 74 6f 20 6c | 61 73 74 4c 75 6d 69 6e |nce to l|astLumin|
|00001bf0| 61 6e 63 65 2c 0d 77 69 | 74 68 20 6d 69 6e 69 6d |ance,.wi|th minim|
|00001c00| 75 6d 20 65 72 72 6f 72 | 20 72 65 6c 61 74 69 76 |um error| relativ|
|00001c10| 65 20 74 6f 20 61 6e 79 | 20 6c 75 6d 69 6e 61 6e |e to any| luminan|
|00001c20| 63 65 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |ce in th|e range |
|00001c30| 6c 6f 77 4c 75 6d 69 6e | 61 6e 63 65 20 74 6f 0d |lowLumin|ance to.|
|00001c40| 68 69 67 68 4c 75 6d 69 | 6e 61 6e 63 65 2e 20 28 |highLumi|nance. (|
|00001c50| 57 65 20 64 6f 6e 27 74 | 20 63 61 72 65 20 61 62 |We don't| care ab|
|00001c60| 6f 75 74 20 61 20 73 6d | 61 6c 6c 20 65 72 72 6f |out a sm|all erro|
|00001c70| 72 20 69 6e 20 6d 65 61 | 6e 20 6c 75 6d 69 6e 61 |r in mea|n lumina|
|00001c80| 6e 63 65 2e 29 0d 28 53 | 65 74 4c 75 6d 69 6e 61 |nce.).(S|etLumina|
|00001c90| 6e 63 65 73 2c 20 77 68 | 69 63 68 20 64 6f 65 73 |nces, wh|ich does|
|00001ca0| 6e 27 74 20 68 61 76 65 | 20 74 68 65 73 65 20 61 |n't have| these a|
|00001cb0| 72 67 75 6d 65 6e 74 73 | 2c 20 75 73 65 73 20 66 |rguments|, uses f|
|00001cc0| 69 72 73 74 4c 75 6d 69 | 6e 61 6e 63 65 20 61 6e |irstLumi|nance an|
|00001cd0| 64 0d 6c 61 73 74 4c 75 | 6d 69 6e 61 6e 63 65 20 |d.lastLu|minance |
|00001ce0| 74 6f 20 73 65 74 20 74 | 68 69 73 20 72 61 6e 67 |to set t|his rang|
|00001cf0| 65 2e 29 20 54 68 65 20 | 74 68 72 65 65 20 44 41 |e.) The |three DA|
|00001d00| 43 73 20 61 72 65 20 6c | 69 6e 65 61 72 2c 20 61 |Cs are l|inear, a|
|00001d10| 6e 64 20 74 68 65 20 76 | 69 64 65 6f 0d 61 74 74 |nd the v|ideo.att|
|00001d20| 65 6e 75 61 74 6f 72 20 | 77 69 6c 6c 20 63 6f 6d |enuator |will com|
|00001d30| 62 69 6e 65 20 74 68 65 | 6d 20 6c 69 6e 65 61 72 |bine the|m linear|
|00001d40| 6c 79 20 79 69 65 6c 64 | 69 6e 67 20 61 20 76 6f |ly yield|ing a vo|
|00001d50| 6c 74 61 67 65 20 56 20 | 61 74 20 74 68 65 20 64 |ltage V |at the d|
|00001d60| 69 73 70 6c 61 79 20 69 | 6e 70 75 74 2e 0d 54 68 |isplay i|nput..Th|
|00001d70| 69 73 20 61 6c 6c 6f 77 | 73 20 79 6f 75 20 74 6f |is allow|s you to|
|00001d80| 20 63 6f 6d 70 75 74 65 | 20 79 6f 75 72 20 69 6d | compute| your im|
|00001d90| 61 67 65 20 28 65 2e 67 | 2e 20 61 20 73 69 6e 65 |age (e.g|. a sine|
|00001da0| 77 61 76 65 20 67 72 61 | 74 69 6e 67 29 20 61 6e |wave gra|ting) an|
|00001db0| 64 20 6c 6f 61 64 65 64 | 20 74 6f 0d 74 68 65 20 |d loaded| to.the |
|00001dc0| 66 72 61 6d 65 20 73 74 | 6f 72 65 20 61 73 20 61 |frame st|ore as a|
|00001dd0| 20 66 75 6c 6c 20 73 63 | 61 6c 65 20 6c 69 6e 65 | full sc|ale line|
|00001de0| 61 72 20 66 75 6e 63 74 | 69 6f 6e 2c 20 69 2e 65 |ar funct|ion, i.e|
|00001df0| 2e 20 77 69 74 68 20 76 | 61 6c 75 65 73 20 72 61 |. with v|alues ra|
|00001e00| 6e 67 69 6e 67 0d 30 2e | 2e 32 35 35 2e 20 20 4c |nging.0.|.255. L|
|00001e10| 69 6e 65 61 72 69 7a 61 | 74 69 6f 6e 20 6f 66 20 |ineariza|tion of |
|00001e20| 74 68 65 20 64 69 73 70 | 6c 61 79 20 61 6e 64 20 |the disp|lay and |
|00001e30| 73 65 74 74 69 6e 67 20 | 6f 66 20 63 6f 6e 74 72 |setting |of contr|
|00001e40| 61 73 74 20 74 6f 20 77 | 68 61 74 65 76 65 72 20 |ast to w|hatever |
|00001e50| 79 6f 75 0d 77 61 6e 74 | 20 61 72 65 20 62 6f 74 |you.want| are bot|
|00001e60| 68 20 61 63 63 6f 6d 70 | 6c 69 73 68 65 64 20 62 |h accomp|lished b|
|00001e70| 79 20 6f 6e 65 20 63 61 | 6c 6c 20 74 6f 20 53 65 |y one ca|ll to Se|
|00001e80| 74 4c 75 6d 69 6e 61 6e | 63 65 73 28 29 2e 20 54 |tLuminan|ces(). T|
|00001e90| 68 65 20 63 6f 6e 74 72 | 61 73 74 20 63 61 6e 20 |he contr|ast can |
|00001ea0| 62 65 0d 63 68 61 6e 67 | 65 64 20 62 79 20 63 61 |be.chang|ed by ca|
|00001eb0| 6c 6c 69 6e 67 20 53 65 | 74 4c 75 6d 69 6e 61 6e |lling Se|tLuminan|
|00001ec0| 63 65 73 28 29 20 61 67 | 61 69 6e 2c 20 6e 6f 77 |ces() ag|ain, now|
|00001ed0| 20 77 69 74 68 20 61 20 | 6c 61 72 67 65 72 20 6f | with a |larger o|
|00001ee0| 72 20 73 6d 61 6c 6c 65 | 72 20 6c 75 6d 69 6e 61 |r smalle|r lumina|
|00001ef0| 6e 63 65 0d 72 61 6e 67 | 65 2e 20 49 66 20 53 65 |nce.rang|e. If Se|
|00001f00| 74 4c 75 6d 69 6e 61 6e | 63 65 73 20 69 73 20 74 |tLuminan|ces is t|
|00001f10| 6f 6f 20 73 6c 6f 77 20 | 66 6f 72 20 61 20 72 65 |oo slow |for a re|
|00001f20| 61 6c 2d 74 69 6d 65 20 | 61 70 70 6c 69 63 61 74 |al-time |applicat|
|00001f30| 69 6f 6e 20 28 69 74 73 | 0d 63 6f 6d 70 75 74 61 |ion (its|.computa|
|00001f40| 74 69 6f 6e 73 20 74 61 | 6b 65 20 61 62 6f 75 74 |tions ta|ke about|
|00001f50| 20 38 2d 33 30 20 6d 73 | 20 74 6f 20 63 6f 6d 70 | 8-30 ms| to comp|
|00001f60| 75 74 65 20 61 20 77 68 | 6f 6c 65 20 32 35 36 2d |ute a wh|ole 256-|
|00001f70| 65 6e 74 72 79 20 43 4c | 55 54 29 20 79 6f 75 20 |entry CL|UT) you |
|00001f80| 63 61 6e 20 74 65 6c 6c | 0d 69 74 20 74 6f 20 6a |can tell|.it to j|
|00001f90| 75 73 74 20 63 6f 6d 70 | 75 74 65 2c 20 62 75 74 |ust comp|ute, but|
|00001fa0| 20 6e 6f 74 20 6c 6f 61 | 64 20 74 68 65 20 6e 65 | not loa|d the ne|
|00001fb0| 77 20 43 6f 6c 6f 72 53 | 70 65 63 20 74 61 62 6c |w ColorS|pec tabl|
|00001fc0| 65 20 28 6a 75 73 74 20 | 73 75 70 70 6c 79 20 4e |e (just |supply N|
|00001fd0| 55 4c 4c 20 69 6e 0d 70 | 6c 61 63 65 20 6f 66 20 |ULL in.p|lace of |
|00001fe0| 64 65 76 69 63 65 29 2c | 20 61 6e 64 20 79 6f 75 |device),| and you|
|00001ff0| 20 63 61 6e 20 74 68 65 | 6e 20 71 75 69 63 6b 6c | can the|n quickl|
|00002000| 79 20 6c 6f 61 64 20 79 | 6f 75 72 20 43 6f 6c 6f |y load y|our Colo|
|00002010| 72 53 70 65 63 20 74 61 | 62 6c 65 20 69 6e 74 6f |rSpec ta|ble into|
|00002020| 0d 74 68 65 20 43 4c 55 | 54 20 6c 61 74 65 72 20 |.the CLU|T later |
|00002030| 62 79 20 63 61 6c 6c 69 | 6e 67 20 4c 6f 61 64 4c |by calli|ng LoadL|
|00002040| 75 6d 69 6e 61 6e 63 65 | 73 28 29 2e 0d 0d 64 6f |uminance|s()...do|
|00002050| 75 62 6c 65 20 47 65 74 | 4c 75 6d 69 6e 61 6e 63 |uble Get|Luminanc|
|00002060| 65 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |e(GDHand|le devic|
|00002070| 65 2c 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |e,Lumina|nceRecor|
|00002080| 64 20 2a 4c 50 2c 69 6e | 74 20 65 6e 74 72 79 29 |d *LP,in|t entry)|
|00002090| 0d 2f 2a 0d 49 66 20 64 | 65 76 69 63 65 20 69 73 |./*.If d|evice is|
|000020a0| 20 6e 6f 74 20 4e 55 4c | 4c 20 74 68 65 6e 20 65 | not NUL|L then e|
|000020b0| 78 61 6d 69 6e 65 73 20 | 6f 6e 65 20 65 6e 74 72 |xamines |one entr|
|000020c0| 79 20 69 6e 20 74 68 65 | 20 61 63 74 75 61 6c 20 |y in the| actual |
|000020d0| 43 4c 55 54 2c 20 6f 74 | 68 65 72 77 69 73 65 0d |CLUT, ot|herwise.|
|000020e0| 65 78 61 6d 69 6e 65 73 | 20 74 68 65 20 43 6f 6c |examines| the Col|
|000020f0| 6f 72 53 70 65 63 20 74 | 61 62 6c 65 20 63 6f 6e |orSpec t|able con|
|00002100| 74 61 69 6e 65 64 20 69 | 6e 20 2a 4c 50 2c 20 61 |tained i|n *LP, a|
|00002110| 6e 64 20 69 6e 20 65 69 | 74 68 65 72 20 63 61 73 |nd in ei|ther cas|
|00002120| 65 20 72 65 74 75 72 6e | 73 20 74 68 65 0d 6c 75 |e return|s the.lu|
|00002130| 6d 69 6e 61 6e 63 65 20 | 74 68 61 74 20 77 69 6c |minance |that wil|
|00002140| 6c 20 62 65 20 70 72 6f | 64 75 63 65 64 2e 20 53 |l be pro|duced. S|
|00002150| 75 70 70 6c 79 69 6e 67 | 20 61 6e 20 69 6c 6c 65 |upplying| an ille|
|00002160| 67 61 6c 20 65 6e 74 72 | 79 20 76 61 6c 75 65 20 |gal entr|y value |
|00002170| 72 65 73 75 6c 74 73 20 | 69 6e 20 61 0d 72 65 74 |results |in a.ret|
|00002180| 75 72 6e 65 64 20 76 61 | 6c 75 65 20 6f 66 20 2d |urned va|lue of -|
|00002190| 49 4e 46 2e 0d 2a 2f 0d | 47 65 74 4c 75 6d 69 6e |INF..*/.|GetLumin|
|000021a0| 61 6e 63 65 28 29 20 72 | 65 74 75 72 6e 73 20 74 |ance() r|eturns t|
|000021b0| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 20 6f 66 20 |he lumin|ance of |
|000021c0| 61 20 73 69 6e 67 6c 65 | 20 65 6e 74 72 79 2e 20 |a single| entry. |
|000021d0| 49 66 20 64 65 76 69 63 | 65 20 69 73 20 6e 6f 74 |If devic|e is not|
|000021e0| 20 4e 55 4c 4c 20 74 68 | 65 6e 0d 47 65 74 4c 75 | NULL th|en.GetLu|
|000021f0| 6d 69 6e 61 6e 63 65 20 | 77 69 6c 6c 20 6d 61 6b |minance |will mak|
|00002200| 65 20 61 20 6c 6f 77 2d | 6c 65 76 65 6c 20 63 61 |e a low-|level ca|
|00002210| 6c 6c 20 74 6f 20 74 68 | 65 20 76 69 64 65 6f 20 |ll to th|e video |
|00002220| 64 72 69 76 65 72 20 74 | 6f 20 64 65 74 65 72 6d |driver t|o determ|
|00002230| 69 6e 65 20 77 68 61 74 | 20 69 73 20 69 6e 20 74 |ine what| is in t|
|00002240| 68 61 74 0d 43 4c 55 54 | 20 65 6e 74 72 79 20 69 |hat.CLUT| entry i|
|00002250| 6e 20 74 68 65 20 61 63 | 74 75 61 6c 20 68 61 72 |n the ac|tual har|
|00002260| 64 77 61 72 65 2c 20 61 | 6e 64 20 77 69 6c 6c 20 |dware, a|nd will |
|00002270| 72 65 74 75 72 6e 20 74 | 68 65 20 6c 75 6d 69 6e |return t|he lumin|
|00002280| 61 6e 63 65 20 74 68 61 | 74 20 69 73 20 65 78 70 |ance tha|t is exp|
|00002290| 65 63 74 65 64 0d 74 6f | 20 72 65 73 75 6c 74 20 |ected.to| result |
|000022a0| 67 69 76 65 6e 20 74 68 | 65 20 63 68 61 6e 6e 65 |given th|e channe|
|000022b0| 6c 20 67 61 69 6e 73 20 | 61 6e 64 20 6c 75 6d 69 |l gains |and lumi|
|000022c0| 6e 61 6e 63 65 20 6e 6f | 6e 6c 69 6e 65 61 72 69 |nance no|nlineari|
|000022d0| 74 79 20 64 65 73 63 72 | 69 62 65 64 20 69 6e 20 |ty descr|ibed in |
|000022e0| 79 6f 75 72 0d 4c 75 6d | 69 6e 61 6e 63 65 52 65 |your.Lum|inanceRe|
|000022f0| 63 6f 72 64 2e 20 49 66 | 20 64 65 76 69 63 65 20 |cord. If| device |
|00002300| 69 73 20 4e 55 4c 4c 20 | 74 68 65 6e 20 47 65 74 |is NULL |then Get|
|00002310| 4c 75 6d 69 6e 61 6e 63 | 65 0d 72 65 74 75 72 6e |Luminanc|e.return|
|00002320| 73 20 74 68 65 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |s the lu|minance |
|00002330| 63 6f 72 72 65 73 70 6f | 6e 64 69 6e 67 20 74 6f |correspo|nding to|
|00002340| 20 74 68 65 20 65 6e 74 | 72 79 20 69 6e 20 74 68 | the ent|ry in th|
|00002350| 65 20 43 6f 6c 6f 72 53 | 70 65 63 20 74 61 62 6c |e ColorS|pec tabl|
|00002360| 65 20 69 6e 20 79 6f 75 | 72 0d 4c 75 6d 69 6e 61 |e in you|r.Lumina|
|00002370| 6e 63 65 52 65 63 6f 72 | 64 2e 0d 0d 76 6f 69 64 |nceRecor|d...void|
|00002380| 20 49 6e 63 72 65 6d 65 | 6e 74 4c 75 6d 69 6e 61 | Increme|ntLumina|
|00002390| 6e 63 65 28 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |nce(GDHa|ndle dev|
|000023a0| 69 63 65 2c 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ice,Lumi|nanceRec|
|000023b0| 6f 72 64 20 2a 4c 50 2c | 69 6e 74 20 65 6e 74 72 |ord *LP,|int entr|
|000023c0| 79 29 0d 2f 2a 0d 4d 61 | 6b 65 20 73 6d 61 6c 6c |y)./*.Ma|ke small|
|000023d0| 65 73 74 20 70 6f 73 73 | 69 62 6c 65 20 69 6e 63 |est poss|ible inc|
|000023e0| 72 65 61 73 65 20 6f 66 | 20 74 68 65 20 6c 75 6d |rease of| the lum|
|000023f0| 69 6e 61 6e 63 65 20 6f | 66 20 6f 6e 65 20 65 6e |inance o|f one en|
|00002400| 74 72 79 20 69 6e 20 74 | 68 65 20 43 6f 6c 6f 72 |try in t|he Color|
|00002410| 53 70 65 63 20 74 61 62 | 6c 65 2e 0d 54 68 69 73 |Spec tab|le..This|
|00002420| 20 69 73 20 61 20 77 61 | 79 20 74 6f 20 66 69 67 | is a wa|y to fig|
|00002430| 75 72 65 20 6f 75 74 20 | 77 68 61 74 20 69 73 20 |ure out |what is |
|00002440| 74 68 65 20 6c 6f 77 65 | 73 74 20 63 6f 6e 74 72 |the lowe|st contr|
|00002450| 61 73 74 20 74 68 61 74 | 20 79 6f 75 20 63 61 6e |ast that| you can|
|00002460| 20 70 72 6f 64 75 63 65 | 2e 0d 2a 2f 0d 0d 76 6f | produce|..*/..vo|
|00002470| 69 64 20 4c 6f 61 64 4c | 75 6d 69 6e 61 6e 63 65 |id LoadL|uminance|
|00002480| 73 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |s(GDHand|le devic|
|00002490| 65 2c 20 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |e, Lumin|anceReco|
|000024a0| 72 64 20 2a 4c 50 2c 0d | 09 69 6e 74 20 66 69 72 |rd *LP,.|.int fir|
|000024b0| 73 74 45 6e 74 72 79 2c | 20 69 6e 74 20 6c 61 73 |stEntry,| int las|
|000024c0| 74 45 6e 74 72 79 29 0d | 2f 2a 0d 54 68 69 73 20 |tEntry).|/*.This |
|000024d0| 6a 75 73 74 20 63 61 6c | 6c 73 20 47 44 53 65 74 |just cal|ls GDSet|
|000024e0| 45 6e 74 72 69 65 73 28 | 29 20 74 6f 20 6c 6f 61 |Entries(|) to loa|
|000024f0| 64 20 79 6f 75 72 20 43 | 6f 6c 6f 72 53 70 65 63 |d your C|olorSpec|
|00002500| 20 74 61 62 6c 65 20 69 | 6e 74 6f 20 74 68 65 20 | table i|nto the |
|00002510| 43 4c 55 54 20 6f 66 0d | 79 6f 75 72 20 73 63 72 |CLUT of.|your scr|
|00002520| 65 65 6e 20 64 65 76 69 | 63 65 2e 20 49 74 20 69 |een devi|ce. It i|
|00002530| 73 20 68 65 72 65 20 73 | 69 6d 70 6c 79 20 74 6f |s here s|imply to|
|00002540| 20 70 72 6f 76 69 64 65 | 20 61 20 63 6f 73 6d 65 | provide| a cosme|
|00002550| 74 69 63 20 6d 61 74 63 | 68 20 74 6f 20 74 68 65 |tic matc|h to the|
|00002560| 0d 63 61 6c 6c 20 74 6f | 20 53 65 74 4c 75 6d 69 |.call to| SetLumi|
|00002570| 6e 61 6e 63 65 73 28 29 | 2c 20 66 6f 72 20 77 68 |nances()|, for wh|
|00002580| 69 63 68 20 6c 6f 61 64 | 69 6e 67 20 74 68 65 20 |ich load|ing the |
|00002590| 43 4c 55 54 20 69 73 20 | 6f 70 74 69 6f 6e 61 6c |CLUT is |optional|
|000025a0| 2e 0d 4e 6f 74 65 3a 20 | 69 66 20 79 6f 75 20 70 |..Note: |if you p|
|000025b0| 72 65 66 65 72 2c 20 69 | 6e 73 74 65 61 64 20 6f |refer, i|nstead o|
|000025c0| 66 20 4c 50 20 79 6f 75 | 20 6d 61 79 20 73 65 6e |f LP you| may sen|
|000025d0| 64 20 6a 75 73 74 20 74 | 68 65 20 61 64 64 72 65 |d just t|he addre|
|000025e0| 73 73 20 6f 66 20 0d 61 | 20 43 6f 6c 6f 72 53 70 |ss of .a| ColorSp|
|000025f0| 65 63 20 74 61 62 6c 65 | 2c 20 63 61 73 74 20 74 |ec table|, cast t|
|00002600| 6f 20 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |o (Lumin|anceReco|
|00002610| 72 64 20 2a 29 2c 20 73 | 69 6e 63 65 20 61 20 4c |rd *), s|ince a L|
|00002620| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 0d |uminance|Record .|
|00002630| 62 65 67 69 6e 73 20 77 | 69 74 68 20 61 20 43 6f |begins w|ith a Co|
|00002640| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 2e 0d 44 |lorSpec |table..D|
|00002650| 6f 65 73 20 6e 6f 74 68 | 69 6e 67 20 69 66 20 64 |oes noth|ing if d|
|00002660| 65 76 69 63 65 3d 3d 4e | 55 4c 4c 20 6f 72 20 74 |evice==N|ULL or t|
|00002670| 68 65 20 64 65 76 69 63 | 65 20 68 61 73 20 6e 6f |he devic|e has no|
|00002680| 20 64 72 69 76 65 72 2e | 0d 2a 2f 0d 0d 64 6f 75 | driver.|.*/..dou|
|00002690| 62 6c 65 20 47 65 74 56 | 28 47 44 48 61 6e 64 6c |ble GetV|(GDHandl|
|000026a0| 65 20 64 65 76 69 63 65 | 2c 4c 75 6d 69 6e 61 6e |e device|,Luminan|
|000026b0| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 69 6e 74 |ceRecord| *LP,int|
|000026c0| 20 65 6e 74 72 79 29 3b | 0d 64 6f 75 62 6c 65 20 | entry);|.double |
|000026d0| 56 54 6f 4c 28 4c 75 6d | 69 6e 61 6e 63 65 52 65 |VToL(Lum|inanceRe|
|000026e0| 63 6f 72 64 20 2a 4c 50 | 2c 64 6f 75 62 6c 65 20 |cord *LP|,double |
|000026f0| 56 29 3b 0d 64 6f 75 62 | 6c 65 20 4c 54 6f 56 28 |V);.doub|le LToV(|
|00002700| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|00002710| 2a 4c 50 2c 64 6f 75 62 | 6c 65 20 4c 29 3b 0d 64 |*LP,doub|le L);.d|
|00002720| 6f 75 62 6c 65 20 4c 54 | 6f 4c 28 4c 75 6d 69 6e |ouble LT|oL(Lumin|
|00002730| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 2c 64 |anceReco|rd *LP,d|
|00002740| 6f 75 62 6c 65 20 4c 29 | 3b 0d 4d 6f 73 74 20 75 |ouble L)|;.Most u|
|00002750| 73 65 72 73 20 77 69 6c | 6c 20 6e 65 76 65 72 20 |sers wil|l never |
|00002760| 68 61 76 65 20 61 6e 79 | 20 72 65 61 73 6f 6e 20 |have any| reason |
|00002770| 74 6f 20 75 73 65 20 74 | 68 65 73 65 20 72 6f 75 |to use t|hese rou|
|00002780| 74 69 6e 65 73 2e 20 54 | 68 65 79 20 61 72 65 20 |tines. T|hey are |
|00002790| 75 73 65 66 75 6c 0d 70 | 72 69 6d 61 72 69 6c 79 |useful.p|rimarily|
|000027a0| 20 69 6e 20 65 72 72 6f | 72 20 61 6e 61 6c 79 73 | in erro|r analys|
|000027b0| 69 73 20 6f 66 20 74 68 | 65 20 4c 75 6d 69 6e 61 |is of th|e Lumina|
|000027c0| 6e 63 65 2e 63 20 70 61 | 63 6b 61 67 65 2e 0d 0d |nce.c pa|ckage...|
|000027d0| 45 58 41 4d 50 4c 45 53 | 3a 0d 0d 64 6f 75 62 6c |EXAMPLES|:..doubl|
|000027e0| 65 20 74 6f 6c 65 72 61 | 6e 63 65 2c 6c 75 6d 69 |e tolera|nce,lumi|
|000027f0| 6e 61 6e 63 65 2c 6d 65 | 61 6e 4c 75 6d 69 6e 61 |nance,me|anLumina|
|00002800| 6e 63 65 2c 63 3b 0d 69 | 6e 74 20 66 69 72 73 74 |nce,c;.i|nt first|
|00002810| 45 6e 74 72 79 2c 6c 61 | 73 74 45 6e 74 72 79 2c |Entry,la|stEntry,|
|00002820| 65 6e 74 72 79 3b 0d 0d | 2f 2a 20 6c 6f 61 64 20 |entry;..|/* load |
|00002830| 43 4c 55 54 20 77 69 74 | 68 20 6c 69 6e 65 61 72 |CLUT wit|h linear|
|00002840| 20 6c 75 6d 69 6e 61 6e | 63 65 20 72 61 6e 67 65 | luminan|ce range|
|00002850| 2c 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 2a 2f |, immedi|ately */|
|00002860| 0d 74 6f 6c 65 72 61 6e | 63 65 3d 53 65 74 4c 75 |.toleran|ce=SetLu|
|00002870| 6d 69 6e 61 6e 63 65 73 | 28 64 65 76 69 63 65 2c |minances|(device,|
|00002880| 26 4c 52 2c 30 2c 32 35 | 35 2c 28 31 2e 2d 63 29 |&LR,0,25|5,(1.-c)|
|00002890| 2a 6d 65 61 6e 4c 75 6d | 69 6e 61 6e 63 65 2c 28 |*meanLum|inance,(|
|000028a0| 31 2b 63 29 2a 6d 65 61 | 6e 4c 75 6d 69 6e 61 6e |1+c)*mea|nLuminan|
|000028b0| 63 65 29 3b 0d 0d 2f 2a | 20 6c 6f 61 64 20 43 6f |ce);../*| load Co|
|000028c0| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 20 77 69 |lorSpec |table wi|
|000028d0| 74 68 20 6c 69 6e 65 61 | 72 20 6c 75 6d 69 6e 61 |th linea|r lumina|
|000028e0| 6e 63 65 20 72 61 6e 67 | 65 2c 20 74 68 65 6e 20 |nce rang|e, then |
|000028f0| 6c 6f 61 64 20 43 4c 55 | 54 20 2a 2f 0d 74 6f 6c |load CLU|T */.tol|
|00002900| 65 72 61 6e 63 65 3d 53 | 65 74 4c 75 6d 69 6e 61 |erance=S|etLumina|
|00002910| 6e 63 65 73 28 4e 55 4c | 4c 2c 26 4c 52 2c 30 2c |nces(NUL|L,&LR,0,|
|00002920| 32 35 35 2c 28 31 2e 2d | 63 29 2a 6d 65 61 6e 4c |255,(1.-|c)*meanL|
|00002930| 75 6d 69 6e 61 6e 63 65 | 2c 28 31 2b 63 29 2a 6d |uminance|,(1+c)*m|
|00002940| 65 61 6e 4c 75 6d 69 6e | 61 6e 63 65 29 3b 0d 4c |eanLumin|ance);.L|
|00002950| 6f 61 64 4c 75 6d 69 6e | 61 6e 63 65 73 28 64 65 |oadLumin|ances(de|
|00002960| 76 69 63 65 2c 26 4c 52 | 2c 66 69 72 73 74 45 6e |vice,&LR|,firstEn|
|00002970| 74 72 79 2c 6c 61 73 74 | 45 6e 74 72 79 29 3b 0d |try,last|Entry);.|
|00002980| 0d 2f 2a 20 6c 6f 61 64 | 20 43 6f 6c 6f 72 53 70 |./* load| ColorSp|
|00002990| 65 63 20 74 61 62 6c 65 | 20 77 69 74 68 20 73 69 |ec table| with si|
|000029a0| 6e 75 73 6f 69 64 61 6c | 20 6c 75 6d 69 6e 61 6e |nusoidal| luminan|
|000029b0| 63 65 20 72 61 6e 67 65 | 2c 20 74 68 65 6e 20 6c |ce range|, then l|
|000029c0| 6f 61 64 20 43 4c 55 54 | 20 2a 2f 0d 66 6f 72 28 |oad CLUT| */.for(|
|000029d0| 65 6e 74 72 79 3d 30 3b | 65 6e 74 72 79 3c 32 35 |entry=0;|entry<25|
|000029e0| 36 3b 65 6e 74 72 79 2b | 2b 29 20 7b 0d 09 6c 75 |6;entry+|+) {..lu|
|000029f0| 6d 69 6e 61 6e 63 65 20 | 3d 20 6d 65 61 6e 4c 75 |minance |= meanLu|
|00002a00| 6d 69 6e 61 6e 63 65 2a | 28 31 2e 30 2b 63 2a 73 |minance*|(1.0+c*s|
|00002a10| 69 6e 28 32 2e 30 2a 33 | 2e 31 34 31 35 39 32 36 |in(2.0*3|.1415926|
|00002a20| 35 2a 65 6e 74 72 79 2f | 32 35 36 2e 29 29 3b 0d |5*entry/|256.));.|
|00002a30| 09 74 6f 6c 65 72 61 6e | 63 65 3d 53 65 74 4c 75 |.toleran|ce=SetLu|
|00002a40| 6d 69 6e 61 6e 63 65 28 | 4e 55 4c 4c 2c 26 4c 52 |minance(|NULL,&LR|
|00002a50| 2c 65 6e 74 72 79 2c 6c | 75 6d 69 6e 61 6e 63 65 |,entry,l|uminance|
|00002a60| 2c 28 31 2e 2d 63 29 2a | 6d 65 61 6e 4c 75 6d 69 |,(1.-c)*|meanLumi|
|00002a70| 6e 61 6e 63 65 2c 28 31 | 2b 63 29 2a 6d 65 61 6e |nance,(1|+c)*mean|
|00002a80| 4c 75 6d 69 6e 61 6e 63 | 65 29 3b 0d 7d 0d 4c 6f |Luminanc|e);.}.Lo|
|00002a90| 61 64 4c 75 6d 69 6e 61 | 6e 63 65 73 28 64 65 76 |adLumina|nces(dev|
|00002aa0| 69 63 65 2c 26 4c 52 2c | 66 69 72 73 74 45 6e 74 |ice,&LR,|firstEnt|
|00002ab0| 72 79 2c 6c 61 73 74 45 | 6e 74 72 79 29 3b 0d 0d |ry,lastE|ntry);..|
|00002ac0| 2f 2a 20 45 78 61 6d 69 | 6e 65 20 61 6e 20 65 6e |/* Exami|ne an en|
|00002ad0| 74 72 79 20 69 6e 20 74 | 68 65 20 43 6f 6c 6f 72 |try in t|he Color|
|00002ae0| 53 70 65 63 20 74 61 62 | 6c 65 20 6f 72 20 43 4c |Spec tab|le or CL|
|00002af0| 55 54 20 2a 2f 0d 6c 75 | 6d 69 6e 61 6e 63 65 3d |UT */.lu|minance=|
|00002b00| 47 65 74 4c 75 6d 69 6e | 61 6e 63 65 28 64 65 76 |GetLumin|ance(dev|
|00002b10| 69 63 65 2c 26 4c 52 2c | 65 6e 74 72 79 29 3b 09 |ice,&LR,|entry);.|
|00002b20| 2f 2a 20 69 6e 20 43 4c | 55 54 20 2a 2f 0d 6c 75 |/* in CL|UT */.lu|
|00002b30| 6d 69 6e 61 6e 63 65 3d | 47 65 74 4c 75 6d 69 6e |minance=|GetLumin|
|00002b40| 61 6e 63 65 28 4e 55 4c | 4c 2c 26 4c 52 2c 65 6e |ance(NUL|L,&LR,en|
|00002b50| 74 72 79 29 3b 09 09 2f | 2a 20 69 6e 20 43 6f 6c |try);../|* in Col|
|00002b60| 6f 72 53 70 65 63 20 74 | 61 62 6c 65 20 2a 2f 0d |orSpec t|able */.|
|00002b70| 0d 4e 4f 54 45 53 3a 0d | 0d 54 68 65 20 61 72 67 |.NOTES:.|.The arg|
|00002b80| 75 6d 65 6e 74 20 66 69 | 72 73 74 45 6e 74 72 79 |ument fi|rstEntry|
|00002b90| 20 6d 75 73 74 20 6e 6f | 74 20 65 78 63 65 65 64 | must no|t exceed|
|00002ba0| 20 6c 61 73 74 45 6e 74 | 72 79 2e 20 54 68 65 79 | lastEnt|ry. They|
|00002bb0| 20 6d 61 79 20 62 65 20 | 65 71 75 61 6c 2e 0d 0d | may be |equal...|
|00002bc0| 54 68 65 20 72 65 74 75 | 72 6e 65 64 20 76 61 6c |The retu|rned val|
|00002bd0| 75 65 2c 20 74 6f 6c 65 | 72 61 6e 63 65 2c 20 69 |ue, tole|rance, i|
|00002be0| 73 20 61 6e 20 65 73 74 | 69 6d 61 74 65 20 6f 66 |s an est|imate of|
|00002bf0| 20 74 68 65 20 6c 61 72 | 67 65 73 74 20 70 6f 73 | the lar|gest pos|
|00002c00| 73 69 62 6c 65 20 65 72 | 72 6f 72 20 69 6e 0d 74 |sible er|ror in.t|
|00002c10| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 20 44 49 46 |he lumin|ance DIF|
|00002c20| 46 45 52 45 4e 43 45 53 | 2c 20 74 61 6b 69 6e 67 |FERENCES|, taking|
|00002c30| 20 69 6e 74 6f 20 61 63 | 63 6f 75 6e 74 20 74 68 | into ac|count th|
|00002c40| 65 20 70 72 65 63 69 73 | 69 6f 6e 2c 20 61 63 63 |e precis|ion, acc|
|00002c50| 75 72 61 63 79 20 28 61 | 73 73 75 6d 65 64 0d 74 |uracy (a|ssumed.t|
|00002c60| 6f 20 62 65 20 b1 31 20 | 6c 65 61 73 74 20 73 69 |o be .1 |least si|
|00002c70| 67 6e 69 66 69 63 61 6e | 74 20 62 69 74 29 2c 20 |gnifican|t bit), |
|00002c80| 61 6e 64 20 72 61 6e 67 | 65 20 6f 66 20 74 68 65 |and rang|e of the|
|00002c90| 20 44 41 43 73 2e 20 28 | 4e 6f 74 65 20 74 68 65 | DACs. (|Note the|
|00002ca0| 20 72 65 74 75 72 6e 65 | 64 0d 74 6f 6c 65 72 61 | returne|d.tolera|
|00002cb0| 6e 63 65 20 74 65 6c 6c | 73 20 79 6f 75 20 61 62 |nce tell|s you ab|
|00002cc0| 6f 75 74 20 65 72 72 6f | 72 73 20 69 6e 20 74 68 |out erro|rs in th|
|00002cd0| 65 20 6c 75 6d 69 6e 61 | 6e 63 65 20 44 49 46 46 |e lumina|nce DIFF|
|00002ce0| 45 52 45 4e 43 45 53 20 | 6f 6e 20 74 68 65 20 64 |ERENCES |on the d|
|00002cf0| 69 73 70 6c 61 79 2e 0d | 54 68 65 20 65 72 72 6f |isplay..|The erro|
|00002d00| 72 20 69 6e 20 41 42 53 | 4f 4c 55 54 45 20 6c 75 |r in ABS|OLUTE lu|
|00002d10| 6d 69 6e 61 6e 63 65 20 | 6f 66 20 74 68 65 20 64 |minance |of the d|
|00002d20| 69 73 70 6c 61 79 20 69 | 73 20 65 78 70 65 63 74 |isplay i|s expect|
|00002d30| 65 64 20 74 6f 20 62 65 | 20 61 74 20 6d 6f 73 74 |ed to be| at most|
|00002d40| 20 b1 31 20 73 74 65 70 | 0d 6f 66 20 61 6c 6c 20 | .1 step|.of all |
|00002d50| 74 68 65 20 44 41 43 73 | 2c 20 69 2e 65 2e 20 6f |the DACs|, i.e. o|
|00002d60| 6e 65 20 70 61 72 74 20 | 69 6e 20 32 35 35 20 6f |ne part |in 255 o|
|00002d70| 66 20 66 75 6c 6c 20 73 | 63 61 6c 65 2e 29 0d 0d |f full s|cale.)..|
|00002d80| 54 68 65 72 65 20 61 72 | 65 20 6e 6f 20 72 65 73 |There ar|e no res|
|00002d90| 74 72 69 63 74 69 6f 6e | 73 20 61 74 20 61 6c 6c |triction|s at all|
|00002da0| 20 6f 6e 20 66 69 72 73 | 74 4c 75 6d 69 6e 61 6e | on firs|tLuminan|
|00002db0| 63 65 20 61 6e 64 20 6c | 61 73 74 4c 75 6d 69 6e |ce and l|astLumin|
|00002dc0| 61 6e 63 65 2e 20 49 74 | 20 69 73 0d 72 65 61 73 |ance. It| is.reas|
|00002dd0| 6f 6e 61 62 6c 65 20 74 | 6f 20 72 65 71 75 65 73 |onable t|o reques|
|00002de0| 74 20 61 6e 20 69 6d 70 | 6f 73 73 69 62 6c 79 20 |t an imp|ossibly |
|00002df0| 6c 61 72 67 65 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |large lu|minance |
|00002e00| 72 61 6e 67 65 2c 20 65 | 2e 67 2e 20 66 72 6f 6d |range, e|.g. from|
|00002e10| 20 61 20 6e 65 67 61 74 | 69 76 65 0d 6c 75 6d 69 | a negat|ive.lumi|
|00002e20| 6e 61 6e 63 65 20 75 70 | 20 74 6f 20 74 77 69 63 |nance up| to twic|
|00002e30| 65 20 74 68 65 20 6d 61 | 78 69 6d 75 6d 20 6c 75 |e the ma|ximum lu|
|00002e40| 6d 69 6e 61 6e 63 65 2e | 20 53 65 74 4c 75 6d 69 |minance.| SetLumi|
|00002e50| 6e 61 6e 63 65 73 20 77 | 69 6c 6c 20 70 72 6f 64 |nances w|ill prod|
|00002e60| 75 63 65 20 74 68 65 0d | 63 6c 6f 73 65 73 74 20 |uce the.|closest |
|00002e70| 70 6f 73 73 69 62 6c 65 | 20 61 70 70 72 6f 78 69 |possible| approxi|
|00002e80| 6d 61 74 69 6f 6e 2e 20 | 54 68 65 20 6c 75 6d 69 |mation. |The lumi|
|00002e90| 6e 61 6e 63 65 20 6f 66 | 20 65 61 63 68 20 65 6e |nance of| each en|
|00002ea0| 74 72 79 20 77 69 6c 6c | 20 62 65 20 63 6c 69 70 |try will| be clip|
|00002eb0| 70 65 64 20 74 6f 0d 66 | 69 74 20 69 6e 20 74 68 |ped to.f|it in th|
|00002ec0| 65 20 72 61 6e 67 65 20 | 6f 66 20 70 6f 73 73 69 |e range |of possi|
|00002ed0| 62 6c 65 20 6c 75 6d 69 | 6e 61 6e 63 65 73 2e 20 |ble lumi|nances. |
|00002ee0| 54 68 75 73 20 79 6f 75 | 20 77 69 6c 6c 20 6f 62 |Thus you| will ob|
|00002ef0| 74 61 69 6e 20 74 68 65 | 20 72 65 71 75 65 73 74 |tain the| request|
|00002f00| 65 64 0d 63 6f 6e 74 72 | 61 73 74 20 66 6f 72 20 |ed.contr|ast for |
|00002f10| 70 69 78 65 6c 20 76 61 | 6c 75 65 73 20 74 68 61 |pixel va|lues tha|
|00002f20| 74 20 61 72 65 6e 27 74 | 20 63 6c 69 70 70 65 64 |t aren't| clipped|
|00002f30| 2e 20 59 6f 75 20 63 61 | 6e 20 64 65 74 65 63 74 |. You ca|n detect|
|00002f40| 20 74 68 65 20 63 6c 69 | 70 70 69 6e 67 20 62 79 | the cli|pping by|
|00002f50| 0d 74 68 65 20 66 61 63 | 74 20 74 68 61 74 20 74 |.the fac|t that t|
|00002f60| 68 65 20 72 65 74 75 72 | 6e 65 64 20 74 6f 6c 65 |he retur|ned tole|
|00002f70| 72 61 6e 63 65 20 77 69 | 6c 6c 20 62 65 20 76 65 |rance wi|ll be ve|
|00002f80| 72 79 20 6c 61 72 67 65 | 2e 0d 0d 41 20 63 6f 6d |ry large|...A com|
|00002f90| 6d 6f 6e 20 6d 69 73 74 | 61 6b 65 20 69 6e 20 43 |mon mist|ake in C|
|00002fa0| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 69 73 20 | program|ming is |
|00002fb0| 74 6f 20 75 73 65 20 61 | 20 70 6f 69 6e 74 65 72 |to use a| pointer|
|00002fc0| 20 74 68 61 74 20 73 75 | 70 70 6f 73 65 64 6c 79 | that su|pposedly|
|00002fd0| 20 70 6f 69 6e 74 73 20 | 74 6f 0d 61 20 73 74 72 | points |to.a str|
|00002fe0| 75 63 74 75 72 65 2c 20 | 77 69 74 68 6f 75 74 20 |ucture, |without |
|00002ff0| 65 76 65 72 20 61 6c 6c | 6f 63 61 74 69 6e 67 20 |ever all|ocating |
|00003000| 73 61 69 64 20 73 74 72 | 75 63 74 75 72 65 2e 20 |said str|ucture. |
|00003010| 43 6f 6e 73 69 64 65 72 | 20 74 68 65 0d 4c 75 6d |Consider| the.Lum|
|00003020| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 2e 20 54 68 |inanceRe|cord. Th|
|00003030| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 64 65 63 6c |e follow|ing decl|
|00003040| 61 72 61 74 69 6f 6e 20 | 61 6e 64 20 63 61 6c 6c |aration |and call|
|00003050| 20 77 69 6c 6c 20 62 65 | 20 61 63 63 65 70 74 65 | will be| accepte|
|00003060| 64 20 62 79 20 74 68 65 | 0d 63 6f 6d 70 69 6c 65 |d by the|.compile|
|00003070| 72 2c 20 62 75 74 20 77 | 69 6c 6c 20 75 73 75 61 |r, but w|ill usua|
|00003080| 6c 6c 79 20 68 61 76 65 | 20 64 69 73 61 73 74 72 |lly have| disastr|
|00003090| 6f 75 73 20 63 6f 6e 73 | 65 71 75 65 6e 63 65 73 |ous cons|equences|
|000030a0| 3a 0d 09 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |:..Lumin|anceReco|
|000030b0| 72 64 20 2a 4c 50 3b 0d | 09 53 65 74 4c 75 6d 69 |rd *LP;.|.SetLumi|
|000030c0| 6e 61 6e 63 65 73 28 2e | 2e 2e 2c 4c 50 2c 2e 2e |nances(.|..,LP,..|
|000030d0| 2e 29 3b 09 09 2f 2a 20 | 42 61 64 21 20 2a 2f 0d |.);../* |Bad! */.|
|000030e0| 54 68 65 20 70 72 6f 62 | 6c 65 6d 20 69 73 20 74 |The prob|lem is t|
|000030f0| 68 61 74 20 79 6f 75 20 | 6e 65 76 65 72 20 61 6c |hat you |never al|
|00003100| 6c 6f 63 61 74 65 64 20 | 61 20 4c 75 6d 69 6e 61 |located |a Lumina|
|00003110| 6e 63 65 52 65 63 6f 72 | 64 2c 20 6f 6e 6c 79 20 |nceRecor|d, only |
|00003120| 61 20 70 6f 69 6e 74 65 | 72 2e 20 57 68 65 6e 0d |a pointe|r. When.|
|00003130| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 73 20 73 74 |SetLumin|ances st|
|00003140| 61 72 74 73 20 73 74 6f | 72 69 6e 67 20 69 6e 66 |arts sto|ring inf|
|00003150| 6f 72 6d 61 74 69 6f 6e | 20 69 6e 20 77 68 61 74 |ormation| in what|
|00003160| 20 69 74 20 74 68 69 6e | 6b 73 20 69 73 20 61 20 | it thin|ks is a |
|00003170| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|00003180| 69 74 0d 77 69 6c 6c 20 | 61 63 74 75 61 6c 6c 79 |it.will |actually|
|00003190| 20 62 65 20 77 72 69 74 | 69 6e 67 20 6f 76 65 72 | be writ|ing over|
|000031a0| 20 61 20 72 61 6e 64 6f | 6d 20 70 61 72 74 20 6f | a rando|m part o|
|000031b0| 66 20 6d 65 6d 6f 72 79 | 2e 20 57 68 61 74 20 79 |f memory|. What y|
|000031c0| 6f 75 20 73 68 6f 75 6c | 64 20 64 6f 20 69 73 3a |ou shoul|d do is:|
|000031d0| 0d 09 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |..Lumina|nceRecor|
|000031e0| 64 20 4c 52 3b 0d 09 53 | 65 74 4c 75 6d 69 6e 61 |d LR;..S|etLumina|
|000031f0| 6e 63 65 73 28 2e 2e 2e | 2c 26 4c 52 2c 2e 2e 2e |nces(...|,&LR,...|
|00003200| 29 3b 09 09 2f 2a 20 47 | 6f 6f 64 20 2a 2f 0d 4f |);../* G|ood */.O|
|00003210| 72 20 79 6f 75 20 63 61 | 6e 20 64 6f 20 74 68 69 |r you ca|n do thi|
|00003220| 73 3a 0d 09 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |s:..Lumi|nanceRec|
|00003230| 6f 72 64 20 4c 52 2c 2a | 4c 50 3b 0d 09 4c 50 3d |ord LR,*|LP;..LP=|
|00003240| 26 4c 52 3b 0d 09 53 65 | 74 4c 75 6d 69 6e 61 6e |&LR;..Se|tLuminan|
|00003250| 63 65 73 28 2e 2e 2e 2c | 4c 50 2c 2e 2e 2e 29 3b |ces(...,|LP,...);|
|00003260| 09 09 2f 2a 20 47 6f 6f | 64 20 2a 2f 0d 54 68 69 |../* Goo|d */.Thi|
|00003270| 73 20 73 65 63 6f 6e 64 | 20 74 65 63 68 6e 69 71 |s second| techniq|
|00003280| 75 65 20 69 73 20 61 20 | 62 65 74 74 65 72 20 68 |ue is a |better h|
|00003290| 61 62 69 74 2c 20 73 69 | 6e 63 65 20 69 66 20 79 |abit, si|nce if y|
|000032a0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 70 75 74 20 73 |ou want |to put s|
|000032b0| 6f 6d 65 20 6f 66 20 79 | 6f 75 72 20 63 6f 64 65 |ome of y|our code|
|000032c0| 20 69 6e 74 6f 0d 61 20 | 73 75 62 72 6f 75 74 69 | into.a |subrouti|
|000032d0| 6e 65 2c 20 79 6f 75 27 | 6c 6c 20 62 65 20 70 61 |ne, you'|ll be pa|
|000032e0| 73 73 69 6e 67 20 74 68 | 65 20 70 6f 69 6e 74 65 |ssing th|e pointe|
|000032f0| 72 2c 20 6e 6f 74 20 74 | 68 65 20 73 74 72 75 63 |r, not t|he struc|
|00003300| 74 75 72 65 20 69 74 73 | 65 6c 66 2c 20 73 6f 20 |ture its|elf, so |
|00003310| 79 6f 75 20 6d 69 67 68 | 74 20 61 73 20 77 65 6c |you migh|t as wel|
|00003320| 6c 0d 67 65 74 20 75 73 | 65 64 20 74 6f 20 75 73 |l.get us|ed to us|
|00003330| 69 6e 67 20 74 68 65 20 | 70 6f 69 6e 74 65 72 2e |ing the |pointer.|
|00003340| 0d 0d 42 65 66 6f 72 65 | 20 75 73 69 6e 67 20 53 |..Before| using S|
|00003350| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 20 6f 72 20 53 |etLumina|nce or S|
|00003360| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 73 20 79 6f 75 |etLumina|nces you|
|00003370| 20 6d 75 73 74 20 69 6e | 69 74 69 61 6c 69 7a 65 | must in|itialize|
|00003380| 20 79 6f 75 72 20 4c 75 | 6d 69 6e 61 6e 63 65 52 | your Lu|minanceR|
|00003390| 65 63 6f 72 64 2e 20 0d | 59 6f 75 20 73 68 6f 75 |ecord. .|You shou|
|000033a0| 6c 64 20 64 6f 20 74 68 | 61 74 20 62 79 20 72 65 |ld do th|at by re|
|000033b0| 61 64 69 6e 67 20 69 6e | 2c 0d 09 4c 75 6d 69 6e |ading in|,..Lumin|
|000033c0| 61 6e 63 65 52 65 63 6f | 72 64 20 4c 52 3b 0d 09 |anceReco|rd LR;..|
|000033d0| 52 65 61 64 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ReadLumi|nanceRec|
|000033e0| 6f 72 64 28 22 4c 75 6d | 69 6e 61 6e 63 65 52 65 |ord("Lum|inanceRe|
|000033f0| 63 6f 72 64 32 2e 68 22 | 2c 26 4c 52 2c 30 29 3b |cord2.h"|,&LR,0);|
|00003400| 0d 6f 72 20 23 69 6e 63 | 6c 75 64 69 6e 67 20 61 |.or #inc|luding a|
|00003410| 20 66 69 6c 65 20 77 69 | 74 68 20 61 6c 6c 20 74 | file wi|th all t|
|00003420| 68 65 20 70 61 72 61 6d | 65 74 65 72 73 20 64 65 |he param|eters de|
|00003430| 73 63 72 69 62 69 6e 67 | 20 79 6f 75 72 20 6d 6f |scribing| your mo|
|00003440| 6e 69 74 6f 72 2e 20 0d | 09 4c 75 6d 69 6e 61 6e |nitor. .|.Luminan|
|00003450| 63 65 52 65 63 6f 72 64 | 20 4c 52 3b 0d 09 23 69 |ceRecord| LR;..#i|
|00003460| 6e 63 6c 75 64 65 20 22 | 4c 75 6d 69 6e 61 6e 63 |nclude "|Luminanc|
|00003470| 65 52 65 63 6f 72 64 32 | 2e 68 22 0d 0d 48 65 72 |eRecord2|.h"..Her|
|00003480| 65 27 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f |e's an e|xample o|
|00003490| 66 20 74 68 65 20 63 6f | 6e 74 65 6e 74 73 20 6f |f the co|ntents o|
|000034a0| 66 20 61 20 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |f a Lumi|nanceRec|
|000034b0| 6f 72 64 31 2e 68 20 66 | 69 6c 65 2c 20 61 73 20 |ord1.h f|ile, as |
|000034c0| 70 72 6f 64 75 63 65 64 | 20 62 79 20 74 68 65 0d |produced| by the.|
|000034d0| 70 72 6f 67 72 61 6d 20 | 43 61 6c 69 62 72 61 74 |program |Calibrat|
|000034e0| 65 4c 75 6d 69 6e 61 6e | 63 65 2e 20 59 6f 75 20 |eLuminan|ce. You |
|000034f0| 6d 75 73 74 20 75 73 65 | 20 43 61 6c 69 62 72 61 |must use| Calibra|
|00003500| 74 65 4c 75 6d 69 6e 61 | 6e 63 65 20 74 6f 20 63 |teLumina|nce to c|
|00003510| 61 6c 69 62 72 61 74 65 | 0d 79 6f 75 72 20 6f 77 |alibrate|.your ow|
|00003520| 6e 20 66 72 61 6d 65 73 | 74 6f 72 65 2c 20 49 53 |n frames|tore, IS|
|00003530| 52 20 56 69 64 65 6f 20 | 41 74 74 65 6e 75 61 74 |R Video |Attenuat|
|00003540| 6f 72 2c 20 61 6e 64 20 | 64 69 73 70 6c 61 79 2e |or, and |display.|
|00003550| 20 0d 09 4c 52 2e 73 63 | 72 65 65 6e 3d 31 3b 09 | ..LR.sc|reen=1;.|
|00003560| 2f 2a 20 64 65 76 69 63 | 65 3d 47 65 74 53 63 72 |/* devic|e=GetScr|
|00003570| 65 65 6e 44 65 76 69 63 | 65 28 4c 52 2e 73 63 72 |eenDevic|e(LR.scr|
|00003580| 65 65 6e 29 3b 20 2a 2f | 0d 09 2f 2a 20 43 61 75 |een); */|../* Cau|
|00003590| 74 69 6f 6e 3a 20 74 68 | 65 20 73 63 72 65 65 6e |tion: th|e screen|
|000035a0| 20 6e 75 6d 62 65 72 20 | 75 73 65 64 20 68 65 72 | number |used her|
|000035b0| 65 20 61 6e 64 20 69 6e | 20 47 65 74 53 63 72 65 |e and in| GetScre|
|000035c0| 65 6e 20 44 65 76 69 63 | 65 20 69 73 20 4e 4f 54 |en Devic|e is NOT|
|000035d0| 20 74 68 65 20 73 61 6d | 65 20 61 73 20 2a 2f 0d | the sam|e as */.|
|000035e0| 09 2f 2a 20 64 69 73 70 | 6c 61 79 65 64 20 62 79 |./* disp|layed by|
|000035f0| 20 74 68 65 20 4d 6f 6e | 69 74 6f 72 73 20 63 64 | the Mon|itors cd|
|00003600| 65 76 20 69 6e 20 74 68 | 65 20 43 6f 6e 74 72 6f |ev in th|e Contro|
|00003610| 6c 20 50 61 6e 65 6c 2e | 20 53 6f 72 72 79 2e 20 |l Panel.| Sorry. |
|00003620| 54 68 65 20 6d 6f 73 74 | 20 6f 62 76 69 6f 75 73 |The most| obvious|
|00003630| 20 64 69 66 66 65 72 65 | 6e 63 65 20 2a 2f 0d 09 | differe|nce */..|
|00003640| 2f 2a 20 69 73 20 74 68 | 61 74 20 47 65 74 53 63 |/* is th|at GetSc|
|00003650| 72 65 65 6e 44 65 76 69 | 63 65 20 61 6c 77 61 79 |reenDevi|ce alway|
|00003660| 73 20 61 73 73 69 67 6e | 73 20 30 20 74 6f 20 74 |s assign|s 0 to t|
|00003670| 68 65 20 6d 61 69 6e 20 | 73 63 72 65 65 6e 2c 20 |he main |screen, |
|00003680| 74 68 65 20 6f 6e 65 20 | 77 69 74 68 20 74 68 65 |the one |with the|
|00003690| 20 6d 65 6e 75 20 62 61 | 72 2e 20 2a 2f 0d 09 4c | menu ba|r. */..L|
|000036a0| 52 2e 64 61 74 65 3d 22 | 33 3a 30 39 20 50 4d 20 |R.date="|3:09 PM |
|000036b0| 46 72 69 64 61 79 2c 20 | 4f 63 74 6f 62 65 72 20 |Friday, |October |
|000036c0| 31 36 2c 20 31 39 39 32 | 22 3b 0d 09 4c 52 2e 69 |16, 1992|";..LR.i|
|000036d0| 64 3d 22 35 31 31 31 37 | 36 37 22 3b 0d 09 4c 52 |d="51117|67";..LR|
|000036e0| 2e 6e 61 6d 65 3d 22 73 | 69 67 6e 61 6c 22 3b 0d |.name="s|ignal";.|
|000036f0| 09 4c 52 2e 6e 6f 74 65 | 73 3d 22 6d 61 6e 6f 6a |.LR.note|s="manoj|
|00003700| 2c 20 6c 69 67 68 74 73 | 20 6f 66 66 2c 20 70 68 |, lights| off, ph|
|00003710| 6f 74 6f 6d 65 74 65 72 | 20 31 20 69 6e 63 68 20 |otometer| 1 inch |
|00003720| 66 72 6f 6d 20 73 63 72 | 65 65 6e 22 3b 0d 09 4c |from scr|een";..L|
|00003730| 52 2e 64 70 69 3d 37 36 | 2e 30 3b 09 2f 2a 20 70 |R.dpi=76|.0;./* p|
|00003740| 69 78 65 6c 73 20 70 65 | 72 20 69 6e 63 68 20 2a |ixels pe|r inch *|
|00003750| 2f 0d 09 4c 52 2e 48 7a | 3d 36 36 2e 36 37 3b 09 |/..LR.Hz|=66.67;.|
|00003760| 2f 2a 20 66 72 61 6d 65 | 73 20 70 65 72 20 73 65 |/* frame|s per se|
|00003770| 63 6f 6e 64 20 2a 2f 0d | 09 4c 52 2e 75 6e 69 74 |cond */.|.LR.unit|
|00003780| 73 3d 22 63 64 2f 6d 5e | 32 22 3b 0d 09 2f 2a 20 |s="cd/m^|2";../* |
|00003790| 63 6f 65 66 66 69 63 69 | 65 6e 74 73 20 6f 66 20 |coeffici|ents of |
|000037a0| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 20 66 69 74 20 2a |polynomi|al fit *|
|000037b0| 2f 0d 09 4c 52 2e 63 6f | 65 66 66 69 63 69 65 6e |/..LR.co|efficien|
|000037c0| 74 73 3d 39 3b 09 2f 2a | 20 23 20 6f 66 20 63 6f |ts=9;./*| # of co|
|000037d0| 65 66 66 69 63 69 65 6e | 74 73 20 69 6e 20 70 6f |efficien|ts in po|
|000037e0| 6c 79 6e 6f 6d 69 61 6c | 20 66 69 74 20 2a 2f 0d |lynomial| fit */.|
|000037f0| 09 2f 2a 20 4c 28 56 29 | 3d 70 5b 30 5d 2b 70 5b |./* L(V)|=p[0]+p[|
|00003800| 31 5d 2a 56 2b 70 5b 32 | 5d 2a 56 2a 56 2b 20 2e |1]*V+p[2|]*V*V+ .|
|00003810| 20 2e 20 2e 20 b1 70 6f | 6c 79 6e 6f 6d 69 61 6c | . . .po|lynomial|
|00003820| 45 72 72 6f 72 20 2a 2f | 0d 09 4c 52 2e 70 5b 30 |Error */|..LR.p[0|
|00003830| 5d 3d 31 2e 32 38 32 30 | 31 65 2d 31 34 3b 0d 09 |]=1.2820|1e-14;..|
|00003840| 4c 52 2e 70 5b 31 5d 3d | 38 2e 32 35 37 37 36 65 |LR.p[1]=|8.25776e|
|00003850| 2d 31 33 3b 0d 09 4c 52 | 2e 70 5b 32 5d 3d 35 2e |-13;..LR|.p[2]=5.|
|00003860| 30 30 30 36 34 65 2d 31 | 31 3b 0d 09 4c 52 2e 70 |00064e-1|1;..LR.p|
|00003870| 5b 33 5d 3d 32 2e 35 31 | 31 33 38 65 2d 30 39 3b |[3]=2.51|138e-09;|
|00003880| 0d 09 4c 52 2e 70 5b 34 | 5d 3d 37 2e 39 38 30 35 |..LR.p[4|]=7.9805|
|00003890| 35 65 2d 30 38 3b 0d 09 | 4c 52 2e 70 5b 35 5d 3d |5e-08;..|LR.p[5]=|
|000038a0| 2d 32 2e 30 34 31 38 34 | 65 2d 30 39 3b 0d 09 4c |-2.04184|e-09;..L|
|000038b0| 52 2e 70 5b 36 5d 3d 31 | 2e 37 39 31 38 31 65 2d |R.p[6]=1|.79181e-|
|000038c0| 31 31 3b 0d 09 4c 52 2e | 70 5b 37 5d 3d 2d 36 2e |11;..LR.|p[7]=-6.|
|000038d0| 33 37 39 31 65 2d 31 34 | 3b 0d 09 4c 52 2e 70 5b |3791e-14|;..LR.p[|
|000038e0| 38 5d 3d 38 2e 31 30 38 | 38 38 65 2d 31 37 3b 0d |8]=8.108|88e-17;.|
|000038f0| 09 4c 52 2e 70 6f 6c 79 | 6e 6f 6d 69 61 6c 45 72 |.LR.poly|nomialEr|
|00003900| 72 6f 72 3d 20 20 30 2e | 32 32 36 33 3b 09 2f 2a |ror= 0.|2263;./*|
|00003910| 20 52 4d 53 20 65 72 72 | 6f 72 20 6f 66 20 66 69 | RMS err|or of fi|
|00003920| 74 20 2a 2f 0d 09 2f 2a | 20 63 6f 65 66 66 69 63 |t */../*| coeffic|
|00003930| 69 65 6e 74 73 20 6f 66 | 20 71 75 61 64 72 61 74 |ients of| quadrat|
|00003940| 69 63 20 66 69 74 20 2a | 2f 0d 09 2f 2a 20 4c 28 |ic fit *|/../* L(|
|00003950| 56 29 3d 71 5b 30 5d 2b | 71 5b 31 5d 2a 56 2b 71 |V)=q[0]+|q[1]*V+q|
|00003960| 5b 32 5d 2a 56 2a 56 b1 | 71 75 61 64 72 61 74 69 |[2]*V*V.|quadrati|
|00003970| 63 45 72 72 6f 72 20 2a | 2f 0d 09 4c 52 2e 71 5b |cError *|/..LR.q[|
|00003980| 30 5d 3d 34 2e 38 36 32 | 38 35 3b 0d 09 4c 52 2e |0]=4.862|85;..LR.|
|00003990| 71 5b 31 5d 3d 2d 30 2e | 32 30 31 32 36 36 3b 0d |q[1]=-0.|201266;.|
|000039a0| 09 4c 52 2e 71 5b 32 5d | 3d 30 2e 30 30 31 32 35 |.LR.q[2]|=0.00125|
|000039b0| 39 39 38 3b 0d 09 4c 52 | 2e 71 75 61 64 72 61 74 |998;..LR|.quadrat|
|000039c0| 69 63 45 72 72 6f 72 3d | 20 20 32 2e 35 34 39 33 |icError=| 2.5493|
|000039d0| 3b 09 2f 2a 20 52 4d 53 | 20 65 72 72 6f 72 20 6f |;./* RMS| error o|
|000039e0| 66 20 66 69 74 20 2a 2f | 0d 09 2f 2a 20 63 6f 65 |f fit */|../* coe|
|000039f0| 66 66 69 63 69 65 6e 74 | 73 20 6f 66 20 70 6f 77 |fficient|s of pow|
|00003a00| 65 72 20 6c 61 77 20 66 | 69 74 20 2a 2f 0d 09 2f |er law f|it */../|
|00003a10| 2a 20 4c 28 56 29 3d 70 | 6f 77 65 72 5b 30 5d 2b |* L(V)=p|ower[0]+|
|00003a20| 52 65 63 74 69 66 79 28 | 70 6f 77 65 72 5b 31 5d |Rectify(|power[1]|
|00003a30| 2b 70 6f 77 65 72 5b 32 | 5d 2a 56 29 5e 70 6f 77 |+power[2|]*V)^pow|
|00003a40| 65 72 5b 33 5d b1 70 6f | 77 65 72 45 72 72 6f 72 |er[3].po|werError|
|00003a50| 20 2a 2f 0d 09 2f 2a 20 | 77 68 65 72 65 20 52 65 | */../* |where Re|
|00003a60| 63 74 69 66 79 28 78 29 | 3d 78 20 69 66 20 78 b3 |ctify(x)|=x if x.|
|00003a70| 30 2c 20 61 6e 64 20 52 | 65 63 74 69 66 79 28 78 |0, and R|ectify(x|
|00003a80| 29 3d 30 20 6f 74 68 65 | 72 77 69 73 65 20 2a 2f |)=0 othe|rwise */|
|00003a90| 0d 09 2f 2a 20 50 65 6c | 6c 69 20 26 20 5a 68 61 |../* Pel|li & Zha|
|00003aa0| 6e 67 20 28 31 39 39 31 | 29 20 45 71 73 2e 39 26 |ng (1991|) Eqs.9&|
|00003ab0| 31 30 20 75 73 65 20 73 | 79 6d 62 6f 6c 73 20 76 |10 use s|ymbols v|
|00003ac0| 3d 56 2f 32 35 35 2c 20 | 61 6c 70 68 61 3d 70 6f |=V/255, |alpha=po|
|00003ad0| 77 65 72 5b 30 5d 2c 20 | 62 65 74 61 3d 70 6f 77 |wer[0], |beta=pow|
|00003ae0| 65 72 5b 31 5d 2c 20 6b | 61 70 70 61 3d 70 6f 77 |er[1], k|appa=pow|
|00003af0| 65 72 5b 32 5d 2a 32 35 | 35 2c 20 67 61 6d 6d 61 |er[2]*25|5, gamma|
|00003b00| 3d 70 6f 77 65 72 5b 33 | 5d 20 2a 2f 0d 09 4c 52 |=power[3|] */..LR|
|00003b10| 2e 70 6f 77 65 72 5b 30 | 5d 3d 2d 30 2e 30 36 31 |.power[0|]=-0.061|
|00003b20| 35 34 32 31 3b 0d 09 4c | 52 2e 70 6f 77 65 72 5b |5421;..L|R.power[|
|00003b30| 31 5d 3d 2d 33 2e 33 38 | 35 35 34 3b 0d 09 4c 52 |1]=-3.38|554;..LR|
|00003b40| 2e 70 6f 77 65 72 5b 32 | 5d 3d 30 2e 30 33 30 35 |.power[2|]=0.0305|
|00003b50| 30 31 37 3b 0d 09 4c 52 | 2e 70 6f 77 65 72 5b 33 |017;..LR|.power[3|
|00003b60| 5d 3d 32 2e 34 38 38 36 | 36 3b 0d 09 4c 52 2e 70 |]=2.4886|6;..LR.p|
|00003b70| 6f 77 65 72 45 72 72 6f | 72 3d 20 20 30 2e 32 36 |owerErro|r= 0.26|
|00003b80| 31 36 3b 09 2f 2a 20 52 | 4d 53 20 65 72 72 6f 72 |16;./* R|MS error|
|00003b90| 20 6f 66 20 66 69 74 20 | 2a 2f 0d 09 2f 2a 20 63 | of fit |*/../* c|
|00003ba0| 6f 65 66 66 69 63 69 65 | 6e 74 73 20 6f 66 20 70 |oefficie|nts of p|
|00003bb0| 6f 77 65 72 20 6c 61 77 | 20 66 69 74 2c 20 77 69 |ower law| fit, wi|
|00003bc0| 74 68 20 66 69 78 65 64 | 20 65 78 70 6f 6e 65 6e |th fixed| exponen|
|00003bd0| 74 20 2a 2f 0d 09 2f 2a | 20 4c 28 56 29 3d 66 69 |t */../*| L(V)=fi|
|00003be0| 78 65 64 50 6f 77 65 72 | 5b 30 5d 2b 52 65 63 74 |xedPower|[0]+Rect|
|00003bf0| 69 66 79 28 66 69 78 65 | 64 50 6f 77 65 72 5b 31 |ify(fixe|dPower[1|
|00003c00| 5d 2b 66 69 78 65 64 50 | 6f 77 65 72 5b 32 5d 2a |]+fixedP|ower[2]*|
|00003c10| 56 29 5e 66 69 78 65 64 | 50 6f 77 65 72 5b 33 5d |V)^fixed|Power[3]|
|00003c20| b1 66 69 78 65 64 50 6f | 77 65 72 45 72 72 6f 72 |.fixedPo|werError|
|00003c30| 20 2a 2f 0d 09 4c 52 2e | 66 69 78 65 64 50 6f 77 | */..LR.|fixedPow|
|00003c40| 65 72 5b 30 5d 3d 2d 30 | 2e 37 36 34 30 35 38 3b |er[0]=-0|.764058;|
|00003c50| 0d 09 4c 52 2e 66 69 78 | 65 64 50 6f 77 65 72 5b |..LR.fix|edPower[|
|00003c60| 31 5d 3d 2d 32 2e 39 36 | 37 38 35 3b 0d 09 4c 52 |1]=-2.96|785;..LR|
|00003c70| 2e 66 69 78 65 64 50 6f | 77 65 72 5b 32 5d 3d 30 |.fixedPo|wer[2]=0|
|00003c80| 2e 30 33 31 30 31 36 34 | 3b 0d 09 4c 52 2e 66 69 |.0310164|;..LR.fi|
|00003c90| 78 65 64 50 6f 77 65 72 | 5b 33 5d 3d 20 20 32 2e |xedPower|[3]= 2.|
|00003ca0| 32 38 3b 0d 09 4c 52 2e | 66 69 78 65 64 50 6f 77 |28;..LR.|fixedPow|
|00003cb0| 65 72 45 72 72 6f 72 3d | 20 20 31 2e 31 39 38 36 |erError=| 1.1986|
|00003cc0| 3b 09 2f 2a 20 52 4d 53 | 20 65 72 72 6f 72 20 6f |;./* RMS| error o|
|00003cd0| 66 20 66 69 74 20 2a 2f | 0d 09 4c 52 2e 72 3d 30 |f fit */|..LR.r=0|
|00003ce0| 2e 30 32 38 32 34 30 36 | 3b 0d 09 4c 52 2e 67 3d |.0282406|;..LR.g=|
|00003cf0| 30 2e 31 34 39 38 38 33 | 3b 0d 09 4c 52 2e 62 3d |0.149883|;..LR.b=|
|00003d00| 30 2e 38 32 31 38 37 37 | 3b 0d 09 4c 52 2e 67 61 |0.821877|;..LR.ga|
|00003d10| 69 6e 41 63 63 75 72 61 | 63 79 3d 2d 30 2e 30 33 |inAccura|cy=-0.03|
|00003d20| 33 37 39 30 35 3b 0d 09 | 4c 52 2e 67 6d 3d 33 2e |37905;..|LR.gm=3.|
|00003d30| 38 35 35 34 33 3b 09 2f | 2a 20 54 68 65 20 6d 6f |85543;./|* The mo|
|00003d40| 6e 69 74 6f 72 27 73 20 | 63 6f 6e 74 72 61 73 74 |nitor's |contrast|
|00003d50| 20 67 61 69 6e 2e 20 2a | 2f 0d 09 4c 52 2e 56 4d | gain. *|/..LR.VM|
|00003d60| 69 6e 3d 20 20 30 3b 09 | 2f 2a 20 6d 69 6e 69 6d |in= 0;.|/* minim|
|00003d70| 75 6d 20 76 61 6c 75 65 | 20 74 68 61 74 20 63 61 |um value| that ca|
|00003d80| 6e 20 62 65 20 6c 6f 61 | 64 65 64 20 69 6e 74 6f |n be loa|ded into|
|00003d90| 20 44 41 43 20 2a 2f 0d | 09 4c 52 2e 56 4d 61 78 | DAC */.|.LR.VMax|
|00003da0| 3d 32 35 35 3b 09 2f 2a | 20 6d 61 78 69 6d 75 6d |=255;./*| maximum|
|00003db0| 20 76 61 6c 75 65 20 74 | 68 61 74 20 63 61 6e 20 | value t|hat can |
|00003dc0| 62 65 20 6c 6f 61 64 65 | 64 20 69 6e 74 6f 20 44 |be loade|d into D|
|00003dd0| 41 43 20 2a 2f 0d 09 4c | 52 2e 4c 4d 69 6e 3d 20 |AC */..L|R.LMin= |
|00003de0| 20 20 2d 30 2e 30 36 3b | 09 2f 2a 20 6c 75 6d 69 | -0.06;|./* lumi|
|00003df0| 6e 61 6e 63 65 20 61 74 | 20 56 4d 69 6e 20 2a 2f |nance at| VMin */|
|00003e00| 0d 09 4c 52 2e 4c 4d 61 | 78 3d 20 20 20 33 39 2e |..LR.LMa|x= 39.|
|00003e10| 37 30 3b 09 2f 2a 20 6c | 75 6d 69 6e 61 6e 63 65 |70;./* l|uminance|
|00003e20| 20 61 74 20 56 4d 61 78 | 20 2a 2f 0d 09 4c 52 2e | at VMax| */..LR.|
|00003e30| 4c 42 61 63 6b 67 72 6f | 75 6e 64 3d 20 20 20 39 |LBackgro|und= 9|
|00003e40| 2e 37 33 31 3b 09 2f 2a | 20 62 61 63 6b 67 72 6f |.731;./*| backgro|
|00003e50| 75 6e 64 20 6c 75 6d 69 | 6e 61 6e 63 65 20 64 75 |und lumi|nance du|
|00003e60| 72 69 6e 67 20 63 61 6c | 69 62 72 61 74 69 6f 6e |ring cal|ibration|
|00003e70| 20 2a 2f 0d 09 4c 52 2e | 56 42 61 63 6b 67 72 6f | */..LR.|VBackgro|
|00003e80| 75 6e 64 3d 31 39 33 3b | 09 2f 2a 20 62 61 63 6b |und=193;|./* back|
|00003e90| 67 72 6f 75 6e 64 20 6e | 75 6d 62 65 72 20 75 73 |ground n|umber us|
|00003ea0| 65 64 20 64 75 72 69 6e | 67 20 63 61 6c 69 62 72 |ed durin|g calibr|
|00003eb0| 61 74 69 6f 6e 20 2a 2f | 0d 09 4c 52 2e 72 61 6e |ation */|..LR.ran|
|00003ec0| 67 65 53 65 74 3d 30 3b | 09 2f 2a 20 69 6e 64 69 |geSet=0;|./* indi|
|00003ed0| 63 61 74 65 20 74 68 61 | 74 20 72 61 6e 67 65 20 |cate tha|t range |
|00003ee0| 70 61 72 61 6d 65 74 65 | 72 73 20 68 61 76 65 20 |paramete|rs have |
|00003ef0| 79 65 74 20 74 6f 20 62 | 65 20 73 65 74 20 2a 2f |yet to b|e set */|
|00003f00| 0d 09 4c 52 2e 4c 2e 65 | 78 69 73 74 73 3d 30 3b |..LR.L.e|xists=0;|
|00003f10| 09 2f 2a 20 69 6e 64 69 | 63 61 74 65 20 74 68 61 |./* indi|cate tha|
|00003f20| 74 20 6c 75 6d 69 6e 61 | 6e 63 65 20 74 61 62 6c |t lumina|nce tabl|
|00003f30| 65 20 68 61 73 20 79 65 | 74 20 74 6f 20 62 65 20 |e has ye|t to be |
|00003f40| 69 6e 69 74 69 61 6c 69 | 7a 65 64 20 2a 2f 0d 4e |initiali|zed */.N|
|00003f50| 6f 74 65 20 74 68 61 74 | 20 74 68 65 73 65 20 70 |ote that| these p|
|00003f60| 61 72 61 6d 65 74 65 72 | 73 20 64 65 73 63 72 69 |arameter|s descri|
|00003f70| 62 65 20 66 69 74 73 20 | 6f 66 20 74 68 72 65 65 |be fits |of three|
|00003f80| 20 66 75 6e 63 74 69 6f | 6e 73 20 74 6f 20 74 68 | functio|ns to th|
|00003f90| 65 20 67 61 6d 6d 61 20 | 66 75 6e 63 74 69 6f 6e |e gamma |function|
|00003fa0| 2e 0d 59 6f 75 20 6d 61 | 79 20 6f 6d 69 74 20 61 |..You ma|y omit a|
|00003fb0| 6e 79 20 6f 72 20 61 6c | 6c 20 6f 66 20 74 68 65 |ny or al|l of the|
|00003fc0| 73 65 20 66 69 74 73 2c | 20 62 75 74 20 73 68 6f |se fits,| but sho|
|00003fd0| 75 6c 64 20 64 6f 63 75 | 6d 65 6e 74 20 69 74 20 |uld docu|ment it |
|00003fe0| 62 79 20 73 65 74 74 69 | 6e 67 20 74 68 65 0d 63 |by setti|ng the.c|
|00003ff0| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 65 72 72 |orrespon|ding err|
|00004000| 6f 72 20 74 65 72 6d 73 | 20 74 6f 20 69 6e 66 69 |or terms| to infi|
|00004010| 6e 69 74 79 20 28 3d 31 | 2e 30 2f 30 2e 30 29 2e |nity (=1|.0/0.0).|
|00004020| 20 49 66 20 79 6f 75 20 | 6f 6d 69 74 20 61 6c 6c | If you |omit all|
|00004030| 20 6f 66 20 74 68 65 6d | 20 74 68 65 6e 0d 79 6f | of them| then.yo|
|00004040| 75 20 6d 75 73 74 20 73 | 75 70 70 6c 79 20 61 20 |u must s|upply a |
|00004050| 74 61 62 6c 65 20 64 65 | 73 63 72 69 62 69 6e 67 |table de|scribing|
|00004060| 20 74 68 65 20 67 61 6d | 6d 61 20 66 75 6e 63 74 | the gam|ma funct|
|00004070| 69 6f 6e 2c 20 65 2e 67 | 2e 0d 09 4c 52 2e 4c 2e |ion, e.g|...LR.L.|
|00004080| 5f 56 4d 69 6e 3d 44 6f | 75 62 6c 65 54 6f 46 69 |_VMin=Do|ubleToFi|
|00004090| 78 28 30 2e 29 3b 09 2f | 2a 20 69 66 20 70 6f 73 |x(0.);./|* if pos|
|000040a0| 73 69 62 6c 65 2c 20 72 | 65 73 74 72 69 63 74 20 |sible, r|estrict |
|000040b0| 74 6f 20 6a 75 73 74 20 | 74 68 65 20 6d 6f 6e 6f |to just |the mono|
|000040c0| 74 6f 6e 69 63 20 72 61 | 6e 67 65 20 2a 2f 0d 09 |tonic ra|nge */..|
|000040d0| 4c 52 2e 4c 2e 5f 56 4d | 61 78 3d 44 6f 75 62 6c |LR.L._VM|ax=Doubl|
|000040e0| 65 54 6f 46 69 78 28 32 | 35 35 2e 29 3b 09 2f 2a |eToFix(2|55.);./*|
|000040f0| 20 69 66 20 70 6f 73 73 | 69 62 6c 65 2c 20 72 65 | if poss|ible, re|
|00004100| 73 74 72 69 63 74 20 74 | 6f 20 6a 75 73 74 20 74 |strict t|o just t|
|00004110| 68 65 20 6d 6f 6e 6f 74 | 6f 6e 69 63 20 72 61 6e |he monot|onic ran|
|00004120| 67 65 20 2a 2f 0d 09 4c | 52 2e 4c 2e 5f 64 56 3d |ge */..L|R.L._dV=|
|00004130| 28 4c 52 2e 4c 2e 5f 56 | 4d 61 78 2d 4c 52 2e 4c |(LR.L._V|Max-LR.L|
|00004140| 2e 5f 56 4d 69 6e 29 2f | 28 4c 55 4d 49 4e 41 4e |._VMin)/|(LUMINAN|
|00004150| 43 45 53 5f 49 4e 5f 54 | 41 42 4c 45 2d 31 29 3b |CES_IN_T|ABLE-1);|
|00004160| 0d 09 4c 52 2e 4c 2e 6c | 61 74 65 73 74 49 6e 64 |..LR.L.l|atestInd|
|00004170| 65 78 3d 2d 31 3b 09 09 | 09 2f 2a 20 69 6e 76 61 |ex=-1;..|./* inva|
|00004180| 6c 69 64 20 6c 61 74 65 | 73 74 49 6e 64 65 78 2c |lid late|stIndex,|
|00004190| 20 73 6f 20 68 75 6e 74 | 20 77 69 6c 6c 20 73 74 | so hunt| will st|
|000041a0| 61 72 74 20 66 72 6f 6d | 20 73 63 72 61 74 63 68 |art from| scratch|
|000041b0| 20 2a 2f 0d 09 4c 52 2e | 4c 2e 65 78 69 73 74 73 | */..LR.|L.exists|
|000041c0| 3d 6c 75 6d 69 6e 61 6e | 63 65 53 65 74 3b 09 09 |=luminan|ceSet;..|
|000041d0| 2f 2a 20 6d 61 72 6b 20 | 74 61 62 6c 65 20 61 73 |/* mark |table as|
|000041e0| 20 76 61 6c 69 64 20 2a | 2f 0d 09 4c 52 2e 4c 2e | valid *|/..LR.L.|
|000041f0| 5f 4c 75 5b 30 5d 3d 44 | 6f 75 62 6c 65 54 6f 46 |_Lu[0]=D|oubleToF|
|00004200| 69 78 28 30 2e 35 37 29 | 3b 0d 09 4c 52 2e 4c 2e |ix(0.57)|;..LR.L.|
|00004210| 5f 4c 75 5b 31 5d 3d 44 | 6f 75 62 6c 65 54 6f 46 |_Lu[1]=D|oubleToF|
|00004220| 69 78 28 30 2e 35 37 29 | 3b 0d 09 2e 2e 2e 0d 09 |ix(0.57)|;.......|
|00004230| 4c 52 2e 4c 2e 5f 4c 75 | 5b 4c 55 4d 49 4e 41 4e |LR.L._Lu|[LUMINAN|
|00004240| 43 45 53 5f 49 4e 5f 54 | 41 42 4c 45 2d 31 5d 3d |CES_IN_T|ABLE-1]=|
|00004250| 44 6f 75 62 6c 65 54 6f | 46 69 78 28 31 30 31 2e |DoubleTo|Fix(101.|
|00004260| 31 33 29 3b 0d 22 4c 55 | 4d 49 4e 41 4e 43 45 53 |13);."LU|MINANCES|
|00004270| 5f 49 4e 5f 54 41 42 4c | 45 22 20 69 73 20 63 75 |_IN_TABL|E" is cu|
|00004280| 72 72 65 6e 74 6c 79 20 | 64 65 66 69 6e 65 64 20 |rrently |defined |
|00004290| 74 6f 20 62 65 20 31 32 | 38 20 69 6e 20 4c 75 6d |to be 12|8 in Lum|
|000042a0| 69 6e 61 6e 63 65 2e 68 | 2e 20 4e 6f 72 6d 61 6c |inance.h|. Normal|
|000042b0| 6c 79 20 74 68 69 73 20 | 0d 74 61 62 6c 65 20 69 |ly this |.table i|
|000042c0| 73 20 73 79 6e 74 68 65 | 73 69 7a 65 64 20 61 74 |s synthe|sized at|
|000042d0| 20 72 75 6e 20 74 69 6d | 65 2c 20 66 72 6f 6d 20 | run tim|e, from |
|000042e0| 6f 6e 65 20 6f 66 20 74 | 68 65 20 66 6f 72 6d 75 |one of t|he formu|
|000042f0| 6c 61 69 63 20 64 65 73 | 63 72 69 70 74 69 6f 6e |laic des|cription|
|00004300| 73 2c 0d 62 75 74 20 79 | 6f 75 20 6d 61 79 20 70 |s,.but y|ou may p|
|00004310| 72 65 66 65 72 20 74 6f | 20 73 75 70 70 6c 79 20 |refer to| supply |
|00004320| 69 74 20 64 69 72 65 63 | 74 6c 79 2c 20 70 6f 73 |it direc|tly, pos|
|00004330| 73 69 62 6c 79 20 75 73 | 69 6e 67 20 74 68 65 20 |sibly us|ing the |
|00004340| 72 61 77 20 6d 65 61 73 | 75 72 65 6d 65 6e 74 73 |raw meas|urements|
|00004350| 2c 0d 61 6e 64 20 6e 6f | 74 20 62 6f 74 68 65 72 |,.and no|t bother|
|00004360| 20 77 69 74 68 20 61 6e | 79 20 66 69 74 74 69 6e | with an|y fittin|
|00004370| 67 2e 20 54 68 65 20 66 | 6f 72 6d 75 6c 61 73 20 |g. The f|ormulas |
|00004380| 61 72 65 20 6e 6f 74 20 | 75 73 65 64 20 69 66 20 |are not |used if |
|00004390| 74 68 65 20 74 61 62 6c | 65 20 69 73 20 73 75 70 |the tabl|e is sup|
|000043a0| 70 6c 69 65 64 2e 0d 0d | 54 6f 20 66 69 6c 6c 20 |plied...|To fill |
|000043b0| 69 6e 20 74 68 65 20 6e | 75 6d 62 65 72 73 20 61 |in the n|umbers a|
|000043c0| 62 6f 76 65 2c 20 79 6f | 75 20 68 61 76 65 20 74 |bove, yo|u have t|
|000043d0| 6f 20 64 6f 20 74 77 6f | 20 63 61 6c 69 62 72 61 |o do two| calibra|
|000043e0| 74 69 6f 6e 73 2e 20 28 | 54 68 69 73 20 69 73 20 |tions. (|This is |
|000043f0| 77 68 61 74 20 74 68 65 | 0d 43 61 6c 69 62 72 61 |what the|.Calibra|
|00004400| 74 65 4c 75 6d 69 6e 61 | 6e 63 65 20 70 72 6f 67 |teLumina|nce prog|
|00004410| 72 61 6d 20 64 6f 65 73 | 2e 29 0d 0d 30 2e 20 42 |ram does|.)..0. B|
|00004420| 65 66 6f 72 65 20 73 74 | 61 72 74 69 6e 67 2c 20 |efore st|arting, |
|00004430| 63 61 6c 6c 20 47 44 4c | 69 6e 65 61 72 47 61 6d |call GDL|inearGam|
|00004440| 6d 61 28 29 2e 20 28 4e | 6f 74 65 20 74 68 61 74 |ma(). (N|ote that|
|00004450| 20 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 20 0d 61 | GDOpenW|indow .a|
|00004460| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 63 61 6c |utomatic|ally cal|
|00004470| 6c 73 20 47 44 4c 69 6e | 65 61 72 47 61 6d 6d 61 |ls GDLin|earGamma|
|00004480| 20 66 6f 72 20 79 6f 75 | 2e 29 20 41 6c 6c 20 63 | for you|.) All c|
|00004490| 61 6c 69 62 72 61 74 69 | 6f 6e 73 20 73 68 6f 75 |alibrati|ons shou|
|000044a0| 6c 64 20 62 65 20 64 6f | 6e 65 0d 77 69 74 68 20 |ld be do|ne.with |
|000044b0| 74 68 65 20 49 53 52 20 | 56 69 64 65 6f 20 41 74 |the ISR |Video At|
|000044c0| 74 65 6e 75 61 74 6f 72 | 20 69 6e 20 70 6c 61 63 |tenuator| in plac|
|000044d0| 65 2e 0d 0d 31 2e 20 4d | 65 61 73 75 72 65 20 74 |e...1. M|easure t|
|000044e0| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 20 76 65 72 |he lumin|ance ver|
|000044f0| 73 75 73 20 22 76 6f 6c | 74 61 67 65 22 20 6e 6f |sus "vol|tage" no|
|00004500| 6e 6c 69 6e 65 61 72 69 | 74 79 20 6f 66 20 79 6f |nlineari|ty of yo|
|00004510| 75 72 20 6d 6f 6e 69 74 | 6f 72 2e 0d 49 20 75 73 |ur monit|or..I us|
|00004520| 65 20 61 20 73 65 70 61 | 72 61 74 65 20 70 72 6f |e a sepa|rate pro|
|00004530| 67 72 61 6d 20 22 43 61 | 6c 69 62 72 61 74 65 4c |gram "Ca|librateL|
|00004540| 75 6d 69 6e 61 6e 63 65 | 22 20 74 6f 20 6d 65 61 |uminance|" to mea|
|00004550| 73 75 72 65 20 74 68 65 | 20 73 63 72 65 65 6e 20 |sure the| screen |
|00004560| 6c 75 6d 69 6e 61 6e 63 | 65 20 61 74 20 76 61 6c |luminanc|e at val|
|00004570| 75 65 73 0d 6f 66 20 56 | 20 66 72 6f 6d 20 30 20 |ues.of V| from 0 |
|00004580| 74 6f 20 32 35 35 2e 20 | 46 6f 72 20 74 68 69 73 |to 255. |For this|
|00004590| 20 63 61 6c 69 62 72 61 | 74 69 6f 6e 20 79 6f 75 | calibra|tion you|
|000045a0| 20 6c 6f 61 64 20 65 71 | 75 61 6c 20 76 61 6c 75 | load eq|ual valu|
|000045b0| 65 73 20 69 6e 74 6f 20 | 52 65 64 2c 20 47 72 65 |es into |Red, Gre|
|000045c0| 65 6e 2c 20 61 6e 64 20 | 42 6c 75 65 0d 6c 6f 6f |en, and |Blue.loo|
|000045d0| 6b 75 70 20 74 61 62 6c | 65 73 2e 20 49 20 75 73 |kup tabl|es. I us|
|000045e0| 65 20 71 75 61 64 72 61 | 74 69 63 2c 20 70 6f 6c |e quadra|tic, pol|
|000045f0| 79 6e 6f 6d 69 61 6c 2c | 20 61 6e 64 20 70 6f 77 |ynomial,| and pow|
|00004600| 65 72 20 6c 61 77 20 66 | 69 74 73 2e 20 53 65 65 |er law f|its. See|
|00004610| 20 50 65 6c 6c 69 20 26 | 20 5a 68 61 6e 67 20 28 | Pelli &| Zhang (|
|00004620| 31 39 39 31 29 2e 0d 0d | 59 6f 75 20 6d 75 73 74 |1991)...|You must|
|00004630| 20 73 65 74 20 4c 52 2e | 4c 4d 69 6e 20 61 6e 64 | set LR.|LMin and|
|00004640| 20 4c 52 2e 4c 4d 61 78 | 20 74 6f 20 74 68 65 20 | LR.LMax| to the |
|00004650| 6c 75 6d 69 6e 61 6e 63 | 65 73 20 61 74 20 4c 52 |luminanc|es at LR|
|00004660| 2e 56 4d 69 6e 20 61 6e | 64 20 4c 52 2e 56 4d 61 |.VMin an|d LR.VMa|
|00004670| 78 2e 0d 0d 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |x...The |followin|
|00004680| 67 20 70 72 6f 67 72 61 | 6d 20 66 72 61 67 6d 65 |g progra|m fragme|
|00004690| 6e 74 20 61 6c 6c 6f 77 | 73 20 79 6f 75 20 74 6f |nt allow|s you to|
|000046a0| 20 6d 65 61 73 75 72 65 | 20 74 68 65 20 73 63 72 | measure| the scr|
|000046b0| 65 65 6e 20 6c 75 6d 69 | 6e 61 6e 63 65 20 61 73 |een lumi|nance as|
|000046c0| 20 61 20 66 75 6e 63 74 | 69 6f 6e 0d 6f 66 20 6e | a funct|ion.of n|
|000046d0| 6f 6d 69 6e 61 6c 20 76 | 6f 6c 74 61 67 65 2e 0d |ominal v|oltage..|
|000046e0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 56 69 64 65 6f |.#includ|e "Video|
|000046f0| 54 6f 6f 6c 62 6f 78 2e | 68 22 0d 23 69 6e 63 6c |Toolbox.|h".#incl|
|00004700| 75 64 65 20 22 4c 75 6d | 69 6e 61 6e 63 65 2e 68 |ude "Lum|inance.h|
|00004710| 22 0d 0d 76 6f 69 64 20 | 6d 61 69 6e 28 76 6f 69 |"..void |main(voi|
|00004720| 64 29 0d 7b 0d 09 4c 75 | 6d 69 6e 61 6e 63 65 52 |d).{..Lu|minanceR|
|00004730| 65 63 6f 72 64 20 4c 52 | 3b 0d 09 69 6e 74 20 56 |ecord LR|;..int V|
|00004740| 2c 69 2c 64 6f 6e 65 3b | 0d 09 64 6f 75 62 6c 65 |,i,done;|..double|
|00004750| 20 61 3b 0d 09 47 44 48 | 61 6e 64 6c 65 20 6f 6c | a;..GDH|andle ol|
|00004760| 64 44 65 76 69 63 65 2c | 64 65 76 69 63 65 3b 0d |dDevice,|device;.|
|00004770| 09 43 57 69 6e 64 6f 77 | 50 74 72 20 63 57 69 6e |.CWindow|Ptr cWin|
|00004780| 64 6f 77 2c 6f 6c 64 43 | 57 69 6e 64 6f 77 3b 0d |dow,oldC|Window;.|
|00004790| 09 63 68 61 72 20 73 74 | 72 69 6e 67 5b 33 32 5d |.char st|ring[32]|
|000047a0| 3b 0d 09 0d 09 23 69 6e | 63 6c 75 64 65 20 22 4c |;....#in|clude "L|
|000047b0| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 31 2e |uminance|Record1.|
|000047c0| 68 22 0d 09 47 65 74 47 | 57 6f 72 6c 64 28 26 6f |h"..GetG|World(&o|
|000047d0| 6c 64 43 57 69 6e 64 6f | 77 2c 26 6f 6c 64 44 65 |ldCWindo|w,&oldDe|
|000047e0| 76 69 63 65 29 3b 0d 09 | 4c 52 2e 73 63 72 65 65 |vice);..|LR.scree|
|000047f0| 6e 3d 31 3b 0d 09 64 65 | 76 69 63 65 3d 47 65 74 |n=1;..de|vice=Get|
|00004800| 53 63 72 65 65 6e 44 65 | 76 69 63 65 28 4c 52 2e |ScreenDe|vice(LR.|
|00004810| 73 63 72 65 65 6e 29 3b | 09 2f 2a 20 73 63 72 65 |screen);|./* scre|
|00004820| 65 6e 20 31 20 2a 2f 0d | 09 63 57 69 6e 64 6f 77 |en 1 */.|.cWindow|
|00004830| 3d 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 28 64 65 |=GDOpenW|indow(de|
|00004840| 76 69 63 65 29 3b 09 09 | 2f 2a 20 4f 70 65 6e 20 |vice);..|/* Open |
|00004850| 61 20 66 75 6c 6c 2d 73 | 63 72 65 65 6e 20 77 69 |a full-s|creen wi|
|00004860| 6e 64 6f 77 20 77 69 74 | 68 20 65 78 70 6c 69 63 |ndow wit|h explic|
|00004870| 69 74 20 63 6f 6c 6f 72 | 73 20 2a 2f 0d 09 53 65 |it color|s */..Se|
|00004880| 74 47 57 6f 72 6c 64 28 | 63 57 69 6e 64 6f 77 2c |tGWorld(|cWindow,|
|00004890| 64 65 76 69 63 65 29 3b | 0d 09 50 6d 42 61 63 6b |device);|..PmBack|
|000048a0| 43 6f 6c 6f 72 28 31 29 | 3b 09 09 09 09 09 09 2f |Color(1)|;....../|
|000048b0| 2a 20 70 69 63 6b 20 61 | 20 63 6f 6c 6f 72 20 74 |* pick a| color t|
|000048c0| 61 62 6c 65 20 65 6e 74 | 72 79 20 2a 2f 0d 09 45 |able ent|ry */..E|
|000048d0| 72 61 73 65 52 65 63 74 | 28 26 63 57 69 6e 64 6f |raseRect|(&cWindo|
|000048e0| 77 2d 3e 70 6f 72 74 52 | 65 63 74 29 3b 09 09 2f |w->portR|ect);../|
|000048f0| 2a 20 66 69 6c 6c 20 77 | 68 6f 6c 65 20 77 69 6e |* fill w|hole win|
|00004900| 64 6f 77 20 77 69 74 68 | 20 74 68 61 74 20 63 6f |dow with| that co|
|00004910| 6c 6f 72 20 2a 2f 0d 09 | 53 65 74 47 57 6f 72 6c |lor */..|SetGWorl|
|00004920| 64 28 6f 6c 64 43 57 69 | 6e 64 6f 77 2c 6f 6c 64 |d(oldCWi|ndow,old|
|00004930| 44 65 76 69 63 65 29 3b | 0d 09 4c 52 2e 4c 2e 5f |Device);|..LR.L._|
|00004940| 56 4d 69 6e 3d 44 6f 75 | 62 6c 65 54 6f 46 69 78 |VMin=Dou|bleToFix|
|00004950| 28 30 2e 29 3b 09 09 09 | 2f 2a 20 69 66 20 70 6f |(0.);...|/* if po|
|00004960| 73 73 69 62 6c 65 2c 20 | 72 65 73 74 72 69 63 74 |ssible, |restrict|
|00004970| 20 74 6f 20 6a 75 73 74 | 20 74 68 65 20 73 74 72 | to just| the str|
|00004980| 69 63 74 6c 79 20 6d 6f | 6e 6f 74 6f 6e 69 63 20 |ictly mo|notonic |
|00004990| 72 61 6e 67 65 20 2a 2f | 0d 09 4c 52 2e 4c 2e 5f |range */|..LR.L._|
|000049a0| 56 4d 61 78 3d 44 6f 75 | 62 6c 65 54 6f 46 69 78 |VMax=Dou|bleToFix|
|000049b0| 28 32 35 35 2e 29 3b 0d | 09 64 6f 6e 65 3d 30 3b |(255.);.|.done=0;|
|000049c0| 0d 09 66 6f 72 28 69 3d | 30 3b 69 3c 4c 55 4d 49 |..for(i=|0;i<LUMI|
|000049d0| 4e 41 4e 43 45 53 5f 49 | 4e 5f 54 41 42 4c 45 3b |NANCES_I|N_TABLE;|
|000049e0| 69 2b 2b 29 7b 0d 09 09 | 4c 52 2e 4c 2e 5f 64 56 |i++){...|LR.L._dV|
|000049f0| 3d 63 65 69 6c 28 46 69 | 78 54 6f 44 6f 75 62 6c |=ceil(Fi|xToDoubl|
|00004a00| 65 28 4c 52 2e 4c 2e 5f | 56 4d 61 78 2d 4c 52 2e |e(LR.L._|VMax-LR.|
|00004a10| 4c 2e 5f 56 4d 69 6e 29 | 2f 28 4c 55 4d 49 4e 41 |L._VMin)|/(LUMINA|
|00004a20| 4e 43 45 53 5f 49 4e 5f | 54 41 42 4c 45 2d 31 29 |NCES_IN_|TABLE-1)|
|00004a30| 29 3b 0d 09 09 56 3d 46 | 69 78 54 6f 4c 6f 6e 67 |);...V=F|ixToLong|
|00004a40| 28 69 2a 4c 52 2e 4c 2e | 5f 64 56 29 3b 0d 09 09 |(i*LR.L.|_dV);...|
|00004a50| 69 66 28 56 3e 3d 46 69 | 78 54 6f 4c 6f 6e 67 28 |if(V>=Fi|xToLong(|
|00004a60| 4c 52 2e 4c 2e 5f 56 4d | 61 78 29 29 7b 0d 09 09 |LR.L._VM|ax)){...|
|00004a70| 09 56 3d 46 69 78 54 6f | 4c 6f 6e 67 28 4c 52 2e |.V=FixTo|Long(LR.|
|00004a80| 4c 2e 5f 56 4d 61 78 29 | 3b 0d 09 09 09 64 6f 6e |L._VMax)|;....don|
|00004a90| 65 3d 31 3b 0d 09 09 7d | 0d 09 09 4c 52 2e 74 61 |e=1;...}|...LR.ta|
|00004aa0| 62 6c 65 5b 31 5d 2e 72 | 67 62 2e 72 65 64 09 09 |ble[1].r|gb.red..|
|00004ab0| 3d 56 3c 3c 38 3b 09 2f | 2a 20 53 65 74 20 63 6f |=V<<8;./|* Set co|
|00004ac0| 6c 6f 72 20 74 61 62 6c | 65 20 65 6e 74 72 79 20 |lor tabl|e entry |
|00004ad0| 31 2e 20 2a 2f 0d 09 09 | 4c 52 2e 74 61 62 6c 65 |1. */...|LR.table|
|00004ae0| 5b 31 5d 2e 72 67 62 2e | 67 72 65 65 6e 09 3d 56 |[1].rgb.|green.=V|
|00004af0| 3c 3c 38 3b 0d 09 09 4c | 52 2e 74 61 62 6c 65 5b |<<8;...L|R.table[|
|00004b00| 31 5d 2e 72 67 62 2e 62 | 6c 75 65 09 3d 56 3c 3c |1].rgb.b|lue.=V<<|
|00004b10| 38 3b 0d 09 09 4c 6f 61 | 64 4c 75 6d 69 6e 61 6e |8;...Loa|dLuminan|
|00004b20| 63 65 73 28 64 65 76 69 | 63 65 2c 26 4c 52 2c 31 |ces(devi|ce,&LR,1|
|00004b30| 2c 31 29 3b 09 2f 2a 20 | 43 6f 70 79 20 63 6f 6c |,1);./* |Copy col|
|00004b40| 6f 72 20 74 61 62 6c 65 | 20 65 6e 74 72 79 20 31 |or table| entry 1|
|00004b50| 20 74 6f 20 43 4c 55 54 | 20 2a 2f 0d 09 09 70 72 | to CLUT| */...pr|
|00004b60| 69 6e 74 66 28 22 25 33 | 64 20 50 6c 65 61 73 65 |intf("%3|d Please|
|00004b70| 20 6d 65 61 73 75 72 65 | 20 73 63 72 65 65 6e 20 | measure| screen |
|00004b80| 6c 75 6d 69 6e 61 6e 63 | 65 20 6e 6f 77 2c 20 69 |luminanc|e now, i|
|00004b90| 6e 20 25 73 2c 20 61 6e | 64 20 74 79 70 65 20 69 |n %s, an|d type i|
|00004ba0| 6e 3a 22 2c 56 2c 4c 52 | 2e 75 6e 69 74 73 29 3b |n:",V,LR|.units);|
|00004bb0| 0d 09 09 67 65 74 73 28 | 73 74 72 69 6e 67 29 3b |...gets(|string);|
|00004bc0| 0d 09 09 73 73 63 61 6e | 66 28 73 74 72 69 6e 67 |...sscan|f(string|
|00004bd0| 2c 22 25 6c 66 22 2c 26 | 61 29 3b 0d 09 09 70 72 |,"%lf",&|a);...pr|
|00004be0| 69 6e 74 66 28 22 25 36 | 2e 32 67 20 25 73 5c 6e |intf("%6|.2g %s\n|
|00004bf0| 22 2c 61 2c 4c 52 2e 75 | 6e 69 74 73 29 3b 0d 09 |",a,LR.u|nits);..|
|00004c00| 09 4c 52 2e 4c 2e 5f 4c | 75 5b 69 5d 3d 44 6f 75 |.LR.L._L|u[i]=Dou|
|00004c10| 62 6c 65 54 6f 46 69 78 | 28 61 29 3b 0d 09 09 69 |bleToFix|(a);...i|
|00004c20| 66 28 64 6f 6e 65 29 62 | 72 65 61 6b 3b 0d 09 09 |f(done)b|reak;...|
|00004c30| 69 66 28 4c 52 2e 4c 2e | 5f 4c 75 5b 69 5d 3c 3d |if(LR.L.|_Lu[i]<=|
|00004c40| 4c 52 2e 4c 2e 5f 4c 75 | 5b 30 5d 29 7b 09 2f 2a |LR.L._Lu|[0]){./*|
|00004c50| 20 72 65 73 74 72 69 63 | 74 20 74 6f 20 6a 75 73 | restric|t to jus|
|00004c60| 74 20 74 68 65 20 73 74 | 72 69 63 74 6c 79 20 6d |t the st|rictly m|
|00004c70| 6f 6e 6f 74 6f 6e 69 63 | 20 72 61 6e 67 65 20 2a |onotonic| range *|
|00004c80| 2f 0d 09 09 09 4c 52 2e | 4c 2e 5f 56 4d 69 6e 3d |/....LR.|L._VMin=|
|00004c90| 4c 6f 6e 67 54 6f 46 69 | 78 28 56 29 3b 0d 09 09 |LongToFi|x(V);...|
|00004ca0| 09 4c 52 2e 4c 2e 5f 4c | 75 5b 30 5d 3d 4c 52 2e |.LR.L._L|u[0]=LR.|
|00004cb0| 4c 2e 5f 4c 75 5b 69 5d | 3b 0d 09 09 09 69 3d 30 |L._Lu[i]|;....i=0|
|00004cc0| 3b 0d 09 09 7d 0d 09 7d | 0d 09 4c 52 2e 4c 2e 6c |;...}..}|..LR.L.l|
|00004cd0| 61 74 65 73 74 49 6e 64 | 65 78 3d 2d 31 3b 09 09 |atestInd|ex=-1;..|
|00004ce0| 09 2f 2a 20 69 6e 76 61 | 6c 69 64 20 6c 61 74 65 |./* inva|lid late|
|00004cf0| 73 74 49 6e 64 65 78 2c | 20 73 6f 20 68 75 6e 74 |stIndex,| so hunt|
|00004d00| 20 77 69 6c 6c 20 73 74 | 61 72 74 20 66 72 6f 6d | will st|art from|
|00004d10| 20 73 63 72 61 74 63 68 | 20 2a 2f 0d 09 4c 52 2e | scratch| */..LR.|
|00004d20| 4c 2e 65 78 69 73 74 73 | 3d 6c 75 6d 69 6e 61 6e |L.exists|=luminan|
|00004d30| 63 65 53 65 74 3b 09 09 | 2f 2a 20 6d 61 72 6b 20 |ceSet;..|/* mark |
|00004d40| 74 61 62 6c 65 20 61 73 | 20 76 61 6c 69 64 20 2a |table as| valid *|
|00004d50| 2f 0d 7d 0d 0d 32 2e 20 | 4d 65 61 73 75 72 65 20 |/.}..2. |Measure |
|00004d60| 74 68 65 20 67 61 69 6e | 73 20 6f 66 20 74 68 65 |the gain|s of the|
|00004d70| 20 74 68 72 65 65 20 69 | 6e 70 75 74 73 20 6f 66 | three i|nputs of|
|00004d80| 20 79 6f 75 72 20 49 53 | 52 20 56 69 64 65 6f 20 | your IS|R Video |
|00004d90| 41 74 74 65 6e 75 61 74 | 6f 72 2e 20 59 6f 75 20 |Attenuat|or. You |
|00004da0| 63 6f 75 6c 64 0d 64 6f | 20 74 68 69 73 20 62 79 |could.do| this by|
|00004db0| 20 75 73 69 6e 67 20 61 | 6e 20 6f 73 63 69 6c 6c | using a|n oscill|
|00004dc0| 6f 73 63 6f 70 65 20 74 | 6f 20 6d 65 61 73 75 72 |oscope t|o measur|
|00004dd0| 69 6e 67 20 74 68 65 20 | 76 6f 6c 74 61 67 65 20 |ing the |voltage |
|00004de0| 61 74 20 74 68 65 20 69 | 6e 70 75 74 20 74 6f 20 |at the i|nput to |
|00004df0| 74 68 65 20 6d 6f 6e 69 | 74 6f 72 2e 0d 49 6e 73 |the moni|tor..Ins|
|00004e00| 74 65 61 64 2c 20 49 20 | 6d 65 61 73 75 72 65 20 |tead, I |measure |
|00004e10| 74 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 6c 75 |the resu|lting lu|
|00004e20| 6d 69 6e 61 6e 63 65 20 | 61 6e 64 20 75 73 65 20 |minance |and use |
|00004e30| 4c 54 6f 56 28 29 20 74 | 6f 20 69 6e 66 65 72 20 |LToV() t|o infer |
|00004e40| 74 68 65 20 76 6f 6c 74 | 61 67 65 2e 0d 56 61 72 |the volt|age..Var|
|00004e50| 79 20 6f 6e 65 20 44 41 | 43 20 77 68 69 6c 65 20 |y one DA|C while |
|00004e60| 68 6f 6c 64 69 6e 67 20 | 74 68 65 20 6f 74 68 65 |holding |the othe|
|00004e70| 72 20 74 77 6f 20 66 69 | 78 65 64 20 61 74 20 32 |r two fi|xed at 2|
|00004e80| 35 35 20 61 6e 64 20 6d | 65 61 73 75 72 65 20 74 |55 and m|easure t|
|00004e90| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 73 2e 20 0d |he lumin|ances. .|
|00004ea0| 55 73 65 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |Use the |function|
|00004eb0| 20 4c 54 6f 56 28 29 20 | 74 6f 20 63 6f 6e 76 65 | LToV() |to conve|
|00004ec0| 72 74 20 62 61 63 6b 20 | 74 6f 20 61 20 22 76 6f |rt back |to a "vo|
|00004ed0| 6c 74 61 67 65 22 20 61 | 6e 64 20 63 6f 6d 70 75 |ltage" a|nd compu|
|00004ee0| 74 65 20 74 68 65 20 67 | 61 69 6e 20 6f 66 20 74 |te the g|ain of t|
|00004ef0| 68 65 0d 76 61 72 79 69 | 6e 67 20 44 41 43 2e 20 |he.varyi|ng DAC. |
|00004f00| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 20 74 68 |Note tha|t the th|
|00004f10| 72 65 65 20 44 41 43 73 | 20 6f 6e 20 79 6f 75 72 |ree DACs| on your|
|00004f20| 20 66 72 61 6d 65 73 74 | 6f 72 65 20 77 69 6c 6c | framest|ore will|
|00004f30| 20 67 65 6e 65 72 61 6c | 6c 79 20 68 61 76 65 20 | general|ly have |
|00004f40| 67 61 69 6e 73 20 74 68 | 61 74 0d 6d 61 74 63 68 |gains th|at.match|
|00004f50| 20 74 6f 20 6f 6e 6c 79 | 20 b1 35 25 2e 20 54 68 | to only| .5%. Th|
|00004f60| 69 73 20 63 61 6c 69 62 | 72 61 74 69 6f 6e 20 69 |is calib|ration i|
|00004f70| 73 20 6d 65 61 73 75 72 | 69 6e 67 20 74 68 65 20 |s measur|ing the |
|00004f80| 6f 76 65 72 61 6c 6c 20 | 67 61 69 6e 20 6f 66 20 |overall |gain of |
|00004f90| 65 61 63 68 20 6f 66 20 | 74 68 65 20 74 68 72 65 |each of |the thre|
|00004fa0| 65 0d 70 61 74 68 77 61 | 79 73 2c 20 69 6e 63 6c |e.pathwa|ys, incl|
|00004fb0| 75 64 69 6e 67 20 79 6f | 75 72 20 44 41 43 73 20 |uding yo|ur DACs |
|00004fc0| 61 6e 64 20 74 68 65 20 | 49 53 52 20 56 69 64 65 |and the |ISR Vide|
|00004fd0| 6f 20 41 74 74 65 6e 75 | 61 74 6f 72 2e 09 0d 0d |o Attenu|ator....|
|00004fe0| 4c 49 4d 49 54 41 54 49 | 4f 4e 53 3a 0d 0d 49 74 |LIMITATI|ONS:..It|
|00004ff0| 20 69 73 20 69 6d 70 65 | 72 61 74 69 76 65 20 74 | is impe|rative t|
|00005000| 68 61 74 20 79 6f 75 20 | 63 61 6c 6c 20 47 44 4c |hat you |call GDL|
|00005010| 69 6e 65 61 72 47 61 6d | 6d 61 28 29 20 61 74 20 |inearGam|ma() at |
|00005020| 73 6f 6d 65 20 74 69 6d | 65 20 62 65 66 6f 72 65 |some tim|e before|
|00005030| 20 75 73 69 6e 67 0d 53 | 65 74 4c 75 6d 69 6e 61 | using.S|etLumina|
|00005040| 6e 63 65 73 2e 20 53 65 | 74 4c 75 6d 69 6e 61 6e |nces. Se|tLuminan|
|00005050| 63 65 73 20 41 53 53 55 | 4d 45 53 20 74 68 61 74 |ces ASSU|MES that|
|00005060| 20 6e 6f 20 67 61 6d 6d | 61 20 63 6f 72 72 65 63 | no gamm|a correc|
|00005070| 74 69 6f 6e 20 74 61 6b | 65 73 20 70 6c 61 63 65 |tion tak|es place|
|00005080| 2e 20 59 6f 75 0d 6f 6e | 6c 79 20 6e 65 65 64 20 |. You.on|ly need |
|00005090| 74 6f 20 63 61 6c 6c 20 | 47 44 4c 69 6e 65 61 72 |to call |GDLinear|
|000050a0| 47 61 6d 6d 61 20 6f 6e | 63 65 2e 20 49 74 20 77 |Gamma on|ce. It w|
|000050b0| 69 6c 6c 20 73 74 61 79 | 20 74 68 61 74 20 77 61 |ill stay| that wa|
|000050c0| 79 20 75 6e 74 69 6c 20 | 74 68 65 20 6e 65 78 74 |y until |the next|
|000050d0| 20 74 69 6d 65 0d 79 6f | 75 20 72 65 73 74 61 72 | time.yo|u restar|
|000050e0| 74 20 79 6f 75 72 20 63 | 6f 6d 70 75 74 65 72 2e |t your c|omputer.|
|000050f0| 20 49 6e 63 69 64 65 6e | 74 61 6c 6c 79 2c 20 47 | Inciden|tally, G|
|00005100| 44 4f 70 65 6e 57 69 6e | 64 6f 77 28 29 20 63 61 |DOpenWin|dow() ca|
|00005110| 6c 6c 73 20 47 44 4c 69 | 6e 65 61 72 47 61 6d 6d |lls GDLi|nearGamm|
|00005120| 61 20 66 6f 72 0d 79 6f | 75 2e 0d 0d 54 68 65 20 |a for.yo|u...The |
|00005130| 6c 75 6d 69 6e 61 6e 63 | 65 20 63 61 6c 69 62 72 |luminanc|e calibr|
|00005140| 61 74 69 6f 6e 20 64 61 | 74 61 20 74 68 61 74 20 |ation da|ta that |
|00005150| 79 6f 75 20 73 75 70 70 | 6c 79 20 74 6f 20 53 65 |you supp|ly to Se|
|00005160| 74 4c 75 6d 69 6e 61 6e | 63 65 73 20 6d 75 73 74 |tLuminan|ces must|
|00005170| 20 61 6c 73 6f 20 68 61 | 76 65 0d 62 65 65 6e 20 | also ha|ve.been |
|00005180| 63 6f 6c 6c 65 63 74 65 | 64 20 77 69 74 68 20 6e |collecte|d with n|
|00005190| 6f 20 67 61 6d 6d 61 20 | 63 6f 72 72 65 63 74 69 |o gamma |correcti|
|000051a0| 6f 6e 2c 20 69 2e 65 2e | 20 41 46 54 45 52 20 63 |on, i.e.| AFTER c|
|000051b0| 61 6c 6c 69 6e 67 20 47 | 44 4c 69 6e 65 61 72 47 |alling G|DLinearG|
|000051c0| 61 6d 6d 61 2e 0d 0d 54 | 68 65 20 72 65 61 73 6f |amma...T|he reaso|
|000051d0| 6e 20 74 68 61 74 20 67 | 61 6d 6d 61 20 63 6f 72 |n that g|amma cor|
|000051e0| 72 65 63 74 69 6f 6e 20 | 69 73 20 6e 6f 74 20 61 |rection |is not a|
|000051f0| 6c 6c 6f 77 65 64 20 69 | 73 20 74 68 61 74 20 69 |llowed i|s that i|
|00005200| 74 20 77 6f 75 6c 64 20 | 72 65 73 75 6c 74 20 69 |t would |result i|
|00005210| 6e 20 61 0d 6e 6f 6e 6c | 69 6e 65 61 72 20 74 72 |n a.nonl|inear tr|
|00005220| 61 6e 73 66 6f 72 6d 61 | 74 69 6f 6e 20 6f 66 20 |ansforma|tion of |
|00005230| 74 68 65 20 74 68 72 65 | 65 20 63 68 61 6e 6e 65 |the thre|e channe|
|00005240| 6c 73 20 42 45 46 4f 52 | 45 20 74 68 65 79 20 61 |ls BEFOR|E they a|
|00005250| 72 65 20 63 6f 6d 62 69 | 6e 65 64 20 69 6e 20 74 |re combi|ned in t|
|00005260| 68 65 0d 56 69 64 65 6f | 20 41 74 74 65 6e 75 61 |he.Video| Attenua|
|00005270| 74 6f 72 2e 0d 0d 54 68 | 65 20 6d 65 61 73 75 72 |tor...Th|e measur|
|00005280| 65 6d 65 6e 74 20 6f 66 | 20 74 68 65 20 67 61 69 |ement of| the gai|
|00005290| 6e 73 20 6f 66 20 74 68 | 65 20 74 68 72 65 65 20 |ns of th|e three |
|000052a0| 70 61 74 68 77 61 79 73 | 20 6d 75 73 74 20 62 65 |pathways| must be|
|000052b0| 20 6d 61 64 65 20 75 73 | 69 6e 67 20 59 4f 55 52 | made us|ing YOUR|
|000052c0| 0d 66 72 61 6d 65 73 74 | 6f 72 65 2e 20 54 68 65 |.framest|ore. The|
|000052d0| 20 67 61 69 6e 73 20 6f | 66 20 79 6f 75 72 20 74 | gains o|f your t|
|000052e0| 68 72 65 65 20 44 41 43 | 73 20 77 69 6c 6c 20 69 |hree DAC|s will i|
|000052f0| 6e 20 67 65 6e 65 72 61 | 6c 20 62 65 20 64 69 66 |n genera|l be dif|
|00005300| 66 65 72 65 6e 74 20 66 | 72 6f 6d 20 65 61 63 68 |ferent f|rom each|
|00005310| 0d 6f 74 68 65 72 2c 20 | 61 6e 64 20 64 69 66 66 |.other, |and diff|
|00005320| 65 72 65 6e 74 20 66 72 | 6f 6d 20 66 72 61 6d 65 |erent fr|om frame|
|00005330| 73 74 6f 72 65 20 74 6f | 20 66 72 61 6d 65 73 74 |store to| framest|
|00005340| 6f 72 65 2e 20 42 72 6f | 6f 6b 74 72 65 65 20 67 |ore. Bro|oktree g|
|00005350| 75 61 72 61 6e 74 65 65 | 73 20 74 68 65 0d 6d 61 |uarantee|s the.ma|
|00005360| 74 63 68 69 6e 67 20 6f | 66 20 74 68 65 20 67 61 |tching o|f the ga|
|00005370| 69 6e 73 20 6f 66 20 74 | 68 65 20 74 68 72 65 65 |ins of t|he three|
|00005380| 20 44 41 43 73 20 6f 6e | 20 74 68 65 69 72 20 63 | DACs on| their c|
|00005390| 68 69 70 20 74 6f 20 6f | 6e 6c 79 20 b1 35 25 2e |hip to o|nly .5%.|
|000053a0| 0d 0d 54 68 65 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |..The lu|minance |
|000053b0| 72 65 63 6f 72 64 20 6d | 61 79 20 69 6e 63 6c 75 |record m|ay inclu|
|000053c0| 64 65 20 65 69 74 68 65 | 72 20 61 20 74 61 62 6c |de eithe|r a tabl|
|000053d0| 65 20 6f 66 20 6c 75 6d | 69 6e 61 6e 63 65 20 63 |e of lum|inance c|
|000053e0| 61 6c 69 62 72 61 74 69 | 6f 6e 73 2e 20 49 66 20 |alibrati|ons. If |
|000053f0| 69 74 0d 69 73 20 6e 6f | 74 20 73 75 70 70 6c 69 |it.is no|t suppli|
|00005400| 65 64 20 74 68 65 6e 20 | 69 74 20 77 69 6c 6c 20 |ed then |it will |
|00005410| 62 65 20 73 79 6e 74 68 | 65 73 69 7a 65 64 20 66 |be synth|esized f|
|00005420| 72 6f 6d 20 74 68 65 20 | 70 61 72 61 6d 65 74 65 |rom the |paramete|
|00005430| 72 73 20 6f 66 20 74 68 | 65 0d 70 6f 6c 79 6e 6f |rs of th|e.polyno|
|00005440| 6d 69 61 6c 20 6f 72 20 | 70 6f 77 65 72 20 6c 61 |mial or |power la|
|00005450| 77 20 66 69 74 2e 20 49 | 66 20 74 68 65 20 70 6f |w fit. I|f the po|
|00005460| 77 65 72 2c 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 2c |wer, pol|ynomial,|
|00005470| 20 6f 72 20 71 75 61 64 | 72 61 74 69 63 20 66 69 | or quad|ratic fi|
|00005480| 74 0d 70 61 72 61 6d 65 | 74 65 72 73 20 61 72 65 |t.parame|ters are|
|00005490| 20 6e 6f 74 20 73 75 70 | 70 6c 69 65 64 20 74 68 | not sup|plied th|
|000054a0| 65 6e 20 74 68 65 20 61 | 70 70 72 6f 70 72 69 61 |en the a|ppropria|
|000054b0| 74 65 20 4c 52 2e 70 6f | 77 65 72 45 72 72 6f 72 |te LR.po|werError|
|000054c0| 2c 0d 4c 52 2e 70 6f 6c | 79 6e 6f 6d 69 61 6c 45 |,.LR.pol|ynomialE|
|000054d0| 72 72 6f 72 2c 20 6f 72 | 20 4c 52 2e 71 75 61 64 |rror, or| LR.quad|
|000054e0| 72 61 74 69 63 45 72 72 | 6f 72 20 66 69 65 6c 64 |raticErr|or field|
|000054f0| 20 73 68 6f 75 6c 64 20 | 62 65 20 73 65 74 20 74 | should |be set t|
|00005500| 6f 20 69 6e 66 69 6e 69 | 74 79 0d 28 3d 30 2e 30 |o infini|ty.(=0.0|
|00005510| 2f 31 2e 30 29 2e 0d 09 | 09 09 0d 54 68 65 20 77 |/1.0)...|...The w|
|00005520| 68 6f 6c 65 20 70 61 63 | 6b 61 67 65 20 69 73 20 |hole pac|kage is |
|00005530| 61 74 20 70 72 65 73 65 | 6e 74 20 72 65 73 74 72 |at prese|nt restr|
|00005540| 69 63 74 65 64 20 74 6f | 20 67 72 61 79 73 63 61 |icted to| graysca|
|00005550| 6c 65 2e 0d 54 68 65 72 | 65 20 69 73 20 6e 6f 20 |le..Ther|e is no |
|00005560| 70 72 6f 76 69 73 69 6f | 6e 20 66 6f 72 20 6c 69 |provisio|n for li|
|00005570| 6e 65 61 72 69 7a 69 6e | 67 20 61 20 63 6f 6c 6f |nearizin|g a colo|
|00005580| 72 20 6d 6f 6e 69 74 6f | 72 2e 20 49 6e 20 70 61 |r monito|r. In pa|
|00005590| 72 74 69 63 75 6c 61 72 | 20 69 74 20 69 73 0d 61 |rticular| it is.a|
|000055a0| 73 73 75 6d 65 64 20 74 | 68 61 74 20 74 68 65 20 |ssumed t|hat the |
|000055b0| 74 68 65 20 44 41 43 73 | 20 61 72 65 20 6c 69 6e |the DACs| are lin|
|000055c0| 65 61 72 6c 79 20 63 6f | 6d 62 69 6e 65 64 20 42 |early co|mbined B|
|000055d0| 45 46 4f 52 45 20 74 68 | 65 20 64 69 73 70 6c 61 |EFORE th|e displa|
|000055e0| 79 20 6e 6f 6e 6c 69 6e | 65 61 72 69 74 79 2e 0d |y nonlin|earity..|
|000055f0| 4c 69 6e 65 61 72 69 7a | 69 6e 67 20 6c 75 6d 69 |Lineariz|ing lumi|
|00005600| 6e 61 6e 63 65 20 6f 6e | 20 61 20 63 6f 6c 6f 72 |nance on| a color|
|00005610| 20 64 69 73 70 6c 61 79 | 20 77 6f 75 6c 64 20 6e | display| would n|
|00005620| 65 65 64 20 74 6f 20 61 | 6c 6c 6f 77 20 66 6f 72 |eed to a|llow for|
|00005630| 20 74 68 72 65 65 20 64 | 69 66 66 65 72 65 6e 74 | three d|ifferent|
|00005640| 0d 6e 6f 6e 6c 69 6e 65 | 61 72 20 74 72 61 6e 73 |.nonline|ar trans|
|00005650| 66 6f 72 6d 61 74 69 6f | 6e 73 2e 0d 0d 45 58 50 |formatio|ns...EXP|
|00005660| 4c 41 4e 41 54 49 4f 4e | 20 4f 46 20 54 48 45 20 |LANATION| OF THE |
|00005670| 43 4f 44 45 3a 0d 0d 50 | 68 79 73 69 63 61 6c 6c |CODE:..P|hysicall|
|00005680| 79 20 79 6f 75 72 20 66 | 72 61 6d 65 73 74 6f 72 |y your f|ramestor|
|00005690| 65 20 74 72 61 6e 73 66 | 6f 72 6d 73 20 65 61 63 |e transf|orms eac|
|000056a0| 68 20 43 4c 55 54 20 65 | 6e 74 72 79 20 6e 75 6d |h CLUT e|ntry num|
|000056b0| 62 65 72 20 74 6f 20 61 | 20 76 6f 6c 74 61 67 65 |ber to a| voltage|
|000056c0| 20 74 68 61 74 0d 77 69 | 6c 6c 20 62 65 20 6c 69 | that.wi|ll be li|
|000056d0| 6e 65 61 72 6c 79 20 72 | 65 6c 61 74 65 64 20 74 |nearly r|elated t|
|000056e0| 6f 20 74 68 65 20 6e 75 | 6d 62 65 72 2e 20 54 68 |o the nu|mber. Th|
|000056f0| 65 20 74 68 72 65 65 20 | 6f 75 74 70 75 74 20 76 |e three |output v|
|00005700| 6f 6c 74 61 67 65 73 20 | 77 69 6c 6c 20 62 65 0d |oltages |will be.|
|00005710| 63 6f 6d 62 69 6e 65 64 | 20 62 79 20 74 68 65 20 |combined| by the |
|00005720| 49 53 52 20 56 69 64 65 | 6f 20 41 74 74 65 6e 75 |ISR Vide|o Attenu|
|00005730| 61 74 6f 72 20 74 6f 20 | 70 72 6f 64 75 63 65 20 |ator to |produce |
|00005740| 61 20 73 69 6e 67 6c 65 | 20 76 6f 6c 74 61 67 65 |a single| voltage|
|00005750| 20 77 68 69 63 68 20 64 | 72 69 76 65 73 0d 74 68 | which d|rives.th|
|00005760| 65 20 76 69 64 65 6f 20 | 6d 6f 6e 69 74 6f 72 2e |e video |monitor.|
|00005770| 20 46 69 6e 61 6c 6c 79 | 2c 20 74 68 65 20 64 69 | Finally|, the di|
|00005780| 73 70 6c 61 79 20 6e 6f | 6e 6c 69 6e 65 61 72 6c |splay no|nlinearl|
|00005790| 79 20 74 72 61 6e 73 66 | 6f 72 6d 73 20 56 20 74 |y transf|orms V t|
|000057a0| 6f 20 70 72 6f 64 75 63 | 65 20 61 0d 6c 75 6d 69 |o produc|e a.lumi|
|000057b0| 6e 61 6e 63 65 20 4c 2e | 20 4d 79 20 63 6f 6e 76 |nance L.| My conv|
|000057c0| 65 6e 74 69 6f 6e 20 66 | 6f 72 20 22 6d 65 61 73 |ention f|or "meas|
|000057d0| 75 72 69 6e 67 22 20 74 | 68 65 20 22 76 6f 6c 74 |uring" t|he "volt|
|000057e0| 61 67 65 22 20 56 20 61 | 74 20 74 68 65 20 69 6e |age" V a|t the in|
|000057f0| 70 75 74 20 6f 66 20 74 | 68 65 0d 6d 6f 6e 69 74 |put of t|he.monit|
|00005800| 6f 72 20 69 73 20 74 68 | 61 74 20 56 3d 30 20 77 |or is th|at V=0 w|
|00005810| 68 65 6e 20 61 6c 6c 20 | 74 68 72 65 65 20 44 41 |hen all |three DA|
|00005820| 43 73 20 61 72 65 20 73 | 65 74 20 74 6f 20 7a 65 |Cs are s|et to ze|
|00005830| 72 6f 20 61 6e 64 20 56 | 3d 32 35 35 20 77 68 65 |ro and V|=255 whe|
|00005840| 6e 20 61 6c 6c 20 74 68 | 72 65 65 0d 44 41 43 73 |n all th|ree.DACs|
|00005850| 20 61 72 65 20 73 65 74 | 20 74 6f 20 32 35 35 2e | are set| to 255.|
|00005860| 20 28 54 68 69 73 20 77 | 69 6c 6c 20 62 65 20 6c | (This w|ill be l|
|00005870| 69 6e 65 61 72 6c 79 20 | 72 65 6c 61 74 65 64 20 |inearly |related |
|00005880| 74 6f 20 76 6f 6c 74 73 | 20 6d 65 61 73 75 72 65 |to volts| measure|
|00005890| 64 2c 20 77 69 74 68 20 | 61 0d 76 6f 6c 74 6d 65 |d, with |a.voltme|
|000058a0| 74 65 72 2c 20 61 74 20 | 74 68 65 20 6f 75 74 70 |ter, at |the outp|
|000058b0| 75 74 20 6f 66 20 74 68 | 65 20 56 69 64 65 6f 20 |ut of th|e Video |
|000058c0| 41 74 74 65 6e 75 61 74 | 6f 72 2e 29 20 54 68 65 |Attenuat|or.) The|
|000058d0| 20 76 69 72 74 75 65 20 | 6f 66 20 74 68 65 20 61 | virtue |of the a|
|000058e0| 74 74 65 6e 75 61 74 6f | 72 0d 69 73 20 74 68 61 |ttenuato|r.is tha|
|000058f0| 74 20 69 74 20 61 6c 6c | 6f 77 73 20 75 73 20 74 |t it all|ows us t|
|00005900| 6f 20 70 72 6f 64 75 63 | 65 20 6e 6f 6e 69 6e 74 |o produc|e nonint|
|00005910| 65 67 72 61 6c 20 76 61 | 6c 75 65 73 20 6f 66 20 |egral va|lues of |
|00005920| 56 2e 0d 0d 54 68 65 72 | 65 20 61 72 65 20 74 77 |V...Ther|e are tw|
|00005930| 6f 20 67 69 76 65 6e 73 | 3a 0d 31 2e 20 44 41 43 |o givens|:.1. DAC|
|00005940| 73 20 61 72 65 20 69 6e | 61 63 63 75 72 61 74 65 |s are in|accurate|
|00005950| 2e 20 41 20 67 6f 6f 64 | 20 44 41 43 20 6d 61 79 |. A good| DAC may|
|00005960| 20 62 65 20 73 70 65 63 | 69 66 69 65 64 20 74 6f | be spec|ified to|
|00005970| 20 62 65 20 6d 65 72 65 | 6c 79 20 6d 6f 6e 6f 74 | be mere|ly monot|
|00005980| 6f 6e 69 63 2e 20 46 6f | 72 0d 70 75 72 70 6f 73 |onic. Fo|r.purpos|
|00005990| 65 73 20 6f 66 20 63 6f | 6d 70 75 74 69 6e 67 20 |es of co|mputing |
|000059a0| 74 68 65 20 72 65 74 75 | 72 6e 65 64 20 74 6f 6c |the retu|rned tol|
|000059b0| 65 72 61 6e 63 65 20 76 | 61 6c 75 65 2c 20 49 20 |erance v|alue, I |
|000059c0| 66 6f 6c 6c 6f 77 20 74 | 68 65 20 42 72 6f 6f 6b |follow t|he Brook|
|000059d0| 74 72 65 65 20 44 41 43 | 0d 73 70 65 63 69 66 69 |tree DAC|.specifi|
|000059e0| 63 61 74 69 6f 6e 20 6f | 66 20 b1 31 20 4c 53 42 |cation o|f .1 LSB|
|000059f0| 20 65 72 72 6f 72 20 69 | 6e 20 69 6e 74 65 67 72 | error i|n integr|
|00005a00| 61 74 65 64 20 6c 69 6e | 65 61 72 69 74 79 20 61 |ated lin|earity a|
|00005a10| 6e 64 20 61 73 73 75 6d | 65 20 74 68 61 74 20 74 |nd assum|e that t|
|00005a20| 68 65 20 65 72 72 6f 72 | 0d 69 6e 20 61 6e 79 20 |he error|.in any |
|00005a30| 6c 75 6d 69 6e 61 6e 63 | 65 20 64 69 66 66 65 72 |luminanc|e differ|
|00005a40| 65 6e 63 65 20 69 73 20 | 61 74 20 6d 6f 73 74 20 |ence is |at most |
|00005a50| b1 31 20 4c 53 42 2e 0d | 32 2e 20 57 65 20 77 61 |.1 LSB..|2. We wa|
|00005a60| 6e 74 20 74 6f 20 6d 69 | 6e 69 6d 69 7a 65 20 74 |nt to mi|nimize t|
|00005a70| 68 65 20 65 72 72 6f 72 | 20 69 6e 20 72 65 70 72 |he error| in repr|
|00005a80| 65 73 65 6e 74 69 6e 67 | 20 74 68 65 20 77 61 76 |esenting| the wav|
|00005a90| 65 66 6f 72 6d 2c 20 62 | 75 74 20 61 72 65 20 6e |eform, b|ut are n|
|00005aa0| 6f 74 0d 70 61 72 74 69 | 63 75 6c 61 72 6c 79 20 |ot.parti|cularly |
|00005ab0| 77 6f 72 72 69 65 64 20 | 61 62 6f 75 74 20 74 68 |worried |about th|
|00005ac0| 65 20 65 78 61 63 74 20 | 76 61 6c 75 65 20 6f 66 |e exact |value of|
|00005ad0| 20 74 68 65 20 6d 65 61 | 6e 20 6c 75 6d 69 6e 61 | the mea|n lumina|
|00005ae0| 6e 63 65 2e 20 54 68 75 | 73 2c 20 69 66 20 77 65 |nce. Thu|s, if we|
|00005af0| 0d 68 61 76 65 20 44 41 | 43 73 20 77 69 74 68 20 |.have DA|Cs with |
|00005b00| 64 69 66 66 65 72 65 6e | 74 20 67 61 69 6e 73 20 |differen|t gains |
|00005b10| 77 65 20 6d 61 79 20 66 | 69 78 20 74 68 65 20 63 |we may f|ix the c|
|00005b20| 6f 61 72 73 65 20 44 41 | 43 73 20 74 6f 20 73 65 |oarse DA|Cs to se|
|00005b30| 74 20 74 68 65 20 6d 65 | 61 6e 0d 6c 75 6d 69 6e |t the me|an.lumin|
|00005b40| 61 6e 63 65 20 61 6e 64 | 20 76 61 72 79 20 74 68 |ance and| vary th|
|00005b50| 65 20 66 69 6e 65 20 44 | 41 43 73 20 74 6f 20 70 |e fine D|ACs to p|
|00005b60| 72 6f 64 75 63 65 20 74 | 68 65 20 6c 69 6e 65 61 |roduce t|he linea|
|00005b70| 72 20 72 61 6e 67 65 20 | 6f 66 20 6c 75 6d 69 6e |r range |of lumin|
|00005b80| 61 6e 63 65 73 0d 72 65 | 71 75 65 73 74 65 64 2e |ances.re|quested.|
|00005b90| 0d 0d 48 65 72 65 27 73 | 20 74 68 65 20 73 74 72 |..Here's| the str|
|00005ba0| 61 74 65 67 79 2e 20 57 | 65 20 77 61 6e 74 20 74 |ategy. W|e want t|
|00005bb0| 6f 20 63 6f 76 65 72 20 | 74 68 65 20 72 61 6e 67 |o cover |the rang|
|00005bc0| 65 20 4c 30 20 74 6f 20 | 4c 6e 20 77 69 74 68 20 |e L0 to |Ln with |
|00005bd0| 74 68 65 20 73 6d 61 6c | 6c 65 73 74 0d 70 6f 73 |the smal|lest.pos|
|00005be0| 73 69 62 6c 65 20 65 72 | 72 6f 72 20 69 6e 20 4c |sible er|ror in L|
|00005bf0| 2d 4c 30 2e 0d 0d 53 74 | 65 70 73 20 31 20 74 6f |-L0...St|eps 1 to|
|00005c00| 20 35 20 68 61 70 70 65 | 6e 20 69 6e 20 53 65 74 | 5 happe|n in Set|
|00005c10| 4c 75 6d 69 6e 61 6e 63 | 65 52 61 6e 67 65 3a 0d |Luminanc|eRange:.|
|00005c20| 31 2e 20 53 6f 72 74 20 | 74 68 65 20 44 41 43 73 |1. Sort |the DACs|
|00005c30| 20 62 79 20 67 61 69 6e | 20 67 2c 20 77 68 65 72 | by gain| g, wher|
|00005c40| 65 20 67 61 69 6e 20 69 | 73 20 64 65 66 69 6e 65 |e gain i|s define|
|00005c50| 64 20 61 73 20 74 68 65 | 20 63 68 61 6e 67 65 20 |d as the| change |
|00005c60| 69 6e 20 56 20 77 68 65 | 6e 0d 61 20 73 69 6e 67 |in V whe|n.a sing|
|00005c70| 6c 65 20 44 41 43 20 69 | 73 20 69 6e 63 72 65 61 |le DAC i|s increa|
|00005c80| 73 65 64 20 66 72 6f 6d | 20 30 20 74 6f 20 32 35 |sed from| 0 to 25|
|00005c90| 35 2c 20 73 6f 20 67 30 | 2b 67 31 2b 67 32 3d 31 |5, so g0|+g1+g2=1|
|00005ca0| 2e 20 4c 65 74 20 74 68 | 65 20 67 61 69 6e 73 20 |. Let th|e gains |
|00005cb0| 62 65 20 67 30 3e 67 31 | 3e 67 32 2e 20 0d 32 2e |be g0>g1|>g2. .2.|
|00005cc0| 20 54 72 61 6e 73 66 6f | 72 6d 20 74 68 65 20 6c | Transfo|rm the l|
|00005cd0| 75 6d 69 6e 61 6e 63 65 | 20 72 61 6e 67 65 20 74 |uminance| range t|
|00005ce0| 6f 20 61 20 6e 6f 6d 69 | 6e 61 6c 20 76 6f 6c 74 |o a nomi|nal volt|
|00005cf0| 61 67 65 20 72 61 6e 67 | 65 20 6c 6f 77 56 20 61 |age rang|e lowV a|
|00005d00| 6e 64 20 68 69 67 68 56 | 2e 0d 33 2e 20 44 65 63 |nd highV|..3. Dec|
|00005d10| 69 64 65 20 77 68 69 63 | 68 20 44 41 43 73 20 73 |ide whic|h DACs s|
|00005d20| 68 6f 75 6c 64 20 62 65 | 20 76 61 72 69 61 62 6c |hould be| variabl|
|00005d30| 65 20 61 6e 64 20 77 68 | 69 63 68 20 73 68 6f 75 |e and wh|ich shou|
|00005d40| 6c 64 20 62 65 20 66 69 | 78 65 64 2c 0d 73 6f 20 |ld be fi|xed,.so |
|00005d50| 61 73 20 74 68 65 20 6d | 69 6e 69 6d 69 7a 65 20 |as the m|inimize |
|00005d60| 74 68 65 20 74 6f 6c 65 | 72 61 6e 63 65 20 69 6e |the tole|rance in|
|00005d70| 20 74 68 65 20 6c 75 6d | 69 6e 61 6e 63 65 20 69 | the lum|inance i|
|00005d80| 6e 63 72 65 6d 65 6e 74 | 73 2e 0d 34 2e 20 54 65 |ncrement|s..4. Te|
|00005d90| 6d 70 6f 72 61 72 69 6c | 79 20 73 65 74 20 74 68 |mporaril|y set th|
|00005da0| 65 20 76 61 72 69 61 62 | 6c 65 20 44 41 43 73 20 |e variab|le DACs |
|00005db0| 74 6f 20 74 68 65 69 72 | 20 6d 69 64 70 6f 69 6e |to their| midpoin|
|00005dc0| 74 73 2e 20 4e 6f 77 20 | 73 65 74 20 74 68 65 20 |ts. Now |set the |
|00005dd0| 66 69 78 65 64 20 44 41 | 43 73 20 74 6f 0d 6d 6f |fixed DA|Cs to.mo|
|00005de0| 73 74 20 61 63 63 75 72 | 61 74 65 6c 79 20 72 65 |st accur|ately re|
|00005df0| 70 72 65 73 65 6e 74 20 | 74 68 65 20 6d 69 64 70 |present |the midp|
|00005e00| 6f 69 6e 74 20 6f 66 20 | 74 68 65 20 6e 6f 6d 69 |oint of |the nomi|
|00005e10| 6e 61 6c 20 76 6f 6c 74 | 61 67 65 20 72 61 6e 67 |nal volt|age rang|
|00005e20| 65 2c 20 28 6c 6f 77 56 | 2b 68 69 67 68 56 29 2f |e, (lowV|+highV)/|
|00005e30| 32 2e 0d 35 2e 20 49 66 | 20 6e 65 63 65 73 73 61 |2..5. If| necessa|
|00005e40| 72 79 2c 20 63 6f 6d 70 | 75 74 65 20 61 20 73 6d |ry, comp|ute a sm|
|00005e50| 61 6c 6c 20 6c 75 6d 69 | 6e 61 6e 63 65 20 6f 66 |all lumi|nance of|
|00005e60| 66 73 65 74 20 4c 53 68 | 69 66 74 20 74 6f 20 62 |fset LSh|ift to b|
|00005e70| 72 69 6e 67 20 74 68 65 | 20 72 65 71 75 65 73 74 |ring the| request|
|00005e80| 65 64 20 72 61 6e 67 65 | 20 0d 6c 6f 77 56 20 74 |ed range| .lowV t|
|00005e90| 6f 20 68 69 67 68 56 20 | 69 6e 74 6f 20 74 68 65 |o highV |into the|
|00005ea0| 20 72 61 6e 67 65 20 61 | 74 74 61 69 6e 61 62 6c | range a|ttainabl|
|00005eb0| 65 20 62 79 20 74 68 65 | 20 76 61 72 69 61 62 6c |e by the| variabl|
|00005ec0| 65 20 44 41 43 73 2e 20 | 28 54 68 69 73 20 69 73 |e DACs. |(This is|
|00005ed0| 20 6e 65 63 65 73 73 61 | 72 79 0d 62 65 63 61 75 | necessa|ry.becau|
|00005ee0| 73 65 20 74 68 65 20 63 | 65 6e 74 65 72 69 6e 67 |se the c|entering|
|00005ef0| 20 69 6e 20 73 74 65 70 | 20 34 20 6d 61 79 20 6e | in step| 4 may n|
|00005f00| 6f 74 20 62 65 20 70 72 | 65 63 69 73 65 20 65 6e |ot be pr|ecise en|
|00005f10| 6f 75 67 68 2e 29 0d 0d | 53 74 65 70 20 36 20 68 |ough.)..|Step 6 h|
|00005f20| 61 70 70 65 6e 73 20 69 | 6e 20 5f 53 65 74 4c 75 |appens i|n _SetLu|
|00005f30| 6d 69 6e 61 6e 63 65 3a | 0d 36 2e 20 53 65 74 20 |minance:|.6. Set |
|00005f40| 74 68 65 20 76 61 72 69 | 61 62 6c 65 20 44 41 43 |the vari|able DAC|
|00005f50| 73 20 69 6e 20 74 68 65 | 20 43 6f 6c 6f 72 53 70 |s in the| ColorSp|
|00005f60| 65 63 20 65 6e 74 72 79 | 20 73 6f 20 61 73 20 74 |ec entry| so as t|
|00005f70| 6f 20 6d 6f 73 74 20 61 | 63 63 75 72 61 74 65 6c |o most a|ccuratel|
|00005f80| 79 20 72 65 70 72 65 73 | 65 6e 74 0d 4c 2b 4c 53 |y repres|ent.L+LS|
|00005f90| 68 69 66 74 2e 0d 0d 53 | 65 74 4c 75 6d 69 6e 61 |hift...S|etLumina|
|00005fa0| 6e 63 65 73 28 29 2c 20 | 53 65 74 4c 75 6d 69 6e |nces(), |SetLumin|
|00005fb0| 61 6e 63 65 73 41 6e 64 | 52 61 6e 67 65 28 29 2c |ancesAnd|Range(),|
|00005fc0| 20 61 6e 64 20 53 65 74 | 4c 75 6d 69 6e 61 6e 63 | and Set|Luminanc|
|00005fd0| 65 28 29 20 61 6c 6c 20 | 63 61 6c 6c 20 5f 53 65 |e() all |call _Se|
|00005fe0| 74 4c 75 6d 69 6e 61 6e | 63 65 28 29 2e 0d 23 65 |tLuminan|ce()..#e|
|00005ff0| 6e 64 69 66 00 00 00 00 | 00 00 00 00 00 00 00 00 |ndif....|........|
|00006000| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00006010| 61 62 6c 65 73 00 01 62 | 6d 61 70 4f 66 66 73 65 |ables..b|mapOffse|
|00006020| 74 00 01 b8 73 74 72 4f | 66 66 73 65 74 00 03 a4 |t...strO|ffset...|
|00006030| 0d 4c 75 6d 69 6e 61 6e | 63 65 2e 64 6f 63 02 00 |.Luminan|ce.doc..|
|00006040| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 64 03 00 |..TEXTCW|IE...d..|
|00006050| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 64 03 00 |..TEXTCW|IE...d..|
|00006060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006070| 00 00 ac 8e 0c 34 00 00 | 5f 74 00 00 01 9a 72 65 |.....4..|_t....re|
|00006080| 73 4f 66 66 73 65 74 38 | 00 02 c3 72 65 73 4c 65 |sOffset8|...resLe|
|00006090| 6e 67 74 68 31 00 02 c4 | 72 65 73 4c 65 6e 67 74 |ngth1...|resLengt|
|000060a0| 68 32 00 02 c5 72 65 73 | 4c 65 6e 67 74 68 33 00 |h2...res|Length3.|
|000060b0| 05 99 75 6e 54 6f 6b 65 | 6e 4c 65 6e 67 74 68 00 |..unToke|nLength.|
|000060c0| 06 49 64 65 66 50 61 72 | 74 73 4c 65 6e 67 74 68 |.IdefPar|tsLength|
|000060d0| 00 07 94 77 68 74 53 70 | 4c 69 73 74 4c 65 6e 67 |...whtSp|ListLeng|
|000060e0| 74 68 00 02 c9 72 65 73 | 4c 65 6e 67 74 68 37 00 |th...res|Length7.|
|000060f0| 02 ca 72 65 73 4c 65 6e | 67 74 68 38 00 07 e0 49 |..resLen|gth8...I|
|00006100| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00006110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006120| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 03 01 ba |........|...W....|
|00006130| 02 7d 00 57 00 03 01 ba | 02 7d ac 8e 0f c6 00 00 |.}.W....|.}......|
|00006140| 00 13 00 00 00 13 00 00 | 00 00 00 00 00 00 00 04 |........|........|
|00006150| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00006160| 00 00 00 46 01 d7 4f 68 | 34 84 00 00 00 1c 00 46 |...F..Oh|4......F|
|00006170| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00006180| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00006190| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000061a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+