-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcol601.txt
60 lines (45 loc) · 1.29 KB
/
col601.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
REM MODE MODE :REM Reset Screen display. but leave in current mode.
ON ERROR PRINTREPORT$;" at line ";ERL:END
CLG
OFF : REM Turn off text cursor
:
REM The following four line read the current screen size co-ords.
SYS "OS_ReadModeVariable",-1,4 TO ,,XEigFactor%
SYS "OS_ReadModeVariable",-1,5 TO ,,YEigFactor%
SYS "OS_ReadModeVariable",-1,11 TO ,,XSize%:XSize%+=1
SYS "OS_ReadModeVariable",-1,12 TO ,,YSize%:YSize%+=1
:
XStep%=1<<XEigFactor%
YStep%=1<<YEigFactor%
MaxX%=XSize%<<XEigFactor%
MaxY%=YSize%<<YEigFactor%
CentreX%=MaxX% DIV 2
CentreY%=MaxY% DIV 2
DIM conv601(2,2)
conv601() = 1,0,1.403 ,1,-.344,-0.714,1,1.773,0
DIM rgb(2)
DIM in(2)
LUMA =0
FOR X%= 0 TO MaxX% STEP XStep%
FOR Y%= 0 TO MaxY% STEP YStep%
u= (X%-CentreX%)/(2*CentreX%)
v =(Y%-CentreY%)/(2*CentreY%)
PROCyuv2rgb601(LUMA ,u,v)
REM PRINT u,v
REM PRINT rgb(0),rgb(1),rgb(2)
GCOL INT(rgb(0)*255),INT(rgb(1)*255),INT(rgb(2)*255 )
PLOT 69, X%,Y%
NEXT
NEXT
END
DEF PROCyuv2rgb601(y,u,v):
REM LOCAL DIM in(2)
in(0)=y
in(1)=u
in(2)=v
rgb() = conv601().in()
FOR c% = 0 TO 2
IF rgb(c%) < 0 THEN rgb(c%)=0
IF rgb(c%) > 1 THEN rgb(c%)=1
NEXT
ENDPROC