ImagerColorTest.cm
Last Edited by: Crow, August 16, 1984 10:38:28 am PDT

Send this to interpreter first
&sgf[ImagerColorMain]
Available devices
Uses standard sixteen colors, caches additional colors as used
SetDevice[$Std8bpp, [0,0,400,300], [0,0,0,0], TRUE]
Puts an 8-bit buffer on each channel. Displays them alternately
SetDevice[$DblBffr8bpp, [0,0,400,300], [0,0,0,0], TRUE]
Loads grayscale map, produces antialiased figures from imager calls
SetDevice[$SmoothGray, [0,0,400,300], [0,0,0,0], TRUE]
Uses standard sixteen colors only
SetDevice[$Std4bpp, [0,0,400,300], [0,0,64,64], TRUE]
Uses black, white, red, and cyan only
SetDevice[$Std2bpp, [0,0,400,300], [0,0,0,0], TRUE]
Allows full color, note, can only be used on lower resolution (640x480) displays
SetDevice[$Std24bpp, [0,0,512,384], [0,0,0,0], TRUE]

Games with Pixel Maps
PinMap[]
UnPinMap[]
MoveOverlayTo[500, 400]
RecoverContext[0]
SwitchBuffers[]

Screen Clear, note raw imager coordinates are in meters
NameColor["Black"]
FillRectangle[0.0, 0.0, .4, .3]

NameColor["White"]
DrawLine[[0.02, 0.02], [.2, .15], .001]

Loads an 8-bit color map with 6x6x6 color cube and 40 gray levels.
LoadStd8BitMap[]
 Rotates map entries from 1 to 254 inclusive for about 10 seconds, leaves zeroth and 255th color map entries untouched
Rotate8BitMap[1, 254, 10]
Puts cached color map on screen in pattern at bottom middle
Show8BitMap[]
Loads a continuous ramp into the color table and linearizes it.
 This example loads a grey scale (0,0,0) to (1,1,1) and exponentiates the values by .43.
 Can be used to invert colors, put colored backgrounds in smoothgraydisplays, or twiddle TRC.
 Use with $Std8bpp or $Std24bpp or $SmoothGray.

Load8BitRampMap[0.0, 0.0, 0.0, 1.0, 1.0, 1.0, .43]
Imager rope display
ShowRope[.025, .11, "The Current Color and Font"]
ShowRope[.025, .07, "The Current Color", "Xerox/Pressfonts/TimesRoman/MRR", .02]
SetDevice[$SmoothGray, [0,0,512,400], [0,0,0,0], TRUE]
NameColor["Black"]
ShowRope[.005, .073, "This is what small text (.002) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .002]
ShowRope[.005, .075, "This is what small text (.0025) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .0025]
ShowRope[.005, .078, "This is what small text (.003) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .003]
ShowRope[.005, .082, "This is what small text (.0035) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .0035]
ShowRope[.005, .087, "This is what small text (.004) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .004]
ShowRope[.005, .093, "This is what small text (.005) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .005]
ShowRope[.005, .101, "This is what small text (.006) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .006]
ShowRope[.005, .11, "This is what small text (.007) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .007]
ShowRope[.005, .12, "This is what small text (.008) looks like on this display.", "Xerox/Pressfonts/TimesRoman/MRR", .008]
Smooth text Display
SetDevice[$SmoothGray, [0,0,512,400], [0,0,0,0], TRUE]
GetAISFile[ "/ivy/crow/ais/SmoothText.ais"]
Load8BitRampMap[1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0]
For displaying full-color AIS files
SetDevice[$Std24bpp, [0,0,0,0]]
Get3AISFiles[ "/ivy/crow/ais/Poobs-red.ais", "/ivy/crow/ais/Poobs-grn.ais", "/ivy/crow/ais/Poobs-blu.ais"]
Get3AISFiles[ "/indigo/ais/Baboon-red.ais", "/indigo/ais/Baboon-green.ais", "/indigo/ais/Baboon-blue.ais"]
Get3AISFiles[ "/indigo/ais/tiffany-red.ais", "/indigo/ais/tiffany-green.ais", "/indigo/ais/tiffany-blue.ais"]
Get3AISFiles[ "/indigo/ais/girl22-red.ais", "/indigo/ais/girl22-green.ais", "/indigo/ais/girl22-blue.ais"]
Output full-color to 3 AIS files
Put3AISFiles[ "Poobs-red.ais", "Poobs-grn.ais", "Poobs-blu.ais"]
Output color in Dorado RG-interleaved format to 1 AIS file
PutFastAISFile["Poobs.ais"]

For displaying 8-bit AIS files
LoadGrey8BitMap[]
GetAISFile[ "/ivy/crow/SummedAreaTables/ChkrbdJg.ais"]
GetAISFile[ "/ivy/crow/SummedAreaTables/ChkrbdSm.ais"]
GetAISFile[ "/ivy/crow/SummedAreaTables/EggsChecked.ais"]
GetAISFile[ "/ivy/crow/SummedAreaTables/EggsStriped.ais"]
Ouput 8-bit AIS file
PutAISFile["Poobs-gray.ais"]

Display Standard Color Map (first 16)
 Yellow   Cyan     Magenta  White
 Very Dark Grey Very Light Grey Grey   Purple
 Orange   Brown   Dark Grey  Light Grey
 Black    Red     Green   Blue
NameColor["Black"]
FillRectangle[0.025, 0.0, .05, .05]
NameColor["Red"]
FillRectangle[0.075, 0.0, .05, .05]
NameColor["Green"]
FillRectangle[0.125, 0.0, .05, .05]
NameColor["Blue"]
FillRectangle[0.175, 0.0, .05, .05]
NameColor["Orange"]
FillRectangle[0.025, 0.05, .05, .05]
NameColor["Brown"]
FillRectangle[0.075, 0.05, .05, .05]
NameColor["Dark Grey"]
FillRectangle[0.125, 0.05, .05, .05]
NameColor["Light Grey"]
FillRectangle[0.175, 0.05, .05, .05]
NameColor["Very Dark Grey"]
FillRectangle[0.025, 0.1, .05, .05]
NameColor["Very Light Grey"]
FillRectangle[0.075, 0.1, .05, .05]
NameColor["Grey"]
FillRectangle[0.125, 0.1, .05, .05]
NameColor["Purple"]
FillRectangle[0.175, 0.1, .05, .05]
NameColor["Yellow"]
FillRectangle[0.025, 0.15, .05, .05]
NameColor["Cyan"]
FillRectangle[0.075, 0.15, .05, .05]
NameColor["Magenta"]
FillRectangle[0.125, 0.15, .05, .05]
NameColor["White"]
FillRectangle[0.175, 0.15, .05, .05]
Green to Blue ramp
NameColor["Green"]
FillRectangle[0.025, 0.175, .025, .025]
NameColor["Very Green Blue Green"]
FillRectangle[0.05, 0.175, .025, .025]
NameColor["Green Blue Green"]
FillRectangle[0.075, 0.175, .025, .025]
NameColor["Bluish Green"]
FillRectangle[0.1, 0.175, .025, .025]
NameColor["Blue Green"]
FillRectangle[0.125, 0.175, .025, .025]
NameColor["Greenish Blue"]
FillRectangle[0.15, 0.175, .025, .025]
NameColor["Blue Blue Green"]
FillRectangle[0.175, 0.175, .025, .025]
NameColor["Very Blue Blue Green"]
FillRectangle[0.2, 0.175, .025, .025]
NameColor["Blue"]
FillRectangle[0.225, 0.175, .052, .025]
Black to white ramp
NameColor["Black"]
FillRectangle[0.025, 0.1, .025, .025]
NameColor["Very Dark Grey"]
FillRectangle[0.05, 0.1, .025, .025]
NameColor["Dark Grey"]
FillRectangle[0.075, 0.1, .025, .025]
NameColor["Light Dark Grey"]
FillRectangle[0.1, 0.1, .025, .025]
NameColor["Grey"]
FillRectangle[0.125, 0.1, .025, .025]
NameColor["Dark Light Grey"]
FillRectangle[0.15, 0.1, .025, .025]
NameColor["Light Grey"]
FillRectangle[0.175, 0.1, .025, .025]
NameColor["Very Light Grey"]
FillRectangle[0.2, 0.1, .025, .025]
NameColor["White"]
FillRectangle[0.225, 0.1, .052, .025]
Green to Gray ramp
NameColor["Green"]
FillRectangle[0.025, 0.125, .025, .025]
NameColor["Very Strong Weak Green"]
FillRectangle[0.05, 0.125, .025, .025]
NameColor["Strong Weak Green"]
FillRectangle[0.075, 0.125, .025, .025]
NameColor["Weak Strong Weak Green"]
FillRectangle[0.1, 0.125, .025, .025]
NameColor["Weak Green"]
FillRectangle[0.125, 0.125, .025, .025]
NameColor["Strong Very Weak Green"]
FillRectangle[0.15, 0.125, .025, .025]
NameColor["Very Weak Green"]
FillRectangle[0.175, 0.125, .025, .025]
NameColor["Very Very Weak Green"]
FillRectangle[0.2, 0.125, .025, .025]
NameColor["Grey"]
FillRectangle[0.225, 0.125, .052, .025]