linesm(3G)linesm(3G)NAMElinesm - specify antialiasing of lines
FORTRAN 77 SPECIFICATION
subroutine linesm(mode)
integer*4 mode
PARAMETERS
mode expects one of two values:
SMLOFF, defeats antialiasing of lines (default).
SMLON enables antialiasing of lines. SMLON can be modified by
either or both of two additional symbolic constants:
SMLSMO indicates that a higher quality filter should be used
during line drawing. This filter typically requires that more
pixels be modified, and therefore potentially reduces the rate at
which antialiased lines are rendered.
SMLEND indicates that the endpoints of antialiased lines should be
trimmed to the exact length specified by the subpixel position of
each line.
The constants SMLSMO and SMLEND are specified with SMLON by bitwise ORing
them, or by adding them. For example,
linesm(SMLON + SMLSMO + SMLEND)
enables antialiased line drawing with the highest quality, and
potentially lowest performance, algorithm. These modifiers are hints,
not directives, and are therefore ignored by systems that do not support
the requested feature.
DESCRIPTION
Antialiased lines can be drawn in both color map and RGB modes. linesm
controls this capability. In both modes, for antialiased lines to draw
properly:
o linestyle must be 0xFFFF,
o lsrepeat must be 1.
For color map antialiased lines to draw correctly, a 16-entry colormap
block (whose lowest entry location is a multiple of 16) must be
initialized to a ramp between the background color (lowest index) and the
line color (highest index). Before drawing lines, clear the area to the
background color.
Page 1
linesm(3G)linesm(3G)
The linesmooth hardware replaces the least significant 4 bits of the
current color index with bits that represent pixel coverage. Therefore,
by changing the current color index (only the upper 8 bits are
significant) you can select among many 16-entry color ramps, representing
different colors and intensities. You can draw depthcued, antialiased
lines in this manner.
The z-buffer hardware can be used to improve the quality of color map
antialiased line images. Enabled in the standard depth-comparison mode,
it ensures that lines nearer the viewer obscure more distant lines.
Alternately, the z-buffer hardware can be used to compare color values by
issuing:
zbuffe(.TRUE.)
zsourc(ZSRCCO)zfunct(ZFGREA)
Pixels are then replaced only by 'brighter' values, resulting in better
intersections between lines drawn using the same ramp.
RGB antialiased lines can be drawn only on machines that support
blending. For these lines to draw correctly, the blendfunction must be
set to merge new pixel color components into the framebuffer using the
incoming (source) alpha values. Incoming color components should always
be multiplied by the source alpha (BFSA). Current (destination) color
components can be multiplied either by one minus the source alpha
(BFMSA), resulting in a weighted average blend, or by one (BFONE),
resulting in color accumulation to saturation; issue:
c weighted average
blendf(BFSA, BFMSA)
or
c saturation
blendf(BFSA, BFONE)
The linesmooth hardware scales incoming alpha components by an 8-bit
computed coverage value. Therefore reducing the incoming source alpha
results in transparent, antialiased lines.
RGB antialiased lines draw correctly over any background image. It is
not necessary to clear the area in which they are to be drawn.
Both color map and RGB mode antialiased lines can be drawn with
subpixel-positioned vertexes (see subpix). Subpixel positioning of line
vertexes results in higher quality lines. On some models subpixel
positioning may reduce performance.
Page 2
linesm(3G)linesm(3G)
The width of antialiased lines is controlled by linewi and linewf.
Although line width can be arbitrarily specified, only a small, hardware
specific number of line widths is actually supported. (Refer to the
linewi manpage.)
The modifier SMLSMO can be ORed or ADDed to the symbolic constant SMLON
when antialiased lines are enabled. When this is done, a higher quality
and potentially lower performance filter is used to scan convert
antialiased lines. SMLSMO is a hint, not a directive. Thus a higher
quality filter is used only if it is available.
The modifier SMLEND can ba ORed or ADDed to the symbolic constant SMLON
when antialiased lines are enabled. When this is done, the endpoints of
antialiased lines are scaled to the exact length specified by their
subpixel-positioned endpoints, rather than drawn to the nearest integer
length. SMLEND is a hint, not a directive. Thus antialiased lines are
drawn with corrected endpoints only if support is available in the
hardware.
SEE ALSO
bgnlin, blendf, deflin, linewi, lsrepe, pntsmo, v, subpix, zbuffe,
zfunct, zsourc
NOTES
This subroutine does not function on IRIS-4D B or G models.
IRIS-4D GT and GTX models, as well as the Personal Iris, Personal Iris
Turbo and Iris Entry, do not support SMLSMO and SMLEND. Both hints are
ignored on these systems.
XS, XS24, XZ, Elan and Extreme systems do not support SMLSMO
On Iris Entry, Personal Iris, and Personal Iris Turbo linesm support is
only valid for color index mode. Personal Iris and Personal Iris Turbo
require that subpixel positioning is enabled when drawing smooth lines.
IRIS-4D VGX models adjust the antialiasing filter for each line based on
its slope when SMLSMO is requested. They support SMLEND only in RGB
mode.
BUGS
On the IRIS-4D GT and GTX models ZSRCCO z-buffering is supported only for
non-subpixel positioned color map mode lines.
Before ZSRCCO z-buffering is used on IRIS-4D GT and GTX models, bitplanes
12 through 23 must be explicitly cleared to zero. This must be done in
RGB mode, with a code sequence such as:
Page 3
linesm(3G)linesm(3G)RGBmod()double()gconfi()
frontb(.TRUE.)
cpack(0)clear()cmode()
frontb(.FALSE.)
gconfi()
body of program
The clear operation must be repeated only after bitplanes 12 through 23
are modified, which can result only from interaction with another window
running in RGB mode.
Page 4