home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
graphics
/
edgedetection.amos
/
edgedetection.amosSourceCode
Wrap
AMOS Source Code
|
1991-04-06
|
2KB
|
76 lines
' Edge Detection Program By Dominic Ramsey
'
' April 1991
'
' 2 The Paddocks, Haddenham, Bucks. HP17 8AG.
'
STRT:
Screen Open 0,320,200,2,Lowres : Curs Off : Hide On : Palette 0,$FFF
Print : Centre "This edge detection program will"
Print : Centre "convert any non ham IFF image into a"
Print : Centre "two colour line drawing. The Picture"
Print : Centre "can then be saved to disk and"
Print : Centre "used in any art or DTP program."
Print : Print : Print : Centre "Press Mouse"
While Mouse Key=0 : Wend
Cls 0
EDG_DETEC
Procedure EDG_DETEC
Show On
F$=Fsel$("DF0:","*","Choose A Non Ham Picture","For Edge Detection")
Hide On
If F$="" Then End
Load Iff F$,0
SW=Screen Width(0)
SH=Screen Height(0)
If Screen Colour=4096
Cls 0 : Paper 0 : Pen 1
Centre "Sorry, can't use ham pictures- try again"
Wait 50
EDG_DETEC
End If
Wait 100
If Screen Colour=32
Screen Open 1,SW,SH,2,Lowres
Else
Screen Open 1,SW,SH,2,Hires
End If
Palette $FFF,0
Centre " Enter sensitivity, Press (0-3)"
Print : Print : Centre "Try Low value for cartoons"
Print : Centre "High value for digitised pictures"
Print : Print : Centre "Try 1 for first attempt."
Repeat
S$=Inkey$
S=Asc(S$)
Until S>47 and S<51
S=S-48
'
'Try increasing s for 16 col B/W digitised pictures.
'
Cls 0
Ink 1,0
PP=15
For Y=0 To SH-1
For X=0 To SW-1
Screen 0
P=Point(X,Y)
If P-PP>=S or PP-P=>S
Screen 1
Plot X,Y
Screen 0
End If
PY=Point(X,Y-1)
If P-PY>S or PY-P>S
Screen 1
Plot X,Y
Screen 0
End If
PP=P
Next X
Next Y
End Proc
F$=Fsel$("Savescreen.iff","","Save new screen")
If F$="" Then End
Save Iff F$,1
Goto STRT