home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / texmf / source / SpecHost / Luminance.asm < prev    next >
Assembly Source File  |  1994-05-27  |  9KB  |  99 lines

  1. **
  2. **    SpecialHost for PasTeX
  3. **
  4. **    Copyright © by Olaf Barthel & Georg Heßmann
  5. **
  6.  
  7.     csect    text,0,0,1,2
  8.  
  9.     ;    UBYTE __asm Luminance(register __d0 WORD R,register __d1 WORD G,register __d2 WORD B);
  10.  
  11.     xdef    _Luminance
  12.  
  13. _Luminance:
  14.  
  15.     lea.l    _LumR(a4),a0        ; Tabellenanfang, Rotwerte
  16.  
  17.     IFD    VANILLA
  18.     add.w    d0,d0
  19.     add.w    d0,d0
  20.     move.l    0(a0,d0.w),d0        ; Rotwert aus der Tabelle holen
  21.     add.w    d1,d1
  22.     add.w    d1,d1
  23.     add.w    #_LumG-_LumR,d1
  24.     add.l    0(a0,d1.w),d0        ; Grünwert aus der Tabelle addieren
  25.     add.w    d2,d2
  26.     add.w    d2,d2
  27.     add.w    #_LumB-_LumR,d2
  28.     add.l    0(a0,d2.w),d0        ; Blauwert aus der Tabelle addieren
  29.     ELSE
  30.     move.l    0(a0,d0.w*4),d0        ; Rotwert aus der Tabelle holen
  31.     add.l    _LumG-_LumR(a0,d1.w*4),d0    ; Grünwert aus der Tabelle addieren
  32.     add.l    _LumB-_LumR(a0,d2.w*4),d0    ; Blauwert aus der Tabelle addieren
  33.     ENDC
  34.  
  35.     clr.w    d0            ; Die unteren 16 Bit löschen
  36.     swap    d0            ; Summe durch 65536 teilen
  37.     rts                ; Ergebnis abliefern
  38.  
  39.     csect    __MERGED,DATA
  40.  
  41.     xdef    _LumR
  42.  
  43. _LumR:    dc.l    $00000000,$00004c8b,$00009916,$0000e5a1,$0001322d,$00017eb8,$0001cb43,$000217ce,$0002645a,$0002b0e5,$0002fd70,$000349fb,$00039687,$0003e312,$00042f9d,$00047c28
  44.     dc.l    $0004c8b4,$0005153f,$000561ca,$0005ae56,$0005fae1,$0006476c,$000693f7,$0006e083,$00072d0e,$00077999,$0007c624,$000812b0,$00085f3b,$0008abc6,$0008f851,$000944dd
  45.     dc.l    $00099168,$0009ddf3,$000a2a7e,$000a770a,$000ac395,$000b1020,$000b5cac,$000ba937,$000bf5c2,$000c424d,$000c8ed9,$000cdb64,$000d27ef,$000d747a,$000dc106,$000e0d91
  46.     dc.l    $000e5a1c,$000ea6a7,$000ef333,$000f3fbe,$000f8c49,$000fd8d4,$00102560,$001071eb,$0010be76,$00110b02,$0011578d,$0011a418,$0011f0a3,$00123d2f,$001289ba,$0012d645
  47.     dc.l    $001322d0,$00136f5c,$0013bbe7,$00140872,$001454fd,$0014a189,$0014ee14,$00153a9f,$0015872b,$0015d3b6,$00162041,$00166ccc,$0016b958,$001705e3,$0017526e,$00179ef9
  48.     dc.l    $0017eb85,$00183810,$0018849b,$0018d126,$00191db2,$00196a3d,$0019b6c8,$001a0353,$001a4fdf,$001a9c6a,$001ae8f5,$001b3581,$001b820c,$001bce97,$001c1b22,$001c67ae
  49.     dc.l    $001cb439,$001d00c4,$001d4d4f,$001d99db,$001de666,$001e32f1,$001e7f7c,$001ecc08,$001f1893,$001f651e,$001fb1a9,$001ffe35,$00204ac0,$0020974b,$0020e3d7,$00213062
  50.     dc.l    $00217ced,$0021c978,$00221604,$0022628f,$0022af1a,$0022fba5,$00234831,$002394bc,$0023e147,$00242dd2,$00247a5e,$0024c6e9,$00251374,$00255fff,$0025ac8b,$0025f916
  51.     dc.l    $002645a1,$0026922d,$0026deb8,$00272b43,$002777ce,$0027c45a,$002810e5,$00285d70,$0028a9fb,$0028f687,$00294312,$00298f9d,$0029dc28,$002a28b4,$002a753f,$002ac1ca
  52.     dc.l    $002b0e56,$002b5ae1,$002ba76c,$002bf3f7,$002c4083,$002c8d0e,$002cd999,$002d2624,$002d72b0,$002dbf3b,$002e0bc6,$002e5851,$002ea4dd,$002ef168,$002f3df3,$002f8a7e
  53.     dc.l    $002fd70a,$00302395,$00307020,$0030bcac,$00310937,$003155c2,$0031a24d,$0031eed9,$00323b64,$003287ef,$0032d47a,$00332106,$00336d91,$0033ba1c,$003406a7,$00345333
  54.     dc.l    $00349fbe,$0034ec49,$003538d4,$00358560,$0035d1eb,$00361e76,$00366b02,$0036b78d,$00370418,$003750a3,$00379d2f,$0037e9ba,$00383645,$003882d0,$0038cf5c,$00391be7
  55.     dc.l    $00396872,$0039b4fd,$003a0189,$003a4e14,$003a9a9f,$003ae72b,$003b33b6,$003b8041,$003bcccc,$003c1958,$003c65e3,$003cb26e,$003cfef9,$003d4b85,$003d9810,$003de49b
  56.     dc.l    $003e3126,$003e7db2,$003eca3d,$003f16c8,$003f6353,$003fafdf,$003ffc6a,$004048f5,$00409581,$0040e20c,$00412e97,$00417b22,$0041c7ae,$00421439,$004260c4,$0042ad4f
  57.     dc.l    $0042f9db,$00434666,$004392f1,$0043df7c,$00442c08,$00447893,$0044c51e,$004511a9,$00455e35,$0045aac0,$0045f74b,$004643d7,$00469062,$0046dced,$00472978,$00477604
  58.     dc.l    $0047c28f,$00480f1a,$00485ba5,$0048a831,$0048f4bc,$00494147,$00498dd2,$0049da5e,$004a26e9,$004a7374,$004abfff,$004b0c8b,$004b5916,$004ba5a1,$004bf22d,$004c3eb8
  59.  
  60.     xdef    _LumG
  61.  
  62. _LumG:    dc.l    $00000000,$00009646,$00012c8c,$0001c2d2,$00025917,$0002ef5d,$000385a3,$00041be9,$0004b22e,$00054874,$0005deb9,$000674ff,$00070b44,$0007a18a,$000837d0,$0008ce16
  63.     dc.l    $0009645b,$0009faa1,$000a90e7,$000b272c,$000bbd71,$000c53b7,$000ce9fd,$000d8042,$000e1688,$000eacce,$000f4314,$000fd959,$00106f9f,$001105e4,$00119c2a,$0012326f
  64.     dc.l    $0012c8b5,$00135efb,$0013f541,$00148b86,$001521cc,$0015b812,$00164e57,$0016e49c,$00177ae2,$00181128,$0018a76d,$00193db3,$0019d3f9,$001a6a3f,$001b0084,$001b96ca
  65.     dc.l    $001c2d10,$001cc355,$001d599a,$001defe0,$001e8626,$001f1c6c,$001fb2b1,$002048f7,$0020df3d,$00217582,$00220bc7,$0022a20d,$00233853,$0023ce98,$002464de,$0024fb24
  66.     dc.l    $0025916a,$002627af,$0026bdf5,$0027543b,$0027ea80,$002880c5,$0029170b,$0029ad51,$002a4396,$002ad9dc,$002b7022,$002c0668,$002c9cad,$002d32f2,$002dc938,$002e5f7e
  67.     dc.l    $002ef5c3,$002f8c09,$0030224f,$0030b895,$00314eda,$0031e520,$00327b66,$003311ab,$0033a7f0,$00343e36,$0034d47c,$00356ac1,$00360107,$0036974d,$00372d93,$0037c3d8
  68.     dc.l    $00385a1e,$0038f063,$003986a9,$003a1cee,$003ab334,$003b497a,$003bdfc0,$003c7605,$003d0c4b,$003da291,$003e38d6,$003ecf1b,$003f6561,$003ffba7,$004091ec,$00412832
  69.     dc.l    $0041be78,$004254be,$0042eb03,$00438149,$0044178e,$0044add4,$00454419,$0045da5f,$004670a5,$004706eb,$00479d30,$00483376,$0048c9bc,$00496001,$0049f646,$004a8c8c
  70.     dc.l    $004b22d2,$004bb917,$004c4f5d,$004ce5a3,$004d7be9,$004e122e,$004ea874,$004f3eb9,$004fd4ff,$00506b44,$0051018a,$005197d0,$00522e16,$0052c45b,$00535aa1,$0053f0e7
  71.     dc.l    $0054872c,$00551d71,$0055b3b7,$005649fd,$0056e042,$00577688,$00580cce,$0058a314,$00593959,$0059cf9f,$005a65e4,$005afc2a,$005b926f,$005c28b5,$005cbefb,$005d5541
  72.     dc.l    $005deb86,$005e81cc,$005f1812,$005fae57,$0060449c,$0060dae2,$00617128,$0062076d,$00629db3,$006333f9,$0063ca3f,$00646084,$0064f6ca,$00658d10,$00662355,$0066b99a
  73.     dc.l    $00674fe0,$0067e626,$00687c6c,$006912b1,$0069a8f7,$006a3f3d,$006ad582,$006b6bc7,$006c020d,$006c9853,$006d2e98,$006dc4de,$006e5b24,$006ef16a,$006f87af,$00701df5
  74.     dc.l    $0070b43b,$00714a80,$0071e0c5,$0072770b,$00730d51,$0073a396,$007439dc,$0074d022,$00756668,$0075fcad,$007692f2,$00772938,$0077bf7e,$007855c3,$0078ec09,$0079824f
  75.     dc.l    $007a1895,$007aaeda,$007b4520,$007bdb66,$007c71ab,$007d07f0,$007d9e36,$007e347c,$007ecac1,$007f6107,$007ff74d,$00808d93,$008123d8,$0081ba1e,$00825063,$0082e6a9
  76.     dc.l    $00837cee,$00841334,$0084a97a,$00853fc0,$0085d605,$00866c4b,$00870291,$008798d6,$00882f1b,$0088c561,$00895ba7,$0089f1ec,$008a8832,$008b1e78,$008bb4be,$008c4b03
  77.     dc.l    $008ce149,$008d778e,$008e0dd4,$008ea419,$008f3a5f,$008fd0a5,$009066eb,$0090fd30,$00919376,$009229bc,$0092c001,$00935646,$0093ec8c,$009482d2,$00951917,$0095af5d
  78.  
  79.     xdef    _LumB
  80.  
  81. _LumB:    dc.l    $00000000,$00001d2f,$00003a5e,$0000578d,$000074bc,$000091eb,$0000af1a,$0000cc49,$0000e978,$000106a7,$000123d7,$00014106,$00015e35,$00017b64,$00019893,$0001b5c2
  82.     dc.l    $0001d2f1,$0001f020,$00020d4f,$00022a7e,$000247ae,$000264dd,$0002820c,$00029f3b,$0002bc6a,$0002d999,$0002f6c8,$000313f7,$00033126,$00034e56,$00036b85,$000388b4
  83.     dc.l    $0003a5e3,$0003c312,$0003e041,$0003fd70,$00041a9f,$000437ce,$000454fd,$0004722d,$00048f5c,$0004ac8b,$0004c9ba,$0004e6e9,$00050418,$00052147,$00053e76,$00055ba5
  84.     dc.l    $000578d4,$00059604,$0005b333,$0005d062,$0005ed91,$00060ac0,$000627ef,$0006451e,$0006624d,$00067f7c,$00069cac,$0006b9db,$0006d70a,$0006f439,$00071168,$00072e97
  85.     dc.l    $00074bc6,$000768f5,$00078624,$0007a353,$0007c083,$0007ddb2,$0007fae1,$00081810,$0008353f,$0008526e,$00086f9d,$00088ccc,$0008a9fb,$0008c72b,$0008e45a,$00090189
  86.     dc.l    $00091eb8,$00093be7,$00095916,$00097645,$00099374,$0009b0a3,$0009cdd2,$0009eb02,$000a0831,$000a2560,$000a428f,$000a5fbe,$000a7ced,$000a9a1c,$000ab74b,$000ad47a
  87.     dc.l    $000af1a9,$000b0ed9,$000b2c08,$000b4937,$000b6666,$000b8395,$000ba0c4,$000bbdf3,$000bdb22,$000bf851,$000c1581,$000c32b0,$000c4fdf,$000c6d0e,$000c8a3d,$000ca76c
  88.     dc.l    $000cc49b,$000ce1ca,$000cfef9,$000d1c28,$000d3958,$000d5687,$000d73b6,$000d90e5,$000dae14,$000dcb43,$000de872,$000e05a1,$000e22d0,$000e4000,$000e5d2f,$000e7a5e
  89.     dc.l    $000e978d,$000eb4bc,$000ed1eb,$000eef1a,$000f0c49,$000f2978,$000f46a7,$000f63d7,$000f8106,$000f9e35,$000fbb64,$000fd893,$000ff5c2,$001012f1,$00103020,$00104d4f
  90.     dc.l    $00106a7e,$001087ae,$0010a4dd,$0010c20c,$0010df3b,$0010fc6a,$00111999,$001136c8,$001153f7,$00117126,$00118e56,$0011ab85,$0011c8b4,$0011e5e3,$00120312,$00122041
  91.     dc.l    $00123d70,$00125a9f,$001277ce,$001294fd,$0012b22d,$0012cf5c,$0012ec8b,$001309ba,$001326e9,$00134418,$00136147,$00137e76,$00139ba5,$0013b8d4,$0013d604,$0013f333
  92.     dc.l    $00141062,$00142d91,$00144ac0,$001467ef,$0014851e,$0014a24d,$0014bf7c,$0014dcac,$0014f9db,$0015170a,$00153439,$00155168,$00156e97,$00158bc6,$0015a8f5,$0015c624
  93.     dc.l    $0015e353,$00160083,$00161db2,$00163ae1,$00165810,$0016753f,$0016926e,$0016af9d,$0016cccc,$0016e9fb,$0017072b,$0017245a,$00174189,$00175eb8,$00177be7,$00179916
  94.     dc.l    $0017b645,$0017d374,$0017f0a3,$00180dd2,$00182b02,$00184831,$00186560,$0018828f,$00189fbe,$0018bced,$0018da1c,$0018f74b,$0019147a,$001931a9,$00194ed9,$00196c08
  95.     dc.l    $00198937,$0019a666,$0019c395,$0019e0c4,$0019fdf3,$001a1b22,$001a3851,$001a5581,$001a72b0,$001a8fdf,$001aad0e,$001aca3d,$001ae76c,$001b049b,$001b21ca,$001b3ef9
  96.     dc.l    $001b5c28,$001b7958,$001b9687,$001bb3b6,$001bd0e5,$001bee14,$001c0b43,$001c2872,$001c45a1,$001c62d0,$001c8000,$001c9d2f,$001cba5e,$001cd78d,$001cf4bc,$001d11eb
  97.  
  98.     end
  99.