This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,37 @@
link graphics,printf
procedure main() # generalized colour bars
DrawTestCard(Simple_TestCard())
WDone()
end
procedure DrawTestCard(TC)
size := sprintf("size=%d,%d",TC.width,TC.height)
&window := TC.window := open(TC.id,"g","bg=black",size) |
stop("Unable to open window")
every R := TC.bands[r := 1 to *TC.bands -1] do
every C := R.bars[c := 1 to *R.bars - 1] do {
Fg(R.bars[c].colour)
FillRectangle( C.left, R.top,
R.bars[c+1].left-C.left, TC.bands[r+1].top-R.top )
}
return TC
end
record testcard(window,id,width,height,bands)
record band(top,bars)
record bar(left,colour)
procedure Simple_TestCard() #: return structure simple testcard
return testcard(,"Simple Test Card",width := 800,height := 600,
[ band( 1, [ bar( 1, "black"),
bar(114, "red"),
bar(228, "green"),
bar(342, "blue"),
bar(456, "magenta"),
bar(570, "cyan"),
bar(684, "yellow"),
bar(width) ] ),
band(height) ])
end

View file

@ -0,0 +1,29 @@
procedure SMPTE_TestCard() #: return structure with 480i(ish) testcard
return testcard(,"SMPTE TV Test Card",width := 672,height := 504,
[ band( 1, [ bar( 1, "#c0c0c0"),
bar( 95, "#c0c000"),
bar(191, "#00c0c0"),
bar(288, "#00c000"),
bar(383, "#c000c0"),
bar(480, "#c00000"),
bar(575, "#0000c0"),
bar(width) ] ),
band(335, [ bar( 1, "#0000c0"),
bar( 95, "#131313"),
bar(191, "#c000c0"),
bar(288, "#131313"),
bar(383, "#00c0c0"),
bar(480, "#131313"),
bar(575, "#c0c0c0"),
bar(width) ] ),
band(378, [ bar( 1, "#00214c"),
bar(120, "#ffffff"),
bar(240, "#32006a"),
bar(360, "#131313"),
bar(480, "#090909"),
bar(512, "#131313"),
bar(544, "#1d1d1d"),
bar(576, "#131313"),
bar(width) ] ),
band(height) ])
end

View file

@ -0,0 +1,4 @@
load 'viewmat'
size=: 2{.".wd'qm' NB. J6
size=: getscreenwh_jgtk_ '' NB. J7
'rgb'viewmat (|.size){. (>.&.(%&160)|.size)$ 20# 256#.255*#:i.8

View file

@ -0,0 +1,20 @@
nomainwin
colors$="black red green blue pink cyan yellow white"
WindowWidth=DisplayWidth:WindowHeight=DisplayHeight
UpperLeftX=1:UpperLeftY=1
barWidth=DisplayWidth/8
graphicbox #main.g, 0,0,DisplayWidth,DisplayHeight
open "" for window_popup as #main
#main "trapclose [quit]"
#main.g "down; setfocus; when characterInput [quit]"
#main.g "when leftButtonUp [quit]"
#main.g "size ";barWidth
for x = barWidth/2 to DisplayWidth step barWidth
i=i+1
if i>8 then i=1
col$=word$(colors$,i)
#main.g "color ";col$;"; line ";x;" 0 ";x;" ";DisplayHeight
next
wait
[quit] close #main:end

View file

@ -0,0 +1,7 @@
10 MODE 0:BORDER 23
20 FOR x=0 TO 15
30 ORIGIN x*40,0
40 GRAPHICS PEN x
50 FOR z=0 TO 39 STEP 4:MOVE z,0:DRAW z,400:NEXT
60 NEXT
70 CALL &bb06 ' wait for key press

View file

@ -0,0 +1,3 @@
ArrayPlot[
ConstantArray[{Black, Red, Green, Blue, Magenta, Cyan, Yellow,
White}, 5]]