home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Graphics / PerfectPaint / rexx / circle / LensFlare.rx < prev    next >
Text File  |  2000-08-16  |  15KB  |  689 lines

  1. /*
  2.     Draw and Anim Lens Flare
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.   parse ARG Port x1 y1 r2 b
  9.     ADDRESS value Port
  10.  
  11.     pp_CountFrames
  12.     Total_Frame=result
  13.     if Total_Frame=0 then Total_Frame=1
  14.     Start_Frame=1
  15.     End_Frame=Total_Frame
  16.  
  17.     pp_GetDepth
  18.     Dp=result
  19.  
  20.     Anim=0;Path=0;Type=0
  21.     Light=0
  22.     Start_B1=100;End_B1=100
  23.     Start_B2=48;End_B2=48
  24.     Start_S=r2;End_S=r2
  25.     Arti=1
  26.     Glob=0
  27.  
  28.     Pi=3.1415926/180
  29.     totalR=r2*2
  30.     RayShade=100-Start_B1
  31.     NbStar=8
  32.  
  33.     ADDRESS COMMAND
  34.     file="Ram:T/pp_lens"
  35.     IF OPEN('b',file,'R') then DO
  36.         Anim=READLN('b')
  37.         Path=READLN('b')
  38.         Type=READLN('b')
  39.         Light=READLN('b')
  40.         Start_B1=READLN('b')
  41.         End_B1=READLN('b')
  42.         Start_B2=READLN('b')
  43.         End_B2=READLN('b')
  44.         Arti=READLN('b')
  45.         Glob=READLN('b')
  46.         CALL CLOSE('b')
  47.     END
  48.  
  49.     ADDRESS value Port
  50.     R=-1
  51.  
  52. DO UNTIL R>-1
  53.  
  54.     pp_DialogInit 250 270 "*LENS*FLARE*" 10
  55.     pp_Cycle 0 70 5 100 16 "Animation" 1 "No|Yes" Anim
  56.     pp_Cycle 1 70 35 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
  57.     pp_Cycle 2 70 53 100 16 "Type" 1 "In|Out" Type
  58.     pp_Button 3 20 71 200 16 '*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
  59.     
  60.     pp_Cycle 4 70 100 100 16 "Light" 1 "Rays|Glow|Star" Light
  61.     pp_Button 5 20 118 200 16 '*Brightness*(*'||Start_B1||'*->*'||End_B1||'*)*'
  62.     pp_Button 6 20 136 200 16 '*Size*(*'||Start_S||'*->*'||End_S||'*)*'
  63.  
  64.     pp_Cycle 7 70 165 100 16 "Artifacts" 1 "None|Standard|Spot|Spot2" Arti
  65.  
  66.     pp_Cycle 8 70 194 100 16 "Globals" 1 "Red|Blue|Yellow|White" Glob
  67.     pp_Button 9 20 212 200 16 '*Brightness*(*'||Start_B2||'*->*'||End_B2||'*)*'
  68.     
  69.     pp_Dialog
  70.     R=result
  71.  
  72.     pp_GetDialog 0
  73.     Anim=result
  74.  
  75.     pp_GetDialog 1
  76.     Path=result
  77.  
  78.     pp_GetDialog 2
  79.     Type=result
  80.  
  81.     pp_GetDialog 4
  82.     Light=result
  83.  
  84.     pp_GetDialog 7
  85.     Arti=result
  86.  
  87.     pp_GetDialog 8
  88.     Glob=result
  89.  
  90.     if R=-3 then DO
  91.         pp_DialogInit 150 80 "*FRAME*" 2
  92.             pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
  93.             pp_Integer 1 60 25 50 16 "End" 1 End_Frame
  94.         pp_Dialog
  95.         rc=result
  96.         IF rc=1 then DO
  97.             pp_GetDialog 0
  98.             Start_Frame=result
  99.  
  100.             pp_GetDialog 1
  101.             End_Frame=result
  102.  
  103.             IF End_Frame>Total_Frame THEN DO
  104.                 End_Frame=Total_Frame
  105.             END
  106.  
  107.             IF Start_Frame>End_Frame THEN DO
  108.                 Start_Frame=1
  109.             END
  110.  
  111.         END            
  112.     END
  113.  
  114.     if R=-5 then DO
  115.         if Anim=1 then DO
  116.             pp_DialogInit 150 75 "*LIGHT.BRIGHTNESS*" 2
  117.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B1
  118.             pp_Integer 1 60 25 50 16 "End" 1 End_B1
  119.             pp_Dialog
  120.             rc=result
  121.             IF rc=1 then DO
  122.                 pp_GetDialog 0
  123.                 Start_B1=result
  124.                 pp_GetDialog 1
  125.                 End_B1=result        
  126.             END
  127.         END
  128.         ELSE DO
  129.             pp_DialogInit 150 55 "*LIGHT.BRIGHTNESS*" 1
  130.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B1
  131.             pp_Dialog
  132.             rc=result
  133.             IF rc=1 then DO
  134.                 pp_GetDialog 0
  135.                 Start_B1=result
  136.                 End_B1=result        
  137.             END
  138.         END            
  139.     END
  140.  
  141.     if R=-6 then DO
  142.         if Anim=1 then DO
  143.             pp_DialogInit 150 75 "*LIGHT.SIZE*" 2
  144.             pp_Integer 0 60 5 50 16 "Start" 1 Start_S
  145.             pp_Integer 1 60 25 50 16 "End" 1 End_S
  146.             pp_Dialog
  147.             rc=result
  148.             IF rc=1 then DO
  149.                 pp_GetDialog 0
  150.                 Start_S=result
  151.                 pp_GetDialog 1
  152.                 End_S=result        
  153.             END
  154.         END
  155.         ELSE DO
  156.             pp_DialogInit 150 55 "*LIGHT.SIZE*" 1
  157.             pp_Integer 0 60 5 50 16 "Size" 1 Start_S
  158.             pp_Dialog
  159.             rc=result
  160.             IF rc=1 then DO
  161.                 pp_GetDialog 0
  162.                 Start_S=result
  163.                 End_S=result        
  164.             END
  165.         END            
  166.     END
  167.  
  168.     if R=-9 then DO
  169.         if Anim=1 then DO
  170.             pp_DialogInit 150 75 "*GLOBAL.BRIGHTNESS*" 2
  171.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B2
  172.             pp_Integer 1 60 25 50 16 "End" 1 End_B2
  173.             pp_Dialog
  174.             rc=result
  175.             IF rc=1 then DO
  176.                 pp_GetDialog 0
  177.                 Start_B2=result
  178.                 pp_GetDialog 1
  179.                 End_B2=result        
  180.             END
  181.         END
  182.         ELSE DO
  183.             pp_DialogInit 150 55 "*GLOBAL.BRIGHTNESS*" 1
  184.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B2
  185.             pp_Dialog
  186.             rc=result
  187.             IF rc=1 then DO
  188.                 pp_GetDialog 0
  189.                 Start_B2=result
  190.                 End_B2=result        
  191.             END
  192.         END            
  193.     END
  194. END
  195.  
  196.     if R=0 then DO
  197.         EXIT
  198.     END    
  199.  
  200.     if End_Frame<2 then do
  201.         if Anim=1 then DO
  202.             pp_Warn 'Make*an*Anim*first.'
  203.             EXIT
  204.         end
  205.     end
  206.  
  207.     ADDRESS COMMAND
  208.  
  209.     file='ram:t/pp_lens'
  210.  
  211.     IF EXISTS(file) THEN DO
  212.         'delete >nil: ram:t/pp_lens'
  213.     END
  214.  
  215.     IF OPEN('c',file,'W') then DO
  216.         CALL WRITELN('c',Anim)
  217.         CALL WRITELN('c',Path)
  218.         CALL WRITELN('c',Type)
  219.         CALL WRITELN('c',Light)
  220.         CALL WRITELN('c',Start_B1)
  221.         CALL WRITELN('c',End_B1)
  222.         CALL WRITELN('c',Start_B2)
  223.         CALL WRITELN('c',End_B2)
  224.         CALL WRITELN('c',Arti)
  225.         CALL WRITELN('c',Glob)
  226.         CALL CLOSE('c')
  227.     END
  228.  
  229.     ADDRESS value Port
  230.  
  231.     pp_AliasOn
  232.     pp_PenType 0
  233.     pp_ComposeReqOff
  234.  
  235.     pp_ClosestColor 0 0 0
  236.     color=result
  237.     pp_SetBpen color
  238.     pp_ClosestColor 255 255 255
  239.     color=result
  240.     pp_SetApen color
  241.  
  242.     pp_Compose 0 100 0    
  243.  
  244.     IF Anim=0 THEN DO
  245.         pp_SpareOnOff
  246.         pp_Cls
  247.  
  248.         r=Start_S
  249.         totalR=r*2
  250.         RayShade=100-Start_B1
  251.  
  252.         if Light=0 then CALL DrawRays()
  253.         if Light=1 then CALL DrawGlow()
  254.         if Light=2 then CALL DrawStar()
  255.  
  256.         pp_SpareOnOff
  257.         pp_UpdateUndo
  258.         pp_EffectOn
  259.  
  260.         pp_Compose 1 100 0    
  261.         pp_Gradient 0 2 x1 y1
  262.  
  263.         pp_ClearRange 0
  264.         pp_setRange 0 4 0 0 0
  265.  
  266.         if Glob=0 then pp_setRange 0 16 Start_B2 0 0
  267.         if Glob=1 then pp_setRange 0 16 0 0 Start_B2
  268.         if Glob=2 then pp_setRange 0 16 Start_B2 Start_B2 0
  269.         if Glob=3 then pp_setRange 0 16 Start_B2 Start_B2 Start_B2
  270.  
  271.         pp_setRange 0 19 Start_B2 Start_B2 Start_B2
  272.         pp_CircleF x1 y1 TotalR
  273.  
  274.         pp_Spare
  275.         pp_Compose 1 100 0
  276.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  277.  
  278.         if Arti>0 then CALL DrawArtefacts()
  279.         
  280.     END
  281.     ELSE DO
  282.  
  283.         pp_GetWidth
  284.         W=result
  285.  
  286.         pp_GetHeight
  287.         H=result
  288.  
  289.         HX=r2
  290.         HY=r2
  291.  
  292.         Start_X=x1
  293.         End_X=x1
  294.         Start_Y=y1
  295.         End_Y=y1
  296.  
  297.         IF Path=1 then DO
  298.             IF Type=0 then DO
  299.                 Start_X=HX*-1
  300.             END
  301.             ELSE DO
  302.                 End_X=HX*-1
  303.             END
  304.         END
  305.  
  306.         IF Path=2 then DO
  307.             IF Type=0 then DO
  308.                 Start_X=W+HX
  309.             END
  310.             ELSE DO
  311.                 End_X=W+HX
  312.             END
  313.         END
  314.  
  315.         IF Path=3 then DO
  316.             IF Type=0 then DO
  317.                 Start_Y=HY*-1
  318.             END
  319.             ELSE DO
  320.                 End_Y=HY*-1
  321.             END
  322.         END
  323.  
  324.         IF Path=4 then DO
  325.             IF Type=0 then DO
  326.                 Start_Y=H+HY
  327.             END
  328.             ELSE DO
  329.                 End_Y=H+HY
  330.             END
  331.         END
  332.  
  333.         step=(End_Frame-Start_Frame)
  334.  
  335.         Step_B1=(End_B1-Start_B1)/Step
  336.         Step_B2=(End_B2-Start_B2)/Step
  337.         Step_S=(End_S-Start_S)/Step
  338.         Step_X=(End_X-Start_X)/Step
  339.         Step_Y=(End_Y-Start_Y)/Step
  340.  
  341.  
  342.  
  343.         DO i=Start_Frame to End_Frame
  344.             pp_GotoFrame i
  345.             r=trunc(Start_S+Step_S*(i-Start_Frame)+0.5,0)
  346.             RayShade=100-trunc(Start_B1+Step_B1*(i-Start_Frame)+0.5,0)
  347.             B2=trunc(Start_B2+Step_B2*(i-Start_Frame)+0.5,0)            
  348.             x1=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
  349.             y1=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
  350.  
  351.             pp_SpareOnOff
  352.             pp_Cls
  353.  
  354.             totalR=r*2
  355.  
  356.             if Light=0 then CALL DrawRays()
  357.             if Light=1 then CALL DrawGlow()
  358.             if Light=2 then CALL DrawStar()
  359.  
  360.             pp_SpareOnOff
  361.             pp_EffectOn
  362.  
  363.             pp_Compose 1 100 0    
  364.             pp_Gradient 0 2 x1 y1
  365.  
  366.             pp_ClearRange 0
  367.             pp_setRange 0 4 0 0 0
  368.  
  369.             if Glob=0 then pp_setRange 0 16 B2 0 0
  370.             if Glob=1 then pp_setRange 0 16 0 0 B2
  371.             if Glob=2 then pp_setRange 0 16 B2 B2 0
  372.             if Glob=3 then pp_setRange 0 16 B2 B2 B2
  373.  
  374.             pp_setRange 0 19 B2 B2 B2
  375.             pp_CircleF x1 y1 TotalR
  376.  
  377.             pp_Spare
  378.             pp_Compose 1 100 0
  379.             pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  380.  
  381.             if Arti>0 then CALL DrawArtefacts()
  382.         END
  383.         pp_GotoFrame Start_Frame
  384.     END
  385.  
  386.  
  387.  
  388. EXIT
  389.     
  390. /*********************************************************/
  391. /*                       Draw Star                       */
  392. /*********************************************************/
  393.  
  394. DrawStar: PROCEDURE EXPOSE x1 y1 r Pi totalR NbStar RayShade
  395.  
  396.     pp_Compose 0 100 0
  397.     pp_EffectOff
  398.     r2=4
  399.     a=360/NbStar
  400.     a2=a/2
  401.  
  402.   DO i=0 To 359 by a
  403.         r3=r
  404.  
  405.       x = Sin(i*Pi)*r3+x1
  406.     y = Cos(i*Pi)*r3+y1
  407.  
  408.         ii=i+a2
  409.       x2 = Sin(ii*Pi)*r2+x1
  410.     y2 = Cos(ii*Pi)*r2+y1
  411.  
  412.         ii=i-a2
  413.       x3 = Sin(ii*Pi)*r2+x1
  414.     y3 = Cos(ii*Pi)*r2+y1
  415.  
  416.         pp_StartPoly
  417.         pp_AddPoly trunc(x3+0.5) trunc(y3+0.5)
  418.         pp_AddPoly trunc(x2+0.5) trunc(y2+0.5)
  419.         pp_AddPoly trunc(x+0.5) trunc(y+0.5)
  420.         pp_EndPolyF
  421.  
  422.     END
  423.  
  424.     pp_EffectOn
  425.     rr=trunc(r/6)
  426.     if rr<3 then rr=3
  427.     pp_Airbrush 100 rr
  428.  
  429.  
  430.     pp_CircleF x1 y1 rr
  431.  
  432.     pp_EffectOn
  433.     pp_ConvInit 1 25 0
  434.     pp_Conv 0 1 1 1 1 1
  435.     pp_Conv 1 1 1 1 1 1
  436.     pp_Conv 2 1 1 1 1 1
  437.     pp_Conv 3 1 1 1 1 1
  438.     pp_Conv 4 1 1 1 1 1    
  439. /*    
  440.     pp_ConvInit 1 159 0    
  441.     pp_Conv 0 2 4 5 4 2
  442.     pp_Conv 1 4 9 12 9 4
  443.     pp_Conv 2 5 12 15 12 5
  444.     pp_Conv 3 4 9 12 9 4
  445.     pp_Conv 4 2 4 5 4 2
  446. */
  447.  
  448.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  449.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  450.  
  451.  
  452.     if RayShade >0 then DO
  453.     pp_Shade RayShade
  454.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  455.     END
  456.  
  457. RETURN
  458.  
  459. /*********************************************************/
  460. /*                       Draw Glow                       */
  461. /*********************************************************/
  462. DrawGlow: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  463.     pp_EffectOn
  464.     AB=r*0.5
  465.     if AB>20 then AB=20
  466.     if AB<2 then AB=2
  467.     
  468.     pp_AirBrush 100 trunc(AB)
  469.     pp_CircleF x1 y1 r/2.5
  470.  
  471.     if RayShade >0 then DO
  472.         pp_Shade RayShade
  473.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  474.     END
  475. RETURN
  476.  
  477. /*********************************************************/
  478. /*                       Draw Ray                        */
  479. /*********************************************************/
  480.  
  481. DrawRays: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  482. RN=abs(x1*y1)+totalR*RayShade
  483. pp_Compose 0 100 0
  484. pp_EffectOff
  485. aa=random(100,200,RN)
  486. DO j=1 to 5
  487.     aa=aa/2
  488.     a=360/aa
  489.     a2=a/2    
  490.   DO i=aa To 359+aa by a
  491.         r3=totalR
  492.     x = Sin(i*Pi)*r3+x1
  493.     y = Cos(i*Pi)*r3+y1
  494.         pp_line x1 y1 x y
  495.     END
  496.     pp_EffectOn
  497.     pp_ConvInit 0 9 0
  498.     pp_Conv 0 1 1 1 1 1
  499.     pp_Conv 1 1 1 1 1 1
  500.     pp_Conv 2 1 1 1 1 1
  501.     pp_Conv 3 1 1 1 1 1
  502.     pp_Conv 4 1 1 1 1 1    
  503.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  504.     pp_EffectOff
  505. END    
  506.  
  507.     pp_EffectOn
  508.     pp_Gradient 0 2 x1 y1
  509.     pp_ClearRange 0
  510.     pp_setRange 0 10 0 0 0
  511.     pp_setRange 0 16 255 255 255
  512.     pp_setRange 0 19 255 255 255
  513.     pp_Compose 4 100 0
  514.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  515.  
  516.     if RayShade >0 then DO
  517.     pp_Shade RayShade
  518.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  519.     END
  520.  
  521.     pp_EffectOff
  522.  
  523. RETURN
  524.  
  525.  
  526. /*********************************************************/
  527. /*                       Draw Rings                   */
  528. /*********************************************************/
  529.  
  530. DrawRings: PROCEDURE EXPOSE x1 y1 r
  531.         pp_EffectOn
  532.         pp_Compose 1 100 0    
  533.         pp_Gradient 0 2 x1 y1
  534.         pp_ClearRange 0
  535.         pp_setRange 0 0 0 0 0
  536.         pp_setRange 0 5 0 0 0
  537.         pp_setRange 0 6 48 0 0
  538.         pp_setRange 0 7 0 0 0
  539.         pp_setRange 0 13 48 0 0
  540.         pp_setRange 0 19 0 0 0
  541.  
  542.         pp_CircleF x1 y1 r
  543.  
  544. RETURN
  545.  
  546.  
  547. /*********************************************************/
  548. /*                       Draw artifact                   */
  549. /*********************************************************/
  550.  
  551. DrawArtefacts: PROCEDURE EXPOSE x1 y1 r totalR Arti
  552.  
  553.     pp_GetWidth
  554.     cx=trunc(result/2)
  555.     pp_GetHeight
  556.     cy=trunc(result/2)
  557.  
  558. if Arti=1 then do
  559. Nb_Spot=15
  560. t.1=1;s.1=25;d.1=123;c.1=15;r.1=255;g.1=255;b.1=255
  561. t.2=3;s.2=60;d.2=100;c.2=15;r.2=255;g.2=20;b.2=0
  562. t.3=1;s.3=13;d.3=58;c.3=10;r.3=160;g.3=160;b.3=255
  563. t.4=2;s.4=33;d.4=54;c.4=5;r.4=160;g.4=160;b.4=255
  564. t.5=2;s.5=16;d.5=50;c.5=10;r.5=160;g.5=160;b.5=255
  565. t.6=2;s.6=10;d.6=30;c.6=20;r.6=255;g.6=160;b.6=25
  566. t.7=4;s.7=4;d.7=18;c.7=50;r.7=255;g.7=255;b.7=255
  567. t.8=4;s.8=6;d.8=-4;c.8=50;r.8=255;g.8=255;b.8=255
  568. t.9=1;s.9=23;d.9=-15;c.9=12;r.9=255;g.9=160;b.9=25
  569. t.10=1;s.10=44;d.10=-18;c.10=12;r.10=255;g.10=160;b.10=25
  570. t.11=1;s.11=10;d.11=-21;c.11=12;r.11=255;g.11=160;b.11=25
  571. t.12=1;s.12=15;d.12=-36;c.12=15;r.12=145;g.12=255;b.12=145
  572. t.13=2;s.13=8;d.13=-40;c.13=20;r.13=100;g.13=120;b.13=255
  573. t.14=3;s.14=63;d.14=-67;c.14=12;r.14=145;g.14=255;b.14=145
  574. t.15=5;s.15=133;d.15=-100;c.15=10;r.15=255;g.15=255;b.15=255
  575. end
  576.  
  577. if Arti=2 then do
  578. Nb_Spot=25
  579. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  580. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=50;b.2=230
  581. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  582. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  583. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=80;b.5=250
  584. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  585. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=55;b.7=245
  586. t.8=1;s.8=12;d.8=23;c.8=21;r.8=60;g.8=50;b.8=255
  587. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  588. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=55;b.10=255
  589. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  590. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=50;b.12=255
  591. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=50;g.13=50;b.13=235
  592. t.14=1;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  593. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  594. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=50;b.16=245
  595. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=50;b.17=230
  596. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  597. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=55;b.19=225
  598. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  599. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=55;b.21=225
  600. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=60;b.22=255
  601. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  602. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=55;g.24=55;b.24=245
  603. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=50;b.25=255
  604. end
  605.  
  606. if Arti=3 then do
  607. Nb_Spot=25
  608. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  609. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=150;b.2=230
  610. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  611. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  612. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=180;b.5=250
  613. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  614. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=155;b.7=245
  615. t.8=1;s.8=12;d.8=23;c.8=21;r.8=50;g.8=250;b.8=255
  616. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  617. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=155;b.10=255
  618. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  619. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=150;b.12=255
  620. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=150;g.13=150;b.13=235
  621. t.14=2;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  622. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  623. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=150;b.16=245
  624. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=150;b.17=230
  625. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  626. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=155;b.19=225
  627. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  628. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=155;b.21=225
  629. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=160;b.22=255
  630. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  631. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=255;g.24=255;b.24=255
  632. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=150;b.25=255
  633. end
  634.  
  635.     pp_Compose 1 100 0    
  636.  
  637.     DO i=1 TO Nb_Spot
  638.     spot_size = trunc((r*s.i)/100)
  639.     spot_x  = ((x1 - cx) * d.i)/100 + cx
  640.     spot_y = ((y1 - cy) * d.i)/100 + cy
  641.  
  642.         spot_r = ((r.i*c.i)/100)
  643.         spot_g = ((g.i*c.i)/100)    
  644.         spot_b = ((b.i*c.i)/100)
  645.  
  646.         pp_Gradient 0 2 spot_x spot_y
  647.  
  648.         pp_ClearRange 0
  649.         
  650.         SELECT
  651.             WHEN t.i=1 then DO
  652.                 pp_setRange 0 0 0 0 0
  653.         pp_setRange 0 5 0 0 0
  654.         pp_setRange 0 7 spot_r spot_g spot_b
  655.                 pp_setRange 0 15 0 0 0
  656.                 pp_setRange 0 19 0 0 0
  657.       END
  658.             WHEN t.i=2 then DO
  659.         pp_setRange 0 5 0 0 0
  660.         pp_setRange 0 7 spot_r spot_g spot_b
  661.         pp_setRange 0 19 spot_r spot_g spot_b
  662.             END
  663.             WHEN t.i=3 then DO
  664.         pp_setRange 0 5 0 0 0
  665.         pp_setRange 0 6 spot_r spot_g spot_b
  666.         pp_setRange 0 8 0 0 0
  667.             END
  668.             WHEN t.i=4 then DO
  669.         pp_setRange 0 5 0 0 0
  670.         pp_setRange 0 16 spot_r spot_g spot_b
  671.         pp_setRange 0 19 spot_r spot_g spot_b
  672.             END
  673.             WHEN t.i=5 then DO
  674.                 spot_r = ((255*c.i)/100)
  675.         pp_setRange 0 5 0 0 0
  676.         pp_setRange 0 6 spot_r 0 0
  677.         pp_setRange 0 7 0 spot_r 0
  678.         pp_setRange 0 8 0 0 spot_r
  679.         pp_setRange 0 9 0 0 0
  680.             END
  681.         END        
  682.  
  683.         pp_CircleF spot_x spot_y spot_size
  684.  
  685.     END
  686.  
  687. RETURN
  688.     
  689.