6.5.1.2. UTILITY TSTCOL (UNIX/X.11 VERSION)

next, previous Section / Table of Contents / Index The Unix/X.11 version of TSTCOL can be used to adjust color / shading definitions of the BALSAC initialization file interactively but is also useful to test color map and adapter definitions of the X.11 Windows environment if problems arise in the graphics display part of BALSAC. TSTCOL is started from the command line using the command tstcol [initfile] where initfile is the name of an optional initialization file (up to 72 characters, the default file name used by BALSAC is 'balsac2.ini' in the calling directory, see below). Note that this utility generates X.11 Windows color graphics output requiring a color graphics interface (X-terminal, workstation). If TSTCOL is started without a file name on the command line the prompt NCOLSAV(5-30), NTONE(2-30) : asks for the number of different colors, ncsav (values between 5 and 50), and the number of tones per color, nsh (values between 2 and 50), to be used in the following which can be stored on external files inside TSTCOL. While ncsav can be modified interactively the value nsh is fixed for the following TSTCOL session. After meaningful input of ncsav, nsh the program opens a window and generates the work bench. TSTCOL started with a file name denoting a correct BALSAC initialization file, see Sec. 6.4.10, loads all file parameters and opens a window generating the work bench. The work bench window shows as +------------------------------------------------------------------------+ | __ __ __ ___ ___ ____ | | | | | | | | | | | | ________________ |quit| | | | | | | | | | | | | / /\ |____| | | | | | | | | | | / / \ | | | | | | | ( 2 ) | | | / / \ | | | | | | | | | | / / \ | | | | | | | | | | | | / / \ | | |__| |__| |__| |___| |___| / / \ | | +---------------+ ( 1 ) + | | \ \ / | | __ __ \ \ / | | ____ ____ ____ ____ | | | \ \ / | | |____|____|____|____| | | | \ \ / | | | | | \ \ / | | ______ ( 3 ) | | | \_______________/ | | / \ | | | | | | | | | | | | | | | | | | | \ ______ / |__|__| | | | | | | ____ ____ ____ ____ ____ ____ ____ __ ___ ____ ____ ____ ____ | | |____|____|____|____|____|____|____|__ ( 4 ) ___|____|____|____|____| | | | +------------------------------------------------------------------------+ consisting of four main areas, - the color selection hexagon (1) at the upper right, - the color and tone fine tuning section (2) at the upper left, - the ball painting/shading section (3) at the lower left, -the color save/recall section (4) at the bottom. Input to TSTCOL is possible inside the workbench window by moving the mouse into one of the main areas, pointing at an option, and clicking the left or central mouse button for selection. Here it is assumed that the Unix system is equipped with a three button mouse where only the left and central buttons are used. For two-button mouses the right button replaces the central button in the text below. The different options of the main areas are explained in the following. RGB colors will be used in the following in normalized form (r,g,b) where 0 < r,g,b < 1 . Thus adapter RGB values (R,G,B) have to be multiplied by the range maximum defaulted to (2^16-1)= 65535 in TSTCOL. (1) The COLOR SELECTION HEXAGON shows as -----------------------------------------------------------------------+ | GREEN ____________________ YELLOW _____ | / /\ |quit | | / / \ |_____| | / / \ | / / \ | / / \ | / / \ | / / \ | CYAN +-------------------+ WHITE (BLACK) + RED | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \ \ / | \___________________/ | BLUE MAGENTA | | displaying the upper (lower) surface of the RGB cube as viewed along the cube diagonal where white =(1,1,1) or black =(0,0,0) is at the center. The basic RGB colors, green =(0,1,0), yellow =(1,1,0), red =(1,0,0), magenta =(1,0,1), blue =(0,0,1), cyan =(0,1,1) form the hexagon edges. Pointing inside the hexagon and clicking the central mouse button switches between top and bottom view of the RGB cube. Pointing inside the hexagon and clicking the left mouse button selects an appropriate RGB triple on the cube surface, i. e. points (1,g,b), (r,1,b), (r,g,1) for the cube top and (0,g,b), (r,0,b), (r,g,0) for the cube bottom. The selected point is marked inside the hexagon and the appropriate color is used as generic color to produce a set of color tones which are displayed in the color and tone fine tuning section and can be modified further, see below. Pointing inside the QUIT box at the upper right and clicking the left mouse button finishes the TSTCOL session by closing the workbench window and returning to the Unix command line. (2) The COLOR AND TONE FINE TUNING SECTION shows as +----------------------------------------------------------------- | | RGB= nr ng nb (r g b) | SAT/BOT,BAS,ENH,TOP/GAM = sa / qu def.dark def.light qt / gam | | ____ ____ ____ _____ _____ | | | | | | | |:::::| |:::::| | |____| |____| | | |:::::| |:::::| | |::::| |::::| | | |:::::| |:::::| | |::::| |----| |----| |-----| |-----| | |::::| |::::| |____| |:::::| |:::::| | |::::| |::::| |::::| |:::::| |:::::| | |::::| |----| |::::| |:::::| |:::::| | |::::| |::::| |::::| |-----| |:::::| | |::::| |----| |::::| |:::::| |:::::| | |::::| |____| |::::| |:::::| |:::::| | \ \ \ \ \ (2.1) (2.2) (2.3) (2.4) (2.5) listing the RGB value of the generic color selected at present both as an adapter color triple (nr, ng, nb) and in normalized form (r, g, b). The second text line shows the present color saturation value 0 < sa < 1, the darkness factors of the bottom and top color tones, qu and qt, those of the basic and enhanced color tones, def.dark and def.light (used for hard ball shading, see Secs. 6.2.7, 6.3.5), and the gamma factor value gam. The darkness factors are based on the color model discussed in detail in Sec. 5.4. The five rectangular boxes (2.1) - (2.5) allow you to inspect and modify the present color/shading selection interactively. Box (2.1) gives a graphical display of the present color saturation value sa. The horizontal line separating the white and black part of the box visualizes the actual value 0 < sa < 1 with sa = 0.0 (gray tones only) at the bottom and sa = 1.0 (maximum color saturation, default) at the top of the box. The color saturation can be redefined by pointing inside box (2.1) at the appropriate height and clicking the left mouse button. This modifies the generic color by admixing gray accordingly. The result is shown in boxes (2.4), (2.5) and the numerical RGB values of the generic color are updated in the two text lines. Box (2.2) gives a graphical display of the present darkness factor values qu, qt determining the color tone range and def.dark, def.light defining the basic/enhanced color tones. All values lie within the range [0,1] where 0 (1) corresponds to the bottom (top) of the box. Further, there is an order constraint qu < def.dark < def.light < qt . The value qu (qt) defines the bottom (top) line of the white area inside the box and def.dark (def.light) determines the lower (upper) black line inside the white area. Pointing inside the box at a given height and clicking the left mouse button determines a new darkness factor qq corresponding to the height and used to redefine the color shading range. If qq is closer in absolute value to qu than to qt then qu will be replaced by qq. Otherwise qt will be replaced by qq. However, the above constraint forces qu < def.dark and qt > def.light. The new definition quantified in the text line is shown in box (2.2) by a changed white area and its consequences for the color shading in box (2.5). Pointing inside the box at a given height and clicking the right mouse button determines a new darkness factor qq corresponding to the height and used to redefine the basic/enhanced color tones. If qq is closer in absolute value to def.dark than to def.light then def.dark will be replaced by qq. Otherwise def.light will be replaced by qq. However, the above constraint forces def.dark > qu and def.light < qt. The new definition quantified in the text line is shown in box (2.2) by changed positions of the black lines and its consequences for the color shading in boxes (2.4), (2.5). Box (2.3) gives a graphical display of the present value of the gamma factor gam defined by the position of the white (black) horizontal line. The white area at the lower half of the box refers to values 0 < gam < 1 (linear scale with 0 = bottom, 1 = top) while the black area at the top gives values 1 < gam < 5 (linear scale with 1 = bottom, 5 = top). The gamma factor is used to determine the overall distribution of the tone values between darkest and lightest tones, see Sec. 5.4. Here gam = 1 corresponds to a homogeneous distribution whereas gam > 1 (gam < 1) emphasizes darker (lighter) tones. The gamma value can be redefined by pointing inside box (2.3) at the appropriate height and clicking the left mouse button. This sets the appropriate value and the result is shown in box (2.5). Box (2.4) gives a graphical impression of the present main color definition by three color rectangles from top to bottom. The topmost rectangle shows the generic color, the intermediate rectangle shows the basic color tone, and the bottom rectangle shows the enhanced color tone (used for hard ball shading, see Secs. 6.2.7, 6.3.5). Box (2.4) does not respond to mouse input. Box (2.5) gives a graphical impression of the present color definition showing all nsh different color tones produced from the present generic color as discussed in Sec. 5.4 by horizontal stripes. The generic color itself is marked by a black (white) horizontal line in this box. Box (2.5) does not respond to mouse input. (3) The BALL PAINTING/SHADING SECTION shows as | Diff Lamb Spec | ______ ______ | ________ ________ ________ ________ | | | | | | | | | | | | | | SHAD | fuzz | dith | spec | | | | | |________|________|________|________| | | | | \ | | | | (3.1) | | | | _________ | | | | /:::::::::::\ | | | | /:::::::::::::::\ /| | | | /:::::::::::::::::::\ (3.2) | .x. | | |:::::::::::::::::::::| | . | .. | | |...::::::::::::::::::| | . | .. | | | .....:::::::::::::::|\ | . | .x | | .....::::::::::::| (3.3) | . | | | | .....::::::::::| |. | | | \ .....:::::::/ x | | | \ ....::::/ | | | | \__________:/ | | | | | | | | |______|______| | | DIFF,LAMB,SPEC/SUM = qdiff qlamb qspec / sum | | THT,PHI = theta, phi | listing the different ball shading weights and the direction of the incident light used for shading in BALSAC plots, see Secs. 6.2.7, 6.2.15, 6.3.5. Here qdiff, qlamb, qspec are the relative contributions of the diffuse background, the Lambert shading, and the specular reflection and sum gives the value of qdiff + qlamb + qspec. The second text line lists polar and azimuthal angles theta, phi of the incident light used for ball shading. The two rectangular boxes (3.1), (3.2) and the circular box (3.3) (showing an example of a shaded ball) allow you to inspect and modify the present shading definition interactively. Box (3.1) lists the four different shading modes as discussed in Secs. 6.2.7, 6.3.5 in respective subboxes shad : hard ball shading (L = 6, default), fuzz : fuzzy ball shading (L = 7), dith : dithered ball shading (L = 8), spec : full glossy shading (L = 9) where the present definition used for the ball painting in box (3.3) is shown in upper case characters. Pointing inside one of the four subboxes and clicking the left mouse button selects this shading mode (shown in upper cases in the following) and updates the ball painting in box (3.3). Box (3.2) gives a graphical display of the present shading weights where all three values qdiff, qlamb, qspec lie within the range [0,1] with 0 (1) corresponding to the bottom (top) of the box. The actual values are given for qdiff at the left side, for qlamb at the vertical center line, and for qspec at the right side of the box and are connected by straight lines. Pointing inside the box at a given height close to the left side and clicking the left mouse button determines a new value qdiff corresponding to the height which replaces the old value of the diffuse background contribution. This updates the ball painting in box (3.3) and the new qdiff value is used in all subsequent ball drawings. Pointing inside the box at a given height close to the vertical center line and clicking the left mouse button determines a new value qlamb corresponding to the height which replaces the old value of the Lambert shading contribution. This updates the ball painting in box (3.3) and the new qlamb value is used in all subsequent ball drawings. Pointing inside the box at a given height close to the right side and clicking the left mouse button determines a new value qspec corresponding to the height which replaces the old value of the specular reflection contribution. This updates the ball painting in box (3.3) and the new qspec value is used in all subsequent ball drawings. Note that meaningful shading requires that the sum of all shading contributions sum = qdiff + qlamb + qspec should be of the order 1.0. Box (3.3) shows an example of a shaded ball with the present definition of color and shading parameters. Pointing inside the box at a given point and clicking the left/central mouse button selects the respective point at the ball surface which, together with the ball center, defines the new direction of the incident light used for ball shading. This is quantified by new values of the polar and azimuthal angles theta, phi in the text line and the ball painting is updated using the new definition. Pressing the left button will select the light source in front of the screen while pressing the right button assumes the light source behind the screen. (4) The COLOR SAVE/RECALL SECTION shows as | | | ____ ____ ____ ____ ____ ____ ____ _____ ____ ___ ____ ____ ____ | | |____|____|____|____|____|____|____|____|____|____| |____|____|____| | | blk wht bak txt bnd srd sbl swt 1 2 ... ncsav save +/- | | | +------------------------------------------------------------------------+ giving a sequence of color subboxes which may be empty or filled with colors. The different boxes refer to generic colors which are defined in the initialization file, see Secs. 6.2.15, 6.4.10, 5.4 and are used inside BALSAC. The definitions are blk : default color used for "black", wht : default color used for "white", bak : default color used for background painting, txt : default color used for text, bnd : default color used for bonds connecting atoms, srd : default color used for "stereo red", sbl : default color used for "stereo blue", swt : default color used for "stereo white", 1 - ncsav : generic color definitions used for ball painting. Pointing inside one of the subboxes denoted blk - ncsav and clicking the left mouse button assigns the present color setting (generic color, see color selection above) to the respective definition which is confirmed by the generic color filling the appropriate subbox. This color assignment will be used in any subsequent initialization file store, see below. Pointing inside one of the subboxes denoted blk - ncsav and clicking the right mouse button recalls the color definition of the respective subbox replacing the present color setting which is confirmed by an update of boxes (2.1) - (2.4), (3.3) and by moving the mouse cursor to the respective point inside the color hexagon which defines the respective generic color. Pointing inside the subbox denoted "save" and clicking the left mouse button saves all present color definitions in an external output file using the BALSAC initialization file definition, see Sec. 6.4.10. If TSTCOL was started with an explicit initialization file named "initfile" the name of the output file will be "initfile$" for the first file store of the session, "initfile$$" for the second file store, etc. Otherwise, the output file will be named "tstcol.sav", "tstcol.sav$", etc. Pointing inside the subbox denoted "+/-" and clicking the left mouse button increases the number ncsav of different color definitions by 1 and adds a new subbox denoted "ncsav+1" to the existing palette. Pointing inside the subbox denoted "+/-" and clicking the right mouse button decreases the number ncsav of different color definitions by 1 and removes the subbox denoted "ncsav" from the existing palette. Any previous color definition of this subbox will be lost. next, previous Section / Table of Contents / Index