subpixel(3G) subpixel(3G)
subpixel - controls the placement of point, line, and polygon vertices
void subpixel(b)
Boolean b;
b expects either FALSE or TRUE.
FALSE forces screen vertices to the centers of pixels (default).
TRUE positions screen vertices exactly.
subpixel controls the placement of point, line, and polygon vertices in
screen coordinates. By default subpixel is FALSE, causing vertices to be
snapped to the center of the nearest pixel after they have been
transformed to screen coordinates. Vertex snapping introduces artifacts
into the scan conversion of lines and polygons. It is especially
noticable when points or lines are drawn smooth (see pntsmooth and
linesmooth). Thus subpixel is typically set to TRUE while smooth points
or smooth lines are being drawn.
In addition to its effect on vertex position, subpixel also modifies the
scan conversion of lines. Specifically, non-subpixel positioned lines
are drawn closed, meaning that connected line segments both draw the
pixel at their shared vertex, while subpixel positioned lines are drawn
half open, meaning that connected lines segments share no pixels.
(Smooth lines are always drawn half open, regardless of state of
subpixel.) Thus subpixel positioned lines produce better results when
logicop or blendfunction are used, but will produce different, possibly
undesirable results in 2-D applications where the endpoints of lines have
been carefully placed.
For example, using the standard 2-D projection:
ortho2(left-0.5,right+0.5,bottom-0.5,top+0.5);
viewport(left,right,bottom,top);
subpixel positioned lines match non-subpixel positioned lines pixel for
pixel, except that they omit either the right-most or top-most pixel.
Thus the non-subpixel positioned line drawn from (0,0) to (0,2) fills
pixels (0,0), (0,1), and (0,2), while the subpixel positioned line drawn
between the same coordinates fills only pixels (0,0) and (0,1).
linesmooth, pntsmooth
Page 1
subpixel(3G) subpixel(3G)
NOTES
This routine does not function on IRIS-4D B or G models.
The IRIS-4D GT and GTX models do not implement subpixel positioned
polygons. They also do not implement subpixel positioned non-smooth
lines.
On the Personal Iris, XS, XS24, XZ, Elan and Extreme, polygons are always
subpixel positioned, regardless of the value of subpixel. Subpixel
positioned non-smooth lines are not implemented.
On Indy, Iris Indigo Entry, and XL systems, subpixel positioned nonsmooth
lines are drawn closed instead of half-open.
PPPPaaaaggggeeee 2222 [ Back ]
|